wenhongquan 2 жил өмнө
parent
commit
02fe10cae7

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

@@ -198,12 +198,12 @@ public class TableDetectionController extends BaseController
         if(detection==null){
             return error("计划不存在");
         }
-        detection.setStatus(4L);
+//        detection.setStatus(4L);
         tbldetectionLog.setDetectionStatus(4L);
         tblDetectionLogService.insertTblDetectionLog(tbldetectionLog);
-        tableDetectionService.updateTableDetection(detection);
+//        tableDetectionService.updateTableDetection(detection);
         //发送钉钉通知
-        ryTask.setNotice("011544081228132554,013303042738042020",null,"检测计划完成通知","http://www.baidu.com");
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"检测计划状况上传通知","http://www.baidu.com");
 
 
         return success("成功");

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

@@ -6,6 +6,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.Threads;
 import com.ruoyi.framework.web.service.PermissionService;
 import com.ruoyi.quartz.task.RyTask;
 import com.ruoyi.system.domain.TblMaintainLog;
@@ -162,6 +163,28 @@ public class TblMaintainController extends BaseController
      * @param tblMaintainLog
      * @return
      */
+    @PostMapping("/resultsupload")
+    @PreAuthorize("@ss.hasPermi('system:maintain:feedback')")
+    public AjaxResult maintainResultsUpload(@RequestBody TblMaintainLog tblMaintainLog){
+        if(tblMaintainLog==null || tblMaintainLog.getMaintainId()==null || tblMaintainLog.getLogDes()==null){
+            return error("表单不完整");
+        }
+
+        TblMaintain maintain = tblMaintainService.selectTblMaintainById(tblMaintainLog.getMaintainId());
+        if(maintain==null){
+            return error("计划不存在");
+        }
+//        maintain.setStatus(4L);
+        tblMaintainLog.setMaintainStatus(4L);
+        tblMaintainLogService.insertTblMaintainLog(tblMaintainLog);
+//        tblMaintainService.updateTblMaintain(maintain);
+        //发送钉钉通知
+
+        ryTask.setNotice("011544081228132554,013303042738042020",null,"养护计划成果上传通知","http://www.baidu.com");
+
+        return success("成功");
+    }
+
     @PostMapping("/feedback")
     @PreAuthorize("@ss.hasPermi('system:maintain:feedback')")
     public AjaxResult maintainFeedback(@RequestBody TblMaintainLog tblMaintainLog){
@@ -200,8 +223,8 @@ public class TblMaintainController extends BaseController
         if(maintain==null){
             return error("计划不存在");
         }
-        maintain.setStatus(4L);
-        tblMaintainLog.setMaintainStatus(4L);
+        maintain.setStatus(5L);
+        tblMaintainLog.setMaintainStatus(5L);
         tblMaintainLogService.insertTblMaintainLog(tblMaintainLog);
         tblMaintainService.updateTblMaintain(maintain);
         //发送钉钉通知

+ 26 - 19
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java

@@ -64,14 +64,17 @@ public class RyTask
         if(token.equals("")||(new Date().getTime()/1000 - tokentime)>exp){
             getToken();
         }
-        try {
-            DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
-            OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
-            request.setAgentId(agentId);
-            request.setUseridList(userids);
-            request.setToAllUser(false);
-
-            OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
+        Thread t = new Thread(){
+            @Override
+            public void run() {
+                try {
+                    DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/topapi/message/corpconversation/asyncsend_v2");
+                    OapiMessageCorpconversationAsyncsendV2Request request = new OapiMessageCorpconversationAsyncsendV2Request();
+                    request.setAgentId(agentId);
+                    request.setUseridList(userids);
+                    request.setToAllUser(false);
+
+                    OapiMessageCorpconversationAsyncsendV2Request.Msg msg = new OapiMessageCorpconversationAsyncsendV2Request.Msg();
 //            msg.setMsgtype("text");
 //            msg.setText(new OapiMessageCorpconversationAsyncsendV2Request.Text());
 //            msg.getText().setContent("test123");
@@ -109,19 +112,23 @@ public class RyTask
 //        msg.setMsgtype("oa");
 //        request.setMsg(msg);
 
-            msg.setActionCard(new OapiMessageCorpconversationAsyncsendV2Request.ActionCard());
-            msg.getActionCard().setTitle(title);
-            msg.getActionCard().setMarkdown(content==null?("### "+title):content);
-            msg.getActionCard().setSingleTitle("测试测试"+new Date().getTime());
-            msg.getActionCard().setSingleUrl(url);
-            msg.setMsgtype("action_card");
-            request.setMsg(msg);
-            OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, token);
-            log.debug("发送钉钉消息");
+                    msg.setActionCard(new OapiMessageCorpconversationAsyncsendV2Request.ActionCard());
+                    msg.getActionCard().setTitle(title);
+                    msg.getActionCard().setMarkdown(content==null?("### "+title):content);
+                    msg.getActionCard().setSingleTitle("测试测试"+new Date().getTime());
+                    msg.getActionCard().setSingleUrl(url);
+                    msg.setMsgtype("action_card");
+                    request.setMsg(msg);
+                    OapiMessageCorpconversationAsyncsendV2Response rsp = client.execute(request, token);
+                    log.debug("发送钉钉消息");
 
-        }catch (Exception e){
+                }catch (Exception e){
+
+                }
+            }
+        };
+        t.run();
 
-        }
 
     }