|
@@ -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("成功");
|
|
|
+ }
|
|
|
}
|