From 168bc124e530e0d9b326b0162b6b63adeb865bb1 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期一, 16 十一月 2026 09:17:38 +0800
Subject: [PATCH] Merge branch 'smartor_ls_261103' into smartor_ls_merge
---
ruoyi-task/src/main/java/com/ruoyi/task/service/impl/ServiceSubtaskServiceImpl.java | 137 +++++++++++++++++++++++++++++++++++++++------
1 files changed, 118 insertions(+), 19 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 3f2df0b..51418de 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
@@ -1870,6 +1870,25 @@
serviceTaskdeptService.insertServiceTaskdept(serviceTaskdept);
}
}
+ // 鐐逛綅琛岋紙2026-11锛宎ppltype=7锛夛細绉戝 / 鐥呭尯 / 鐐逛綅鍦� service_taskdept 閲屾槸
+ // **鍚勮嚜鐙珛鐨勮**锛屽彲浠ュ叡瀛樹篃鍙互涓嶅叡瀛� 鈥斺�� 鎵�浠ョ偣浣嶈鏄�"棰濆杩藉姞"锛�
+ // 涓嶆浛鎹笂闈㈢殑绉戝/鐥呭尯琛屻�傜偣浣嶈鐨� dept_code/dept_name 鐣欑┖锛岀紪鐮佸彧钀� point_location銆�
+ if ("7".equals(serviceTaskVO.getAppltype())) {
+ String pointLocation = firstNonBlank(serviceTaskVO.getPointLocation(),
+ serviceTask.getPointLocation());
+ if (StringUtils.isNotEmpty(pointLocation)) {
+ ServiceTaskdept pointDept = new ServiceTaskdept();
+ pointDept.setTaskId(serviceTask.getTaskid());
+ pointDept.setTaskName(serviceTask.getTaskName());
+ pointDept.setOrgid(serviceTask.getOrgid());
+ pointDept.setLongtask(serviceTask.getLongTask() == null ? null
+ : Long.valueOf(serviceTask.getLongTask()));
+ pointDept.setServiceType(serviceTaskVO.getServiceType());
+ pointDept.setDeptType("3");
+ pointDept.setPointLocation(pointLocation);
+ serviceTaskdeptService.insertServiceTaskdept(pointDept);
+ }
+ }
}
}
//闀挎湡浠诲姟锛屼篃鍏佽鍔犱汉浜�
@@ -2249,6 +2268,27 @@
scheduleVO.setOplevelCodes(serviceTaskVO.getOplevelcode());
scheduleVO.setCreateBy(serviceTask.getUpdateBy());
serviceTaskScheduleService.saveScheduleWithDetail(scheduleVO);
+ } else if (serviceTaskVO.getAppltype().equals("7")) {
+ // 鎸夌偣浣嶏紙鍚屽痉闇�姹傦級锛氬厛杞垹璇ヤ换鍔℃棫鐨� dept_type='3' 琛岋紝鍐嶆寜鍏ュ弬閲嶅缓
+ // 锛堜笌绉戝/鐥呭尯銆屽厛鍒犲悗鎻掋�嶅悓鍙e緞锛涚偣浣嶈 dept_code/dept_name 鐣欑┖锛�
+ ServiceTaskdept oldPoint = new ServiceTaskdept();
+ oldPoint.setTaskId(serviceTask.getTaskid());
+ oldPoint.setDeptType("3");
+ serviceTaskdeptService.deleteServiceTaskdeptByTaskId(oldPoint);
+ String pointLocation = StringUtils.isNotEmpty(serviceTaskVO.getPointLocation())
+ ? serviceTaskVO.getPointLocation() : serviceTask.getPointLocation();
+ if (StringUtils.isNotEmpty(pointLocation)) {
+ ServiceTaskdept pointDept = new ServiceTaskdept();
+ pointDept.setTaskId(serviceTask.getTaskid());
+ pointDept.setTaskName(serviceTask.getTaskName());
+ pointDept.setOrgid(serviceTaskVO.getOrgid());
+ pointDept.setLongtask(serviceTask.getLongTask() == null ? null
+ : Long.valueOf(serviceTask.getLongTask()));
+ pointDept.setServiceType(serviceTaskVO.getServiceType());
+ pointDept.setDeptType("3");
+ pointDept.setPointLocation(pointLocation);
+ serviceTaskdeptService.insertServiceTaskdept(pointDept);
+ }
}
}
if (ObjectUtils.isNotEmpty(serviceTaskVO.getIvrTaskTemplateVO())) {
@@ -2525,7 +2565,10 @@
if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
groupKey = drcode;
} else {
- groupKey = "deptcode";
+ // 2026-11 瀛楁閲嶅懡鍚嶅悗锛歞eptcode 鏄湪闄㈢瀹わ紙鍘嗗彶鏁版嵁涓虹┖锛夛紝
+ // 鍑洪櫌绉戝宸叉敼鍚嶄负 leaveldeptcode锛屽垎缁勫繀椤荤敤鍚庤�咃紝
+ // 鍚﹀垯 getSfStatisticsGroupKey 浼氳繑鍥� NULL锛屾嫾鎴� IN (NULL) 瀵艰嚧鏁磋〃鏌ョ┖銆�
+ groupKey = "leaveldeptcode";
}
} else if (serviceSubtaskCountReq.getStatisticaltype() != null && serviceSubtaskCountReq.getStatisticaltype() == 3) {
// 鐥呯缁熻锛氭寜浠诲姟ID鍒嗙粍锛屾瘡涓换鍔″嵆涓�涓梾绉嶉殢璁夸换鍔�
@@ -2536,6 +2579,17 @@
Map<String, List<ServiceSubtask>> collect = new HashMap<>();
serviceSubtaskCountReq.setGroupKey(groupKey);
List<String> groupKeyList = serviceSubtaskMapper.getSfStatisticsGroupKey(serviceSubtaskCountReq);
+ /*
+ * 鍒嗙粍閿彲鑳戒负 NULL锛堝巻鍙叉暟鎹�佹垨閲嶅懡鍚嶅悗灏氭湭鍥炲~鐨勫湪闄㈢淮搴﹀垪锛夛紝
+ * 鐩存帴鎷艰繘 SQL 浼氬彉鎴� `AND IFNULL(鍒�,'Unknown') IN (NULL)`锛屾亽涓嶆垚绔嬶紝鏁村紶缁熻琛ㄤ负绌恒��
+ * 杩欓噷缁熶竴鎴� 'Unknown'锛屼笌鑱氬悎 SQL 鐨� IFNULL(鍒�,'Unknown') 鍙e緞瀵归綈銆�
+ */
+ if (groupKeyList != null) {
+ groupKeyList = groupKeyList.stream()
+ .map(key -> key == null ? "Unknown" : key)
+ .distinct()
+ .collect(Collectors.toList());
+ }
serviceSubtaskCountReq.setGroupKeyList(groupKeyList);
List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq);
switch (groupKey) {
@@ -2550,6 +2604,7 @@
collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getManagementDoctorCode()).orElse("Unknown")));
break;
case "deptcode":
+ case "leaveldeptcode":
collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeaveldeptcode()).orElse("Unknown")));
break;
case "leavehospitaldistrictcode":
@@ -3166,7 +3221,7 @@
}
/**
- * 鍐嶆闅忚闄勫姞缁熻锛氬緟闅忚銆佸凡鍙戦�併�佷汉宸ョ數璇濊秴鏃跺強鍥為櫌澶嶈瘖澶嶆煡锛坰uggest=6锛夈��
+ * 鍐嶆闅忚闄勫姞缁熻锛氬緟闅忚銆佸凡鍙戦�併�佷汉宸ョ數璇濊秴鏃跺強鍥為櫌澶嶈瘖澶嶆煡锛坰uggest=7锛夈��
*/
private void applyAgainFollowUpExtraStatistics(ServiceSubtaskStatistic statistic, ServiceSubtask serviceSubtask) {
if (serviceSubtask.getVisitCount() == null || serviceSubtask.getVisitCount() <= 1) {
@@ -3176,9 +3231,9 @@
return;
}
Long sendstate = serviceSubtask.getSendstate();
- // 鍥為櫌澶嶈瘖澶嶆煡锛氬啀娆¢殢璁夸腑鎸夊鐞嗘剰瑙� suggest=6 缁熻
- if (StringUtils.equals("6", StringUtils.trim(serviceSubtask.getSuggest()))) {
- statistic.setSuggest6CountAgain(statistic.getSuggest6CountAgain() + 1L);
+ // 鍥為櫌澶嶈瘖澶嶆煡锛氬啀娆¢殢璁夸腑鎸夊鐞嗘剰瑙� suggest=7 缁熻
+ if (StringUtils.equals("7", StringUtils.trim(serviceSubtask.getSuggest()))) {
+ statistic.setSuggest7CountAgain(statistic.getSuggest7CountAgain() + 1L);
}
if (sendstate.equals(3L)) {
statistic.setSentAgain(statistic.getSentAgain() + 1L);
@@ -3824,7 +3879,7 @@
* pendingFollowUpSentAgainInfo - visitCount > 1 && sendstate in (3,7)
* sentInfo - visitCount = 1 && sendstate = 3
* sentAgainInfo - visitCount > 1 && sendstate = 3
- * suggest6CountAgainInfo - visitCount > 1 && suggest = 6
+ * suggest7CountAgainInfo - visitCount > 1 && suggest = 7
* filterCountList - taskSituation = 6 && sendstate = 4
*
*/
@@ -4009,10 +4064,10 @@
serviceSubtaskCountReq.setVisitCount(2);
serviceSubtaskCountReq.setExcep("1");
break;
- case "suggest6CountAgainInfo":
- // 鍐嶆闅忚鍥為櫌澶嶈瘖澶嶆煡锛歷isitCount > 1 涓� suggest = 6
+ case "suggest7CountAgainInfo":
+ // 鍐嶆闅忚鍥為櫌澶嶈瘖澶嶆煡锛歷isitCount > 1 涓� suggest = 7
serviceSubtaskCountReq.setVisitCount(2);
- serviceSubtaskCountReq.setSuggest("6");
+ serviceSubtaskCountReq.setSuggest("7");
break;
case "taskSituation1Info":
serviceSubtaskCountReq.setTaskSituation(1);
@@ -4571,7 +4626,7 @@
total.setSentAgain(0L);
total.setFollowUpSuccessAgain(0L);
total.setFollowUpFailAgain(0L);
- total.setSuggest6CountAgain(0L);
+ total.setSuggest7CountAgain(0L);
total.setManualAgain(0L);
total.setSmsAgain(0L);
total.setWeChatAgain(0L);
@@ -4616,7 +4671,7 @@
total.setSentAgain(total.getSentAgain() + (stat.getSentAgain() != null ? stat.getSentAgain() : 0L));
total.setFollowUpSuccessAgain(total.getFollowUpSuccessAgain() + (stat.getFollowUpSuccessAgain() != null ? stat.getFollowUpSuccessAgain() : 0L));
total.setFollowUpFailAgain(total.getFollowUpFailAgain() + (stat.getFollowUpFailAgain() != null ? stat.getFollowUpFailAgain() : 0L));
- total.setSuggest6CountAgain(total.getSuggest6CountAgain() + (stat.getSuggest6CountAgain() != null ? stat.getSuggest6CountAgain() : 0L));
+ total.setSuggest7CountAgain(total.getSuggest7CountAgain() + (stat.getSuggest7CountAgain() != null ? stat.getSuggest7CountAgain() : 0L));
total.setManualAgain(total.getManualAgain() + (stat.getManualAgain() != null ? stat.getManualAgain() : 0L));
total.setSmsAgain(total.getSmsAgain() + (stat.getSmsAgain() != null ? stat.getSmsAgain() : 0L));
total.setWeChatAgain(total.getWeChatAgain() + (stat.getWeChatAgain() != null ? stat.getWeChatAgain() : 0L));
@@ -5456,16 +5511,46 @@
String ip = localIP;
ServiceTask serviceTask = new ServiceTask();
serviceTask = serviceTaskService.selectServiceTaskByTaskid(serviceTaskVo.getTaskid());
+ if (ObjectUtils.isEmpty(serviceTask)) {
+ // 浠诲姟涓嶅瓨鍦� 鈫� 涓嶅彲鑳芥湁 data锛岀洿鎺ユ姏涓氬姟寮傚父锛堟帴鍙e眰浼氳浆鎴� code=500锛�
+ throw new BaseException("鎵爜鐢熸垚浠诲姟澶辫触锛氫换鍔′笉瀛樺湪鎴栧凡鍒犻櫎锛坱askid=" + serviceTaskVo.getTaskid() + "锛�");
+ }
if (ObjectUtils.isNotEmpty(serviceTask)) {
try {
ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
- if (ObjectUtils.isNotEmpty(serviceTaskVo.getDeptcode())) {
- serviceTaskdept.setDeptType("1");
- serviceTaskdept.setDeptCode(serviceTaskVo.getDeptcode());
- }
- if (ObjectUtils.isNotEmpty(serviceTaskVo.getLeavehospitaldistrictcode())) {
+ // 缁村害锛堢瀹�/鐥呭尯/鐐逛綅锛夌敱浠诲姟鐨� appltype 鍐冲畾锛�1=绉戝銆�2=鐥呭尯銆�7=鐐逛綅銆�
+ // 涓夌缁村害鍦� service_taskdept 閲屾槸**鍚勮嚜鐙珛鐨勮**锛堝悇鑷殑鍒楋級锛屽彲浠ュ叡瀛樸�佷篃鍙互涓嶅叡瀛橈紱
+ // 浣嗘煡琛屾椂蹇呴』鍙甫涓�涓淮搴� 鈥斺�� 鍚﹀垯浼氱敤 A 缁村害鐨勭紪鐮佸幓鎾� B 缁村害鐨勮锛�
+ // 鑰岀偣浣嶈鐨� dept_code 鏈潵灏辨槸绌虹殑銆�
+ String appltype = serviceTask.getAppltype();
+ if ("7".equals(appltype)) {
+ serviceTaskdept.setDeptType("3");
+ serviceTaskdept.setPointLocation(firstNonBlank(serviceTaskVo.getPointLocation(),
+ serviceTask.getPointLocation()));
+ } else if ("2".equals(appltype)) {
serviceTaskdept.setDeptType("2");
- serviceTaskdept.setDeptCode(serviceTaskVo.getLeavehospitaldistrictcode());
+ // 浠诲姟涓婄殑绉戝/鐥呭尯鍙兘鏄�楀彿澶氶�夛紝鏌� service_taskdept 瑕佺敤鍗曞�硷紙鍙栫涓�涓級
+ serviceTaskdept.setDeptCode(firstNonBlank(serviceTaskVo.getLeavehospitaldistrictcode(),
+ firstValue(serviceTask.getLeavehospitaldistrictcode())));
+ } else if ("1".equals(appltype)) {
+ serviceTaskdept.setDeptType("1");
+ serviceTaskdept.setDeptCode(firstNonBlank(serviceTaskVo.getDeptcode(),
+ firstValue(serviceTask.getDeptcode())));
+ } else {
+ // appltype 涓虹┖鐨勫巻鍙蹭换鍔★細娌跨敤鏀归�犲墠鐨勫彛寰勶紙绉戝 鈫� 鐥呭尯锛屽悗鍐欑殑瑕嗙洊鍏堝啓鐨勶級锛�
+ // 鐐逛綅浣滀负绗笁缁达紝鍙湪浼犱簡鐐逛綅鏃惰ˉ涓娿��
+ if (ObjectUtils.isNotEmpty(serviceTaskVo.getDeptcode())) {
+ serviceTaskdept.setDeptType("1");
+ serviceTaskdept.setDeptCode(serviceTaskVo.getDeptcode());
+ }
+ if (ObjectUtils.isNotEmpty(serviceTaskVo.getLeavehospitaldistrictcode())) {
+ serviceTaskdept.setDeptType("2");
+ serviceTaskdept.setDeptCode(serviceTaskVo.getLeavehospitaldistrictcode());
+ }
+ if (ObjectUtils.isNotEmpty(serviceTaskVo.getPointLocation())) {
+ serviceTaskdept.setDeptType("3");
+ serviceTaskdept.setPointLocation(serviceTaskVo.getPointLocation());
+ }
}
serviceTaskdept.setServiceType(serviceTask.getServiceType());
serviceTaskdept.setOrgid(serviceTask.getOrgid());
@@ -5502,10 +5587,21 @@
iServiceOutPathService.updateServiceOutPath(serviceOutPath);
}
+ } else {
+ // 閰嶇疆缂哄け灞炪�屼笟鍔″彲棰勬湡銆嶆儏鍐碉細甯︿笂鎺掓煡淇℃伅鎶涘嚭鍘伙紙涓嶅悶锛夛紝
+ // 鎺ュ彛灞傛嵁姝よ繑鍥� code=500 + 鏄庣‘ msg锛岄伩鍏嶃��200 + 绌� data銆嶃��
+ throw new BaseException("鎵爜鐢熸垚浠诲姟澶辫触锛氭湭鍖归厤鍒颁换鍔$淮搴﹂厤缃紙taskid=" + serviceTaskVo.getTaskid()
+ + "锛宎ppltype=" + appltype
+ + "锛宒eptType=" + serviceTaskdept.getDeptType()
+ + "锛宒eptCode=" + serviceTaskdept.getDeptCode()
+ + "锛宲ointLocation=" + serviceTaskdept.getPointLocation() + "锛�");
}
+ } catch (BaseException be) {
+ // 鈿狅笍 蹇呴』鎺掑湪 catch (Exception) 涔嬪墠锛欱aseException 鏄� RuntimeException锛�
+ // 鍚﹀垯鍒氭姏鍑虹殑涓氬姟寮傚父浼氳涓嬮潰鏁存鍚炴帀锛屾帴鍙e張鍙樻垚 200 + 绌� data銆�
+ throw be;
} catch (Exception e) {
- e.printStackTrace();
- log.error("銆愭壂鐮佺敓鎴愪换鍔°�戝鐞嗗紓甯革細{}", e.getMessage());
+ log.error("銆愭壂鐮佺敓鎴愪换鍔°�戝鐞嗗紓甯革細taskid={}锛寋}", serviceTaskVo.getTaskid(), e.getMessage(), e);
}
}
return content;
@@ -5523,6 +5619,9 @@
if (StringUtils.isNotEmpty(serviceTaskdept.getDeptType()) && serviceTaskdept.getDeptType().equals("1")) {
serviceSubtask.setLeaveldeptcode(serviceTaskdept.getDeptCode());
serviceSubtask.setLeaveldeptname(serviceTaskdept.getDeptName());
+ } else if (StringUtils.isNotEmpty(serviceTaskdept.getDeptType()) && serviceTaskdept.getDeptType().equals("3")) {
+ // 鐐逛綅琛岋紙dept_type='3'锛夛細dept_code/dept_name 涓虹┖锛岀偣浣嶅彧钀� point_location
+ serviceSubtask.setPointLocation(serviceTaskdept.getPointLocation());
} else {
serviceSubtask.setLeavehospitaldistrictcode(serviceTaskdept.getDeptCode());
serviceSubtask.setLeavehospitaldistrictname(serviceTaskdept.getDeptName());
--
Gitblit v1.9.3