wenhongquan 3 năm trước cách đây
mục cha
commit
9c178fe209

+ 89 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TableDetectionController.java

@@ -2,6 +2,10 @@ package com.ruoyi.web.controller.system;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.quartz.task.RyTask;
+import com.ruoyi.system.domain.TblDetectionLog;
+import com.ruoyi.system.service.ITblDetectionLogService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -34,6 +38,13 @@ public class TableDetectionController extends BaseController
     @Autowired
     private ITableDetectionService tableDetectionService;
 
+
+    @Autowired
+    private ITblDetectionLogService tblDetectionLogService;
+
+    @Autowired
+    private RyTask ryTask;
+
     /**
      * 查询检测计划列表
      */
@@ -101,4 +112,82 @@ public class TableDetectionController extends BaseController
     {
         return toAjax(tableDetectionService.deleteTableDetectionByIds(ids));
     }
+
+    /***
+     * 任务派发
+     * @param tbldetectionLog
+     * @return
+     */
+    @PostMapping("/distributed")
+    public AjaxResult detectionDistributed(@RequestBody TblDetectionLog tbldetectionLog){
+        if(tbldetectionLog==null || tbldetectionLog.getDetectionId()==null || tbldetectionLog.getLogDes()==null){
+            return error("表单不完整");
+        }
+
+        TableDetection detection = tableDetectionService.selectTableDetectionById(tbldetectionLog.getDetectionId());
+        if(detection==null){
+            return error("计划不存在");
+        }
+        detection.setStatus(2L);
+        tbldetectionLog.setDetectionStatus(2L);
+        tblDetectionLogService.insertTblDetectionLog(tbldetectionLog);
+        tableDetectionService.updateTableDetection(detection);
+        //发送钉钉通知
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"检测计划派单通知","http://www.baidu.com");
+
+
+        return success("成功");
+    }
+
+    /***
+     * 执行反馈
+     * @param tbldetectionLog
+     * @return
+     */
+    @PostMapping("/feedback")
+    public AjaxResult detectionFeedback(@RequestBody TblDetectionLog tbldetectionLog){
+        if(tbldetectionLog==null || tbldetectionLog.getDetectionId()==null || tbldetectionLog.getLogDes()==null){
+            return error("表单不完整");
+        }
+
+        TableDetection detection = tableDetectionService.selectTableDetectionById(tbldetectionLog.getDetectionId());
+        if(detection==null){
+            return error("计划不存在");
+        }
+        detection.setStatus(3L);
+        tbldetectionLog.setDetectionStatus(3L);
+        tblDetectionLogService.insertTblDetectionLog(tbldetectionLog);
+        tableDetectionService.updateTableDetection(detection);
+        //发送钉钉通知
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"检测计划反馈通知","http://www.baidu.com");
+
+
+        return success("成功");
+    }
+
+    /***
+     * 养护成果上传
+     * @param tbldetectionLog
+     * @return
+     */
+    @PostMapping("/complete")
+    public AjaxResult detectionComplete(@RequestBody TblDetectionLog tbldetectionLog){
+        if(tbldetectionLog==null || tbldetectionLog.getDetectionId()==null || tbldetectionLog.getLogDes()==null){
+            return error("表单不完整");
+        }
+
+        TableDetection detection = tableDetectionService.selectTableDetectionById(tbldetectionLog.getDetectionId());
+        if(detection==null){
+            return error("计划不存在");
+        }
+        detection.setStatus(4L);
+        tbldetectionLog.setDetectionStatus(4L);
+        tblDetectionLogService.insertTblDetectionLog(tbldetectionLog);
+        tableDetectionService.updateTableDetection(detection);
+        //发送钉钉通知
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"检测计划完成通知","http://www.baidu.com");
+
+
+        return success("成功");
+    }
 }

+ 3 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/TblMaintainController.java

@@ -136,7 +136,7 @@ public class TblMaintainController extends BaseController
         tblMaintainLogService.insertTblMaintainLog(tblMaintainLog);
         tblMaintainService.updateTblMaintain(maintain);
         //发送钉钉通知
-        ryTask.setNotice("011544081228132554,013303042738042020",null,"计划派单通知","http://www.baidu.com");
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"养护计划派单通知","http://www.baidu.com");
 
 
         return success("成功");
@@ -162,7 +162,7 @@ public class TblMaintainController extends BaseController
         tblMaintainLogService.insertTblMaintainLog(tblMaintainLog);
         tblMaintainService.updateTblMaintain(maintain);
         //发送钉钉通知
-        ryTask.setNotice("011544081228132554,013303042738042020",null,"计划反馈通知","http://www.baidu.com");
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"养护计划反馈通知","http://www.baidu.com");
 
 
         return success("成功");
@@ -188,7 +188,7 @@ public class TblMaintainController extends BaseController
         tblMaintainLogService.insertTblMaintainLog(tblMaintainLog);
         tblMaintainService.updateTblMaintain(maintain);
         //发送钉钉通知
-        ryTask.setNotice("011544081228132554,013303042738042020",null,"计划反馈通知","http://www.baidu.com");
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"养护计划完成通知","http://www.baidu.com");
 
 
         return success("成功");

+ 6 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TableDetectionServiceImpl.java

@@ -1,7 +1,9 @@
 package com.ruoyi.system.service.impl;
 
+import java.util.Date;
 import java.util.List;
 
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.domain.TblDetectionLog;
 import com.ruoyi.system.domain.TblMaintain;
 import com.ruoyi.system.domain.TblMaintainLog;
@@ -65,6 +67,8 @@ public class TableDetectionServiceImpl implements ITableDetectionService
     @Override
     public int insertTableDetection(TableDetection tableDetection)
     {
+        tableDetection.setCreateTime(new Date());
+        tableDetection.setCreateBy(SecurityUtils.getUsername());
         return tableDetectionMapper.insertTableDetection(tableDetection);
     }
 
@@ -77,6 +81,8 @@ public class TableDetectionServiceImpl implements ITableDetectionService
     @Override
     public int updateTableDetection(TableDetection tableDetection)
     {
+        tableDetection.setUpdateTime(new Date());
+        tableDetection.setUpdateBy(SecurityUtils.getUsername());
         return tableDetectionMapper.updateTableDetection(tableDetection);
     }
 

BIN
ruoyi/uploadPath/upload/2022/06/22/032002100811_38342209_20220622133045A004.pdf


BIN
ruoyi/uploadPath/upload/2022/06/22/032002100811_38342209_20220622133048A005.pdf


BIN
ruoyi/uploadPath/upload/2022/06/22/623685558_20220622133109A007.mp4


BIN
ruoyi/uploadPath/upload/2022/06/22/btn_yjld_20220622133058A006.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit@2x_20220622094756A002.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit@2x_20220622133128A008.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit@2x_20220622133143A009.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit@2x_20220622133227A010.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit@2x_20220622133411A011.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit_20220622094752A001.png


BIN
ruoyi/uploadPath/upload/2022/06/22/edit_20220622094810A003.png