Bladeren bron

1.完善农事模块以及补充农资商城字段;2.修改file服务上传文件大小

jiuling 9 maanden geleden
bovenliggende
commit
91d28ad9a3

+ 1 - 8
ruoyi-modules/ruoyi-base/src/main/java/com/ruoyi/base/controller/MallController.java

@@ -6,14 +6,7 @@ import javax.servlet.http.HttpServletResponse;
 import com.ruoyi.base.domain.Mall;
 import com.ruoyi.base.service.IMallService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.log.annotation.Log;
 import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;

+ 12 - 0
ruoyi-modules/ruoyi-base/src/main/java/com/ruoyi/base/domain/AgriculturalTasks.java

@@ -30,6 +30,18 @@ public class AgriculturalTasks extends BaseEntity
     @Excel(name = "关联地块ID")
     private Long plotId;
 
+    /** 所属农场ID */
+    @Excel(name = "所属农场ID")
+    private Long farmId;
+
+    /** 地块名称 */
+    @Excel(name = "地块名称")
+    private String fieldName;
+
+    /** 作物名称 */
+    @Excel(name = "作物名称")
+    private String growCrops;
+
     /** 任务名称 */
     @Excel(name = "任务名称")
     private String taskName;

+ 11 - 0
ruoyi-modules/ruoyi-base/src/main/java/com/ruoyi/base/domain/Mall.java

@@ -47,6 +47,10 @@ public class Mall extends BaseEntity
     @Excel(name = "原价")
     private BigDecimal originalPrice;
 
+    /** 单位:元/斤、元/袋等等 */
+    @Excel(name = "单位")
+    private String unit;
+
     /** 商品规格 */
     @Excel(name = "商品规格")
     private String specifications;
@@ -71,4 +75,11 @@ public class Mall extends BaseEntity
     @Excel(name = "状态 (1上架, 0下架)")
     private Integer status;
 
+    /** 是否推荐 () */
+    @Excel(name = "状态 (0-否,1-是)")
+    private Integer isRecommended;
+
+    /*小程序搜索条件*/
+    private String searchKeyword;
+
 }

+ 16 - 1
ruoyi-modules/ruoyi-base/src/main/resources/mapper/base/AgriculturalTasksMapper.xml

@@ -7,6 +7,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="AgriculturalTasks" id="AgriculturalTasksResult">
         <result property="id"    column="id"    />
         <result property="plotId"    column="plot_id"    />
+        <result property="farmId"    column="farm_id"    />
+        <result property="fieldName"    column="field_name"    />
+        <result property="growCrops"    column="grow_crops"    />
         <result property="taskName"    column="task_name"    />
         <result property="taskImages"    column="task_images"    />
         <result property="typeName"    column="type_name"    />
@@ -24,13 +27,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAgriculturalTasksVo">
-        select id, plot_id, task_name, task_images, type_name, task_status, execute_time, assignee_id, assignee_name, remark, completion_time, completion_desc, create_by, create_time, update_time, update_by from agricultural_tasks
+        select id, plot_id, farm_id, field_name, grow_crops, task_name, task_images, type_name, task_status, execute_time, assignee_id, assignee_name, remark, completion_time, completion_desc, create_by, create_time, update_time, update_by from agricultural_tasks
     </sql>
 
     <select id="selectAgriculturalTasksList" parameterType="AgriculturalTasks" resultMap="AgriculturalTasksResult">
         <include refid="selectAgriculturalTasksVo"/>
         <where>  
             <if test="plotId != null "> and plot_id = #{plotId}</if>
