Browse Source

工单处理功能提交

user5 8 months ago
parent
commit
0d30bd0a8c

+ 5 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/oss/domain/WorkAttachment.java

@@ -30,6 +30,9 @@ public class WorkAttachment extends BaseDTO {
      */
     private String attachmentName;
 
+    @TableField(exist = false)
+    private String name;
+
     /**
      * 文件所属业务模块(数据字典配置)
      */
@@ -49,6 +52,8 @@ public class WorkAttachment extends BaseDTO {
      * 附件大小
      */
     private String fileSize;
+    @TableField(exist = false)
+    private String size;
 
     /**
      * 排序

+ 2 - 2
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/oss/mapper/xml/OssServiceMapper.xml

@@ -60,9 +60,9 @@
         VALUES(
             #{workAttachment.id},
             #{userDto.id},
-            #{workAttachment.createDate},
+            #{workAttachment.createTime},
             #{userDto.id},
-            #{workAttachment.updateDate},
+            #{workAttachment.updateTime},
             #{workAttachment.delFlag},
             #{workAttachment.url},
             #{workAttachment.type},

+ 4 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/oss/service/OssService.java

@@ -71,6 +71,10 @@ public class OssService extends ServiceImpl<OssServiceMapper,WorkAttachment> {
         ossServiceMapper.insertWorkAttachmentInfo(workAttachment, userDto);
     }
 
+    public void insertWorkAttachment (WorkAttachment workAttachment, UserDTO userDto){
+        ossServiceMapper.insertWorkAttachment(workAttachment, userDto);
+    }
+
     /**
      * 保存数据
      * @param workAttachments

+ 34 - 4
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/controller/DisposeRubbishController.java

@@ -15,6 +15,7 @@ import com.jeeplus.test.garbageClearance.domain.LookOver;
 import com.jeeplus.test.garbageClearance.service.DTO.LookOverDTO;
 import com.jeeplus.test.garbageClearance.service.LookOverService;
 import com.jeeplus.test.garbageClearance.utils.SnowFlake;
+import com.jeeplus.test.oss.domain.WorkAttachment;
 import com.jeeplus.test.oss.domain.WorkAttachmentInfo;
 import com.jeeplus.test.oss.service.OssService;
 import com.jeeplus.test.wdt.disposeRubbish.domain.DisposeRubbish;
@@ -68,6 +69,20 @@ public class DisposeRubbishController {
     }
 
     /**
+     * 查询巡视工单
+     *
+     * @param id
+     * @return
+     */
+    @GetMapping("getByProcInsId")
+    public ResponseEntity getByProcInsId(String procInsId) {
+        // 还需要处理单位  清运专员  联系方式  及  附件信息
+        DisposeRubbish post = disposeRubbishService.getByProcInsId ( procInsId );
+
+        return ResponseEntity.ok ( post );
+    }
+
+    /**
      * 保存巡视信息
      */
     @ApiLog("保存巡视信息")
@@ -75,9 +90,6 @@ public class DisposeRubbishController {
     @PostMapping("save")
     public  ResponseEntity <String> save(@Valid @RequestBody DisposeRubbish disposeRubbish) {
         //新增或编辑表单保存
-        String lookOverId = SnowFlake.getId();
-        disposeRubbish.setId(lookOverId);
-
         if (StringUtils.isNotBlank(disposeRubbish.getNo())) {
             // 剔除掉XJ-J 只保留纯数字
             // 使用正则表达式替换掉所有非数字字符
@@ -88,10 +100,28 @@ public class DisposeRubbishController {
             String programIds = String.join(",", disposeRubbish.getProgramId());
             disposeRubbish.setProgramId(programIds);
         }
-        disposeRubbish.setStatus("2");
+
 
         disposeRubbishService.saveOrUpdate (disposeRubbish);
 
+
+        //对过磅数据进行处理
+        if (null != disposeRubbish.getFileList4() && disposeRubbish.getFileList4().size() > 0 ) {
+            UserDTO userDTO = UserUtils.getCurrentUserDTO();
+            // 进行附件保存操作,保存到work_attachment 表中
+            for (WorkAttachment attachment : disposeRubbish.getFileList4()) {
+                // 生成id
+                String detailId = SnowFlake.getId();
+                attachment.setId(detailId);
+                attachment.setAttachmentId(disposeRubbish.getId());
+                attachment.setCreateTime(new Date());
+                attachment.setUpdateTime(new Date());
+                attachment.setDelFlag(0);
+                attachment.setAttachmentFlag("weigh");
+                ossService.insertWorkAttachment(attachment,userDTO);
+            }
+        }
+
         for (String workOverId : disposeRubbish.getProgramIds()) {
             LookOver lookOver = overService.getById(workOverId);
             //处理巡查单的状态信息,将巡查单的status调整为处理中

+ 13 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/domain/DisposeRubbish.java

@@ -68,6 +68,15 @@ public class DisposeRubbish extends BaseEntity implements Serializable {
     @ApiModelProperty("关联的巡查id")
     private String programId;
 
+    @ApiModelProperty("重量(t)")
+    private String weight;
+
+    @ApiModelProperty("运输里程(km)")
+    private String transportMileage;
+
+    @ApiModelProperty("补贴(元)")
+    private String subsidy;
+
     //清理前照片
     @TableField(exist = false)
     List<WorkAttachment> fileList1;
@@ -80,6 +89,10 @@ public class DisposeRubbish extends BaseEntity implements Serializable {
     @TableField(exist = false)
     List<WorkAttachment> fileList3;
 
+    //过磅现场照片
+    @TableField(exist = false)
+    List<WorkAttachment> fileList4;
+
     //关联的巡查单据
     @TableField(exist = false)
     List<WorkOverNo> workOverNoList;

+ 7 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/mapper/DisposeRubbishMapper.java

@@ -25,6 +25,13 @@ public interface DisposeRubbishMapper extends BaseMapper<DisposeRubbish> {
      */
     DisposeRubbish selectById(@Param("id") String id);
 
+    /**
+     * 根据id获取巡视工单信息
+     * @param procInsId
+     * @return
+     */
+    DisposeRubbish getByProcInsId(@Param("procInsId") String procInsId);
+
     //查出附件信息
     List<WorkAttachmentInfo> getByAttachmentId(String id);
 }

+ 27 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/mapper/xml/DisposeRubbishMapper.xml

@@ -26,6 +26,9 @@
         a.rubbish_station,
         a.program_id,
         a.proc_ins_id,
+        a.weight,
+        a.transport_mileage,
+        a.subsidy,
         so.name as processingUnitName,
         su.name as clearUserName,
         su.mobile as clearUserMobile
@@ -34,6 +37,30 @@
         left join sys_user su on a.clear_user_id = su.id
         where a.id = #{id} and a.del_flag = 0
     </select>
+
+    <select id="getByProcInsId" resultType="com.jeeplus.test.wdt.disposeRubbish.domain.DisposeRubbish">
+        select
+        a.id,
+        a.create_by_id,
+        a.create_time,
+        a.update_by_id,
+        a.update_time,
+        a.del_flag,
+        a.remarks,
+        a.no,
+        a.processing_unit,
+        a.status,
+        a.clear_user_id,
+        a.dispose_type,
+        a.rubbish_station,
+        a.program_id,
+        a.proc_ins_id,
+        a.weight,
+        a.transport_mileage,
+        a.subsidy
+        from dispose_rubbish a
+        where a.proc_ins_id = #{procInsId} and a.del_flag = 0
+    </select>
     <select id="getByAttachmentId" resultType="com.jeeplus.test.oss.domain.WorkAttachmentInfo">
         SELECT
             url,

+ 10 - 0
jeeplus-modules/jeeplus-test/src/main/java/com/jeeplus/test/wdt/disposeRubbish/service/DisposeRubbishService.java

@@ -69,6 +69,8 @@ public class DisposeRubbishService extends ServiceImpl<DisposeRubbishMapper, Dis
             disposeRubbish.setFileList2(fileList2);
             List<WorkAttachment> fileList3 = ossService.findFileList(programIdList, "after");
             disposeRubbish.setFileList3(fileList3);
+            List<WorkAttachment> fileList4 = ossService.findFileList(id, "weigh");
+            disposeRubbish.setFileList4(fileList4);
 
             List<WorkOverNo> workOverNoList = Lists.newArrayList();
             for (String workOverId : programIdList) {
@@ -85,5 +87,13 @@ public class DisposeRubbishService extends ServiceImpl<DisposeRubbishMapper, Dis
         // 根据id 从work_attachment 表中获取图片信息
         return disposeRubbish;
     }
+    /**
+     * 根据id获取巡视工单信息
+     * @param procInsId
+     * @return
+     */
+    public DisposeRubbish getByProcInsId(String procInsId) {
+        return baseMapper.getByProcInsId(procInsId);
+    }
 
 }

+ 20 - 0
jeeplus-plugins/jeeplus-flowable/src/main/java/com/jeeplus/flowable/controller/FlowableTaskController.java

@@ -120,6 +120,26 @@ public class FlowableTaskController {
     @GetMapping("historic")
     public ResponseEntity historicListData(Page <HisTaskVo> page, Flow flow) {
         page = flowTaskService.historicList ( page, flow );
+        List<HisTaskVo> records = page.getRecords();
+        for (HisTaskVo record : records) {
+            Map vars = record.getVars();
+            String title = (String) vars.get("title");
+            // 查找 "发起了" 的位置
+            int startIndex = title.indexOf("在");
+            // 查找 "[垃圾处理流程]" 的位置
+            int endIndex = title.indexOf("发起了");
+
+            // 确保找到了两个子字符串
+            if (startIndex != -1 && endIndex != -1) {
+                // 截取两个子字符串之间的部分
+                String result = title.substring(startIndex+2, endIndex).trim();
+
+                vars.put("startDate",result);
+            } else {
+                System.out.println("无法找到指定的子字符串");
+            }
+
+        }
         return ResponseEntity.ok ( page );
     }