liusheng
2025-03-28 d3b362de432a32c10ccd039dfc417d8c6233f543
代码提交
已修改15个文件
578 ■■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceTaskController.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ExternalInHospPatientInfo.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java 257 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/HeLibraryMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/HeLocallibraryMapper.xml 127 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceTaskdeptMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
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
      # 从库数据源
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")) {
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;
smartor/src/main/java/com/smartor/domain/PatMedInhosp.java
@@ -388,5 +388,28 @@
    @ApiModelProperty(value = "操作人ID")
    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;
}
smartor/src/main/java/com/smartor/mapper/ServiceTaskdeptMapper.java
@@ -54,6 +54,8 @@
     */
    public int deleteServiceTaskdeptById(Long id);
    public int deleteServiceTaskdeptByTaskId(ServiceTaskdept serviceTaskdept);
    /**
     * 批量删除模板科室关联
     *
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需要处理的出院患者信息:{}", patMedInhosps);
        for (PatMedInhosp patMedInhosp1 : patMedInhosps) {
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);
        //病人信息里没有组织机构ID
        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;
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;
        }
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);
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>
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">
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>
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>
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