Forráskód Böngészése

农品交易模块

jiuling 9 hónapja
szülő
commit
a6c7e481b3

+ 4 - 4
ruoyi-modules/ruoyi-base/src/main/java/com/ruoyi/base/controller/ProductInfoController.java

@@ -38,7 +38,7 @@ public class ProductInfoController extends BaseController
     /**
      * 查询交易信息列表
      */
-    @RequiresPermissions("base:productInfo:list")
+//    @RequiresPermissions("base:productInfo:list")
     @GetMapping("/list")
     public TableDataInfo list(ProductInfo productInfo)
     {
@@ -63,7 +63,7 @@ public class ProductInfoController extends BaseController
     /**
      * 获取交易信息详细信息
      */
-    @RequiresPermissions("base:productInfo:query")
+//    @RequiresPermissions("base:productInfo:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") String id)
     {
@@ -73,7 +73,7 @@ public class ProductInfoController extends BaseController
     /**
      * 新增交易信息
      */
-    @RequiresPermissions("base:productInfo:add")
+//    @RequiresPermissions("base:productInfo:add")
     @Log(title = "交易信息", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody ProductInfo productInfo)
@@ -84,7 +84,7 @@ public class ProductInfoController extends BaseController
     /**
      * 修改交易信息
      */
-    @RequiresPermissions("base:productInfo:edit")
+//    @RequiresPermissions("base:productInfo:edit")
     @Log(title = "交易信息", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody ProductInfo productInfo)

+ 10 - 198
ruoyi-modules/ruoyi-base/src/main/java/com/ruoyi/base/domain/ProductInfo.java

@@ -3,6 +3,9 @@ package com.ruoyi.base.domain;
 import java.math.BigDecimal;
 import java.util.Date;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.ruoyi.common.core.annotation.Excel;
@@ -14,6 +17,9 @@ import com.ruoyi.common.core.web.domain.BaseEntity;
  * @author zmj
  * @date 2025-08-21
  */
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
 public class ProductInfo extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
@@ -82,204 +88,10 @@ public class ProductInfo extends BaseEntity
     private String cityInfo;
 
     /** 发布时间 */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "发布时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
     private Date publishTime;
 
-    public void setId(String id)
-    {
-        this.id = id;
-    }
-
-    public String getId()
-    {
-        return id;
-    }
-
-    public void setUserId(String userId)
-    {
-        this.userId = userId;
-    }
-
-    public String getUserId()
-    {
-        return userId;
-    }
-
-    public void setCategoryId(String categoryId)
-    {
-        this.categoryId = categoryId;
-    }
-
-    public String getCategoryId()
-    {
-        return categoryId;
-    }
-
-    public void setType(Long type)
-    {
-        this.type = type;
-    }
-
-    public Long getType()
-    {
-        return type;
-    }
-
-    public void setTitle(String title)
-    {
-        this.title = title;
-    }
-
-    public String getTitle()
-    {
-        return title;
-    }
-
-    public void setDescription(String description)
-    {
-        this.description = description;
-    }
-
-    public String getDescription()
-    {
-        return description;
-    }
-
-    public void setPrice(String price)
-    {
-        this.price = price;
-    }
-
-    public String getPrice()
-    {
-        return price;
-    }
-
-    public void setQuantity(BigDecimal quantity)
-    {
-        this.quantity = quantity;
-    }
-
-    public BigDecimal getQuantity()
-    {
-        return quantity;
-    }
-
-    public void setUnit(Long unit)
-    {
-        this.unit = unit;
-    }
-
-    public Long getUnit()
-    {
-        return unit;
-    }
-
-    public void setLocation(String location)
-    {
-        this.location = location;
-    }
-
-    public String getLocation()
-    {
-        return location;
-    }
-
-    public void setImageUrl(String imageUrl)
-    {
-        this.imageUrl = imageUrl;
-    }
-
-    public String getImageUrl()
-    {
-        return imageUrl;
-    }
-
-    public void setStatus(Long status)
-    {
-        this.status = status;
-    }
-
-    public Long getStatus()
-    {
-        return status;
-    }
-
-    public void setContactId(String contactId)
-    {
-        this.contactId = contactId;
-    }
-
-    public String getContactId()
-    {
-        return contactId;
-    }
-
-    public void setContactName(String contactName)
-    {
-        this.contactName = contactName;
-    }
-
-    public String getContactName()
-    {
-        return contactName;
-    }
-
-    public void setContactPhone(String contactPhone)
-    {
-        this.contactPhone = contactPhone;
-    }
-
-    public String getContactPhone()
-    {
-        return contactPhone;
-    }
-
-    public void setCityInfo(String cityInfo)
-    {
-        this.cityInfo = cityInfo;
-    }
-
-    public String getCityInfo()
-    {
-        return cityInfo;
-    }
-
-    public void setPublishTime(Date publishTime)
-    {
-        this.publishTime = publishTime;
-    }
-
-    public Date getPublishTime()
-    {
-        return publishTime;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("userId", getUserId())
-            .append("categoryId", getCategoryId())
-            .append("type", getType())
-            .append("title", getTitle())
-            .append("description", getDescription())
-            .append("price", getPrice())
-            .append("quantity", getQuantity())
-            .append("unit", getUnit())
-            .append("location", getLocation())
-            .append("imageUrl", getImageUrl())
-            .append("status", getStatus())
-            .append("contactId", getContactId())
-            .append("contactName", getContactName())
-            .append("contactPhone", getContactPhone())
-            .append("cityInfo", getCityInfo())
-            .append("publishTime", getPublishTime())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .toString();
-    }
+    /*小程序搜索条件*/
+    private String searchKeyword;
 }

+ 3 - 0
ruoyi-modules/ruoyi-base/src/main/java/com/ruoyi/base/service/impl/ProductInfoServiceImpl.java

@@ -2,6 +2,7 @@ package com.ruoyi.base.service.impl;
 
 import java.util.List;
 import com.ruoyi.common.core.utils.DateUtils;
+import com.ruoyi.common.security.utils.SecurityUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.base.mapper.ProductInfoMapper;
@@ -54,6 +55,7 @@ public class ProductInfoServiceImpl implements IProductInfoService
     public int insertProductInfo(ProductInfo productInfo)
     {
         productInfo.setCreateTime(DateUtils.getNowDate());
+        productInfo.setCreateBy(SecurityUtils.getUsername());
         return productInfoMapper.insertProductInfo(productInfo);
     }
 
@@ -67,6 +69,7 @@ public class ProductInfoServiceImpl implements IProductInfoService
     public int updateProductInfo(ProductInfo productInfo)
     {
         productInfo.setUpdateTime(DateUtils.getNowDate());
+        productInfo.setUpdateBy(SecurityUtils.getUsername());
         return productInfoMapper.updateProductInfo(productInfo);
     }
 

+ 2 - 0
ruoyi-modules/ruoyi-base/src/main/resources/mapper/base/ProductInfoMapper.xml

@@ -52,6 +52,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="contactPhone != null  and contactPhone != ''"> and contact_phone = #{contactPhone}</if>
             <if test="cityInfo != null  and cityInfo != ''"> and city_info = #{cityInfo}</if>
             <if test="publishTime != null "> and publish_time = #{publishTime}</if>
+            <if test="searchKeyword != null and searchKeyword != '' "> and title LIKE CONCAT('%', #{searchKeyword}, '%')</if>
+            <if test="createBy != null and createBy != '' "> and create_by = #{createBy}</if>
         </where>
     </select>