From 3ede859fc8cd6068ea91f66553d38f5b510af3ef Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 17 四月 2026 17:06:03 +0800
Subject: [PATCH] 修改一下serviceSubtask的remark的值

---
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java |   74 ++++++++++++++++++++++++++++++++++---
 1 files changed, 68 insertions(+), 6 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 1c9bc79..885ce6c 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.*;
@@ -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;
     }
 
@@ -2302,7 +2303,7 @@
             String deptcodes = CollectionUtils.isEmpty(request.getDeptcodes()) ? null : String.join(",", request.getDeptcodes());
             if (!request.getTimeType().equals("month")) {
                 req.setBeginAdmitdate(DateUtils.parseDate(serviceStatisticsResponse.getTimePeriod()));
-                req.setEndAdmitdate(DateUtils.parseDate(serviceStatisticsResponse.getTimePeriod()));
+                req.setEndAdmitdate( DateUtils.addDays(DateUtils.parseDate(serviceStatisticsResponse.getTimePeriod()),1));
             } else {
                 // year 绫诲瀷锛歵imePeriod 鏍煎紡涓� "yyyy-MM"锛屽彇褰撴湀绗竴澶╁拰鏈�鍚庝竴澶�
                 java.time.YearMonth ym = java.time.YearMonth.parse(serviceStatisticsResponse.getTimePeriod());
@@ -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