From d3b362de432a32c10ccd039dfc417d8c6233f543 Mon Sep 17 00:00:00 2001
From: liusheng <337615773@qq.com>
Date: 星期五, 28 三月 2025 18:10:21 +0800
Subject: [PATCH] 代码提交

---
 smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java        |  257 +++++++++++++++----------
 smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml                   |   16 +
 smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml                    |    2 
 smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java               |    3 
 smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java           |    1 
 smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml                      |   60 +++++
 ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java                          |    1 
 smartor/src/main/java/com/smartor/domain/PatMedInhosp.java                            |   23 ++
 smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java         |    2 
 ruoyi-admin/src/main/resources/application-druid.yml                                  |   20 +-
 smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java            |   32 ++
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java |   26 +-
 smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java                   |    2 
 smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml                    |  127 ++++++++----
 smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml                         |    6 
 15 files changed, 388 insertions(+), 190 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
index 289091a..1c075bd 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java
@@ -84,19 +84,19 @@
 
         if (CollectionUtils.isNotEmpty(serviceTaskVOS)) {
             for (ServiceTaskVO ServiceTaskVO : serviceTaskVOS) {
-                    ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
-                    serviceSubtaskVO.setTaskid(ServiceTaskVO.getTaskid());
-                    serviceSubtaskVO.setStartOutHospTime(serviceTask.getStartOutHospTime());
-                    serviceSubtaskVO.setEndOutHospTime(serviceTask.getEndOutHospTime());
-                    List<ServiceSubtask> ServiceTaskcalls = iServiceTaskCallService.selectServiceSubtaskList(serviceSubtaskVO);
-                    if (CollectionUtils.isNotEmpty(ServiceTaskcalls)) {
-                        //宸插彂閫�
-                        long yfs = ServiceTaskcalls.stream().filter(serviceTaskcall1 -> serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() == 3L).collect(Collectors.toList()).stream().count();
-                        //鏈彂閫�
-                        long wfs = ServiceTaskcalls.stream().filter(serviceTaskcall1 -> serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() == 2L).collect(Collectors.toList()).stream().count();
-                        ServiceTaskVO.setYfs(yfs);
-                        ServiceTaskVO.setWfs(wfs);
-                    }
+                ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
+                serviceSubtaskVO.setTaskid(ServiceTaskVO.getTaskid());
+                serviceSubtaskVO.setStartOutHospTime(serviceTask.getStartOutHospTime());
+                serviceSubtaskVO.setEndOutHospTime(serviceTask.getEndOutHospTime());
+                List<ServiceSubtask> ServiceTaskcalls = iServiceTaskCallService.selectServiceSubtaskList(serviceSubtaskVO);
+                if (CollectionUtils.isNotEmpty(ServiceTaskcalls)) {
+                    //宸插彂閫侊紙瀛愪换鍔′腑鐨� sendstate=1涓鸿棰嗗彇锛�
+                    long yfs = ServiceTaskcalls.stream().filter(serviceTaskcall1 -> (serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() >= 3L) || (serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() == 1L)).collect(Collectors.toList()).stream().count();
+                    //鏈彂閫�
+                    long wfs = ServiceTaskcalls.stream().filter(serviceTaskcall1 -> serviceTaskcall1.getSendstate() != null && serviceTaskcall1.getSendstate() == 2L).collect(Collectors.toList()).stream().count();
+                    ServiceTaskVO.setYfs(yfs);
+                    ServiceTaskVO.setWfs(wfs);
+                }
 
             }
             //鑾峰彇total
diff --git a/ruoyi-admin/src/main/resources/application-druid.yml b/ruoyi-admin/src/main/resources/application-druid.yml
index 71db201..06605ce 100644
--- a/ruoyi-admin/src/main/resources/application-druid.yml
+++ b/ruoyi-admin/src/main/resources/application-druid.yml
@@ -17,17 +17,17 @@
 #        username: smartor
 #        password: Smartor.2023
 #        driverClassName: com.mysql.cj.jdbc.Driver
-        #        # 鏂板崕
-      #        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-      #        username: smartor
-      #        password: Smartor.2023
-      #        driverClassName: com.mysql.cj.jdbc.Driver
+        #        #        # 鏂板崕
+#        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+#        username: smartor
+#        password: Smartor.2023
+#        driverClassName: com.mysql.cj.jdbc.Driver
 
-      #        #        #  鍏徃浜�
-              url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
-              username: hxsoft
-              password: Hxerp2000
-              driverClassName: com.mysql.cj.jdbc.Driver
+        #        #        #  鍏徃浜�
+        url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+        username: hxsoft
+        password: Hxerp2000
+        driverClassName: com.mysql.cj.jdbc.Driver
 
 
       # 浠庡簱鏁版嵁婧�
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 63b3176..a40936e 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
@@ -682,6 +682,7 @@
                 patMedInhosp.setNurseId(thiedInhospInfo.getNurseId());
                 patMedInhosp.setNurseName(thiedInhospInfo.getNurseName());
                 patMedInhosp.setSerialnum(thiedInhospInfo.getInpatientId());
+                patMedInhosp.setFuflag("1");
                 if (cry.equals("0")) {
                     patMedInhosp.setInhospstate("0");
                 } else if (cry.equals("1")) {
diff --git a/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java b/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java
index cc4dacc..cf55f69 100644
--- a/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java
+++ b/smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java
@@ -163,6 +163,9 @@
     @ApiModelProperty(value = "浜у鏍囧織")
     private String ChanFuBZ;
 
+    @ApiModelProperty(value = "鐜颁綇鍧�淇℃伅")
+    private String XianZhuZXX;
+
     @ApiModelProperty(value = "鑱旂郴浜轰俊鎭�")
     List<ExternalInHospPatientLiaisonInfo> externalInHospPatientLiaisonInfos;
 
diff --git a/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java b/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
index b93a8df..f61e49f 100644
--- a/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
+++ b/smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -388,5 +388,28 @@
     @ApiModelProperty(value = "鎿嶄綔浜篒D")
     private String operatorId;
 
+    @ApiModelProperty(value = "鏍囩鍚�")
     private String tagname;
+
+    @ApiModelProperty(value = "闅忚鏍囪瘑锛�0涓嶉渶瑕侊紝1瑕�")
+    private String fuflag;
+
+    @ApiModelProperty(value = "闅忚鏃ユ湡")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date fudate;
+
+    @ApiModelProperty(value = "闅忚鍛ㄦ湡寤鸿")
+    private String fuperiod;
+
+    @ApiModelProperty(value = "闅忚绫诲瀷缂栫爜")
+    private String futypecode;
+
+    @ApiModelProperty(value = "闅忚绫诲瀷鍚嶇О")
+    private String futypedesc;
+
+    @ApiModelProperty(value = "闅忚澶嶈瘖鎸囧")
+    private String fuadivce;
+
+    @ApiModelProperty(value = "涓撶梾闅忚寤鸿")
+    private String fuspecialadvice;
 }
diff --git a/smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java b/smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java
index 5776dbe..7b7a5e5 100644
--- a/smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java
+++ b/smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java
@@ -54,6 +54,8 @@
      */
     public int deleteServiceTaskdeptById(Long id);
 
+    public int deleteServiceTaskdeptByTaskId(ServiceTaskdept serviceTaskdept);
+
     /**
      * 鎵归噺鍒犻櫎妯℃澘绉戝鍏宠仈
      *
diff --git a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
index 2ef79d9..c5ba9e5 100644
--- a/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -209,6 +209,7 @@
         //鑾峰彇闇�瑕佸嚭闄㈤殢璁匡紝鏈鐞嗙殑鏁版嵁
         patMedInhosp.setCheckFlag("0");
         patMedInhosp.setInhospstate("1");
+        patMedInhosp.setFuflag("1");
         List<PatMedInhosp> patMedInhosps = patMedInhospMapper.selectPatMedInhospList(patMedInhosp);
         log.error("dealOutHospInfo闇�瑕佸鐞嗙殑鍑洪櫌鎮h�呬俊鎭細{}", patMedInhosps);
         for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
index 9fd46d8..24b6751 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -3,6 +3,7 @@
 import cn.hutool.core.bean.BeanUtil;
 import com.ruoyi.common.core.domain.entity.SysDept;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.StringUtils;
 import com.smartor.domain.*;
 import com.smartor.mapper.*;
@@ -74,6 +75,9 @@
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
         Map<String, Object> keShiXX = (Map<String, Object>) yeWuXX.get("KeShiXX");
         ExternalDept externalDept = BeanUtil.mapToBean(keShiXX, ExternalDept.class, true);
+        if (ObjectUtils.isEmpty(externalDept)) {
+            throw new BaseException("externalDept鏄┖鐨勶紝娌℃湁鏁版嵁锛侊紒锛�");
+        }
         SysDept sysDept = new SysDept();
         sysDept.setOrgid(externalDept.getZuZhiJGID());
         sysDept.setHisDeptId(externalDept.getKeShiID());
@@ -118,6 +122,9 @@
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
         Map<String, Object> yongHuXX = (Map<String, Object>) yeWuXX.get("YongHuXX");
         ExternalUserInfo externalUserInfo = BeanUtil.mapToBean(yongHuXX, ExternalUserInfo.class, true);
+        if (ObjectUtils.isEmpty(externalUserInfo)) {
+            throw new BaseException("externalUserInfo鏄┖鐨勶紝娌℃湁鏁版嵁锛侊紒锛�");
+        }
         SysUser sysUser = new SysUser();
         sysUser.setGuid(externalUserInfo.getZuZhiJGID());
         sysUser.setUserName(externalUserInfo.getYongHuDLM());
@@ -159,6 +166,9 @@
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
         Map<String, Object> ZuZhiJGXX = (Map<String, Object>) yeWuXX.get("ZuZhiJGXX");
         ExternalOrganInfo externalOrganInfo = BeanUtil.mapToBean(ZuZhiJGXX, ExternalOrganInfo.class, true);
+        if (ObjectUtils.isEmpty(externalOrganInfo)) {
+            throw new BaseException("externalOrganInfo鏄┖鐨勶紝娌℃湁鏁版嵁锛侊紒锛�");
+        }
         BaseOrganization baseOrganization = new BaseOrganization();
         baseOrganization.setOrganizationID(externalOrganInfo.getZuZhiJGID());
         baseOrganization.setOrganizationName(externalOrganInfo.getZuZhiJGMC());
@@ -189,10 +199,10 @@
     public Boolean addInHospInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---addInHospInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        List<HashMap<String, Object>> epai = (List<HashMap<String, Object>>) yeWuXX.get("DiZhiXXList");
-        List<HashMap<String, Object>> epli = (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList");
-        List<HashMap<String, Object>> hospPatientDiagnoseInfos = (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList");
-        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
+        List<HashMap<String, Object>> epai = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("DiZhiXXList") : null;
+        List<HashMap<String, Object>> epli = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList") : null;
+        List<HashMap<String, Object>> hospPatientDiagnoseInfos = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList") : null;
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         ExternalInHospPatientAddrInfo externalInHospPatientAddrInfo = null;
         ExternalInHospPatientLiaisonInfo externalInHospPatientLiaisonInfo = null;
@@ -247,7 +257,7 @@
     public Boolean cancelInHospInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---cancelInHospInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         PatMedInhosp patMedInhosp = new PatMedInhosp();
         patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
@@ -257,12 +267,14 @@
             patMedInhosp1.setTagname(tagname);
         }
         if (CollectionUtils.isNotEmpty(patMedInhospList)) {
-            Map<String, Object> JiuZhenXX = (Map<String, Object>) yeWuXX.get("JiuZhenXX");
+            Map<String, Object> JiuZhenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("JiuZhenXX") : null;
             PatMedInhosp patMedInhosp1 = patMedInhospList.get(0);
             patMedInhosp1.setSchemestatus(3L);
             patMedInhosp1.setDelFlag("1");
-            patMedInhosp1.setOperator(JiuZhenXX.get("CaoZuoRXM").toString());
-            patMedInhosp1.setOperatorId(JiuZhenXX.get("CaoZuoRID").toString());
+            if (ObjectUtils.isNotEmpty(JiuZhenXX)) {
+                patMedInhosp1.setOperator(ObjectUtils.isNotEmpty(JiuZhenXX.get("CaoZuoRXM")) ? JiuZhenXX.get("CaoZuoRXM").toString() : null);
+                patMedInhosp1.setOperatorId(ObjectUtils.isNotEmpty(JiuZhenXX.get("CaoZuoRID")) ? JiuZhenXX.get("CaoZuoRID").toString() : null);
+            }
             patMedInhosp1.setUpdateTime(new Date());
             int i = patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
             if (i != 1) return false;
@@ -274,9 +286,12 @@
     public Boolean addOutHospInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---addOutHospInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
-        List<HashMap<String, Object>> epai = (List<HashMap<String, Object>>) BingRenXX.get("DiZhiXXList");
-        List<HashMap<String, Object>> epli = (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList");
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
+        Map<String, Object> ChuYuanJL = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("ChuYuanJL") : null;
+        List<HashMap<String, Object>> epai = ObjectUtils.isNotEmpty(BingRenXX) ? (List<HashMap<String, Object>>) BingRenXX.get("DiZhiXXList") : null;
+        List<HashMap<String, Object>> epli = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("LianXiRList") : null;
+        Map<String, Object> SuiFangJH = ObjectUtils.isNotEmpty(ChuYuanJL) ? (Map<String, Object>) ChuYuanJL.get("SuiFangJH") : null;
+
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         ExternalInHospPatientAddrInfo externalInHospPatientAddrInfo = null;
         ExternalInHospPatientLiaisonInfo externalInHospPatientLiaisonInfo = null;
@@ -323,7 +338,7 @@
             String tagname = patMedInhospMapper.getTagnameBypatid(patMedInhosp1.getPatid());
             patMedInhosp1.setTagname(tagname);
         }
-        Map<String, Object> JiuZhenXX = (Map<String, Object>) yeWuXX.get("JiuZhenXX");
+        Map<String, Object> JiuZhenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("JiuZhenXX") : null;
         PatMedInhosp patMedInhosp1 = new PatMedInhosp();
         if (CollectionUtils.isNotEmpty(patMedInhospList)) patMedInhosp1 = patMedInhospList.get(0);
         patMedInhosp1.setSchemestatus(2L);
@@ -332,14 +347,16 @@
         } catch (ParseException e) {
             e.printStackTrace();
         }
-        patMedInhosp1.setOperator(JiuZhenXX.get("CaoZuoRXM").toString());
-        patMedInhosp1.setOperatorId(JiuZhenXX.get("CaoZuoRID").toString());
+        if (ObjectUtils.isNotEmpty(JiuZhenXX)) {
+            patMedInhosp1.setOperator(ObjectUtils.isNotEmpty(JiuZhenXX.get("CaoZuoRXM")) ? JiuZhenXX.get("CaoZuoRXM").toString() : null);
+            patMedInhosp1.setOperatorId(ObjectUtils.isNotEmpty(JiuZhenXX.get("CaoZuoRID")) ? JiuZhenXX.get("CaoZuoRID").toString() : null);
+            patMedInhosp1.setDrname(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZhuZhiYSXM")) ? JiuZhenXX.get("ZhuZhiYSXM").toString() : null);
+            patMedInhosp1.setDrcode(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZhuZhiYSID")) ? JiuZhenXX.get("ZhuZhiYSID").toString() : null);
+            patMedInhosp1.setNurseName(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZeRenHSXM")) ? JiuZhenXX.get("ZeRenHSXM").toString() : null);
+            patMedInhosp1.setNurseId(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZeRenHSID")) ? JiuZhenXX.get("ZeRenHSID").toString() : null);
+            patMedInhosp1.setBedNo(ObjectUtils.isNotEmpty(JiuZhenXX.get("DangQianCWMC")) ? JiuZhenXX.get("DangQianCWMC").toString() : null);
+        }
         patMedInhosp1.setUpdateTime(new Date());
-        patMedInhosp1.setDrname(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZhuZhiYSXM")) ? JiuZhenXX.get("ZhuZhiYSXM").toString() : null);
-        patMedInhosp1.setDrcode(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZhuZhiYSID")) ? JiuZhenXX.get("ZhuZhiYSID").toString() : null);
-        patMedInhosp1.setNurseName(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZeRenHSXM")) ? JiuZhenXX.get("ZeRenHSXM").toString() : null);
-        patMedInhosp1.setNurseId(ObjectUtils.isNotEmpty(JiuZhenXX.get("ZeRenHSID")) ? JiuZhenXX.get("ZeRenHSID").toString() : null);
-        patMedInhosp1.setBedNo(ObjectUtils.isNotEmpty(JiuZhenXX.get("DangQianCWMC")) ? JiuZhenXX.get("DangQianCWMC").toString() : null);
         patMedInhosp1.setTelcode(patArchive.getTelcode());
         patMedInhosp1.setLeavehospitaldistrictcode(externalInHospPatientInfo.getDangQianBQID());
         patMedInhosp1.setLeavehospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC());
@@ -347,34 +364,57 @@
         patMedInhosp1.setDeptname(externalInHospPatientInfo.getDangQianKSMC());
         patMedInhosp1.setLeaveldeptcode(externalInHospPatientInfo.getDangQianKSID());
         patMedInhosp1.setDeptcode(externalInHospPatientInfo.getDangQianKSID());
-        List<HashMap<String, Object>> zhenDuanList = (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList");
-        List<ExternalInHospPatientDiagnoseInfo> hospPatientDiagnoseInfos2 = zhenDuanList.stream().map(map -> {
-            ExternalInHospPatientDiagnoseInfo info = new ExternalInHospPatientDiagnoseInfo();
-            info.setZhenDuanID((String) map.get("ZhenDuanID"));
-            info.setZhenDuanMC((String) map.get("ZhenDuanMC"));
-            return info;
-        }).collect(Collectors.toList());
-        patMedInhosp1.setLeaveicd10code(StringUtils.isNotEmpty(patMedInhosp1.getLeaveicd10code()) ? patMedInhosp1.getLeaveicd10code() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanID() : hospPatientDiagnoseInfos2.get(0).getZhenDuanID());
-        patMedInhosp1.setLeavediagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC());
-        patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC());
-        //     patMedInhosp1.setIcd10code(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC());
+
+        if (ObjectUtils.isNotEmpty(SuiFangJH)) {
+            patMedInhosp1.setFuflag(ObjectUtils.isNotEmpty(SuiFangJH.get("SuiFangBS")) ? SuiFangJH.get("SuiFangBS").toString() : null);
+            if (ObjectUtils.isNotEmpty(SuiFangJH.get("SuiFangRQ"))) {
+                try {
+                    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+                    patMedInhosp1.setFudate(simpleDateFormat.parse(SuiFangJH.get("SuiFangRQ").toString()));
+                } catch (ParseException e) {
+                    e.printStackTrace();
+                }
+            }
+            patMedInhosp1.setFuperiod(ObjectUtils.isNotEmpty(SuiFangJH.get("SuiFangZQJY")) ? SuiFangJH.get("SuiFangZQJY").toString() : null);
+            patMedInhosp1.setFutypecode(ObjectUtils.isNotEmpty(SuiFangJH.get("SuiFangFSDM")) ? SuiFangJH.get("SuiFangFSDM").toString() : null);
+            patMedInhosp1.setFutypedesc(ObjectUtils.isNotEmpty(SuiFangJH.get("SuiFangFSMC")) ? SuiFangJH.get("SuiFangFSMC").toString() : null);
+            patMedInhosp1.setFuadivce(ObjectUtils.isNotEmpty(SuiFangJH.get("FuZhenZD")) ? SuiFangJH.get("FuZhenZD").toString() : null);
+            patMedInhosp1.setFuspecialadvice(ObjectUtils.isNotEmpty(SuiFangJH.get("QiTaZKJBSF")) ? SuiFangJH.get("QiTaZKJBSF").toString() : null);
+        }
+
+        List<HashMap<String, Object>> zhenDuanList = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList") : null;
+        if (CollectionUtils.isNotEmpty(zhenDuanList)) {
+            List<ExternalInHospPatientDiagnoseInfo> hospPatientDiagnoseInfos2 = zhenDuanList.stream().map(map -> {
+                ExternalInHospPatientDiagnoseInfo info = new ExternalInHospPatientDiagnoseInfo();
+                info.setZhenDuanID((String) map.get("ZhenDuanID"));
+                info.setZhenDuanMC((String) map.get("ZhenDuanMC"));
+                return info;
+            }).collect(Collectors.toList());
+            patMedInhosp1.setLeaveicd10code(StringUtils.isNotEmpty(patMedInhosp1.getLeaveicd10code()) ? patMedInhosp1.getLeaveicd10code() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanID() : hospPatientDiagnoseInfos2.get(0).getZhenDuanID());
+            patMedInhosp1.setLeavediagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC());
+            patMedInhosp1.setDiagname(StringUtils.isNotEmpty(patMedInhosp1.getLeavediagname()) ? patMedInhosp1.getLeavediagname() + "," + hospPatientDiagnoseInfos2.get(0).getZhenDuanMC() : hospPatientDiagnoseInfos2.get(0).getZhenDuanMC());
+        }
+
         patMedInhosp1.setInhospstate("1");
         if (CollectionUtils.isNotEmpty(patMedInhospList)) {
             patMedInhosp1.setUpdateTime(new Date());
-            patMedInhosp1.setOrgid(BingRenXX.get("ZuZhiJGID").toString());
+            patMedInhosp1.setOrgid(ObjectUtils.isNotEmpty(BingRenXX) && ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null);
             int i = patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
             if (i != 1) return false;
         } else {
-            patMedInhosp1.setHospitalname(BingRenXX.get("ZuZhiJGMC").toString());
-            patMedInhosp1.setHospitalcode(BingRenXX.get("ZuZhiJGID").toString());
-            patMedInhosp1.setLeavehospitaldistrictname(BingRenXX.get("DangQianBQMC").toString());
-            patMedInhosp1.setLeavehospitaldistrictcode(BingRenXX.get("DangQianBQID").toString());
+            if (ObjectUtils.isNotEmpty(BingRenXX)) {
+                patMedInhosp1.setHospitalname(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGMC")) ? BingRenXX.get("ZuZhiJGMC").toString() : null);
+                patMedInhosp1.setHospitalcode(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null);
+                patMedInhosp1.setLeavehospitaldistrictname(ObjectUtils.isNotEmpty(BingRenXX.get("DangQianBQMC")) ? BingRenXX.get("DangQianBQMC").toString() : null);
+                patMedInhosp1.setLeavehospitaldistrictcode(ObjectUtils.isNotEmpty(BingRenXX.get("DangQianBQID")) ? BingRenXX.get("DangQianBQID").toString() : null);
+                patMedInhosp1.setOrgid(ObjectUtils.isNotEmpty(BingRenXX.get("ZuZhiJGID")) ? BingRenXX.get("ZuZhiJGID").toString() : null);
+                patMedInhosp1.setPatno(ObjectUtils.isNotEmpty(BingRenXX.get("BingRenID")) ? BingRenXX.get("BingRenID").toString() : null);
+                patMedInhosp1.setInhospno(ObjectUtils.isNotEmpty(BingRenXX.get("BingAnHao")) ? BingRenXX.get("BingAnHao").toString() : null);
+                patMedInhosp1.setSerialnum(ObjectUtils.isNotEmpty(BingRenXX.get("BingAnHao")) ? BingRenXX.get("BingAnHao").toString() : null);
+            }
             patMedInhosp1.setPatid(patArchive.getId());
             patMedInhosp1.setPatname(patArchive.getName());
-            patMedInhosp1.setOrgid(BingRenXX.get("ZuZhiJGID").toString());
-            patMedInhosp1.setPatno(BingRenXX.get("BingRenID").toString());
-            patMedInhosp1.setInhospno(BingRenXX.get("BingAnHao").toString());
-            patMedInhosp1.setSerialnum(BingRenXX.get("BingAnHao").toString());
+
             patMedInhosp1.setCreateTime(new Date());
             int i = patMedInhospMapper.insertPatMedInhosp(patMedInhosp1);
             if (i != 1) return false;
@@ -386,7 +426,7 @@
     public Boolean cancelOutHospInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---cancelOutHospInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         PatMedInhosp patMedInhosp = new PatMedInhosp();
         patMedInhosp.setInhospno(externalInHospPatientInfo.getBingAnHao());
@@ -396,11 +436,13 @@
             patMedInhosp1.setTagname(tagname);
         }
         if (CollectionUtils.isNotEmpty(patMedInhospList)) {
-            Map<String, Object> JiuZhenXX = (Map<String, Object>) yeWuXX.get("JiuZhenXX");
+            Map<String, Object> JiuZhenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("JiuZhenXX") : null;
             PatMedInhosp patMedInhosp1 = patMedInhospList.get(0);
             patMedInhosp1.setSchemestatus(4L);
-            patMedInhosp1.setOperator(JiuZhenXX.get("CaoZuoRXM").toString());
-            patMedInhosp1.setOperatorId(JiuZhenXX.get("CaoZuoRID").toString());
+            if (ObjectUtils.isNotEmpty(JiuZhenXX)) {
+                patMedInhosp1.setOperator(ObjectUtils.isNotEmpty(JiuZhenXX.get("CaoZuoRXM")) ? JiuZhenXX.get("CaoZuoRXM").toString() : null);
+                patMedInhosp1.setOperatorId(ObjectUtils.isNotEmpty(JiuZhenXX.get("CaoZuoRXM")) ? JiuZhenXX.get("CaoZuoRID").toString() : null);
+            }
             patMedInhosp1.setUpdateTime(new Date());
             int i = patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
             if (i != 1) return false;
@@ -415,26 +457,28 @@
         Map XiaoXiTou = (Map) dataMap.get("XiaoXiTou");
         String FaSongJGID = ObjectUtils.isNotEmpty(XiaoXiTou.get("FaSongJGID")) ? XiaoXiTou.get("FaSongJGID").toString() : null;
 
-        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
-        Map<String, Object> JiuZhenXX = (Map<String, Object>) yeWuXX.get("JiuZhenXX");
-        List<HashMap<String, Object>> ZhenDuanList = (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList");
-        List<HashMap<String, Object>> externalWZInfos = (List<HashMap<String, Object>>) yeWuXX.get("WenZhenList");
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
+        Map<String, Object> JiuZhenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("JiuZhenXX") : null;
+        List<HashMap<String, Object>> ZhenDuanList = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("ZhenDuanList") : null;
+        List<HashMap<String, Object>> externalWZInfos = ObjectUtils.isNotEmpty(yeWuXX) ? (List<HashMap<String, Object>>) yeWuXX.get("WenZhenList") : null;
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
         //鐥呬汉淇℃伅閲屾病鏈夌粍缁囨満鏋処D
         externalInHospPatientInfo.setZuZhiJGID(FaSongJGID);
 
         ExternalJZInfo externalJZInfo = BeanUtil.mapToBean(JiuZhenXX, ExternalJZInfo.class, true);
-        List<ExternalDiagnosisInfo> externalDiagnosisInfoList = ZhenDuanList.stream().map(map -> {
-            ExternalDiagnosisInfo info = new ExternalDiagnosisInfo();
-            info.setZhenDuanYSID((String) map.get("ZhenDuanYSID"));
-            info.setZhenDuanYSXM((String) map.get("ZhenDuanYSXM"));
-            info.setZhenDuanID((String) map.get("ZhenDuanID"));
-            info.setZhenDuanMC((String) map.get("ZhenDuanMC"));
-            info.setZhenDuanLBDM((String) map.get("ZhenDuanLBDM"));
-            info.setZhenDuanLBMC((String) map.get("ZhenDuanLBMC"));
-            return info;
-        }).collect(Collectors.toList());
-
+        List<ExternalDiagnosisInfo> externalDiagnosisInfoList = null;
+        if (CollectionUtils.isNotEmpty(ZhenDuanList)) {
+            externalDiagnosisInfoList = ZhenDuanList.stream().map(map -> {
+                ExternalDiagnosisInfo info = new ExternalDiagnosisInfo();
+                info.setZhenDuanYSID((String) map.get("ZhenDuanYSID"));
+                info.setZhenDuanYSXM((String) map.get("ZhenDuanYSXM"));
+                info.setZhenDuanID((String) map.get("ZhenDuanID"));
+                info.setZhenDuanMC((String) map.get("ZhenDuanMC"));
+                info.setZhenDuanLBDM((String) map.get("ZhenDuanLBDM"));
+                info.setZhenDuanLBMC((String) map.get("ZhenDuanLBMC"));
+                return info;
+            }).collect(Collectors.toList());
+        }
         List<ExternalWZInfo> ExternalWZInfoList = externalWZInfos.stream().map(map -> {
             ExternalWZInfo info = new ExternalWZInfo();
             info.setWenZhenLXMC((String) map.get("WenZhenLXMC"));
@@ -459,7 +503,6 @@
         for (ExternalDiagnosisInfo externalDiagnosisInfo : externalDiagnosisInfoList) {
             if (externalDiagnosisInfo.getZhenDuanLBMC().equals("涓昏瘖鏂�")) {
                 patMedOuthosp.setDiagname(externalDiagnosisInfo.getZhenDuanMC());
-                patMedOuthosp.setIcd10code(externalDiagnosisInfo.getZhenDuanID());
                 patMedOuthosp.setDrcode(externalDiagnosisInfo.getZhenDuanYSID());
                 patMedOuthosp.setDrname(externalDiagnosisInfo.getZhenDuanYSXM());
                 patMedOuthosp.setIcd10code(externalDiagnosisInfo.getIcd10());
@@ -485,10 +528,10 @@
     public Boolean addDiseaseInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---addDiseaseInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        Map<String, Object> JiBing = (Map<String, Object>) yeWuXX.get("JiBingMLXX");
+        Map<String, Object> JiBing = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("JiBingMLXX") : null;
         ExternalDiseaseInfo externalDiseaseInfo = BeanUtil.mapToBean(JiBing, ExternalDiseaseInfo.class, true);
         Map XiaoXiTou = (Map) dataMap.get("XiaoXiTou");
-        String FaSongJGID = XiaoXiTou.get("FaSongJGID").toString();
+        String FaSongJGID = ObjectUtils.isNotEmpty(XiaoXiTou) && ObjectUtils.isNotEmpty(XiaoXiTou.get("FaSongJGID")) ? XiaoXiTou.get("FaSongJGID").toString() : null;
         Icd10 icd10 = new Icd10();
         icd10.setIcdcode(externalDiseaseInfo.getIcD10());
         icd10.setDelFlag("0");
@@ -515,7 +558,7 @@
     public Boolean addWardAreaInfo(Map dataMap) {
         log.error("ServiceExternalServiceImpl---addWardAreaInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        Map<String, Object> bqxx = (Map<String, Object>) yeWuXX.get("BingQuXX");
+        Map<String, Object> bqxx = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingQuXX") : null;
         ExternalWardArea externalWardArea = BeanUtil.mapToBean(bqxx, ExternalWardArea.class, true);
         SysDept sysDept = new SysDept();
         sysDept.setGuid(externalWardArea.getZuZhiJGID());
@@ -549,18 +592,18 @@
         log.error("ServiceExternalServiceImpl---addOperationInfo鐨勬柊澧炵殑鍊间负锛歿}", dataMap);
 
         Map yeWuXX = (Map) dataMap.get("YeWuXX");
-        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
+        Map<String, Object> BingRenXX = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("BingRenXX") : null;
         ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
 
         PatArchive patArchive = addPatArchive(externalInHospPatientInfo, null, null);
 
 
         //鎵嬫湳淇℃伅鏂板
-        Map<String, Object> ssxx = (Map<String, Object>) yeWuXX.get("ShouShuSQ");
+        Map<String, Object> ssxx = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("ShouShuSQ") : null;
         //鎵嬫湳鏇存柊
-        Map<String, Object> ssgx = (Map<String, Object>) yeWuXX.get("ShouShuGX");
+        Map<String, Object> ssgx = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("ShouShuGX") : null;
         //鎵嬫湳鎾ら攢
-        Map<String, Object> sscx = (Map<String, Object>) yeWuXX.get("ShouShuCX");
+        Map<String, Object> sscx = ObjectUtils.isNotEmpty(yeWuXX) ? (Map<String, Object>) yeWuXX.get("ShouShuCX") : null;
         ExternalOperationInfo externalOperationInfo = null;
         if (ObjectUtils.isNotEmpty(ssxx))
             externalOperationInfo = BeanUtil.mapToBean(ssxx, ExternalOperationInfo.class, true);
@@ -572,30 +615,36 @@
         patMedOperation.setPatid(patArchive.getId());
         patMedOperation.setPatcode(externalInHospPatientInfo.getBingRenID());
         patMedOperation.setPaname(externalInHospPatientInfo.getXingMing());
-//        patMedOperation.setOpreqid(externalOperationInfo.getShenQingDID());
         patMedOperation.setOpreqcode(externalOperationInfo.getShenQingDID());
         //鏌ヨ涓�涓嬶紝璇ユ偅鑰呮槸鍚﹀凡缁忔湁杩欎簺鏁版嵁
         List<PatMedOperation> patMedOperations = patMedOperationMapper.selectPatMedOperationList(patMedOperation);
 
         patMedOperation.setOpsstatus(null);
-        patMedOperation.setOptypecode(externalOperationInfo.getShouShuLBDM());
-        patMedOperation.setOptypename(externalOperationInfo.getShouShuLBMC());
-        patMedOperation.setOperatortime(externalOperationInfo.getYaoQiuSJ());
-        patMedOperation.setOpreqtime(externalOperationInfo.getShenQingSJ());
-        patMedOperation.setReqdoccode(externalOperationInfo.getShenQingYSID());
-        patMedOperation.setReqdocname(externalOperationInfo.getShenQingYSXM());
-        patMedOperation.setReqdeptcode(externalOperationInfo.getShenQingKSID());
-        patMedOperation.setReqdeptname(externalOperationInfo.getShenQingKSMC());
-        patMedOperation.setReqloccode(externalOperationInfo.getShouShuKSID());
-        patMedOperation.setReqlocname(externalOperationInfo.getShouShuKSMC());
-        patMedOperation.setSurgeoncode(externalOperationInfo.getZhuDaoYSID());
-        patMedOperation.setSurgeonname(externalOperationInfo.getSanZhuYSXM());
-        patMedOperation.setFirasscode(externalOperationInfo.getYiZhuID());
-        patMedOperation.setFirassname(externalOperationInfo.getYiZhuMC());
-        patMedOperation.setSecasscode(externalOperationInfo.getErZhuYSID());
-        patMedOperation.setSecassname(externalOperationInfo.getErZhuYSXM());
-        patMedOperation.setThrasscode(externalOperationInfo.getSanZhuYSID());
-        patMedOperation.setThrassname(externalOperationInfo.getSanZhuYSXM());
+        if (ObjectUtils.isNotEmpty(externalOperationInfo)) {
+            patMedOperation.setOptypecode(externalOperationInfo.getShouShuLBDM());
+            patMedOperation.setOptypename(externalOperationInfo.getShouShuLBMC());
+            patMedOperation.setOperatortime(externalOperationInfo.getYaoQiuSJ());
+            patMedOperation.setOpreqtime(externalOperationInfo.getShenQingSJ());
+            patMedOperation.setReqdoccode(externalOperationInfo.getShenQingYSID());
+            patMedOperation.setReqdocname(externalOperationInfo.getShenQingYSXM());
+            patMedOperation.setReqdeptcode(externalOperationInfo.getShenQingKSID());
+            patMedOperation.setReqdeptname(externalOperationInfo.getShenQingKSMC());
+            patMedOperation.setReqloccode(externalOperationInfo.getShouShuKSID());
+            patMedOperation.setReqlocname(externalOperationInfo.getShouShuKSMC());
+            patMedOperation.setSurgeoncode(externalOperationInfo.getZhuDaoYSID());
+            patMedOperation.setSurgeonname(externalOperationInfo.getSanZhuYSXM());
+            patMedOperation.setFirasscode(externalOperationInfo.getYiZhuID());
+            patMedOperation.setFirassname(externalOperationInfo.getYiZhuMC());
+            patMedOperation.setSecasscode(externalOperationInfo.getErZhuYSID());
+            patMedOperation.setSecassname(externalOperationInfo.getErZhuYSXM());
+            patMedOperation.setThrasscode(externalOperationInfo.getSanZhuYSID());
+            patMedOperation.setThrassname(externalOperationInfo.getSanZhuYSXM());
+            patMedOperation.setDeptid(externalOperationInfo.getShouShuKSID());
+            patMedOperation.setDeptcode(externalOperationInfo.getShouShuKSID());
+            patMedOperation.setDeptname(externalOperationInfo.getShouShuKSMC());
+            patMedOperation.setDrcode(externalOperationInfo.getZhuDaoYSID());
+            patMedOperation.setDrname(externalOperationInfo.getZhuDaoYSXM());
+        }
         patMedOperation.setCanceltime(null);
         patMedOperation.setCancelreason(null);
         patMedOperation.setCancelcode(null);
@@ -607,24 +656,22 @@
         patMedOperation.setDelFlag("0");
         patMedOperation.setIsupload(null);
         patMedOperation.setUploadTime(null);
-        patMedOperation.setOrgid(externalInHospPatientInfo.getZuZhiJGID());
-        patMedOperation.setInhospstate(null);
-        patMedOperation.setPatno(externalInHospPatientInfo.getBingRenID());
-        patMedOperation.setPatname(externalInHospPatientInfo.getXingMing());
         patMedOperation.setVisitid(null);
-        patMedOperation.setSerialnum(externalInHospPatientInfo.getZhuYuanHao());
-        patMedOperation.setInhospno(externalInHospPatientInfo.getBingAnHao());
-        patMedOperation.setHospitalname(externalInHospPatientInfo.getZuZhiJGMC());
-        patMedOperation.setHospitalcode(externalInHospPatientInfo.getZuZhiJGID());
-        patMedOperation.setDeptid(externalOperationInfo.getShouShuKSID());
-        patMedOperation.setDeptcode(externalOperationInfo.getShouShuKSID());
-        patMedOperation.setDeptname(externalOperationInfo.getShouShuKSMC());
+        patMedOperation.setInhospstate(null);
+        if (ObjectUtils.isNotEmpty(externalInHospPatientInfo)) {
+            patMedOperation.setPatno(externalInHospPatientInfo.getBingRenID());
+            patMedOperation.setPatname(externalInHospPatientInfo.getXingMing());
+            patMedOperation.setOrgid(externalInHospPatientInfo.getZuZhiJGID());
+            patMedOperation.setSerialnum(externalInHospPatientInfo.getZhuYuanHao());
+            patMedOperation.setInhospno(externalInHospPatientInfo.getBingAnHao());
+            patMedOperation.setHospitalname(externalInHospPatientInfo.getZuZhiJGMC());
+            patMedOperation.setHospitalcode(externalInHospPatientInfo.getZuZhiJGID());
+        }
         patMedOperation.setHospitaldistrictcode(null);
         patMedOperation.setHospitaldistrictname(null);
         patMedOperation.setRoomno(null);
         patMedOperation.setBedNo(null);
-        patMedOperation.setDrcode(externalOperationInfo.getZhuDaoYSID());
-        patMedOperation.setDrname(externalOperationInfo.getZhuDaoYSXM());
+
         patMedOperation.setNurseId(null);
         patMedOperation.setNurseName(null);
         if (CollectionUtils.isNotEmpty(patMedOperations)) {
@@ -647,7 +694,7 @@
         if (ObjectUtils.isNotEmpty(ssxx)) {
             List<HashMap<String, Object>> ShouShuMXList = (List<HashMap<String, Object>>) ssxx.get("ShouShuMXList");
 
-            List<ExternalOperationDetail> externalOperationDetails = ShouShuMXList.stream().map(map -> {
+            List<ExternalOperationDetail> externalOperationDetails = ObjectUtils.isNotEmpty(ShouShuMXList) ? ShouShuMXList.stream().map(map -> {
                 ExternalOperationDetail info = new ExternalOperationDetail();
                 info.setShouShuMCID((String) map.get("ShouShuMCID"));
                 info.setShouShuMC((String) map.get("ShouShuMC"));
@@ -661,7 +708,7 @@
                 info.setShouShuMCQZ((String) map.get("ShouShuMCQZ"));
                 info.setShouShuMCHZ((String) map.get("ShouShuMCHZ"));
                 return info;
-            }).collect(Collectors.toList());
+            }).collect(Collectors.toList()) : null;
 
             //addMianTableFalg鏄惁闇�瑕佸皢涓绘墜鏈殑淇℃伅鏀惧埌PatMedOperation琛ㄤ腑锛堝彧鏈夌涓�涓富鎵嬫湳淇℃伅闇�瑕佹斁锛屽悗闈㈢殑閮戒笉闇�瑕佹斁浜嗭紝涔熷氨鏄锛岀涓�涓斁瀹屽悗锛屽氨瑕佹妸杩欎釜flag鏀规垚false锛�
             Boolean addMianTableFalg = true;
@@ -719,7 +766,9 @@
             patArchive.setSex(Long.valueOf(externalInHospPatientInfo.getXingBieDM()));
         patArchive.setNation(externalInHospPatientInfo.getMinZuMC());
         patArchive.setNativePlace(externalInHospPatientInfo.getGuoJiMC());
-        if (ObjectUtils.isNotEmpty(externalInHospPatientAddrInfo)) {
+        if (ObjectUtils.isNotEmpty(externalInHospPatientInfo.getXianZhuZXX())) {
+            patArchive.setPlaceOfResidence(externalInHospPatientInfo.getXianZhuZXX());
+        } else if (ObjectUtils.isNotEmpty(externalInHospPatientAddrInfo)) {
             String por = null;
             if (StringUtils.isNotEmpty(externalInHospPatientAddrInfo.getDiZhiXX())) {
                 por = externalInHospPatientAddrInfo.getDiZhiXX();
@@ -727,7 +776,7 @@
                 por = externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX();
             }
             patArchive.setPlaceOfResidence(por.replace("null", ""));
-            patArchive.setBirthplace(por.replace("null", ""));
+//            patArchive.setBirthplace(por.replace("null", ""));
         }
 
         if (ObjectUtils.isNotEmpty(parse)) {
@@ -973,7 +1022,7 @@
         String ageUnit2 = null;
         Integer age2 = null;
 
-        if (totalDays < 30) {
+        if (totalDays < 90) {
             // 灏忎簬 1 涓湀锛屾寜澶╄绠�
             ageUnit = "澶�";
             age = (int) totalDays;
@@ -981,7 +1030,7 @@
             ageMap.put("ageUnit", ageUnit);
             ageMap.put("age2", null);
             ageMap.put("ageUnit2", null);
-        } else if (totalMonths < 12) {
+        } else if (totalMonths < 36) {
             // 灏忎簬 1 骞达紝鎸夋湀 + 澶╄绠�
             ageUnit = "鏈�";
             age = (int) totalMonths;
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 49c4259..6370dad 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -288,7 +288,7 @@
             if (serviceSubtask.getSendstate() == 4L) wzx = wzx + 1;
             else if (serviceSubtask.getSendstate() != 4L) ysf = ysf + 1;
             if (serviceSubtask.getSendstate() == 5L) fssb = fssb + 1;
-            if (serviceSubtask.getSendstate() == 3L) yfs = yfs + 1;
+            if (serviceSubtask.getSendstate() >= 3L || serviceSubtask.getSendstate() == 1L) yfs = yfs + 1;
             if (serviceSubtask.getSendstate() == 1L) blq = blq + 1;
             if (serviceSubtask.getExcep().equals("1")) yc = yc + 1;
         }
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
index 9192e8f..3ad858d 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -38,7 +38,7 @@
     private ServiceSubtaskMapper serviceSubtaskMapper;
 
     @Autowired
-    private IvrTaskTemplateMapper ivrTaskTemplateMapper;
+    private ServiceTaskdeptMapper serviceTaskdeptMapper;
 
     @Autowired
     private PatArchiveImportMapper patArchiveImportMapper;
@@ -155,12 +155,32 @@
     @Transactional(rollbackFor = Exception.class)
     @Override
     public Boolean deleteServiceTaskByTaskid(Long taskid) {
-        ServiceSubtask ServiceTaskcall = new ServiceSubtask();
-        ServiceTaskcall.setTaskid(taskid);
-        ServiceTaskcall.setDelFlag("1");
-        Boolean aBoolean = serviceSubtaskMapper.updateServiceSubtask(ServiceTaskcall);
+        ServiceSubtask serviceSubtask = new ServiceSubtask();
+        serviceSubtask.setTaskid(taskid);
+
+        //鏌ヨ瀛愪换鍔�
+        ServiceSubtaskVO serviceSubtaskVO = DtoConversionUtils.sourceToTarget(serviceSubtask, ServiceSubtaskVO.class);
+        List<ServiceSubtask> serviceSubtaskList = serviceSubtaskMapper.selectServiceSubtaskList(serviceSubtaskVO);
+        for (ServiceSubtask ss : serviceSubtaskList) {
+            log.error("sfSend闇�瑕佺Щ闄ょ殑subId涓猴細{}", ss.getId().toString());
+            redisCache.removeElementFromList("cache-exist", ss.getId().toString());
+            redisCache.removeElementFromList("cache-0", ss.getId().toString());
+            redisCache.removeElementFromList("cache-1", ss.getId().toString());
+            redisCache.removeElementFromList("cache-2", ss.getId().toString());
+            redisCache.removeElementFromList("cache-3", ss.getId().toString());
+            redisCache.removeElementFromList("cache-4", ss.getId().toString());
+        }
+
+        serviceSubtask.setDelFlag("1");
+        Boolean aBoolean = serviceSubtaskMapper.updateServiceSubtaskByPatId(serviceSubtask);
+
+        //鍏宠仈琛ㄥ垹闄�
+        ServiceTaskdept serviceTaskdept = new ServiceTaskdept();
+        serviceTaskdept.setTaskId(taskid);
+        int i = serviceTaskdeptMapper.deleteServiceTaskdeptByTaskId(serviceTaskdept);
+
         Boolean isSuccess = false;
-        if (!aBoolean) {
+        if (!aBoolean || i <= 0) {
             new BaseException("浠诲姟鍒犻櫎澶辫触");
         }
         isSuccess = serviceTaskMapper.deleteServiceTaskByTaskid(taskid);
diff --git a/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml b/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml
index 7d8f875..2df9355 100644
--- a/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml
@@ -39,6 +39,7 @@
         <result property="otherdata" column="otherdata"/>
         <result property="richText" column="rich_text"/>
         <result property="hetype" column="hetype"/>
+        <result property="watchCount" column="watch_count"/>
         <result property="htmlRichText" column="html_rich_text"/>
     </resultMap>
 
@@ -46,6 +47,7 @@
         select id,
                classification,
                hetype,
+               watch_count,
                html_rich_text,
                assortid,
                preachname,
@@ -108,6 +110,7 @@
             </if>
             <if test="pid != null ">and pid = #{pid}</if>
             <if test="guid != null  and guid != ''">and guid = #{guid}</if>
+            <if test="watchCount != null  ">and watch_count = #{watchCount}</if>
             <if test="parameter != null  and parameter != ''">and parameter = #{parameter}</if>
             <if test="isavailable != null  and isavailable != ''">and isavailable = #{isavailable}</if>
             <if test="suitdisease != null  and suitdisease != ''">and suitdisease = #{suitdisease}</if>
@@ -162,6 +165,7 @@
             <if test="otherdata != null">otherdata,</if>
             <if test="richText != null  and richText != ''">rich_text,</if>
             <if test="hetype != null  and hetype != ''">hetype,</if>
+            <if test="watchCount != null">watch_count,</if>
             <if test="htmlRichText != null  and htmlRichText != ''">html_rich_text,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -198,6 +202,7 @@
             <if test="otherdata != null">#{otherdata},</if>
             <if test="richText != null  and richText != ''">#{richText},</if>
             <if test="hetype != null  and hetype != ''">#{hetype},</if>
+            <if test="watchCount != null">#{watchCount},</if>
             <if test="htmlRichText != null  and htmlRichText != ''">#{htmlRichText},</if>
         </trim>
     </insert>
@@ -239,6 +244,7 @@
             <if test="richText != null  and richText != ''">rich_text = #{richText},</if>
             <if test="hetype != null  and hetype != ''">hetype = #{hetype},</if>
             <if test="htmlRichText != null  and htmlRichText != ''">html_rich_text = #{htmlRichText},</if>
+            <if test="watchCount != null">watch_count=#{watchCount},</if>
         </trim>
         where id = #{id}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml b/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml
index 761c3c0..1bb682f 100644
--- a/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml
@@ -1,58 +1,88 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.smartor.mapper.HeLocallibraryMapper">
 
     <resultMap type="com.smartor.domain.HeLocallibrary" id="HeLocallibraryResult">
-        <result property="id"    column="id"    />
-        <result property="preachcategoryid"    column="preachcategoryid"    />
-        <result property="preachname"    column="preachname"    />
-        <result property="version"    column="version"    />
-        <result property="preachform"    column="preachform"    />
-        <result property="preachdescription"    column="preachdescription"    />
-        <result property="preachcontent"    column="preachcontent"    />
-        <result property="templateid"    column="templateid"    />
-        <result property="preachcode"    column="preachcode"    />
-        <result property="centerlibraryid"    column="centerlibraryid"    />
-        <result property="isenable"    column="isenable"    />
-        <result property="orgid"    column="orgid"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="isupload"    column="isupload"    />
-        <result property="uploadTime"    column="upload_time"    />
-        <result property="classification"    column="classification"    />
-        <result property="islocal"    column="islocal"    />
-        <result property="centerlibrarycode"    column="centerlibrarycode"    />
-        <result property="guid"    column="guid"    />
+        <result property="id" column="id"/>
+        <result property="preachcategoryid" column="preachcategoryid"/>
+        <result property="preachname" column="preachname"/>
+        <result property="version" column="version"/>
+        <result property="preachform" column="preachform"/>
+        <result property="preachdescription" column="preachdescription"/>
+        <result property="preachcontent" column="preachcontent"/>
+        <result property="templateid" column="templateid"/>
+        <result property="preachcode" column="preachcode"/>
+        <result property="centerlibraryid" column="centerlibraryid"/>
+        <result property="isenable" column="isenable"/>
+        <result property="orgid" column="orgid"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="isupload" column="isupload"/>
+        <result property="uploadTime" column="upload_time"/>
+        <result property="classification" column="classification"/>
+        <result property="islocal" column="islocal"/>
+        <result property="centerlibrarycode" column="centerlibrarycode"/>
+        <result property="guid" column="guid"/>
     </resultMap>
 
     <sql id="selectHeLocallibraryVo">
-        select id, preachcategoryid, guid, preachname, version, preachform, preachdescription, preachcontent, templateid, preachcode, centerlibraryid, isenable, orgid, update_by, update_time, del_flag, create_by, create_time, isupload, upload_time, classification, islocal, centerlibrarycode from he_locallibrary
+        select id,
+               preachcategoryid,
+               guid,
+               preachname,
+               version,
+               preachform,
+               preachdescription,
+               preachcontent,
+               templateid,
+               preachcode,
+               centerlibraryid,
+               isenable,
+               orgid,
+               update_by,
+               update_time,
+               del_flag,
+               create_by,
+               create_time,
+               isupload,
+               upload_time,
+               classification,
+               islocal,
+               watch_count,
+               centerlibrarycode
+        from he_library
     </sql>
 
-    <select id="selectHeLocallibraryList" parameterType="com.smartor.domain.HeLocallibrary" resultMap="HeLocallibraryResult">
+    <select id="selectHeLocallibraryList" parameterType="com.smartor.domain.HeLocallibrary"
+            resultMap="HeLocallibraryResult">
         <include refid="selectHeLocallibraryVo"/>
         <where>
-            <if test="preachcategoryid != null "> and preachcategoryid = #{preachcategoryid}</if>
-            <if test="preachname != null  and preachname != ''"> and preachname like concat('%', #{preachname}, '%')</if>
-            <if test="version != null "> and version = #{version}</if>
-            <if test="preachform != null "> and preachform = #{preachform}</if>
-            <if test="preachdescription != null  and preachdescription != ''"> and preachdescription = #{preachdescription}</if>
-            <if test="preachcontent != null  and preachcontent != ''"> and preachcontent = #{preachcontent}</if>
-            <if test="templateid != null "> and templateid = #{templateid}</if>
-            <if test="preachcode != null  and preachcode != ''"> and preachcode = #{preachcode}</if>
-            <if test="centerlibraryid != null "> and centerlibraryid = #{centerlibraryid}</if>
-            <if test="isenable != null "> and isenable = #{isenable}</if>
-            <if test="orgid != null  and orgid != ''"> and orgid = #{orgid}</if>
-            <if test="isupload != null "> and isupload = #{isupload}</if>
-            <if test="uploadTime != null "> and upload_time = #{uploadTime}</if>
-            <if test="classification != null  and classification != ''"> and classification = #{classification}</if>
-            <if test="islocal != null "> and islocal = #{islocal}</if>
-            <if test="centerlibrarycode != null  and centerlibrarycode != ''"> and centerlibrarycode = #{centerlibrarycode}</if>
+            del_flag=0
+            <if test="preachcategoryid != null ">and preachcategoryid = #{preachcategoryid}</if>
+            <if test="preachname != null  and preachname != ''">and preachname like concat('%', #{preachname}, '%')</if>
+            <if test="version != null ">and version = #{version}</if>
+            <if test="preachform != null ">and preachform = #{preachform}</if>
+            <if test="preachdescription != null  and preachdescription != ''">and preachdescription =
+                #{preachdescription}
+            </if>
+            <if test="preachcontent != null  and preachcontent != ''">and preachcontent = #{preachcontent}</if>
+            <if test="templateid != null ">and templateid = #{templateid}</if>
+            <if test="preachcode != null  and preachcode != ''">and preachcode = #{preachcode}</if>
+            <if test="centerlibraryid != null ">and centerlibraryid = #{centerlibraryid}</if>
+            <if test="isenable != null ">and isenable = #{isenable}</if>
+            <if test="orgid != null  and orgid != ''">and orgid = #{orgid}</if>
+            <if test="isupload != null ">and isupload = #{isupload}</if>
+            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
+            <if test="classification != null  and classification != ''">and classification = #{classification}</if>
+            <if test="islocal != null ">and islocal = #{islocal}</if>
+            <if test="centerlibrarycode != null  and centerlibrarycode != ''">and centerlibrarycode =
+                #{centerlibrarycode}
+            </if>
         </where>
     </select>
 
@@ -61,7 +91,8 @@
         where id = #{id}
     </select>
 
-    <insert id="insertHeLocallibrary" parameterType="com.smartor.domain.HeLocallibrary" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertHeLocallibrary" parameterType="com.smartor.domain.HeLocallibrary" useGeneratedKeys="true"
+            keyProperty="id">
         insert into he_locallibrary
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="preachcategoryid != null">preachcategoryid,</if>
@@ -86,7 +117,7 @@
             <if test="islocal != null">islocal,</if>
             <if test="centerlibrarycode != null">centerlibrarycode,</if>
             <if test="guid != null">guid,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="preachcategoryid != null">#{preachcategoryid},</if>
             <if test="preachname != null">#{preachname},</if>
@@ -110,7 +141,7 @@
             <if test="islocal != null">#{islocal},</if>
             <if test="centerlibrarycode != null">#{centerlibrarycode},</if>
             <if test="guid != null">#{guid},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateHeLocallibrary" parameterType="com.smartor.domain.HeLocallibrary">
@@ -143,7 +174,9 @@
     </update>
 
     <delete id="deleteHeLocallibraryById" parameterType="Long">
-        delete from he_locallibrary where id = #{id}
+        delete
+        from he_locallibrary
+        where id = #{id}
     </delete>
 
     <delete id="deleteHeLocallibraryByIds" parameterType="String">
diff --git a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
index 963bbe2..95018be 100644
--- a/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -61,11 +61,25 @@
         <result property="operatorId" column="operator_id"/>
         <result property="remark" column="remark"/>
         <result property="tagname" column="tagname"/>
+        <result property="fuflag" column="fuflag"/>
+        <result property="fudate" column="fudate"/>
+        <result property="fuperiod" column="fuperiod"/>
+        <result property="futypecode" column="futypecode"/>
+        <result property="futypedesc" column="futypedesc"/>
+        <result property="fuadivce" column="fuadivce"/>
+        <result property="fuspecialadvice" column="fuspecialadvice"/>
     </resultMap>
 
     <sql id="selectPatMedInhospVo">
         select inhospid,
                patname,
+               fuflag,
+               fudate,
+               fuperiod,
+               futypecode,
+               futypedesc,
+               fuadivce,
+               fuspecialadvice,
                remark,
                guid,
                operator,
@@ -170,14 +184,14 @@
         b.deptid,
         b.leaveldeptid,
         b.long_task_reason,
-        b.schemetime
-        -- COALESCE (
-        -- (
-        -- SELECT GROUP_CONCAT(d.tagname, ', ')
-        -- FROM pat_archivetag d
-        -- WHERE d.patid = a.id
-        -- AND d.del_flag = 0
-        -- ), '') AS tagname
+        b.schemetime,
+        b.fuflag,
+        b.fudate,
+        b.fuperiod,
+        b.futypecode,
+        b.futypedesc,
+        b.fuadivce,
+        b.fuspecialadvice
         FROM
         pat_med_inhosp b
         JOIN
@@ -211,6 +225,7 @@
             </if>
             <if test="endtime != null ">and b.endtime = #{endtime}</if>
             <if test="inhospno != null ">and b.inhospno = #{inhospno}</if>
+            <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
             <if test="serialnum != null ">and b.serialnum = #{serialnum}</if>
             <if test="endtime != null ">and b.endtime = #{endtime}</if>
             <if test="patno != null ">and b.patno = #{patno}</if>
@@ -314,6 +329,13 @@
         b.deptid,
         b.leaveldeptid,
         b.long_task_reason,
+        b.fuflag,
+        b.fudate,
+        b.fuperiod,
+        b.futypecode,
+        b.futypedesc,
+        b.fuadivce,
+        b.fuspecialadvice
         b.schemetime
         FROM
         pat_med_inhosp b,
@@ -331,6 +353,7 @@
                 concat('%', #{hospitaldistrictname}, '%')
             </if>
             <if test="endtime != null ">and b.endtime = #{endtime}</if>
+            <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
             <if test="nurseId != null ">and b.nurse_id = #{nurseId}</if>
             <if test="nurseName != null ">and b.nurse_name = #{nurseName}</if>
             <if test="patno != null ">and b.patno = #{patno}</if>
@@ -427,6 +450,13 @@
             <if test="operatorId != null ">operator_id,</if>
             <if test="inhospno != null ">inhospno,</if>
             <if test="remark != null ">remark,</if>
+            <if test="fuflag != null ">fuflag,</if>
+            <if test="fudate != null ">fudate,</if>
+            <if test="fuperiod != null ">fuperiod,</if>
+            <if test="futypecode != null ">futypecode,</if>
+            <if test="futypedesc != null ">futypedesc,</if>
+            <if test="fuadivce != null ">fuadivce,</if>
+            <if test="fuspecialadvice != null ">fuspecialadvice,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="serialnum != null">#{serialnum},</if>
@@ -480,6 +510,13 @@
             <if test="operatorId != null ">#{operatorId},</if>
             <if test="inhospno != null ">#{inhospno},</if>
             <if test="remark != null ">#{remark},</if>
+            <if test="fuflag != null ">#{fuflag},</if>
+            <if test="fudate != null ">#{fudate},</if>
+            <if test="fuperiod != null ">#{fuperiod},</if>
+            <if test="futypecode != null ">#{futypecode},</if>
+            <if test="futypedesc != null ">#{futypedesc},</if>
+            <if test="fuadivce != null ">#{fuadivce},</if>
+            <if test="fuspecialadvice != null ">#{fuspecialadvice},</if>
         </trim>
     </insert>
 
@@ -536,6 +573,13 @@
             <if test="operator != null ">operator = #{operator},</if>
             <if test="operatorId != null ">operator_id = #{operatorId},</if>
             <if test="remark != null ">remark = #{remark},</if>
+            <if test="fuflag != null ">fuflag = #{fuflag},</if>
+            <if test="fudate != null ">fudate = #{fudate},</if>
+            <if test="fuperiod != null ">fuperiod = #{fuperiod},</if>
+            <if test="futypecode != null ">futypecode = #{futypecode},</if>
+            <if test="futypedesc != null ">futypedesc = #{futypedesc},</if>
+            <if test="fuadivce != null ">fuadivce = #{fuadivce},</if>
+            <if test="fuspecialadvice != null ">fuspecialadvice = #{fuspecialadvice},</if>
         </trim>
         where inhospid = #{inhospid}
     </update>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
index dc05e19..d3c890c 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -479,6 +479,7 @@
             <if test="sendname != null">sendname = #{sendname},</if>
             <if test="phone != null">phone = #{phone},</if>
             <if test="sex != null">sex = #{sex},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="age != null">age = #{age},</if>
             <if test="sfzh != null">sfzh = #{sfzh},</if>
             <if test="addr != null">addr = #{addr},</if>
@@ -558,6 +559,7 @@
             <if test="sendname != null">sendname = #{sendname},</if>
             <if test="phone != null">phone = #{phone},</if>
             <if test="sex != null">sex = #{sex},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
             <if test="age != null">age = #{age},</if>
             <if test="sfzh != null">sfzh = #{sfzh},</if>
             <if test="addr != null">addr = #{addr},</if>
diff --git a/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml b/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml
index eac2ee3..4eaf56e 100644
--- a/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml
+++ b/smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml
@@ -172,7 +172,10 @@
             <if test="orgid != null">orgid = #{orgid},
             </if>
         </trim>
-        where id = #{id}
+        <where>
+        <if test="id != null">and id = #{id},</if>
+        <if test="taskId != null">and task_id = #{taskId},</if>
+        </where>
     </update>
 
     <update id="deleteServiceTaskdeptById" parameterType="Long">
@@ -183,6 +186,17 @@
         </trim>
         where id = #{id}
     </update>
+    <update id="deleteServiceTaskdeptByTaskId" parameterType="com.smartor.domain.ServiceTaskdept">
+        update service_taskdept
+        <trim prefix="SET" suffixOverrides=",">
+            del_flag =1,
+            update_time = sysdate()
+        </trim>
+        <where>
+            <if test="id != null">and id = #{id},</if>
+            <if test="taskId != null">and task_id = #{taskId},</if>
+        </where>
+    </update>
 
     <update id="deleteServiceTaskdeptByIds" parameterType="String">
         update service_taskdept

--
Gitblit v1.9.3