From e56e937f0b78152cc607ade75b3a0e1b2c1c2c4c Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期六, 07 十一月 2026 14:40:10 +0800
Subject: [PATCH] fix: 完成时状态与超时判断区分任务组

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java |   78 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 76 insertions(+), 2 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
index 3fef07c..8cea226 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -691,6 +691,10 @@
      * manualInfo - visitCount = 1 && currentPreachForm = "1"
      * voiceInfo - visitCount = 1 && currentPreachForm = "3"
      * smsInfo - visitCount = 1 && currentPreachForm = "4"
+     * manualSuccessInfo - visitCount = 1 && currentPreachForm = "1" && sendstate = 6
+     * voiceSuccessInfo - visitCount = 1 && currentPreachForm = "3" && sendstate = 6
+     * smsSuccessInfo - visitCount = 1 && currentPreachForm = "4" && sendstate = 6
+     * wechatSuccessInfo - visitCount = 1 && currentPreachForm = "5" && sendstate = 6
      * wechatInfo - visitCount = 1 && currentPreachForm = "5"
      * abnormalInfo - visitCount = 1 && excep = "1"
      * needFollowUpAgainInfo - visitCount > 1 && sendstate != 4
@@ -709,6 +713,18 @@
      * taskSituation5Info - taskSituation = 5
      * taskSituation6Info - taskSituation = 7
      * manuallyCalledInfo - isManuallyCalled = 1L
+     * manualCallTimeoutInfo - visitCount = 1 && sendstate = 7 && isManuallyCalled = 0
+     * manualCallTimeoutAgainInfo - visitCount > 1 && sendstate = 7 && isManuallyCalled = 0
+     * pendingFollowUpAllInfo - visitCount = 1 && sendstate in (1,2,3,7)
+     * pendingFollowUpAllAgainInfo - visitCount > 1 && sendstate in (1,2,3,7)
+     * pendingFollowUpWaitSendInfo - visitCount = 1 && sendstate in (1,2)
+     * pendingFollowUpWaitSendAgainInfo - visitCount > 1 && sendstate in (1,2)
+     * pendingFollowUpSentInfo - visitCount = 1 && sendstate in (3,7)
+     * pendingFollowUpSentAgainInfo - visitCount > 1 && sendstate in (3,7)
+     * sentInfo - visitCount = 1 && sendstate = 3
+     * sentAgainInfo - visitCount > 1 && sendstate = 3
+     * firstDischargeCountInfo - visitCount = 1
+     * againFollowUpPushCountInfo - visitCount = 2 && visitDeptCode = sys.smartor.center.dept
      * filterCountList - taskSituation = 6 && sendstate = 4
      *
      */
@@ -781,6 +797,9 @@
             log.error(logInfo);
             return error(logInfo);
         }
+        // 鍒嗙被缁熻涓烘眹鎬荤粨鏋滐紝涓嶅弬涓庡垎椤碉紱鍚屾椂閬垮厤 pageNum/pageSize 褰卞搷鍒嗙粍 key 鐨勬敹闆嗐��
+        serviceSubtaskCountReq.setPageNum(null);
+        serviceSubtaskCountReq.setPageSize(null);
         List<ServiceSubtaskStatistic> serviceSubtaskStatistics = serviceSubtaskService.getSfStatisticsScript(serviceSubtaskCountReq);
         return success(serviceSubtaskStatistics);
     }
@@ -811,10 +830,54 @@
         LoginUser loginUser = getLoginUser();
         String orgid = loginUser.getUser().getOrgid();
         serviceSubtaskCountReq.setOrgid(orgid);
-        PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize());
-        return success(serviceSubtaskService.getSfStatisticsScriptDetails(serviceSubtaskCountReq));
+        //娉ㄦ剰锛氳繖閲屼笉鑳藉啀璋冪敤 PageUtils.startPageByPost銆�
+        //杩斿洖缁撴瀯鏄� Map锛屼笖涓嶄紶 type 鏃朵細鎵ц涓ゆ潯 SQL锛孭ageHelper 鍙綔鐢ㄤ簬绗竴鏉� SQL锛�
+        //鍒嗛〉宸叉斁鍒� Service 閲屾寜棰樼洰锛坰criptid锛夊畬鎴愶紝淇濊瘉 total 鏄鐩�绘暟銆�
+        Map<String, Object> details = serviceSubtaskService.getSfStatisticsScriptDetails(serviceSubtaskCountReq);
+        AjaxResult ajax = success(details.get("data"));
+        //鍏煎鏃у墠绔細data 浠嶇劧鏄� {scriptid: 棰樼洰} 鐨� Map锛�
+        //鍚屾椂鎸� RuoYi 涔犳儻琛ヤ笂 rows/total/pageNum/pageSize 鏂逛究鍓嶇鍒嗛〉
+        ajax.put("rows", details.get("rows"));
+        ajax.put("total", details.get("total"));
+        ajax.put("pageNum", details.get("pageNum"));
+        ajax.put("pageSize", details.get("pageSize"));
+        return ajax;
     }
 
+    @ApiOperation("鑾峰彇闅忚鍒嗙被缁熻鏄庣粏璇︽儏瓒呴摼鎺�")
+    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
+    @PostMapping("/getSfStatisticsCountDetailsHyperLink")
+    public AjaxResult getSfStatisticsCountDetailsHyperLink(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) {
+        Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype();
+        if (statisticaltype != null && statisticaltype != 1 && statisticaltype != 2 && statisticaltype != 3) {
+            return error("缁熻缁村害statisticaltype浠呮敮鎸侊細1-鎸夌梾鍖� 2-鎸夌瀹� 3-鎸塼askid");
+        }
+        if (serviceSubtaskCountReq.getScriptid() == null
+                && StringUtils.isEmpty(serviceSubtaskCountReq.getScriptContent())) {
+            return error("闂ID(scriptid)涓嶈兘涓虹┖");
+        }
+        if (serviceSubtaskCountReq.getOptionText() == null) {
+            return error("闂閫夐」(optionText)涓嶈兘涓虹┖");
+        }
+
+        LoginUser loginUser = getLoginUser();
+        String orgid = loginUser.getUser().getOrgid();
+        serviceSubtaskCountReq.setOrgid(orgid);
+
+        // 涓� getSfStatisticsCountDetails 淇濇寔鐩稿悓鐨勯厤缃瓫閫夊彛寰�
+        String configKey = serviceSubtaskCountReq.getConfigKey();
+        if (StringUtils.isNotEmpty(configKey)) {
+            String configValue = configService.selectConfigByKey(configKey, orgid);
+            serviceSubtaskCountReq.setConfigValue(configValue);
+            if (StringUtils.isEmpty(configValue)) {
+                String logInfo = "getSfStatisticsCountDetailsHyperLink-鍙傛暟 " + configKey + " 鏈厤缃�, 璇烽厤缃ソ鍚庨噸璇�";
+                log.error(logInfo);
+                return error(logInfo);
+            }
+        }
+
+        return success(serviceSubtaskService.getSfStatisticsScriptDetailsHyperlink(serviceSubtaskCountReq));
+    }
     /**
      * 鍙戦�佺煭淇℃ā鏉�
      */
@@ -908,6 +971,17 @@
     }
 
     /**
+     * 鎵嬪姩鍙戦�侀棶鍗锋ā鏉跨殑寰俊鍔熻兘
+     *
+     * @param subid
+     * @return
+     */
+    @GetMapping(value = "/weChatSubTask/{subid}")
+    public Map<String, Object> weChatSubTask(@PathVariable("subid") Long subid) {
+        return serviceSubtaskService.weChatSubTask(subid);
+    }
+
+    /**
      * 璺宠浆涓棿椤�
      *
      * @param taskId

--
Gitblit v1.9.3