From 574f63b57552e85406076bc0a2da511a040d263f Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期一, 14 九月 2026 18:03:53 +0800
Subject: [PATCH] 【景宁】记录Url

---
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java |   63 ++++++++++++++++++++++++++++---
 1 files changed, 56 insertions(+), 7 deletions(-)

diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
index 2f047a7..34ada0f 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -9,6 +9,7 @@
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.core.service.IDingTalkService;
 import com.ruoyi.common.dx.MessageSend;
 import com.ruoyi.common.enums.MsgLSEnum;
 import com.ruoyi.common.enums.ServiceFromEnum;
@@ -104,6 +105,9 @@
 
     @Autowired
     private ISysConfigService configService;
+
+    @Autowired
+    private IDingTalkService dingTalkService;
 
 
     @Value("${localIP}")
@@ -266,6 +270,44 @@
             for (String dutyDeptPersonCode : dutyDeptPersonCodeList) {
                 log.info("銆恠endSLTDMYDExceptInfo銆戝彂閫佷汉宸ュ彿锛歿}", dutyDeptPersonCode);
                 String data = MessageSend.sendMsg(exceptContent, "7", dutyDeptPersonCode, LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
+            }
+        }
+    }
+
+    /**
+     * 瀹氭椂鍙戦�佸紓甯镐俊鎭�-鏅畞
+     */
+    public void sendExceptInfo() throws Exception {
+        //1.鑾峰彇鍙戦�佷汉宸ュ彿
+        ServiceSubtaskDetailTraceVO subtaskDetailTraceVO = new ServiceSubtaskDetailTraceVO();
+        subtaskDetailTraceVO.setHandleFlag("0");
+        List<ServiceSubtaskDetailTrace> serviceSubtaskDetailTraces =
+                serviceSubtaskDetailTraceService.selectServiceSubtaskDetailTtraceList(subtaskDetailTraceVO);
+        // 鎶� dutyDeptPersonCode 鏁寸悊鍒� list 涓紙濡傛灉澶氫釜浜虹敤閫楀彿鍒嗗壊锛屽垯灞曞紑骞跺幓閲嶏級
+        List<String> dutyDeptPersonCodeList = serviceSubtaskDetailTraces.stream()
+                .map(ServiceSubtaskDetailTrace::getDutyDeptPersonCode)
+                .filter(StringUtils::isNotBlank)
+                .flatMap(code -> Arrays.stream(code.split(",")))
+                .map(String::trim)
+                .filter(StringUtils::isNotBlank).distinct()  // 鍘婚噸
+                .collect(Collectors.toList());
+        // 鑾峰彇鈥滃紓甯稿唴瀹规彁閱�"
+        SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("send.except.content");
+        String exceptContent = sysConfig.getConfigValue();
+
+        // 鑾峰彇鈥滃唴瀹规彁閱掓祴璇曚汉宸ュ彿鈥�
+        String testPerson = sysConfigMapper.checkConfigKeyUnique("send.test.person").getConfigValue();
+        if (StringUtils.isNotBlank(testPerson)) {
+            String[] split = testPerson.split(",");
+            if (CollectionUtils.isEmpty(dutyDeptPersonCodeList)) dutyDeptPersonCodeList = Arrays.asList(split);
+            else dutyDeptPersonCodeList.addAll(Arrays.asList(split));
+        }
+
+        if (CollectionUtils.isNotEmpty(dutyDeptPersonCodeList)) {
+            for (String dutyDeptPersonCode : dutyDeptPersonCodeList) {
+                log.info("銆恠endExceptInfo銆戝彂閫佷汉宸ュ彿锛歿}", dutyDeptPersonCode);
+                String dutyDeptPerson = dingTalkService.getDingTalkUserByMobile(dutyDeptPersonCode);
+                dingTalkService.sendDingTalkText(exceptContent, dutyDeptPerson);
             }
         }
     }
@@ -1027,18 +1069,17 @@
                     serviceOutPath.setCreateTime(new Date());
                     serviceOutPath.setOrgid(serviceSubtask.getOrgid());
                     iServiceOutPathService.insertServiceOutPath(serviceOutPath);
+                    String url = "";
                     String format = String.format("%03X", serviceOutPath.getId());
-                    serviceOutPath.setRadix(format);
-                    serviceOutPath.setUpdateTime(new Date());
-                    iServiceOutPathService.updateServiceOutPath(serviceOutPath);
                     //鍏堝垽鏂竴涓嬪彂鐨勬槸涓嶆槸瀹f暀
                     if (!"3".equals(serviceSubtask.getType())) {
                         sendMagParam.setPhone(serviceSubtask.getPhone());
-
-                        sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format);
+                        url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/wt?p=" + format : localIP + "/wt?p=" + format;
+                        sendMagParam.setUrl(url);
                         //濡傛灉type鏄闊抽殢璁跨殑璇濓紙璇存槑琛ュ伩鍙戦�佹柟寮忎腑鏈夌數璇濋殢璁跨殑鏂瑰紡锛岃繖閲岀殑澶栭摼灏卞湴鍧�鍙兘鐢�/sf锛�
                         if (serviceSubtask.getType().equals("1"))
-                            sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/sf?p=" + format : localIP + "/sf?p=" + format);
+                            url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/sf?p=" + format : localIP + "/sf?p=" + format;
+                            sendMagParam.setUrl(url);
 
 //                        SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("wj.sms.template");
                         SysConfig sysConfig = new SysConfig();
@@ -1058,7 +1099,9 @@
                         HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(serviceSubtask.getLibtemplateid());
                         if (heLibrary.getHetype().equals("1")) {
                             sendMagParam.setPhone(serviceSubtask.getPhone());
-                            sendMagParam.setUrl(StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/xj?p=" + format : localIP + "/xj?p=" + format);
+                            url = StringUtils.isNotEmpty(req_path) ? localIP + ":" + req_path + "/xj?p=" + format : localIP + "/xj?p=" + format;
+
+                            sendMagParam.setUrl(url);
 
                             SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("xj.sms.template");
                             if (!Objects.isNull(sysConfig)) {
@@ -1076,6 +1119,11 @@
                         }
 
                     }
+
+                    serviceOutPath.setRadix(format);
+                    serviceOutPath.setUpdateTime(new Date());
+                    serviceOutPath.setUrl(url);
+                    iServiceOutPathService.updateServiceOutPath(serviceOutPath);
                     String isSuccess = null;
                     log.info("active鐨勫�间负锛歿}", active);
                     if (active.equals("xh")) {
@@ -1249,6 +1297,7 @@
                     String format = String.format("%03X", serviceOutPath.getId());
                     serviceOutPath.setRadix(format);
                     serviceOutPath.setUpdateTime(new Date());
+                    serviceOutPath.setUrl(url);
                     iServiceOutPathService.updateServiceOutPath(serviceOutPath);
 
                     //鑾峰彇寰俊鍏紬鍙疯姹備俊鎭牴鎹満鏋処D

--
Gitblit v1.9.3