From 2cfa20c70ea84fa3435f3fd1e653c5ae60a3fc1e Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 06 一月 2026 16:52:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java |   90 ++++++++++++++++++++++++++++++++++++--------
 1 files changed, 73 insertions(+), 17 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 e9d9fd6..085f086 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
@@ -16,9 +16,11 @@
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.DtoConversionUtils;
 import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.common.utils.reflect.ReflectUtils;
 import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.system.service.ISysConfigService;
 import com.smartor.domain.*;
 import com.smartor.mapper.PatMedInhospMapper;
 import com.smartor.mapper.PatMedOuthospMapper;
@@ -35,6 +37,7 @@
 import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
@@ -67,6 +70,9 @@
     @Autowired
     private IServiceSubtaskRecordService serviceSubtaskRecordService;
 
+    @Autowired
+    private ISysConfigService configService;
+
     @Value("${spring.profiles.active}")
     private String active;
 
@@ -78,6 +84,7 @@
      */
     @ApiOperation("鏌ヨ鎮h�呴殢璁夸俊鎭�")
     //@PreAuthorize("@ss.hasPermi('system:taskcall:list')")
+//    @Cacheable(value = "patItem", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#serviceSubtaskVO.toString().getBytes())", unless = "#result == null or #result.isEmpty()")
     @PostMapping("/patItem")
     public TableDataInfo patItem(@RequestBody ServiceSubtaskVO serviceSubtaskVO) {
         PageUtils.startPageByPost(serviceSubtaskVO.getPageNum(), serviceSubtaskVO.getPageSize());
@@ -100,17 +107,9 @@
             if (ObjectUtils.isNotEmpty(serviceTask)) serviceSubtask.setPreachform(serviceTask.getPreachform());
         }
 
-        /**
-         * 浠g爜浼樺寲 鍒嗙缁熻
-        Map<String, Object> map = new HashMap<>();
-        map.put("serviceSubtaskList", serviceSubtaskList);
-        List<Map<String, Object>> list = new ArrayList<>();
-        list.add(map);
-         **/
-        //Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO);
-        //patItemCount 璋冪敤redisCache璁板綍缁熻鏁版嵁
-//        Map<String, Object> map = patItemCount(serviceSubtaskVO);
-        Map<String, Object> map = serviceSubtaskService.patItemCount1(serviceSubtaskVO);
+//      patItemCount 璋冪敤redisCache璁板綍缁熻鏁版嵁
+//      Map<String, Object> map = patItemCount(serviceSubtaskVO);
+        Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO);
         map.put("serviceSubtaskList", serviceSubtaskList);
         List<Map<String, Object>> list = new ArrayList<>();
         list.add(map);
@@ -127,7 +126,7 @@
     }
 
     /**
-     * 缁熻闅忚鏁版嵁
+     * 缁熻闅忚鏁版嵁 -- cache鐗�
      */
     @ApiOperation("缁熻闅忚鏁版嵁")
     @PostMapping("/patItemCount")
@@ -235,9 +234,10 @@
             serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString());
             serviceSubtask.setServiceSubtaskRecordList(serviceSubtaskRecordService.selectServiceSubtaskRecordList(serviceSubtaskRecord));
         }
-        //todo 浠g爜浼樺寲
+//      patItemCount 璋冪敤redisCache璁板綍缁熻鏁版嵁
+//      Map<String, Object> map = patItemCount(serviceSubtaskVO);
         Map<String, Object> map = serviceSubtaskService.patItemCount(serviceSubtaskVO);
-//        Map<String, Object> map = patItemCount(serviceSubtaskVO);
+
         map.put("serviceSubtaskList", serviceSubtaskList);
         List<Map<String, Object>> list = new ArrayList<>();
         list.add(map);
@@ -341,9 +341,9 @@
         ExcelUtil<ServiceSubtaskDiagname> util = new ExcelUtil<ServiceSubtaskDiagname>(ServiceSubtaskDiagname.class);
 
         if (active.equals("ls") || active.equals("druid")) {
-            util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "闅忚缁熻瀵煎嚭");
+            util.exportExcel(response, serviceSubtaskDiagnameList, LocalDate.now().getMonthValue() + "闅忚鍘嗗彶璁板綍瀵煎嚭");
         } else {
-            util.exportExcel(response, serviceSubtaskDiagnameList, "闅忚缁熻瀵煎嚭");
+            util.exportExcel(response, serviceSubtaskDiagnameList, "闅忚鍘嗗彶璁板綍瀵煎嚭");
         }
     }
 
@@ -494,7 +494,7 @@
     }
 
     /**
-     * 闅忚缁熻瀵煎嚭
+     * 闅忚鍘嗗彶璁板綍瀵煎嚭
      */
     //@PreAuthorize("@ss.hasPermi('system:taskcall:export')")
     @Log(title = "闅忚缁熻瀵煎嚭", businessType = BusinessType.EXPORT)
@@ -540,6 +540,62 @@
         return success(serviceSubtaskService.getSfStatisticsJoydetails(serviceSubtaskCountReq));
     }
 
+    /**
+     * 鑾峰彇闅忚鍒嗙被缁熻鏄庣粏
+     */
+    @ApiOperation("鑾峰彇闅忚鍒嗙被缁熻鏄庣粏")
+    @PostMapping("/getSfStatisticsCount")
+    public Map<String, Object> getSfStatisticsCount(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) {
+        if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) {
+            return error("鏈嶅姟绫诲瀷涓嶈兘涓虹┖");
+        }
+        PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize());
+
+        String configKey = serviceSubtaskCountReq.getConfigKey();
+        if(StringUtils.isNotEmpty(configKey)){
+            String configValue = configService.selectConfigByKey(configKey);
+            serviceSubtaskCountReq.setConfigValue(configValue);
+            if(StringUtils.isEmpty(configValue)){
+                String logInfo =  "getSfStatisticsCount-鍙傛暟 " + configKey + " 鏈厤缃�, 璇烽厤缃ソ鍚庨噸璇�";
+                log.error(logInfo);
+                return error(logInfo);
+            }
+        }else {
+            String logInfo =  "getSfStatisticsCount-鍙傛暟configKey鏈紶鍏�, 璇烽厤缃ソ鍚庨噸璇�";
+            log.error(logInfo);
+            return error(logInfo);
+        }
+        return success(serviceSubtaskService.getSfStatisticsScript(serviceSubtaskCountReq));
+    }
+
+    @ApiOperation("鑾峰彇闅忚鍒嗙被缁熻鏄庣粏璇︽儏")
+    @PostMapping("/getSfStatisticsCountDetails")
+    public AjaxResult getSfStatisticsCountDetails(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) {
+        if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() == 0 && serviceSubtaskCountReq.getDeptcodes().size() == 0) {
+            return error("绉戝鎴栫梾鍖轰笉鑳戒负绌�");
+        }
+        PageUtils.startPageByPost(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize());
+        //澶嶈瘖缁熻
+        String configKey = serviceSubtaskCountReq.getConfigKey();
+        if(StringUtils.isNotEmpty(configKey)){
+            String configValue = configService.selectConfigByKey(configKey);
+            if(StringUtils.isEmpty(configValue)){
+                String logInfo =  "getSfStatisticsCountDetails-鍙傛暟 " + configKey + " 鏈厤缃�, 璇烽厤缃ソ鍚庨噸璇�";
+                log.error(logInfo);
+                return error(logInfo);
+            }
+            serviceSubtaskCountReq.setConfigValue(configValue);
+        }else {
+            String logInfo =  "getSfStatisticsCountDetails-鍙傛暟configKey鏈紶鍏�, 璇烽厤缃ソ鍚庨噸璇�";
+            log.error(logInfo);
+            return error(logInfo);
+        }
+
+        LoginUser loginUser = getLoginUser();
+        String orgid = loginUser.getUser().getOrgid();
+        serviceSubtaskCountReq.setOrgid(orgid);
+        return success(serviceSubtaskService.getSfStatisticsScriptDetails(serviceSubtaskCountReq));
+    }
 
     /**
      * 鍙戦�佺煭淇℃ā鏉�

--
Gitblit v1.9.3