From 8b9db684defff26456d58609ea243e9fd21ed081 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 17 四月 2026 10:16:02 +0800
Subject: [PATCH] 【本地】获取随访统计比例 逻辑调整
---
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 94 +++++++++++++++++++++++++++++++++++++++--------
1 files changed, 78 insertions(+), 16 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index 8e623b3..3ed0490 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -13,6 +13,7 @@
import com.smartor.common.FtpService;
import com.smartor.config.PhoneUtils;
import com.smartor.domain.*;
+import com.smartor.domain.VO.ServiceSubtaskCotinueCountVO;
import com.smartor.domain.entity.ServiceSubtaskEntity;
import com.smartor.mapper.*;
import com.smartor.service.*;
@@ -411,18 +412,18 @@
// 澶勭悊绌哄紓甯�
if (MapUtils.isEmpty(result)) {
result = new HashMap<>();
+ // 纭繚鎵�鏈� key 閮芥湁鍊硷紝閬垮厤绌烘寚閽堝紓甯�
+ // MyBatis 鐨� SUM 鍦ㄦ病鏈夊尮閰嶈鏃朵細杩斿洖 null
+ result.putIfAbsent("wzx", 0);
+ result.putIfAbsent("ysf", 0);
+ result.putIfAbsent("yc", 0);
+ result.putIfAbsent("jg", 0);
+ result.putIfAbsent("fssb", 0);
+ result.putIfAbsent("yfs", 0);
+ result.putIfAbsent("blq", 0);
+ result.putIfAbsent("dsf", 0);
+ result.putIfAbsent("total", 0);
}
- // 纭繚鎵�鏈� key 閮芥湁鍊硷紝閬垮厤绌烘寚閽堝紓甯�
- // MyBatis 鐨� SUM 鍦ㄦ病鏈夊尮閰嶈鏃朵細杩斿洖 null
- result.putIfAbsent("wzx", 0);
- result.putIfAbsent("ysf", 0);
- result.putIfAbsent("yc", 0);
- result.putIfAbsent("jg", 0);
- result.putIfAbsent("fssb", 0);
- result.putIfAbsent("yfs", 0);
- result.putIfAbsent("blq", 0);
- result.putIfAbsent("dsf", 0);
-
return result;
}
@@ -1982,7 +1983,7 @@
// if (existSize > 0) return pullTaskVOList;
int count = 0;
long size = listOps.size("cache-0");
- log.error("---------鎵撶數璇濅箣鍓嶇紦瀛樹腑鐨勬暟鎹噺锛歿}", size);
+ log.info("---------鎵撶數璇濅箣鍓嶇紦瀛樹腑鐨勬暟鎹噺锛歿}", size);
if (size > 0) {
//phoneCount() 閫氳繃缁欏嚭鐨勬瘡涓皬鏃堕渶瑕佹墦鍑虹殑鐢佃瘽閲忥紝绠楀嚭鍒版櫄涓�8鐐逛竴鐐硅兘鎵撳嚭澶氬皯涓數璇濓紝鑾峰彇鍒版�婚噺
//濡傛灉闇�瑕佺珛鍗虫墽琛岀殑鏁版嵁閲忓ぇ浜庝竴澶╄鎵ц鐨勪笂闄愶紝鍒欏彧鍙栦笂闄愮殑鏁伴噺锛屽叾瀹冪殑鍒欐斁鍥瀝edis涓�
@@ -2031,7 +2032,7 @@
}
}
// if (existList.size() != 0) redisCache.setCacheListRight("cache-exist", existList);
- log.error("-----------瀹為檯鎷夊彇鐨勭數璇濇暟鎹噺锛歿}", CollectionUtils.isNotEmpty(pullTaskVOList) ? pullTaskVOList.size() : null);
+ log.info("-----------瀹為檯鎷夊彇鐨勭數璇濇暟鎹噺锛歿}", CollectionUtils.isNotEmpty(pullTaskVOList) ? pullTaskVOList.size() : null);
return pullTaskVOList;
}
@@ -2370,13 +2371,13 @@
public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq) {
log.info("getSfStatistics鐨勫叆鍙備负锛歿}", serviceSubtaskCountReq);
String groupKey = "drcode";
- if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && !serviceSubtaskCountReq.getLeavehospitaldistrictcodes().isEmpty()) {
+ if (serviceSubtaskCountReq.getStatisticaltype() != null && serviceSubtaskCountReq.getStatisticaltype() == 1) {
if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
groupKey = "drcode";
} else {
groupKey = "leavehospitaldistrictcode";
}
- } else if (serviceSubtaskCountReq.getDeptcodes() != null && !serviceSubtaskCountReq.getDeptcodes().isEmpty()) {
+ } else if (serviceSubtaskCountReq.getStatisticaltype() != null && serviceSubtaskCountReq.getStatisticaltype() == 2) {
if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) {
groupKey = "drcode";
} else {
@@ -3847,7 +3848,7 @@
if (serviceSubtaskPreachform1.getSort() == spSize.size() && failSendstate.equals("4")) {
serviceSubtask.setCurrentPreachform(preachform);
serviceSubtask.setSendstate(5L);
-// serviceSubtask.setRemark("setFailPreachForm鏂规硶 褰撳墠鐨刾reachform宸茬粡鏄渶鍚庝竴涓簡锛屽叏澶辫触浜�");
+ serviceSubtask.setRemark("鎵�鏈夊彂閫佹柟寮忓潎鏈幏鍙栫粨鏋滐紝浠诲姟澶辫触");
serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
return true;
}
@@ -4017,4 +4018,65 @@
public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity entity) {
return serviceSubtaskMapper.getCurrentUserServiceSubtaskCount(entity);
}
+
+ @Override
+ public Map<String, Object> getContinueNurseCount(ServiceSubtaskCotinueCountVO vo) {
+ boolean hasDistrict = !CollectionUtils.isEmpty(vo.getLeavehospitaldistrictcodes());
+ boolean hasDept = !CollectionUtils.isEmpty(vo.getDeptcodes());
+
+ List<Map<String, Object>> districtRows;
+ List<Map<String, Object>> deptRows;
+
+ if (hasDistrict) {
+ // 鍙紶浜嗙梾鍖猴細浠呮寜鐥呭尯缁村害缁熻
+ districtRows = serviceSubtaskMapper.getContinueNurseCount(vo);
+ deptRows = Collections.emptyList();
+ } else if (hasDept) {
+ // 鍙紶浜嗙瀹わ細浠呮寜绉戝缁村害缁熻
+ districtRows = Collections.emptyList();
+ deptRows = serviceSubtaskMapper.getContinueNurseCountByDept(vo);
+ } else {
+ // 閮芥湭浼狅細鐥呭尯鍜岀瀹ゅ悇缁熻涓�閬�
+ districtRows = serviceSubtaskMapper.getContinueNurseCount(vo);
+ deptRows = serviceSubtaskMapper.getContinueNurseCountByDept(vo);
+ }
+
+ long totalNoContinue = 0L;
+ long totalContinue = 0L;
+ List<Map<String, Object>> detail = new ArrayList<>();
+
+ for (Map<String, Object> row : districtRows) {
+ String groupName = row.get("groupName") == null
+ ? (row.get("groupCode") == null ? "" : row.get("groupCode").toString())
+ : row.get("groupName").toString();
+ long noCnt = row.get("noContinueCnt") == null ? 0L : Long.parseLong(row.get("noContinueCnt").toString());
+ long yesCnt = row.get("continueCnt") == null ? 0L : Long.parseLong(row.get("continueCnt").toString());
+ totalNoContinue += noCnt;
+ totalContinue += yesCnt;
+ Map<String, Object> item = new LinkedHashMap<>();
+ item.put("鏈欢缁璤" + groupName, noCnt);
+ item.put("宸插欢缁璤"+groupName, yesCnt);
+ detail.add(item);
+ }
+
+ for (Map<String, Object> row : deptRows) {
+ String groupName = row.get("groupName") == null
+ ? (row.get("groupCode") == null ? "" : row.get("groupCode").toString())
+ : row.get("groupName").toString();
+ long noCnt = row.get("noContinueCnt") == null ? 0L : Long.parseLong(row.get("noContinueCnt").toString());
+ long yesCnt = row.get("continueCnt") == null ? 0L : Long.parseLong(row.get("continueCnt").toString());
+ totalNoContinue += noCnt;
+ totalContinue += yesCnt;
+ Map<String, Object> item = new LinkedHashMap<>();
+ item.put("鏈欢缁璤" + groupName, noCnt);
+ item.put("宸插欢缁璤" + groupName, yesCnt);
+ detail.add(item);
+ }
+
+ Map<String, Object> result = new LinkedHashMap<>();
+ result.put("鏈欢缁�绘暟閲�", totalNoContinue);
+ result.put("宸插欢缁�绘暟閲�", totalContinue);
+ result.put("璇︽儏", detail);
+ return result;
+ }
}
--
Gitblit v1.9.3