From 8249bbcc710c42f89c69fb0bd575094acd2e418d Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 17 四月 2026 16:33:27 +0800
Subject: [PATCH] 南华附一上线、首页问题、定时任务问题处理

---
 smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java            |   36 ++-
 smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java                             |   71 +++++
 ruoyi-admin/src/main/resources/application.yml                                                        |    2 
 smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java                          |    2 
 ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java                    |   34 +-
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java                                          |   37 ++-
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java              |   10 
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java                         |    2 
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSLTDHealthcareRecordController.java |   11 
 ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java                                |   52 ++-
 ruoyi-admin/src/main/resources/application-nhfy.yml                                                   |  256 +++++++++++++++++++++
 smartor/src/main/java/com/smartor/domain/ServiceStatisticsRequest.java                                |    2 
 smartor/src/main/java/com/smartor/domain/MtSubmitSmResp.java                                          |   38 +++
 smartor/src/main/java/com/smartor/common/MtSubmitSmUtil.java                                          |  113 +++++++++
 14 files changed, 582 insertions(+), 84 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
index 7324a94..7a7d6d6 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -23,6 +23,7 @@
 import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.service.ISysConfigService;
 import com.smartor.common.LSHospTokenUtil;
+import com.smartor.common.MtSubmitSmUtil;
 import com.smartor.domain.*;
 import com.smartor.domain.entity.ServiceSubtaskEntity;
 import com.smartor.mapper.*;
@@ -114,6 +115,9 @@
 
     @Value("${spring.profiles.active}")
     private String active;
+
+    @Autowired
+    private MtSubmitSmUtil mtSubmitSmUtil;
 
     @Autowired
     private ISysConfigService configService;
@@ -307,7 +311,7 @@
                         iServiceOutPathService.updateServiceOutPath(serviceOutPath);
                         sendMagParam.setPhone(serviceSubtask.getPhone());
                         sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format);
