Parcourir la source

新增sop排序,新增物资的rfid

车车 il y a 11 mois
Parent
commit
cfb80afccb

+ 7 - 0
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsSopController.java

@@ -97,6 +97,13 @@ public class IsSopController extends BaseController {
         return CommonResult.success(isSopService.updateIsSop(dto));
     }
 
+    @ApiOperation("修改SOP信息排序")
+    @Log(title = "SOP信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIsSopIndex")
+    public CommonResult<Boolean> updateIsSopIndex(@RequestBody @Parameter(name = "isSop", description = "修改数据类,放到body") IsSop isSop) {
+        return CommonResult.success(isSopService.updateIsSopIndex(isSop));
+    }
+
     /**
      * 删除SOP信息
      */

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsMaterials.java

@@ -73,4 +73,7 @@ public class IsMaterials extends BaseBean
     @ApiModelProperty(value = "状态(0-借出 1-柜中)")
     private String loanState;
 
+    @ApiModelProperty(value = "物资RFID")
+    private Long materialsRfid;
+
 }

+ 2 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsSop.java

@@ -64,5 +64,7 @@ public class IsSop extends BaseBean
     @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
     private String delFlag;
 
+    @ApiModelProperty(value = "权重序号")
+    private Integer sopIndex;
 
 }

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/sop/AddSopDTO.java

@@ -38,6 +38,9 @@ public class AddSopDTO implements Serializable {
     @ApiModelProperty(value = "SOP内容")
     private String sopContent;
 
+    @ApiModelProperty(value = "权重序号")
+    private Integer sopIndex;
+
     @ApiModelProperty(value = "点位数据")
     private List<IsJobTicketPoints> pointsList;
 

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/materials/MaterialsPageVO.java

@@ -79,4 +79,7 @@ public class MaterialsPageVO extends BaseBean
     @ApiModelProperty(value = "状态(0-借出 1-柜中)")
     private String loanState;
 
+    @ApiModelProperty(value = "物资RFID")
+    private Long materialsRfid;
+
 }

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/sop/SopPageVO.java

@@ -53,4 +53,7 @@ public class SopPageVO extends BaseBean
     @ApiModelProperty(value = "隔离点数量")
     private Integer pointCount;
 
+    @ApiModelProperty(value = "权重序号")
+    private Integer sopIndex;
+
 }

+ 2 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsSopService.java

@@ -73,4 +73,6 @@ public interface IIsSopService extends IService<IsSop>
      * @return
      */
     Page<SopPageVO> getIsSopPage(Page<IsSop> page, PageSopDTO dto);
+
+    Boolean updateIsSopIndex(IsSop isSop);
 }

+ 10 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsSopServiceImpl.java

@@ -257,4 +257,14 @@ public class IsSopServiceImpl extends ServiceImpl<IsSopMapper, IsSop> implements
         return isSopMapper.getIsSopPage(page, dto);
     }
 
+    @Override
+    public Boolean updateIsSopIndex(IsSop isSop) {
+        Assert.notNull(isSop.getSopId(), "主键id不可为空!");
+        Assert.notNull(isSop.getSopIndex(), "排序数据不可为空!");
+        update(Wrappers.<IsSop>lambdaUpdate()
+                .eq(IsSop::getSopId, isSop.getSopId())
+                .set(IsSop::getSopIndex, isSop.getSopIndex()));
+        return true;
+    }
+
 }

+ 5 - 1
ktg-iscs/src/main/resources/mapper/IsMaterialsMapper.xml

@@ -23,10 +23,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
         <result property="loanState"    column="loan_state"    />
+        <result property="materialsRfid"    column="materials_rfid"    />
     </resultMap>
 
     <sql id="selectIsMaterialsVo">
-        select materials_id, materials_code, materials_name, materials_type_id, workarea_id, materials_cabinet_id, service_life, available_life, service_times, available_times, start_time, remark, del_flag, create_by, create_time, update_time, update_by, loan_state from is_materials
+        select * from is_materials
     </sql>
 
     <select id="selectIsMaterialsList" parameterType="IsMaterials" resultMap="IsMaterialsResult">
@@ -70,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="loanState != null and loanState != ''">loan_state,</if>
+            <if test="materialsRfid != null">materials_rfid,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="materialsCode != null and materialsCode != ''">#{materialsCode},</if>
@@ -89,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="loanState != null and loanState != ''">#{loanState},</if>
+            <if test="materialsRfid != null">#{materialsRfid},</if>
          </trim>
     </insert>
 
@@ -112,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
             <if test="loanState != null and loanState != ''">loan_state = #{loanState},</if>
+            <if test="materialsRfid != null">materials_rfid = #{materialsRfid},</if>
         </trim>
         where materials_id = #{materialsId}
     </update>

+ 6 - 2
ktg-iscs/src/main/resources/mapper/IsSopMapper.xml

@@ -18,10 +18,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime"    column="create_time"    />
         <result property="updateTime"    column="update_time"    />
         <result property="updateBy"    column="update_by"    />
+        <result property="sopIndex"    column="sop_index"    />
     </resultMap>
 
     <sql id="selectIsSopVo">
-        select sop_id, sop_code, sop_name, sop_type, workshop_id, workarea_id, sop_content, sop_status, del_flag, create_by, create_time, update_time, update_by from is_sop
+        select * from is_sop
     </sql>
 
     <select id="selectIsSopList" parameterType="IsSop" resultMap="IsSopResult">
@@ -58,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateBy != null">update_by,</if>
+            <if test="sopIndex != null">sop_index,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="sopCode != null and sopCode != ''">#{sopCode},</if>
@@ -72,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
+            <if test="sopIndex != null">#{sopIndex},</if>
          </trim>
     </insert>
 
@@ -90,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="sopIndex != null">sop_index = #{sopIndex},</if>
         </trim>
         where sop_id = #{sopId}
     </update>
@@ -143,7 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             </if>
         </where>
         GROUP BY s.sop_id
-        ORDER BY s.sop_id DESC
+        ORDER BY s.sop_index ASC, s.sop_id DESC
     </select>
 
 </mapper>