From a5fc29e1f53a23512d0b4235a32b31b2ea8c0055 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 05 六月 2026 10:22:37 +0800
Subject: [PATCH] 【丽水】随访统计全部-修改

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java |   64 ++++++++++++++++++++++++++++++++
 1 files changed, 64 insertions(+), 0 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 a0e194c..56c6428 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
@@ -1,6 +1,8 @@
 package com.ruoyi.web.controller.smartor;
 
 import com.github.pagehelper.ISelect;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
 import com.ruoyi.common.annotation.AddOrgId;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.constant.HttpStatus;
@@ -13,6 +15,7 @@
 import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.BusinessType;
 import com.ruoyi.common.enums.PreachFormEnum;
+import com.ruoyi.common.enums.SendStateEnum;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DtoConversionUtils;
@@ -230,6 +233,10 @@
             for (ServiceSubtaskExport serviceSubtaskExport : serviceSubtaskExports) {
                 String pf = PreachFormEnum.getDescByCode(serviceSubtaskExport.getPreachform());
                 serviceSubtaskExport.setPreachform(pf);
+                if(serviceSubtaskExport.getSendstate() != null) {
+                    String stName = SendStateEnum.getDescByCode("" + serviceSubtaskExport.getSendstate());
+                    serviceSubtaskExport.setStName(stName);
+                }
 
                 //璁$畻鍑洪櫌澶╂暟
                 if (!Objects.isNull(serviceSubtaskExport.getEndtime())) {
@@ -541,6 +548,33 @@
         Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize());
         serviceSubtaskCountReq.setPageNum(offset);
 
+        Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype();
+
+        if(ObjectUtils.isNotEmpty(statisticaltype)){
+            SysUser user = getLoginUser().getUser();
+            if(statisticaltype==1){
+                if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())){
+                    //鍏ㄩ儴鐥呭尯
+                    String deptInfo = user.getDeptInfo();
+                    Gson gson = new Gson();
+                    // 3. 瀹氫箟 List 绫诲瀷锛堟牳蹇冿級
+                    TypeToken<List<String>> typeToken = new TypeToken<List<String>>() {};
+                    List<String> leavehospitaldistrictcodes = gson.fromJson(deptInfo, typeToken.getType());
+                    serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes);
+                }
+            }else if(statisticaltype==2){
+                if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())){
+                    //鍏ㄩ儴绉戝
+                    String hospInfo = user.getHospInfo();
+                    Gson gson = new Gson();
+                    // 3. 瀹氫箟 List 绫诲瀷锛堟牳蹇冿級
+                    TypeToken<List<String>> typeToken = new TypeToken<List<String>>() {};
+                    List<String> deptCodes = gson.fromJson(hospInfo, typeToken.getType());
+                    serviceSubtaskCountReq.setDeptcodes(deptCodes);
+                }
+            }
+        }
+
         String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid());
         if (ObjectUtils.isNotEmpty(followUpCountStyle)) {
             serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle);
@@ -551,6 +585,31 @@
         serviceSubtaskCountReq.setPageSize(null);
         List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq);
         return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSfStatistics(serviceSubtaskCountReq));
+    }
+
+    /**
+     * 鑾峰彇涓撶梾闅忚缁熻姣斾緥
+     */
+    @ApiOperation("鑾峰彇涓撶梾闅忚缁熻姣斾緥")
+    @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid")
+    @PostMapping("/getSpecialSfStatistics")
+    public Map<String, Object> getSpecialSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) {
+        if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) {
+            return error("鏈嶅姟绫诲瀷涓嶈兘涓虹┖");
+        }
+        Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize());
+        serviceSubtaskCountReq.setPageNum(offset);
+
+        String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid());
+        if (ObjectUtils.isNotEmpty(followUpCountStyle)) {
+            serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle);
+        } else {
+            serviceSubtaskCountReq.setFollowUpCountStyle("1");
+        }
+        serviceSubtaskCountReq.setPageNum(null);
+        serviceSubtaskCountReq.setPageSize(null);
+        List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSpecialSfStatistics(serviceSubtaskCountReq);
+        return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSpecialSfStatistics(serviceSubtaskCountReq));
     }
 
     /**
@@ -824,4 +883,9 @@
     public void syncMedInhospForShiyi(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
         collectHISService.syncMedInhosp(startTime, endTime);
     }
+
+    @PostMapping("/syncMedOperForShiyi")
+    public void syncMedOperForShiyi(@RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime) {
+        collectHISService.syncOper(startTime, endTime);
+    }
 }

--
Gitblit v1.9.3