-                        if (active.equals("ls") || active.equals("sltd")) {
+                        if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) {
                             sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
                         } else if (active.equals("xh")) {
                             sendMagParam.setContent("銆愭柊鍗庡尰闄€�戞偍濂斤紝閭�璇锋偍濉啓鍑洪櫌闅忚璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "濉啓銆傛劅璋㈡偍閰嶅悎锛�");
@@ -336,7 +340,7 @@
                         //濡傛灉type鏄闊抽殢璁跨殑璇濓紙璇存槑琛ュ伩鍙戦�佹柟寮忎腑鏈夌數璇濋殢璁跨殑鏂瑰紡锛岃繖閲岀殑澶栭摼灏卞湴鍧�鍙兘鐢�/sf锛�
                         if (serviceSubtask.getType().equals("1"))
                             sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format);
-                        if (active.equals("ls") || active.equals("sltd")) {
+                        if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) {
                             sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
                         } else if (active.equals("xh")) {
                             sendMagParam.setContent("銆愭柊鍗庡尰闄€�戞偍濂斤紝閭�璇锋偍濉啓鍑洪櫌璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "濉啓銆傛劅璋㈡偍閰嶅悎锛�");
@@ -363,7 +367,7 @@
                         if (heLibrary.getHetype().equals("1")) {
                             sendMagParam.setPhone(serviceSubtask.getPhone());
                             sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format);
-                            if (active.equals("ls") || active.equals("sltd")) {
+                            if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) {
                                 sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
                             } else if (active.equals("xh")) {
                                 sendMagParam.setContent("銆愭柊鍗庡尰闄€�戞偍濂斤紝閭�璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
@@ -425,23 +429,37 @@
                             setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�", "5");
                             throw new BaseException("鐭俊鍙戦�佸け璐�");
                         }
-                    } else if (active.equals("sltd")) {
+                    } else if (active.equals("sltd") || active.equals("nhfy")) {
                         //鐪佺珛鍚屽痉鐨勭煭淇″彂閫佹柟寮�
-                        String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
-                        if (StringUtils.isNotEmpty(data)) {
-                            ObjectMapper mapper = new ObjectMapper();
-                            JsonNode root = mapper.readTree(data);
-                            String status = root.get("result").get(0).get("status").asText();
-                            if (status.equals("00000")) {
-                                s = "true";
+                        String data = null;
+                        Map<String, Object> smsResult = null;
+                        if (active.equals("sltd")) {
+                            data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
+                            if (StringUtils.isNotEmpty(data)) {
+                                ObjectMapper mapper = new ObjectMapper();
+                                JsonNode root = mapper.readTree(data);
+                                String status = root.get("result").get(0).get("status").asText();
+                                if (status.equals("00000")) {
+                                    s = "true";
+                                } else {
+                                    setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�: " + data, "5");
+                                    throw new BaseException("鐭俊鍙戦�佸け璐�");
+                                }
+
                             } else {
                                 setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�: " + data, "5");
                                 throw new BaseException("鐭俊鍙戦�佸け璐�");
                             }
-                        } else {
-                            setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�: " + data, "5");
-                            throw new BaseException("鐭俊鍙戦�佸け璐�");
+                        } else if (active.equals("nhfy")) {
+                            smsResult = mtSubmitSmUtil.submitSm(sendMagParam.getPhone(), sendMagParam.getContent());
+                            if (smsResult != null && smsResult.get("result") != null && smsResult.get("result").toString().equals("0")) {
+                                s = "true";
+                            } else {
+                                setFailPreachForm(serviceSubtask, sendPreachform, "鐭俊鍙戦�佸け璐�", "5");
+                                throw new BaseException("鐭俊鍙戦�佸け璐�");
+                            }
                         }
+
                     } else if (active.equals("hzszlyy")) {
                         //甯備竴
                         long timestamp = new Date().getTime();
@@ -845,9 +863,9 @@
                     if (failSendstate.equals("4") || failSendstate.equals("5")) {
                         serviceSubtask.setCurrentPreachform(preachform);
                         serviceSubtask.setSendstate(5L);
-                        serviceSubtask.setRemark("setFailPreachForm鏂规硶 褰撳墠鐨刾reachform宸茬粡鏄渶鍚庝竴涓簡锛屽叏閮ㄦ墽琛屽け璐�");
+                        serviceSubtask.setRemark("澶勭悊琛ュ伩浠诲姟,褰撳墠澶勭悊鏈�鍚庤ˉ鍋匡紝鍏ㄩ儴鎵ц澶辫触");
                         //浜哄伐鍙戦�佽秴鏃�
-                        if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")){
+                        if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")) {
                             serviceSubtask.setSendstate(7L);
                             serviceSubtask.setRemark("浜哄伐鍙戦�佽秴鏃�");
                         }
@@ -865,7 +883,7 @@
         serviceSubtask.setVisitTime(getNextVisitTime(serviceSubtask.getId(), serviceSubtask.getTaskid(), serviceSubtask.getVisitTime(), serviceSubtask.getCurrentPreachform()));
         serviceSubtask.setSendstate(3L);
         //浜哄伐鍙戦�佽秴鏃�
-        if(ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")){
+        if (ObjectUtils.isNotEmpty(preachform) && preachform.equals("1") && failSendstate.equals("7")) {
             serviceSubtask.setSendstate(7L);
             serviceSubtask.setRemark("浜哄伐鍙戦�佽秴鏃�");
         }
diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSLTDHealthcareRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSLTDHealthcareRecordController.java
index 1e24d92..363f367 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSLTDHealthcareRecordController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSLTDHealthcareRecordController.java
@@ -2,6 +2,8 @@
 
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.smartor.common.MtSubmitSmUtil;
+import com.smartor.domain.MtSubmitSmResp;
 import com.smartor.domain.ServiceSLTDDeptReqVO;
 import com.smartor.domain.ServiceSLTDInhospReqVO;
 import com.smartor.domain.ServiceSLTDInhospResDTO;
@@ -10,12 +12,10 @@
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 鐪佺珛鍚屽痉鍋ュ悍璁板綍鏌ヨController
@@ -32,6 +32,9 @@
     @Autowired
     private IServiceSLTDHealthcareRecordService serviceSLTDHealthcareRecordService;
 
+    @Autowired
+    private MtSubmitSmUtil mtSubmitSmUtil;
+
     /**
      * 鏌ヨ鍦ㄩ櫌鎮h�呭仴搴疯褰曞垪琛�
      */
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 e9abbe2..e734dbc 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
@@ -119,16 +119,6 @@
         // 鐩存帴浠庡凡鏈夎仛鍚堢粨鏋滄帹绠梩otal锛岄伩鍏嶅幓鎺夊垎椤靛悗鍐嶅叏閲忔煡涓�閬嶅ぇ琛�
         long total = 0L;
         try {
-//                 * wzx: 鏈墽琛屾暟閲�
-//                    * ysf: 宸查殢璁挎暟閲�
-//                    * fssb: 鍙戦�佸け璐ユ暟閲�
-//                    * yfs: 宸插彂閫佹暟閲�
-//                    * dsf: 寰呴殢璁挎暟閲�
-
-//            long wzx = map.get("wzx") != null ? ((Number) map.get("wzx")).longValue() : 0L;
-//            long ysf = map.get("ysf") != null ? ((Number) map.get("ysf")).longValue() : 0L;
-//            long dsf = map.get("dsf") != null ? ((Number) map.get("dsf")).longValue() : 0L;
-//            long fssb = map.get("fssb") != null ? ((Number) map.get("fssb")).longValue() : 0L;
             total = map.get("total") != null ? ((Number) map.get("total")).longValue() : 0L;
 
         } catch (Exception e) {
diff --git a/ruoyi-admin/src/main/resources/application-nhfy.yml b/ruoyi-admin/src/main/resources/application-nhfy.yml
new file mode 100644
index 0000000..6f97acf
--- /dev/null
+++ b/ruoyi-admin/src/main/resources/application-nhfy.yml
@@ -0,0 +1,256 @@
+# 鏁版嵁婧愰厤缃�
+spring:
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    #    driverClassName: com.mysql.cj.jdbc.Driver
+    druid:
+      # 涓诲簱鏁版嵁婧�
+      master:
+        #        鍗楀崕闄勪竴
+        url: jdbc:mysql://192.168.99.192:3306/smartor_nhfy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&connectTimeout=60000&socketTimeout=120000
+        username: root
+        password: Smartor.2023
+        driverClassName: com.mysql.cj.jdbc.Driver
+
+      #        # 楂樻柉鏁版嵁搴撻厤缃�
+      #        url: jdbc:postgresql://127.0.0.1:5432/smartorlishui
+      #        username: gaussdb
+      #        password: Ls@123456
+      #        driverClassName: org.postgresql.Driver
+
+      # 浠庡簱鏁版嵁婧�
+      slave:
+      # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(鍏徃)
+      # enabled: true
+      # url: jdbc:sqlserver://116.62.18.175:6001;DatabaseName=iv-ywey;encrypt=false;SelectMethod=cursor
+      # username: sa
+      # password: Hxerp2000
+      # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+
+      # 浠庢暟鎹簮寮�鍏�/榛樿鍏抽棴(涔変箤浜岄櫌)
+      # enabled: true
+      # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=IntelligentVoice;encrypt=false;SelectMethod=cursor
+      # username: sa
+      # password: sfxt#2023
+      # driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
+
+      # 鍒濆杩炴帴鏁�
+      initialSize: 5
+      # 鏈�灏忚繛鎺ユ睜鏁伴噺
+      minIdle: 10
+      # 鏈�澶ц繛鎺ユ睜鏁伴噺
+      maxActive: 20
+      # 閰嶇疆鑾峰彇杩炴帴绛夊緟瓒呮椂鐨勬椂闂�
+      maxWait: 60000
+      # 閰嶇疆闂撮殧澶氫箙鎵嶈繘琛屼竴娆℃娴嬶紝妫�娴嬮渶瑕佸叧闂殑绌洪棽杩炴帴锛屽崟浣嶆槸姣
+      timeBetweenEvictionRunsMillis: 60000
+      # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�灏忕敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+      minEvictableIdleTimeMillis: 300000
+      # 閰嶇疆涓�涓繛鎺ュ湪姹犱腑鏈�澶х敓瀛樼殑鏃堕棿锛屽崟浣嶆槸姣
+      maxEvictableIdleTimeMillis: 900000
+      # 閰嶇疆妫�娴嬭繛鎺ユ槸鍚︽湁鏁�
+      validationQuery: SELECT 1 FROM DUAL
+      #      validationQuery: SELECT 1
+      testWhileIdle: true
+      testOnBorrow: false
+      testOnReturn: false
+      webStatFilter:
+        enabled: true
+      statViewServlet:
+        enabled: false
+        # 璁剧疆鐧藉悕鍗曪紝涓嶅~鍒欏厑璁告墍鏈夎闂�
+        allow:
+        url-pattern: /druid/*
+        # 鎺у埗鍙扮鐞嗙敤鎴峰悕鍜屽瘑鐮�
+        login-username: lihu
+        login-password: Lihu@1363419#$
+      filter:
+        stat:
+          enabled: false
+          # 鎱QL璁板綍
+          log-slow-sql: false
+          slow-sql-millis: 1000
+          merge-sql: true
+        wall:
+          config:
+            multi-statement-allow: true
+  # redis 閰嶇疆
+  redis:
+    host: 127.0.0.1
+    port: 6020
+
+    # 鏁版嵁搴撶储寮�
+    database: 0
+    # 瀵嗙爜
+    password: Smartor
+    # 杩炴帴瓒呮椂鏃堕棿
+    timeout: 10s
+    lettuce:
+      pool:
+        # 杩炴帴姹犱腑鐨勬渶灏忕┖闂茶繛鎺�
+        min-idle: 0
+        # 杩炴帴姹犱腑鐨勬渶澶х┖闂茶繛鎺�
+        max-idle: 8
+        # 杩炴帴姹犵殑鏈�澶ф暟鎹簱杩炴帴鏁�
+        max-active: 8
+        # #杩炴帴姹犳渶澶ч樆濉炵瓑寰呮椂闂达紙浣跨敤璐熷�艰〃绀烘病鏈夐檺鍒讹級
+        max-wait: -1ms
+
+# Swagger閰嶇疆
+swagger:
+  # 鏄惁寮�鍚痵wagger
+  enabled: false
+  # 璇锋眰鍓嶇紑
+  pathMapping: /dev-api
+
+# PageHelper鍒嗛〉鎻掍欢
+#pagehelper:
+#  helperDialect: mysql
+#  supportMethodsArguments: true
+#  params: count=countSql
+
+magic-api:
+  web: /magic/web
+  resource:
+    type: database   # 閰嶇疆瀛樺偍鍦ㄦ暟鎹簱涓�
+    tableName: magic_config  # 鏁版嵁搴撲腑鐨勮〃鍚�
+    prefix: /api
+    readonly: false
+  sql-column-case: camel
+  show-sql: true #閰嶇疆鎵撳嵃SQL
+  page-config:
+    size: size
+    page: page
+    default-page: 1
+    default-size: 10
+
+#閽夐拤鐨勫瘑閽�
+dingAppid: dingn8iip5ubj7clrrsv
+dingAppSecret: qlEK8D3oOVwGPOTiBQIBYTqQVlAfy9S_qQizEQFjJdSScwemWFryg4gbneu-NqWD
+
+# websocket瓒呮椂鏃堕棿
+server:
+websocket:
+timeout=60000:
+
+
+accessKeyId: LTAI5tPfc1VJzz7VuhzcBwug
+accessKeySecret: gG1srKxPFDBNWe2oHfqmK1qsSQkf1e
+signName: 鏉窞鍒╂箹绉戞妧
+
+#鏅鸿兘鍛煎彨(涓婃捣)
+phoneIP: http://124.220.50.51
+phonePort: 8001
+#鏉窞
+hzphoneIP: http://121.43.112.160
+hzphonePort: 8088
+#鐢佃瘽绾胯矾锛�1 涓婃捣锛�2 鏉窞锛�
+phonePath: 2
+#鑷繁鐨勭數璇濆彿鐮�
+phoneMySelf: 83234089
+##鎺堟潈 id(鏉窞)
+#app_id: hzgs
+##鎺堟潈 key(宸插姞瀵嗚繃鐨� key)(鏉窞)
+#app_key: 605453540c4a0a692fe07e1cae1162f3
+#鎺堟潈 id(鏉窞)
+app_id: hz_ali
+#鎺堟潈 key(宸插姞瀵嗚繃鐨� key)(鏉窞)
+app_key: a2f3b5799d635216aa280362fafd8c35
+
+
+pub_key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ==
+#杩欎釜鏄悗绔殑绉侀挜锛岀敤涓嶅埌
+pri_key: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg==
+#鍓嶇绉侀挜锛堢敤涓嶅埌浜嗭級
+#pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe
+
+#浜岀淮鐮佽矾寰�
+qrpath: D:\qrcode
+
+
+#澶栭摼璇锋眰IP鍜岀鍙e彿
+req_path:
+localIP: https://xiniuhisintcus.nhfyyy.com/aifollowup
+
+
+#鑾峰彇鎮h�呬俊鎭疷RL(鍗庡崜鎻愪緵)
+hosp_info_url: http://esb-core-rest.wowjoy.cn/esb/exchange
+
+# 0浠h〃璧伴粯璁ょ殑涓婁紶    1 浠g爜璧版柊鍗庡尰闄㈢殑涓婁紶
+uploadSwitch: 1
+
+#  鎸囧畾asr鍥炶皟鐨剈rl璺緞(鏂板崕)
+ASRCallBackPath: http://192.168.101.135:8095/smartor/serviceSubtask/phoneCallBackYQ
+#鎸傛柇IP(鏂板崕)
+hangup: http://192.16.4.220:8091/hangup
+#fs鎵�浣跨敤鐨勯樋閲岀殑app_key(鏂板崕)
+app_key_yq: ZurNHpaQLq6P55YS
+
+#鐭俊璇锋眰鍦板潃(杩欓噷涓虹┖锛屽悓寰锋彁渚涚殑鏄痺s)
+xhsmsPath:
+#甯愬彿
+xhsmsAccount:
+#鎺ュ彛瀵嗙爜
+xhsmsPwd:
+#铏氭嫙鎺ュ叆鐮�
+xhsmsjrm:
+
+##鏈湴FTP杩炴帴
+#FTP_SERVER: "192.168.2.13"
+#FTP_USERNAME: voice
+#FTP_PASSWORD: xh@2023
+
+#鏂板崕FTP杩炴帴
+FTP_SERVER: "192.16.4.220"
+FTP_USERNAME: voice
+FTP_PASSWORD: xh@2023
+
+#璇煶鍦板潃璁块棶鍓嶇紑(鏂板崕)
+voicePathPrefix: http://192.168.191.181:8095/profile/upload/vadio/
+#璇煶鍦板潃璁块棶鍓嶇紑(鍏徃)
+#voicePathPrefix: http://192.168.2.13:8095/profile/upload/vadio/
+
+#绗釜灏忔椂鐢佃瘽鎷ㄦ墦鐨勪笂闄�
+phoneUpEveryHour: 12
+#鐢佃瘽姣忓ぉ缁撴潫鏃堕棿
+phoneEndHour: 20
+
+#鏂板憳宸ラ粯璁ゅ瘑鐮�
+defaultPwd: 123456
+
+#鏄惁闇�瑕佹牴鎹柧鐥呭缓绔嬪嚭闄㈡偅鑰呴殢璁�
+createIcd10Visit: false
+
+#admin绠$悊鍛榰serId
+isAdmin: 1,2,3,4,5,6,7,8,9,10,11,12,13
+
+#鐢ㄦ埛榛樿瀵嗙爜
+userPwd: nhfy@0230
+
+#澶勭悊鎶曡瘔寤鸿鐨勯儴闂ㄧ紪鐮�
+dealDeptCode: 40003024
+
+
+#鏄惁鍔犲瘑  0涓嶅姞   1鍔犲瘑
+isEncryp: 0
+
+#鏂囦欢涓婁紶鍦板潃
+fileUpload: https://xiniuhisintcus.nhfyyy.com/aifollowup
+profile: /prod-api/profile
+
+# 鏉ユ湭鏉pp_key
+lwl_app_key: ak-LMyQUE4rjW25UO7otb8XMXzv
+
+# 鍗楀崕闄勪竴鍙栨暟鎹叕鍏辨帴鍙�
+sltd_pub_path: "http://open.nhyfy.cn/kapi/gw-api/"
+
+sms_accountName: S200232
+sms_password: lD94Yo
+sms_url: http://open.nhyfy.cn/kapi/gw-api/hntypt/ucpmsg/send
+sms_sourceAddr: 1069100020341
+sms_serviceCode: PUSH
+sms_appkey: ak-BFq4NN0TMf92J7KAioNYGz74
+sms_flag: 銆愬崡鍗庡ぇ瀛﹂檮灞炵涓�鍖婚櫌銆�
+
+
+
diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml
index b6d2613..a03e695 100644
--- a/ruoyi-admin/src/main/resources/application.yml
+++ b/ruoyi-admin/src/main/resources/application.yml
@@ -74,7 +74,7 @@
     # 鍥介檯鍖栬祫婧愭枃浠惰矾寰�
     basename: i18n/messages
   profiles:
-    active: druid
+    active: nhfy
 
   # 鏂囦欢涓婁紶
   servlet:
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
index b13fa65..452155b 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
@@ -1,20 +1,6 @@
 package com.ruoyi.framework.web.service;
 
-import javax.annotation.Resource;
-
 import com.alibaba.fastjson2.JSONObject;
-import com.ruoyi.common.utils.HttpUtil;
-import com.ruoyi.common.utils.RSAPublicKeyExample;
-import com.smartor.service.impl.ServiceSLTDHealthcareRecordServiceImpl;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.ObjectUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.stereotype.Component;
 import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.domain.entity.SysUser;
@@ -24,17 +10,24 @@
 import com.ruoyi.common.exception.user.CaptchaException;
 import com.ruoyi.common.exception.user.CaptchaExpireException;
 import com.ruoyi.common.exception.user.UserPasswordNotMatchException;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.MessageUtils;
-import com.ruoyi.common.utils.ServletUtils;
-import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.*;
 import com.ruoyi.common.utils.ip.IpUtils;
 import com.ruoyi.framework.manager.AsyncManager;
 import com.ruoyi.framework.manager.factory.AsyncFactory;
 import com.ruoyi.framework.security.context.AuthenticationContextHolder;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysUserService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Component;
 
+import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -75,6 +68,9 @@
 
     @Value("${spring.profiles.active}")
     private String active;
+
+    @Value("${lwl_app_key}")
+    private String APP_KEY;
 
     /**
      * 鐧诲綍楠岃瘉
@@ -166,7 +162,7 @@
      */
     private String resolveUserNameBySltdToken(String token) {
         Map<String, String> headers = new HashMap<>();
-        headers.put("app-key", ServiceSLTDHealthcareRecordServiceImpl.APP_KEY);
+        headers.put("app-key", APP_KEY);
         Map<String, String> requestParams = new HashMap<>();
         requestParams.put("token", token);
         String reqData = HttpUtil.postFormRequest(sltdPubPath + "/checkSsoTokenId", requestParams, headers, null);
diff --git a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
index 4a1e849..6f8b1b9 100644
--- a/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
+++ b/ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -11,6 +11,7 @@
 import com.ruoyi.common.enums.MsgLSEnum;
 import com.ruoyi.common.enums.ServiceFromEnum;
 import com.ruoyi.common.enums.WxGZHEnum;
+import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.*;
 import com.ruoyi.common.utils.http.HttpUtils;
 import com.ruoyi.common.utils.sms.smsUtils;
@@ -19,6 +20,7 @@
 import com.ruoyi.system.domain.SysConfig;
 import com.ruoyi.system.service.ISysConfigService;
 import com.smartor.common.LSHospTokenUtil;
+import com.smartor.common.MtSubmitSmUtil;
 import com.smartor.domain.*;
 import com.smartor.domain.entity.ServiceSubtaskEntity;
 import com.smartor.mapper.*;
@@ -162,6 +164,8 @@
     @Value("${server.port}")
     private String port;
 
+    @Autowired
+    private MtSubmitSmUtil mtSubmitSmUtil;
 
     @Value("${spring.profiles.active}")
     private String active;
@@ -264,7 +268,9 @@
             } catch (Exception e) {
                 log.error("銆恉ealHisData銆戞渤鍗楁暟鎹噰闆嗗紓甯�", e);
             }
-        } else if (active.trim().equals("sltd")) {
+        } else if (active.trim().equals("sltd") || active.trim().equals("nhfy")) {
+            //鐪佺珛鍚屽痉涓庡崕鍗楅檮涓�鐢ㄥ悓涓�濂楅噰闆嗘柟娉曪紙閮芥槸鏉ユ湭鏉ユ彁渚涳級
+
             try {
                 //鑾峰彇鏄惁闇�瑕侀噰闆嗙敤鎴枫�侀儴闂ㄤ俊鎭�
                 SysConfig config = new SysConfig();
@@ -758,7 +764,7 @@
                         if (heLibrary.getHetype().equals("1")) {
                             sendMagParam.setPhone(serviceSubtask.getPhone());
                             sendMagParam.setUrl(localIP + ":" + req_path + "/xj?p=" + format);
-                            if (active.equals("ls") || active.equals("sltd")) {
+                            if (active.equals("ls") || active.equals("sltd") || active.equals("nhfy")) {
                                 sendMagParam.setContent("鎮ㄥソ锛岄個璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
                             } else if (active.equals("xh")) {
                                 sendMagParam.setContent("銆愭柊鍗庡尰闄€�戞偍濂斤紝閭�璇锋偍濉啓鍑洪櫌瀹f暀璋冩煡琛紝璇风偣鍑�" + sendMagParam.getUrl() + "鏌ョ湅銆傛劅璋㈡偍閰嶅悎锛�");
@@ -810,15 +816,22 @@
                         if (code.equals("0")) {
                             isSuccess = "true";
                         }
-                    } else if (active.equals("sltd")) {
+                    } else if (active.equals("sltd") || active.equals("nhfy")) {
                         log.info("sltd杩涙潵浜嗗悧锛焮}   ,---sendMagParam.getContent()鐨勫弬鏁颁负锛歿}", active, sendMagParam.getContent());
-                        //鐪佺珛鍚屽痉鐨勭煭淇″彂閫佹柟寮�
-                        String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
-                        if (StringUtils.isNotEmpty(data)) {
-                            ObjectMapper mapper = new ObjectMapper();
-                            JsonNode root = mapper.readTree(data);
-                            String status = root.get("result").get(0).get("status").asText();
-                            if (status.equals("00000")) {
+                        if (active.equals("sltd")) {
+                            //鐪佺珛鍚屽痉鐨勭煭淇″彂閫佹柟寮�
+                            String data = MessageSend.sendMsg(sendMagParam.getContent(), "6", sendMagParam.getPhone(), LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
+                            if (StringUtils.isNotEmpty(data)) {
+                                ObjectMapper mapper = new ObjectMapper();
+                                JsonNode root = mapper.readTree(data);
+                                String status = root.get("result").get(0).get("status").asText();
+                                if (status.equals("00000")) {
+                                    isSuccess = "true";
+                                }
+                            }
+                        } else if (active.equals("nhfy")) {
+                            Map<String, Object> smsResult = mtSubmitSmUtil.submitSm(sendMagParam.getPhone(), sendMagParam.getContent());
+                            if (smsResult != null && smsResult.get("result") != null && smsResult.get("result").toString().equals("0")) {
                                 isSuccess = "true";
                             }
                         }
@@ -924,9 +937,9 @@
                     if (active.equals("hzszlyy")) {
                         if (!map.isEmpty() && map.get("success") != null) {
                             Integer wxCodeSuccessShiyi = (Integer) map.get("success");
-                            if(ObjectUtils.isNotEmpty(wxCodeSuccessShiyi) && wxCodeSuccessShiyi == 1){
+                            if (ObjectUtils.isNotEmpty(wxCodeSuccessShiyi) && wxCodeSuccessShiyi == 1) {
                                 wxCodeSuccess = true;
-                            }else {
+                            } else {
                                 wxCodeSuccess = false;
                             }
                         }
diff --git a/smartor/src/main/java/com/smartor/common/MtSubmitSmUtil.java b/smartor/src/main/java/com/smartor/common/MtSubmitSmUtil.java
new file mode 100644
index 0000000..ebe29e1
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/common/MtSubmitSmUtil.java
@@ -0,0 +1,113 @@
+package com.smartor.common;
+
+import com.alibaba.fastjson2.JSON;
+import com.smartor.domain.MtSubmitSmResp;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+import org.springframework.web.client.RestTemplate;
+
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * MT娑堟伅鍙戦�佸伐鍏风被锛圫P鍚戣涓氭眹鑱氬钩鍙版彁浜T娑堟伅锛�
+ * 鎺ュ彛鍦板潃锛歨ttp://ip:port/submitsm
+ * 缂栫爜锛歎TF-8锛岄壌鏉冪畻娉曪細MD5
+ */
+@Slf4j
+@Component
+public class MtSubmitSmUtil {
+    private static final RestTemplate restTemplate = new RestTemplate();
+
+    @Value("${sms_password}")
+    private String password;
+
+    @Value("${sms_accountName}")
+    private String accountName;
+
+    @Value("${sms_url}")
+    private String url;
+
+    @Value("${sms_sourceAddr}")
+    private String sourceAddr;
+
+    @Value("${sms_serviceCode}")
+    private String serviceCode;
+
+    @Value("${sms_appkey}")
+    private String appKey;
+
+    @Value("${sms_flag}")
+    private String smsFlag;
+
+
+    /**
+     * 鍙戦�丮T娑堟伅
+     *
+     * @param destAddr 鐩爣鍙风爜
+     * @param content  鐭俊鍐呭
+     * @return MtSubmitSmResp 鍝嶅簲缁撴灉
+     */
+    public Map<String, Object> submitSm(String destAddr, String content) {
+        try {
+            String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+            String hashHex = buildHashHex(accountName, password, date);
+
+            Map<String, Object> authMap = new HashMap<>();
+            authMap.put("Algorithm", "MD5");
+            authMap.put("Date", date);
+            authMap.put("HASHHEX", hashHex);
+
+            Map<String, Object> reqMap = new HashMap<>();
+            reqMap.put("accountName", accountName);
+            reqMap.put("Authorization", authMap);
+            reqMap.put("DestAddr", destAddr);
+            reqMap.put("SourceAddr", sourceAddr);
+            reqMap.put("Content", smsFlag + content);
+            reqMap.put("ServiceCode", serviceCode);
+
+            HttpHeaders headers = new HttpHeaders();
+            headers.setContentType(new MediaType("application", "json", StandardCharsets.UTF_8));
+            headers.set("Accept-Language", "UTF-8");
+            headers.set("app-key", "ak-BFq4NN0TMf92J7KAioNYGz74");
+
+            HttpEntity<String> entity = new HttpEntity<>(JSON.toJSONString(reqMap), headers);
+            log.info("MtSubmitSm 璇锋眰鍦板潃锛歿}锛岃姹傚弬鏁帮細{}", url + "/submitsm", JSON.toJSONString(reqMap));
+
+            ResponseEntity<String> response = restTemplate.postForEntity(url, entity, String.class);
+            log.info("MtSubmitSm 鍝嶅簲缁撴灉锛歿}", response.getBody());
+
+            return JSON.parseObject(response.getBody(), Map.class);
+        } catch (Exception e) {
+            log.error("MtSubmitSm 鍙戦�佸け璐ワ紝url锛歿}锛宒estAddr锛歿}锛宔rror锛歿}", url, destAddr, e.getMessage(), e);
+            Map<String, Object> resp = new HashMap<>();
+            resp.put("code", -1);
+            resp.put("message", "鍙戦�佸紓甯革細" + e.getMessage());
+            return resp;
+        }
+    }
+
+    /**
+     * 璁$畻HASHHEX锛歁D5(Algorithm:甯愬彿鍚�:瀵嗙爜:Date)
+     * 渚嬶細MD5:95555:12345:2016-10-09 16:19:43
+     */
+    private static String buildHashHex(String accountName, String password, String date) throws Exception {
+        String plain = "MD5:" + accountName + ":" + password + ":" + date;
+        MessageDigest md = MessageDigest.getInstance("MD5");
+        byte[] bytes = md.digest(plain.getBytes(StandardCharsets.UTF_8));
+        StringBuilder sb = new StringBuilder();
+        for (byte b : bytes) {
+            sb.append(String.format("%02x", b));
+        }
+        return sb.toString();
+    }
+}
diff --git a/smartor/src/main/java/com/smartor/domain/MtSubmitSmResp.java b/smartor/src/main/java/com/smartor/domain/MtSubmitSmResp.java
new file mode 100644
index 0000000..9e2a6b5
--- /dev/null
+++ b/smartor/src/main/java/com/smartor/domain/MtSubmitSmResp.java
@@ -0,0 +1,38 @@
+package com.smartor.domain;
+
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * MT娑堟伅鍙戦�佸搷搴斿弬鏁�
+ */
+@Data
+public class MtSubmitSmResp {
+
+
+    /**
+     * 涓嬪彂鐘舵�侊紝0 鎴愬姛锛屽叾浠栧け璐�
+     */
+    private Integer code;
+
+    /**
+     * 澶辫触鏃剁殑閿欒鎻愮ず
+     */
+    private String message;
+
+    /**
+     * 澶辫触鏃剁殑閿欒鎻愮ず
+     */
+    private String success;
+
+    /**
+     * 鍝嶅簲缁撴灉
+     */
+    private String result;
+
+    /**
+     * 涓嬪彂鐘舵��=0鏃舵湁鏁堬紝涓虹郴缁熶骇鐢熺殑msgid锛屽鍙戠敓浜嗛暱鐭俊鎷嗗垎锛屽垯杩斿洖澶氭潯msgid
+     */
+    private List<String> mtSubmitSm;
+}
diff --git a/smartor/src/main/java/com/smartor/domain/ServiceStatisticsRequest.java b/smartor/src/main/java/com/smartor/domain/ServiceStatisticsRequest.java
index 3a079e1..880d3e2 100644
--- a/smartor/src/main/java/com/smartor/domain/ServiceStatisticsRequest.java
+++ b/smartor/src/main/java/com/smartor/domain/ServiceStatisticsRequest.java
@@ -28,7 +28,7 @@
     @JsonFormat(pattern = "yyyy-MM-dd")
     private Date endDate;
 
-    @ApiModelProperty(value = "缁熻缁村害锛歞ay-鎸夊ぉ, month-鎸夋湀, year-鎸夊勾", example = "day")
+    @ApiModelProperty(value = "缁熻缁村害锛歞ay-鎸夊ぉ, month-鎸夋湀, year-鎸夊勾(鏆傛椂娌℃湁)", example = "day")
     private String timeType = "day";
 
     @ApiModelProperty(value = "鏈烘瀯ID锛屼负绌哄垯鏌ヨ鎵�鏈�")
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
index 6baf3e1..ad67157 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -30,6 +30,10 @@
 import java.io.FileOutputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.Period;
+import java.time.ZoneId;
+import java.time.temporal.ChronoUnit;
 import java.util.*;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -650,11 +654,13 @@
 
         List<PatArchive> patArchiveList1 = DtoConversionUtils.sourceToTarget(patArchiveList, PatArchive.class);
         //缁欐偅鑰呰仈绯讳汉璧嬪��
-//        for (PatArchive pa : patArchives) {
         for (PatArchive pa : patArchiveList1) {
             PatArchivecontact patArchivecontact = new PatArchivecontact();
             patArchivecontact.setPatid(pa.getId());
             pa.setPatArchivecontactList(patArchivecontactMapper.selectPatArchivecontactList(patArchivecontact));
+            Map<String, String> map = calculateAge(pa.getBirthdate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), LocalDate.now());
+            pa.setAge(StringUtils.isNotEmpty(map.get("age")) ? Long.valueOf(map.get("age")) : null);
+            pa.setAgeUnit(map.get("ageUnit") != null ? map.get("ageUnit") : "");
         }
 
         return patArchiveList1;
@@ -831,6 +837,7 @@
      * @return
      */
 //    @Override
+
     /**
      * 鑾峰彇鎮h�呬俊鎭�绘暟锛堝幓閲嶏級
      *
@@ -854,7 +861,7 @@
         } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) {
             // 鏌ョ湅浣忛櫌  1  鏌ョ湅闂ㄨ瘖  2   鏌ョ湅浣撴  3 鏌ョ湅鍑洪櫌 4
 //            count = patArchiveMapper.countPatArchiveInfoByOuthospQC(patArchiveReq);
-            PatMedOuthospQueryReq req=new PatMedOuthospQueryReq();
+            PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
             String deptcodes = CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) ? null : String.join(",", patArchiveReq.getLeaveldeptcodes());
             String leavehospitaldistrictcodes = CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) ? null : String.join(",", patArchiveReq.getLeavehospitaldistrictcodes());
             req.setDeptcode(deptcodes);
@@ -882,7 +889,7 @@
         List<PatArchiveOthreInfo> patArchiveList = new ArrayList<>();
 
         //闂ㄦ�ヨ瘖淇℃伅锛岄噰鐢ㄥ垎琛ㄦ煡璇紙鍏堟煡闂ㄦ�ヨ瘖鐨勫瓨鍌ㄨ繃绋嬶紝鍐嶆煡鎮h�呭熀鏈俊鎭〃锛屽叧鑱旀潯浠讹細patid锛�
-        PatMedOuthospQueryReq req=new PatMedOuthospQueryReq();
+        PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
         String deptcodes = CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) ? null : String.join(",", patArchiveReq.getLeaveldeptcodes());
         String leavehospitaldistrictcodes = CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) ? null : String.join(",", patArchiveReq.getLeavehospitaldistrictcodes());
         req.setDeptcode(deptcodes);
@@ -891,10 +898,10 @@
         req.setDrname(StringUtils.isNotEmpty(patArchiveReq.getDrname()) ? patArchiveReq.getDrname() : null);
         req.setPatname(StringUtils.isNotEmpty(patArchiveReq.getName()) ? patArchiveReq.getName() : null);
         req.setDiagname(StringUtils.isNotEmpty(patArchiveReq.getLeavediagname()) ? patArchiveReq.getLeavediagname() : null);
-        req.setPageNum(patArchiveReq.getPageNum()==null?null:patArchiveReq.getPageNum());
-        req.setPageSize(patArchiveReq.getPageSize()==null?null:patArchiveReq.getPageSize());
+        req.setPageNum(patArchiveReq.getPageNum() == null ? null : patArchiveReq.getPageNum());
+        req.setPageSize(patArchiveReq.getPageSize() == null ? null : patArchiveReq.getPageSize());
         List<PatMedOuthosp> patMedOuthosps = patMedOuthospMapper.callSpQueryOuthosp(req);
-        for (PatMedOuthosp patMedOuthosp:patMedOuthosps ) {
+        for (PatMedOuthosp patMedOuthosp : patMedOuthosps) {
             PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedOuthosp.getPatid());
             PatArchiveOthreInfo patArchiveOthreInfo = DtoConversionUtils.sourceToTarget(patArchive, PatArchiveOthreInfo.class);
             patArchiveOthreInfo.setDeptcode(patMedOuthosp.getDeptcode());
@@ -905,5 +912,57 @@
         }
         return patArchiveList;
     }
+
+    public Map<String, String> calculateAge(LocalDate birthdate, LocalDate today) {
+        if (birthdate == null || today.isBefore(birthdate)) {
+            return null;
+        }
+        Map<String, String> ageMap = new HashMap<>();
+
+        Period period = Period.between(birthdate, today);
+        long totalDays = ChronoUnit.DAYS.between(birthdate, today);
+        long totalMonths = ChronoUnit.MONTHS.between(birthdate, today);
+
+        int years = period.getYears();
+        int months = period.getMonths();
+        int days = period.getDays();
+
+        String ageUnit;
+        Integer age;
+        String ageUnit2 = null;
+        Integer age2 = null;
+
+        if (totalDays < 90) {
+            // 灏忎簬 1 涓湀锛屾寜澶╄绠�
+            ageUnit = "澶�";
+            age = (int) totalDays;
+            ageMap.put("age", age != null ? age.toString() : null);
+            ageMap.put("ageUnit", ageUnit);
+            ageMap.put("age2", null);
+            ageMap.put("ageUnit2", null);
+        } else if (totalMonths < 36) {
+            // 灏忎簬 1 骞达紝鎸夋湀 + 澶╄绠�
+            ageUnit = "鏈�";
+            age = (int) totalMonths;
+            ageUnit2 = "澶�";
+            age2 = days;
+            ageMap.put("age", age != null ? age.toString() : null);
+            ageMap.put("ageUnit", ageUnit);
+            ageMap.put("age2", age2 != null ? age2.toString() : null);
+            ageMap.put("ageUnit2", ageUnit2);
+        } else {
+            // 澶т簬 1 骞达紝鎸夊勾 + 鏈堣绠�
+            ageUnit = "宀�";
+            age = years;
+            ageUnit2 = "鏈�";
+            age2 = months;
+            ageMap.put("age", age != null ? age.toString() : null);
+            ageMap.put("ageUnit", ageUnit);
+            ageMap.put("age2", age2 != null ? age2.toString() : null);
+            ageMap.put("ageUnit2", ageUnit2);
+        }
+
+        return ageMap;
+    }
 }
 
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
index 73c1cca..36ffd80 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedOuthospServiceImpl.java
@@ -304,7 +304,7 @@
         PatMedOuthospQueryReq req = new PatMedOuthospQueryReq();
         String deptcodes = CollectionUtils.isEmpty(patMedReq.getDeptcodeList()) ? null : String.join(",", patMedReq.getDeptcodeList());
         req.setBeginAdmitdate(patMedReq.getStartDate());
-        req.setEndAdmitdate(patMedReq.getEndDate());
+        req.setEndAdmitdate(DateUtils.addDays(patMedReq.getEndDate(),1));
         req.setDeptcode(deptcodes);
         req.setOrgid(patMedReq.getOrgid());
 //        req.setCampusid(patMedReq.getCampusid());
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
index 55b34de..6db6b15 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSLTDHealthcareRecordServiceImpl.java
@@ -40,7 +40,6 @@
 public class ServiceSLTDHealthcareRecordServiceImpl implements IServiceSLTDHealthcareRecordService {
 
     private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
-    public static final String APP_KEY = "ak-zUMiOWhqXiJQWPB1pCbz0pjr";
 
     @Autowired
     private IPatArchiveService patArchiveService;
@@ -71,6 +70,9 @@
 
     @Value("${userPwd}")
     private String userPwd;
+
+    @Value("${lwl_app_key}")
+    private String APP_KEY;
 
     @Override
     public List<ServiceSLTDInhospResDTO> queryHealthcareRecordList(ServiceSLTDInhospReqVO reqVO) {
@@ -290,19 +292,18 @@
                     sysUserDept.setCreateTime(new Date());
                     sysUserDept.setDelFlag(0L);
 
-                    //鍒ゆ柇涓�涓嬫槸涓嶆槸宸茬粡瀛樺湪浜�
-                    if (ObjectUtils.isNotEmpty(sysUser1) && ObjectUtils.isNotEmpty(sysDept)) {
+                    //鍒ゆ柇涓�涓嬬敤鎴�-閮ㄩ棬鍏崇郴鏄笉鏄凡缁忓瓨鍦ㄤ簡锛堟棤璁烘柊鐢ㄦ埛杩樻槸鑰佺敤鎴烽兘闇�瑕佸幓閲嶏級
+                    if (ObjectUtils.isNotEmpty(sysUser.getUserId()) && ObjectUtils.isNotEmpty(sysDept)) {
                         SysUserDept sud = new SysUserDept();
-                        sud.setUserId(sysUser1.getUserId());
+                        sud.setUserId(sysUser.getUserId());
                         sud.setDeptId(sysDept.getDeptId());
                         List<SysUserDept> sysUserDepts = sysUserDeptMapper.selectSysUserDeptList(sud);
                         if (CollectionUtils.isNotEmpty(sysUserDepts)) {
                             sysUserDept.setId(sysUserDepts.get(0).getId());
                             sysUserDeptMapper.updateSysUserDept(sysUserDept);
+                        } else {
+                            sysUserDeptMapper.insertSysUserDept(sysUserDept);
                         }
-                    } else {
-                        //涓嶅瓨鍦紝鍒欐柊澧�
-                        sysUserDeptMapper.insertSysUserDept(sysUserDept);
                     }
                     if (StringUtils.isNotEmpty(sysDept.getDeptType()) && sysDept.getDeptType().equals("1")) {
                         hospInfoList.add(Arrays.asList(sysDept.getDeptCode()));
@@ -325,7 +326,7 @@
             sur.setOrgid(sysUser.getOrgid());
 
             //鍏堟煡璇竴涓嬶紝鏄惁瀛樺湪
-            SysUserRole sysUserRole = sysUserRoleMapper.selectUserRoleByRoleIdAndUserId(sysUser.getUserId(), 3L);
+            SysUserRole sysUserRole = sysUserRoleMapper.selectUserRoleByRoleIdAndUserId(3L, sysUser.getUserId());
             if (ObjectUtils.isNotEmpty(sysUserRole)) continue;
 
             userRoleList.add(sur);
@@ -751,9 +752,20 @@
     }
 
     private PatArchive processPatientArchive(ServiceSLTDInhospResDTO dto) {
-        PatArchive queryArchive = new PatArchive();
-        queryArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim());
-        List<PatArchive> existingArchives = patArchiveService.selectPatArchiveList(queryArchive);
+        List<PatArchive> existingArchives = null;
+
+        // 浼樺厛鎸� patientno 绮剧‘鏌ラ噸锛屾煡涓嶅埌鍐嶆寜 idcardno 鏌ラ噸锛圓ND鏉′欢浼氭紡鏌ュ悓涓�浜轰笉鍚宲atientno鐨勬儏鍐碉級
+        if (dto.getPatientId() != null) {
+            PatArchive queryByPatientNo = new PatArchive();
+            queryByPatientNo.setPatientno(String.valueOf(dto.getPatientId()));
+            queryByPatientNo.setIdcardno(StringUtils.isNotEmpty(dto.getIdCardNo()) ? dto.getIdCardNo().trim() : null);
+            existingArchives = patArchiveService.selectPatArchiveList(queryByPatientNo);
+        }
+//        if (CollectionUtils.isEmpty(existingArchives) && !StringUtils.isEmpty(dto.getIdCardNo())) {
+//            PatArchive queryByIdCard = new PatArchive();
+//            queryByIdCard.setIdcardno(dto.getIdCardNo().trim());
+//            existingArchives = patArchiveService.selectPatArchiveList(queryByIdCard);
+//        }
 
         PatArchive patArchive = buildPatientArchive(dto);
 
@@ -771,7 +783,7 @@
 
     private PatArchive buildPatientArchive(ServiceSLTDInhospResDTO dto) {
         PatArchive patArchive = new PatArchive();
-        patArchive.setPatientno("" + dto.getPatientId());
+        patArchive.setPatientno(dto.getPatientId() == null ? null : String.valueOf(dto.getPatientId()));
         patArchive.setIdcardno(StringUtils.isEmpty(dto.getIdCardNo()) ? "" + dto.getMedicalCardId() : dto.getIdCardNo().trim());
         patArchive.setName(dto.getPatientName());
         patArchive.setSourcefrom(2L);
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 3ed0490..885ce6c 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -2303,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());

--
Gitblit v1.9.3