+            <if test="farmId != null "> and farm_id = #{farmId}</if>
+            <if test="fieldName != null  and fieldName != ''"> and field_name like concat('%', #{fieldName}, '%')</if>
+            <if test="growCrops != null  and growCrops != ''"> and grow_crops = #{growCrops}</if>
             <if test="taskName != null  and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
             <if test="taskImages != null  and taskImages != ''"> and task_images = #{taskImages}</if>
             <if test="typeName != null  and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
@@ -61,6 +67,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into agricultural_tasks
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="plotId != null">plot_id,</if>
+            <if test="farmId != null">farm_id,</if>
+            <if test="fieldName != null and fieldName != ''">field_name,</if>
+            <if test="growCrops != null and growCrops != ''">grow_crops,</if>
             <if test="taskName != null and taskName != ''">task_name,</if>
             <if test="taskImages != null and taskImages != ''">task_images,</if>
             <if test="typeName != null and typeName != ''">type_name,</if>
@@ -78,6 +87,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="plotId != null">#{plotId},</if>
+            <if test="farmId != null">#{farmId},</if>
+            <if test="fieldName != null and fieldName != ''">#{fieldName},</if>
+            <if test="growCrops != null and growCrops != ''">#{growCrops},</if>
             <if test="taskName != null and taskName != ''">#{taskName},</if>
             <if test="taskImages != null and taskImages != ''">#{taskImages},</if>
             <if test="typeName != null and typeName != ''">#{typeName},</if>
@@ -99,6 +111,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update agricultural_tasks
         <trim prefix="SET" suffixOverrides=",">
             <if test="plotId != null">plot_id = #{plotId},</if>
+            <if test="farmId != null">farm_id = #{farmId},</if>
+            <if test="fieldName != null and fieldName != ''">field_name = #{fieldName},</if>
+            <if test="growCrops != null and growCrops != ''">grow_crops = #{growCrops},</if>
             <if test="taskName != null and taskName != ''">task_name = #{taskName},</if>
             <if test="taskImages != null and taskImages != ''">task_images = #{taskImages},</if>
             <if test="typeName != null and typeName != ''">type_name = #{typeName},</if>

+ 12 - 1
ruoyi-modules/ruoyi-base/src/main/resources/mapper/base/MallMapper.xml

@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="title"    column="title"    />
         <result property="description"    column="description"    />
         <result property="price"    column="price"    />
+        <result property="unit"    column="unit"    />
         <result property="originalPrice"    column="original_price"    />
         <result property="specifications"    column="specifications"    />
         <result column="features" property="features"
@@ -18,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="swiperImages"    column="swiper_images"    />
         <result property="detailImages"    column="detail_images"    />
         <result property="status"    column="status"    />
+        <result property="isRecommended"    column="is_recommended"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="updateBy"    column="update_by"    />
@@ -25,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectMallVo">
-        select id, product_category, title, description, price, original_price, specifications, features, usage_guide, swiper_images, detail_images, status, create_by, create_time, update_by, update_time from mall
+        select id, product_category, title, description, price, unit, original_price, specifications, features, usage_guide, swiper_images, detail_images, status, is_recommended, create_by, create_time, update_by, update_time from mall
     </sql>
 
     <select id="selectMallList" parameterType="Mall" resultMap="MallResult">
@@ -35,6 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="title != null  and title != ''"> and title = #{title}</if>
             <if test="description != null  and description != ''"> and description = #{description}</if>
             <if test="price != null "> and price = #{price}</if>
+            <if test="unit != null and unit != '' "> and unit = #{unit}</if>
             <if test="originalPrice != null "> and original_price = #{originalPrice}</if>
             <if test="specifications != null  and specifications != ''"> and specifications = #{specifications}</if>
             <if test="features != null  and features != ''"> and features = #{features}</if>
@@ -42,6 +45,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="swiperImages != null  and swiperImages != ''"> and swiper_images = #{swiperImages}</if>
             <if test="detailImages != null  and detailImages != ''"> and detail_images = #{detailImages}</if>
             <if test="status != null "> and status = #{status}</if>
+            <if test="isRecommended != null">and is_recommended = #{isRecommended}</if>
+            <if test="searchKeyword != null and searchKeyword != '' "> and title LIKE CONCAT('%', #{searchKeyword}, '%')</if>
         </where>
     </select>
     
@@ -57,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="title != null and title != ''">title,</if>
             <if test="description != null and description != ''">description,</if>
             <if test="price != null">price,</if>
+            <if test="unit != null and unit != ''">unit,</if>
             <if test="originalPrice != null">original_price,</if>
             <if test="specifications != null and specifications != ''">specifications,</if>
             <if test="features != null and features != ''">features,</if>
@@ -64,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="swiperImages != null and swiperImages != ''">swiper_images,</if>
             <if test="detailImages != null">detail_images,</if>
             <if test="status != null">status,</if>
+            <if test="isRecommended != null">#{is_recommended},</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -73,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="productCategory != null">#{productCategory},</if>
             <if test="title != null and title != ''">#{title},</if>
             <if test="description != null and description != ''">#{description},</if>
+            <if test="unit != null and unit != ''">#{unit},</if>
             <if test="price != null">#{price},</if>
             <if test="originalPrice != null">#{originalPrice},</if>
             <if test="specifications != null and specifications != ''">#{specifications},</if>
@@ -81,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="swiperImages != null and swiperImages != ''">#{swiperImages},</if>
             <if test="detailImages != null">#{detailImages},</if>
             <if test="status != null">#{status},</if>
+            <if test="isRecommended != null">#{isRecommended},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -94,6 +103,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="productCategory != null">product_category = #{productCategory},</if>
             <if test="title != null and title != ''">title = #{title},</if>
             <if test="description != null and description != ''">description = #{description},</if>
+            <if test="unit != null and unit != ''">unit = #{unit},</if>
             <if test="price != null">price = #{price},</if>
             <if test="originalPrice != null">original_price = #{originalPrice},</if>
             <if test="specifications != null and specifications != ''">specifications = #{specifications},</if>
@@ -102,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="swiperImages != null and swiperImages != ''">swiper_images = #{swiperImages},</if>
             <if test="detailImages != null">detail_images = #{detailImages},</if>
             <if test="status != null">status = #{status},</if>
+            <if test="isRecommended != null">is_recommended = #{isRecommended},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>

+ 3 - 0
ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml

@@ -1,6 +1,9 @@
 # Tomcat
 server:
   port: 9300
+  tomcat:
+    max-swallow-size: -1     # -1 表示不限制请求体读取大小
+    max-http-form-post-size: -1
 
 # Spring
 spring: