From 05da49de494dea021bafc1e33038c84f864b6bc4 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期三, 18 十一月 2026 17:33:41 +0800
Subject: [PATCH] 【丽水】随访统计加上 首次累计语音、首次累计微信、首次累计短信、首次累计人工

---
 ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java |  307 ++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 292 insertions(+), 15 deletions(-)

diff --git a/ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java b/ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java
index 51418de..6ed84a4 100644
--- a/ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java
+++ b/ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java
@@ -885,6 +885,39 @@
     }
 
     /**
+     * 鍏煎銆岀瀹�/鐥呭尯銆嶅瓧娈甸噸鍛藉悕鍓嶇殑鏃у叆鍙傘��
+     *
+     * <p>2026-11 璧凤細{@code deptcode/deptname} = 鍦ㄩ櫌绉戝锛寋@code leaveldeptcode/leaveldeptname} = 绂婚櫌绉戝銆�
+     * 浣嗗墠绔�/鏃ц皟鐢ㄦ柟锛坽@code /serviceSubtask/addSubTask}锛変粛鍙兘鎶婄瀹ゆ斁鍦� {@code deptcode/deptname} 閲屻��
+     * 鑻ヤ笉褰掍綅锛屽瓙浠诲姟浼氳惤鍒般�屽湪闄㈢淮搴︺�嶏紝鍒楄〃鎸夌闄㈢瀹ょ瓫閫夋椂鏌ヤ笉鍒帮紙鏈绾夸笂 2654501/2663019 鍗虫闂锛夈��
+     *
+     * <p>瑙勫垯锛�
+     * <ul>
+     *   <li>鍙闈炲欢缁姢鐞嗭紙{@code service_type != '99'}锛夌敓鏁堬紱99 鍏佽浣跨敤鍦ㄩ櫌缁村害锛�</li>
+     *   <li>绂婚櫌绉戝涓虹┖涓� {@code deptcode} 鏈夊�兼椂锛屾妸 {@code deptcode/deptname} 杩佸埌绂婚櫌缁村害锛�</li>
+     *   <li>娓呯┖鍦ㄩ櫌缁村害锛岄伩鍏嶅悓涓�浠界瀹ゅ悓鏃跺懡涓袱缁勭瓫閫夛紙涓� {@code toSubtaskFromTaskVO} 鐨勫彛寰勪竴鑷达級銆�</li>
+     * </ul>
+     */
+    private void alignLeaveDeptFromLegacyDept(ServiceSubtask serviceSubtask) {
+        if (serviceSubtask == null || "99".equals(serviceSubtask.getServiceType())) {
+            return;
+        }
+        if (StringUtils.isEmpty(serviceSubtask.getLeaveldeptcode())
+                && StringUtils.isNotEmpty(serviceSubtask.getDeptcode())) {
+            serviceSubtask.setLeaveldeptcode(serviceSubtask.getDeptcode());
+        }
+        if (StringUtils.isEmpty(serviceSubtask.getLeaveldeptname())
+                && StringUtils.isNotEmpty(serviceSubtask.getDeptname())) {
+            serviceSubtask.setLeaveldeptname(serviceSubtask.getDeptname());
+        }
+        // 鎵嬪伐鏂板鍏ュ彛娌℃湁銆屽湪闄㈢淮搴︺�嶇殑鍙潬鏉ユ簮锛涗换鍔¢厤缃噷鐨勭瀹や笉鏄偅鑰呮湰浜虹殑鍦ㄩ櫌绉戝銆�
+        serviceSubtask.setDeptcode(null);
+        serviceSubtask.setDeptname(null);
+        serviceSubtask.setHospitaldistrictcode(null);
+        serviceSubtask.setHospitaldistrictname(null);
+    }
+
+    /**
      * 鏂板鍗曚竴浠诲姟锛堥殢璁匡級
      *
      * @param serviceSubtask 鍗曚竴浠诲姟锛堥殢璁匡級
@@ -892,6 +925,8 @@
      */
     @Override
     public Map<String, Object> insertServiceSubtask(ServiceSubtask serviceSubtask) {
+        // 鍏煎 2026-11 瀛楁閲嶅懡鍚嶅墠鐨勬棫鍏ュ弬锛�/addSubTask 浠嶅彲鑳芥妸绉戝鏀惧湪 deptcode/deptname 閲�
+        alignLeaveDeptFromLegacyDept(serviceSubtask);
         List<ServiceSubtask> serviceSubtasks = null;
         //鍏堟煡璇竴涓嬭鎮h�呮槸鍚﹀凡缁忓垱寤烘牴鎹畇erviceType,sendstate,inhospid,patid,orgid
         //杩欐牱鍒ゆ柇涓昏鏄负浜嗘兂璁╂柊鍗庡尰闄㈢殑澶栭儴瀵煎叆鎮h�呭垱寤轰换鍔★紝涔熻兘鐢ㄨ繖涓帴鍙�
@@ -2625,6 +2660,8 @@
                 continue;
             }
             ServiceSubtaskStatistic statistic = getStatistic(serviceSubtaskList, serviceSubtaskCountReq.getFollowUpCountStyle(), serviceSubtaskCountReq.getVisitCount());
+            // hzszlyy锛氬墠绔笉鏀瑰瓧娈碉紝鐩存帴鎶婄疮璁″�煎洖濉埌鍘� manual/voice/sms/weChat 鍙� Again 瀛楁
+            applySiteCumulativeOverride(statistic);
             if ("taskid".equals(groupKey)) {
                 applyTaskGroupInfo(statistic, serviceSubtaskList);
             }
@@ -2923,6 +2960,7 @@
                 //棣栨鍑洪櫌闅忚
                 if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) {
                     applyFirstFollowUpExtraStatistics(serviceSubtaskStatistic, serviceSubtask);
+                    applyFirstCumulativePreachformStatistics(serviceSubtaskStatistic, serviceSubtask, followUpCountStyle);
                     //棣栨搴旈殢璁�
                     if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L)) {
                         serviceSubtaskStatistic.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L);
@@ -3045,6 +3083,7 @@
                 }//浜屾鍑洪櫌闅忚
                 else if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) {
                     applyAgainFollowUpExtraStatistics(serviceSubtaskStatistic, serviceSubtask);
+                    applyAgainCumulativePreachformStatistics(serviceSubtaskStatistic, serviceSubtask, followUpCountStyle);
                     //鍐嶆搴旈殢璁�
                     if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
                         serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L);
@@ -3256,6 +3295,220 @@
         return serviceSubtask.getIsManuallyCalled() != null && serviceSubtask.getIsManuallyCalled().equals(0L);
     }
 
+    /** 鍙戦�佹柟寮忕紪鐮侊細浜哄伐 */
+    private static final String PREACHFORM_MANUAL = "1";
+    /** 鍙戦�佹柟寮忕紪鐮侊細璇煶 */
+    private static final String PREACHFORM_VOICE = "3";
+    /** 鍙戦�佹柟寮忕紪鐮侊細鐭俊 */
+    private static final String PREACHFORM_SMS = "4";
+    /** 鍙戦�佹柟寮忕紪鐮侊細寰俊 */
+    private static final String PREACHFORM_WECHAT = "5";
+
+    /** 绱浣嶅浘锛氳闊� */
+    private static final int CUMULATIVE_MASK_VOICE = 1;
+    /** 绱浣嶅浘锛氬井淇� */
+    private static final int CUMULATIVE_MASK_WECHAT = 1 << 1;
+    /** 绱浣嶅浘锛氱煭淇� */
+    private static final int CUMULATIVE_MASK_SMS = 1 << 2;
+    /** 绱浣嶅浘锛氫汉宸� */
+    private static final int CUMULATIVE_MASK_MANUAL = 1 << 3;
+    /** 闇�瑕佹妸绱鍊煎洖濉埌鍘熷瓧娈电殑绔欑偣 */
+    private static final String SITE_HZSZLYY = "hzszlyy";
+
+    /**
+     * 棣栨闅忚銆岀疮璁″彂閫佹柟寮忋�嶇粺璁°��
+     * <p>
+     * 鍘熷彛寰勫彧鐪� current_preachform 绛変簬鏌愪釜鏂瑰紡锛氫緥濡� current_preachform=5锛堝井淇★級鏃讹紝
+     * 鍓嶉潰宸茬粡鎵ц杩囩殑璇煶涓嶅啀璁″叆璇煶鏁般�傛湰鏂规硶鎸� service_subtask.preachform 淇濆瓨鐨�
+     * 椤哄簭鎺ㄧ畻锛歝urrent_preachform 鍦ㄩ『搴忎腑鐨勪綅缃箣鍓嶇殑鍙戦�佹柟寮忥紝閮界畻鈥滅疮璁″凡杩涘叆杩団�濄��
+     * <p>
+     * 渚嬶細preachform = 3,5,4,1锛堣闊斥啋寰俊鈫掔煭淇♀啋浜哄伐锛夛細
+     * <ul>
+     *   <li>current=3锛氱疮璁¤闊�=1锛涘井淇�/鐭俊/浜哄伐=0</li>
+     *   <li>current=5锛氱疮璁¤闊�=1銆佸井淇�=1锛涚煭淇�/浜哄伐=0</li>
+     *   <li>current=4锛氱疮璁¤闊�=1銆佸井淇�=1銆佺煭淇�=1锛涗汉宸�=0</li>
+     *   <li>current=1锛氬洓椤归兘=1</li>
+     * </ul>
+     * 绾﹀畾锛歝urrent_preachform 涓虹┖鏃跺彇 preachform 绗竴涓柟寮忥紱current_preachform=-1 鏃舵寜
+     * 鏈�鍚庝竴涓綅缃鐞嗭紱current_preachform 涓嶅湪椤哄簭涓椂鍙仛绮剧‘鍖归厤鍏滃簳锛岄伩鍏嶅巻鍙茶剰鏁版嵁璇畻銆�
+     * <p>
+     * sendstate 杩囨护涓庡師鏈� manual/voice/sms/weChat 淇濇寔涓�鑷达細
+     * followUpCountStyle=1 鎺掗櫎 sendstate=4锛�=3 鍙粺璁� sendstate=6锛涘叾瀹冪粺璁℃墍鏈夐潪绌� sendstate銆�
+     */
+    private void applyFirstCumulativePreachformStatistics(ServiceSubtaskStatistic statistic,
+                                                          ServiceSubtask serviceSubtask,
+                                                          String followUpCountStyle) {
+        if (serviceSubtask.getVisitCount() == null || serviceSubtask.getVisitCount() != 1) {
+            return;
+        }
+        if (!isCumulativePreachformCountable(serviceSubtask, followUpCountStyle)) {
+            return;
+        }
+        int mask = resolveCumulativePreachformMask(serviceSubtask);
+        if ((mask & CUMULATIVE_MASK_VOICE) != 0) {
+            statistic.setVoiceCumulative(statistic.getVoiceCumulative() + 1L);
+        }
+        if ((mask & CUMULATIVE_MASK_WECHAT) != 0) {
+            statistic.setWeChatCumulative(statistic.getWeChatCumulative() + 1L);
+        }
+        if ((mask & CUMULATIVE_MASK_SMS) != 0) {
+            statistic.setSmsCumulative(statistic.getSmsCumulative() + 1L);
+        }
+        if ((mask & CUMULATIVE_MASK_MANUAL) != 0) {
+            statistic.setManualCumulative(statistic.getManualCumulative() + 1L);
+        }
+    }
+
+    /**
+     * 鍐嶆闅忚銆岀疮璁″彂閫佹柟寮忋�嶇粺璁★紝鍙e緞涓� {@link #applyFirstCumulativePreachformStatistics} 涓�鑷淬��
+     */
+    private void applyAgainCumulativePreachformStatistics(ServiceSubtaskStatistic statistic,
+                                                          ServiceSubtask serviceSubtask,
+                                                          String followUpCountStyle) {
+        if (serviceSubtask.getVisitCount() == null || serviceSubtask.getVisitCount() <= 1) {
+            return;
+        }
+        if (!isCumulativePreachformCountable(serviceSubtask, followUpCountStyle)) {
+            return;
+        }
+        int mask = resolveCumulativePreachformMask(serviceSubtask);
+        if ((mask & CUMULATIVE_MASK_VOICE) != 0) {
+            statistic.setVoiceAgainCumulative(statistic.getVoiceAgainCumulative() + 1L);
+        }
+        if ((mask & CUMULATIVE_MASK_WECHAT) != 0) {
+            statistic.setWeChatAgainCumulative(statistic.getWeChatAgainCumulative() + 1L);
+        }
+        if ((mask & CUMULATIVE_MASK_SMS) != 0) {
+            statistic.setSmsAgainCumulative(statistic.getSmsAgainCumulative() + 1L);
+        }
+        if ((mask & CUMULATIVE_MASK_MANUAL) != 0) {
+            statistic.setManualAgainCumulative(statistic.getManualAgainCumulative() + 1L);
+        }
+    }
+
+    /**
+     * 璁$畻鏌愭潯瀛愪换鍔♀�滃凡杩涘叆杩団�濈殑鍙戦�佹柟寮忎綅鍥俱��
+     * <p>
+     * current_preachform 涓虹┖鍙栫涓�涓紱= -1 瑙嗕负鍏ㄩ儴閬嶅巻瀹岋紱涓嶅湪椤哄簭閲屾椂閫�鍖栦负绮剧‘鍖归厤銆�
+     */
+    private int resolveCumulativePreachformMask(ServiceSubtask serviceSubtask) {
+        List<String> order = splitPreachformOrder(serviceSubtask.getPreachform());
+        String current = StringUtils.isNotBlank(serviceSubtask.getCurrentPreachform())
+                ? serviceSubtask.getCurrentPreachform().trim()
+                : (order.isEmpty() ? null : order.get(0));
+        if (order.isEmpty()) {
+            return exactCumulativeMask(current);
+        }
+        int currentPosition;
+        if ("-1".equals(current)) {
+            currentPosition = order.size();
+        } else {
+            int currentIndex = order.indexOf(current);
+            if (currentIndex < 0) {
+                return exactCumulativeMask(current);
+            }
+            currentPosition = currentIndex + 1;
+        }
+        int mask = 0;
+        if (reachedPreachform(order, PREACHFORM_VOICE, currentPosition)) {
+            mask |= CUMULATIVE_MASK_VOICE;
+        }
+        if (reachedPreachform(order, PREACHFORM_WECHAT, currentPosition)) {
+            mask |= CUMULATIVE_MASK_WECHAT;
+        }
+        if (reachedPreachform(order, PREACHFORM_SMS, currentPosition)) {
+            mask |= CUMULATIVE_MASK_SMS;
+        }
+        if (reachedPreachform(order, PREACHFORM_MANUAL, currentPosition)) {
+            mask |= CUMULATIVE_MASK_MANUAL;
+        }
+        return mask;
+    }
+
+    private int exactCumulativeMask(String current) {
+        if (PREACHFORM_MANUAL.equals(current)) {
+            return CUMULATIVE_MASK_MANUAL;
+        }
+        if (PREACHFORM_VOICE.equals(current)) {
+            return CUMULATIVE_MASK_VOICE;
+        }
+        if (PREACHFORM_SMS.equals(current)) {
+            return CUMULATIVE_MASK_SMS;
+        }
+        if (PREACHFORM_WECHAT.equals(current)) {
+            return CUMULATIVE_MASK_WECHAT;
+        }
+        return 0;
+    }
+
+    private boolean isCumulativePreachformCountable(ServiceSubtask serviceSubtask, String followUpCountStyle) {
+        if (serviceSubtask.getSendstate() == null) {
+            return false;
+        }
+        if ("1".equals(followUpCountStyle)) {
+            return !Long.valueOf(4L).equals(serviceSubtask.getSendstate());
+        }
+        if ("3".equals(followUpCountStyle)) {
+            return Long.valueOf(6L).equals(serviceSubtask.getSendstate());
+        }
+        return true;
+    }
+
+    /**
+     * 鎷嗗垎 preachform 鎵ц椤哄簭銆傚吋瀹硅嫳鏂囬�楀彿銆佷腑鏂囬�楀彿鍜岀┖鏍硷紝鍘婚噸骞朵繚鎸佸師椤哄簭銆�
+     */
+    private List<String> splitPreachformOrder(String preachform) {
+        if (StringUtils.isEmpty(preachform)) {
+            return Collections.emptyList();
+        }
+        return Arrays.stream(preachform.split("[,锛宂"))
+                .map(String::trim)
+                .filter(StringUtils::isNotEmpty)
+                .distinct()
+                .collect(Collectors.toList());
+    }
+
+    private boolean reachedPreachform(List<String> order, String preachform, int currentPosition) {
+        int position = order.indexOf(preachform);
+        return position >= 0 && currentPosition >= position + 1;
+    }
+
+    /**
+     * hzszlyy 绔欑偣淇濇寔鍓嶇瀛楁涓嶅彉锛氭妸绱鍊煎洖濉埌鍘� manual/voice/sms/weChat 鍙� Again 瀛楁銆�
+     * <p>
+     * 鍏跺畠绔欑偣涓嶈鐩栵紝缁х画浣跨敤鍘熸潵鐨勨�滃綋鍓嶆柟寮忕簿纭尮閰嶁�濆彛寰勩��
+     */
+    private void applySiteCumulativeOverride(ServiceSubtaskStatistic statistic) {
+        if (!SITE_HZSZLYY.equals(active)) {
+            return;
+        }
+        statistic.setManual(nvlLong(statistic.getManualCumulative()));
+        statistic.setVoice(nvlLong(statistic.getVoiceCumulative()));
+        statistic.setSms(nvlLong(statistic.getSmsCumulative()));
+        statistic.setWeChat(nvlLong(statistic.getWeChatCumulative()));
+        statistic.setManualAgain(nvlLong(statistic.getManualAgainCumulative()));
+        statistic.setVoiceAgain(nvlLong(statistic.getVoiceAgainCumulative()));
+        statistic.setSmsAgain(nvlLong(statistic.getSmsAgainCumulative()));
+        statistic.setWeChatAgain(nvlLong(statistic.getWeChatAgainCumulative()));
+    }
+
+    /**
+     * 瓒呴摼鎺ヤ笅閽荤殑鍙戦�佹柟寮忔潯浠躲��
+     * <p>
+     * hzszlyy 绔欑偣鐨勫墠绔笉鏀瑰瓧娈碉紝浠嶇偣鍘熸潵鐨� manualInfo/voiceInfo/...锛�
+     * 鍚庣鏀圭敤绱鍙e緞锛涘叾瀹冪珯鐐逛繚鎸� current_preachform 绮剧‘鍖归厤銆�
+     */
+    private void applyPreachformInfoCondition(ServiceSubtaskCountReq serviceSubtaskCountReq,
+                                              int visitCount,
+                                              String preachform) {
+        serviceSubtaskCountReq.setVisitCount(visitCount);
+        if (SITE_HZSZLYY.equals(active)) {
+            serviceSubtaskCountReq.setCumulativePreachform(preachform);
+        } else {
+            serviceSubtaskCountReq.setCurrentPreachform(preachform);
+        }
+    }
+
     /**
      * 棣栨闅忚缁熻
      *
@@ -3296,6 +3549,7 @@
 
             //棣栨鍑洪櫌闅忚
             if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() == 1) {
+                applyFirstCumulativePreachformStatistics(serviceSubtaskStatistic, serviceSubtask, followUpCountStyle);
                 //棣栨搴旈殢璁�
                 if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
                     serviceSubtaskStatistic.setNeedFollowUp(serviceSubtaskStatistic.getNeedFollowUp() + 1L);
@@ -3470,6 +3724,7 @@
 
             //鍐嶆鍑洪櫌闅忚
             if (serviceSubtask.getVisitCount() != null && serviceSubtask.getVisitCount() > 1) {
+                applyAgainCumulativePreachformStatistics(serviceSubtaskStatistic, serviceSubtask, followUpCountStyle);
                 //鍐嶆搴旈殢璁�
                 if (serviceSubtask.getSendstate() != null && serviceSubtask.getSendstate() != 4) {
                     serviceSubtaskStatistic.setNeedFollowUpAgain(serviceSubtaskStatistic.getNeedFollowUpAgain() + 1L);
@@ -3848,6 +4103,10 @@
      * voiceSuccessInfo - visitCount = 1 && currentPreachForm = "3" && sendstate = 6
      * smsSuccessInfo - visitCount = 1 && currentPreachForm = "4" && sendstate = 6
      * wechatSuccessInfo - visitCount = 1 && currentPreachForm = "5" && sendstate = 6
+     * voiceCumulativeInfo - visitCount = 1 && currentPreachForm 浣嶄簬 preachform 椤哄簭涓殑璇煶鍙婁箣鍚�
+     * weChatCumulativeInfo - visitCount = 1 && currentPreachForm 浣嶄簬 preachform 椤哄簭涓殑寰俊鍙婁箣鍚�
+     * smsCumulativeInfo - visitCount = 1 && currentPreachForm 浣嶄簬 preachform 椤哄簭涓殑鐭俊鍙婁箣鍚�
+     * manualCumulativeInfo - visitCount = 1 && currentPreachForm 浣嶄簬 preachform 椤哄簭涓殑浜哄伐鍙婁箣鍚�
      * abnormalInfo - visitCount = 1 && excep = "1"
      * needFollowUpAgainInfo - visitCount > 1 && sendstate != 4
      * pendingFollowUpAgainInfo -  visitCount > 1 && sendstate = 2
@@ -3917,6 +4176,7 @@
         serviceSubtaskCountReq.setVisitCount(null);
         serviceSubtaskCountReq.setSendstates(null);
         serviceSubtaskCountReq.setCurrentPreachform(null);
+        serviceSubtaskCountReq.setCumulativePreachform(null);
         serviceSubtaskCountReq.setExcep(null);
         serviceSubtaskCountReq.setTaskSituation(null);
         serviceSubtaskCountReq.setFinishState(null);
@@ -3969,20 +4229,33 @@
                 serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(5L, 7L)));
                 break;
             case "manualInfo":
-                serviceSubtaskCountReq.setVisitCount(1);
-                serviceSubtaskCountReq.setCurrentPreachform("1");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 1, PREACHFORM_MANUAL);
                 break;
             case "voiceInfo":
-                serviceSubtaskCountReq.setVisitCount(1);
-                serviceSubtaskCountReq.setCurrentPreachform("3");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 1, PREACHFORM_VOICE);
                 break;
             case "smsInfo":
-                serviceSubtaskCountReq.setVisitCount(1);
-                serviceSubtaskCountReq.setCurrentPreachform("4");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 1, PREACHFORM_SMS);
                 break;
             case "weChatInfo":
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 1, PREACHFORM_WECHAT);
+                break;
+            // 绱鍙e緞锛氭寜 preachform 鐨勬墽琛岄『搴忥紝current_preachform 浣嶄簬璇ユ柟寮忓強涔嬪悗鍗宠鍏�
+            case "voiceCumulativeInfo":
                 serviceSubtaskCountReq.setVisitCount(1);
-                serviceSubtaskCountReq.setCurrentPreachform("5");
+                serviceSubtaskCountReq.setCumulativePreachform("3");
+                break;
+            case "weChatCumulativeInfo":
+                serviceSubtaskCountReq.setVisitCount(1);
+                serviceSubtaskCountReq.setCumulativePreachform("5");
+                break;
+            case "smsCumulativeInfo":
+                serviceSubtaskCountReq.setVisitCount(1);
+                serviceSubtaskCountReq.setCumulativePreachform("4");
+                break;
+            case "manualCumulativeInfo":
+                serviceSubtaskCountReq.setVisitCount(1);
+                serviceSubtaskCountReq.setCumulativePreachform("1");
                 break;
             case "manualSuccessInfo":
                 serviceSubtaskCountReq.setVisitCount(1);
@@ -4025,20 +4298,16 @@
                 serviceSubtaskCountReq.setSendstates(new ArrayList<>(Arrays.asList(5L, 7L)));
                 break;
             case "manualAgainInfo":
-                serviceSubtaskCountReq.setVisitCount(2);
-                serviceSubtaskCountReq.setCurrentPreachform("1");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 2, PREACHFORM_MANUAL);
                 break;
             case "voiceAgainInfo":
-                serviceSubtaskCountReq.setVisitCount(2);
-                serviceSubtaskCountReq.setCurrentPreachform("3");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 2, PREACHFORM_VOICE);
                 break;
             case "smsAgainInfo":
-                serviceSubtaskCountReq.setVisitCount(2);
-                serviceSubtaskCountReq.setCurrentPreachform("4");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 2, PREACHFORM_SMS);
                 break;
             case "weChatAgainInfo":
-                serviceSubtaskCountReq.setVisitCount(2);
-                serviceSubtaskCountReq.setCurrentPreachform("5");
+                applyPreachformInfoCondition(serviceSubtaskCountReq, 2, PREACHFORM_WECHAT);
                 break;
             case "manualAgainSuccessInfo":
                 serviceSubtaskCountReq.setVisitCount(1);
@@ -4611,6 +4880,10 @@
         total.setManual(0L);
         total.setSms(0L);
         total.setWeChat(0L);
+        total.setVoiceCumulative(0L);
+        total.setWeChatCumulative(0L);
+        total.setSmsCumulative(0L);
+        total.setManualCumulative(0L);
         total.setAbnormal(0L);
         total.setNeedFollowUpAgain(0L);
         total.setPendingFollowUpAgain(0L);
@@ -4656,6 +4929,10 @@
             total.setManual(total.getManual() + (stat.getManual() != null ? stat.getManual() : 0L));
             total.setSms(total.getSms() + (stat.getSms() != null ? stat.getSms() : 0L));
             total.setWeChat(total.getWeChat() + (stat.getWeChat() != null ? stat.getWeChat() : 0L));
+            total.setVoiceCumulative(total.getVoiceCumulative() + (stat.getVoiceCumulative() != null ? stat.getVoiceCumulative() : 0L));
+            total.setWeChatCumulative(total.getWeChatCumulative() + (stat.getWeChatCumulative() != null ? stat.getWeChatCumulative() : 0L));
+            total.setSmsCumulative(total.getSmsCumulative() + (stat.getSmsCumulative() != null ? stat.getSmsCumulative() : 0L));
+            total.setManualCumulative(total.getManualCumulative() + (stat.getManualCumulative() != null ? stat.getManualCumulative() : 0L));
             total.setAbnormal(total.getAbnormal() + (stat.getAbnormal() != null ? stat.getAbnormal() : 0L));
             total.setNeedFollowUpAgain(total.getNeedFollowUpAgain() + (stat.getNeedFollowUpAgain() != null ? stat.getNeedFollowUpAgain() : 0L));
             total.setPendingFollowUpAgain(total.getPendingFollowUpAgain() + (stat.getPendingFollowUpAgain() != null ? stat.getPendingFollowUpAgain() : 0L));

--
Gitblit v1.9.3