liusheng
2025-03-03 88c5064877fa22316d794c225fff3ceced4371f3
代码提交
已添加1个文件
已修改12个文件
329 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ExternalDiagnosisInfo.java 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml 50 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskAnswerController.java
@@ -107,6 +107,7 @@
    @ApiOperation("患者问题结果记录(外链)")
    @PostMapping("/saveQuestionAnswer")
    public AjaxResult saveQuestionAnswer(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        log.error("-----saveQuestionAnswer方法的入参为:{}", serviceSubTaskAnswerReq);
        return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 0L));
    }
@@ -121,6 +122,7 @@
    @ApiOperation("患者问题结果记录(小程充外链)")
    @PostMapping("/saveQuestionAnswerXCH")
    public AjaxResult saveQuestionAnswerXCH(@RequestBody ServiceSubTaskAnswerReq serviceSubTaskAnswerReq) {
        log.error("-------saveQuestionAnswerXCH的入参的值为:{}", serviceSubTaskAnswerReq);
        return toAjax(serviceSubtaskAnswerService.saveQuestionAnswer(serviceSubTaskAnswerReq, 1L));
    }
ruoyi-admin/src/main/resources/application-druid.yml
@@ -17,18 +17,19 @@
        #        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
        #        # æ–°åŽ
        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?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#        username: hxsoft
#        password: Hxerp2000
#        driverClassName: com.mysql.cj.jdbc.Driver
      # ä»Žåº“数据源
      slave:
      # ä»Žæ•°æ®æºå¼€å…³/默认关闭(公司)
ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -369,7 +369,8 @@
                    //纸质
                } else if (descByCode.equals("微信小程序")) {
                    //微信小程序
                    if (ivrTask1.getPatCycle() == 1) {
                    log.error("ivrTask1的值为:{}", ivrTask1);
                    if (ObjectUtils.isNotEmpty(ivrTask1) && ivrTask1.getPatCycle() == 1) {
                        //说明该任务的患者是循环执行的
                        ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO();
                        serviceSubtaskVO.setTaskid(ivrTask1.getTaskid());
@@ -623,7 +624,7 @@
                    patArchive.setSex(thiedInhospInfo.getPatiRecordGender().equals("男") ? 1L : 2L);
                    patArchive.setNation(thiedInhospInfo.getPatiNation());
                    patArchive.setNativePlace(thiedInhospInfo.getPatiNationality());
                    patArchive.setPlaceOfResidence(thiedInhospInfo.getPatiHomeAddr());
                    patArchive.setPlaceOfResidence(StringUtils.isNotEmpty(thiedInhospInfo.getPatiHomeAddr()) ? thiedInhospInfo.getPatiHomeAddr().replace("null", "") : "");
                    try {
                        if (StringUtils.isNotEmpty(thiedInhospInfo.getPatiBirthday()))
                            patArchive.setBirthdate(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(thiedInhospInfo.getPatiBirthday()));
@@ -698,6 +699,7 @@
                patMedInhosp.setLeavehospitaldistrictcode(thiedInhospInfo.getCurrWardId());
                patMedInhosp.setLeavehospitaldistrictname(thiedInhospInfo.getCurrWardName());
                patMedInhosp.setLeaveldeptid(thiedInhospInfo.getCurrDeptCode());
                patMedInhosp.setOrgid("1");
                //如果是出院,先通过患者编号和流水号去查一下,患者是否存在,如果存在,则进行修改
                PatMedInhosp inhosp = new PatMedInhosp();
                inhosp.setPatno(patArchive.getPatientno());
smartor/src/main/java/com/smartor/domain/ExternalDiagnosisInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,159 @@
package com.smartor.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * @author æŽ¥æ”¶ç¬¬ä¸‰æ–¹æ‚£è€…诊断信息
 * @date 2024-12-13
 */
@Data
@ApiModel(value = "ExternalInHospPatientInfo", description = "接收第三方患者诊断信息")
public class ExternalDiagnosisInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "诊断类别代码")
    private String ZhenDuanLBDM;
    @ApiModelProperty(value = "诊断类别名称")
    private String ZhenDuanLBMC;
    @ApiModelProperty(value = "中医诊断标志")
    private String ZhongYiZDBZ;
    @ApiModelProperty(value = "中医症侯 ID")
    private String ZhongYiZHID;
    @ApiModelProperty(value = "中医症侯名称")
    private String ZhongYiZHMC;
    @ApiModelProperty(value = "诊断医生 ID")
    private String ZhenDuanYSID;
    @ApiModelProperty(value = "诊断医生姓名")
    private String ZhenDuanYSXM;
    @ApiModelProperty(value = "诊断时间")
    private String ZhenDuanSJ;
    @ApiModelProperty(value = "发病日期")
    private String FaBingRQ;
    @ApiModelProperty(value = "诊断 ID")
    private String ZhenDuanID;
    @ApiModelProperty(value = "诊断名称")
    private String ZhenDuanMC;
    @ApiModelProperty(value = "证件号码")
    private String ZhengJianHM;
    @ApiModelProperty(value = "性别代码")
    private String XingBieDM;
    @ApiModelProperty(value = "性别名称")
    private String XingBieMC;
    @ApiModelProperty(value = "出生日期")
    private Date ChuShengRQ;
    @ApiModelProperty(value = "年龄")
    private Long NianLing;
    @ApiModelProperty(value = "年龄单位")
    private String NianLingDW;
    @ApiModelProperty(value = "当前科室ID å…¥é™¢ç§‘室 ID")
    private String DangQianKSID;
    @ApiModelProperty(value = "当前科室名称 å…¥é™¢ç§‘室名称")
    private String DangQianKSMC;
    @ApiModelProperty(value = "当前病区ID å…¥é™¢ç—…区ID")
    private String DangQianBQID;
    @ApiModelProperty(value = "当前病区名称 å…¥é™¢ç—…区名称")
    private String DangQianBQMC;
    @ApiModelProperty(value = "当前床位ID å…¥é™¢åºŠä½ ID")
    private String DangQianCWID;
    @ApiModelProperty(value = "当前床位名称 å…¥é™¢åºŠä½åç§°")
    private String DangQianCWMC;
    @ApiModelProperty(value = "住院次数")
    private Long ZhuYuanCS;
    @ApiModelProperty(value = "入院时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date RuYuanSJ;
    @ApiModelProperty(value = "费用类别 ID")
    private String FeiYongLBID;
    @ApiModelProperty(value = "费用类别名称")
    private String FeiYongLBMC;
    @ApiModelProperty(value = "费用性质 ID")
    private String FeiYongXZID;
    @ApiModelProperty(value = "费用性质名称")
    private String FeiYongXZMC;
    @ApiModelProperty(value = "联系电话")
    private String LianXiDH;
    @ApiModelProperty(value = "联系人电话")
    private String LianXiRDH;
    @ApiModelProperty(value = "单位电话")
    private String DanWeiDH;
    @ApiModelProperty(value = "单位名称")
    private String DanWeiMC;
    @ApiModelProperty(value = "婚姻代码")
    private String HunYinDM;
    @ApiModelProperty(value = "婚姻名称")
    private String HunYinMC;
    @ApiModelProperty(value = "职业代码")
    private String ZhiYeDM;
    @ApiModelProperty(value = "职业名称")
    private String ZhiYeMC;
    @ApiModelProperty(value = "国籍代码")
    private String GuoJiDM;
    @ApiModelProperty(value = "国籍名称")
    private String GuoJiMC;
    @ApiModelProperty(value = "民族代码")
    private String MinZuDM;
    @ApiModelProperty(value = "民族名称")
    private String MinZuMC;
    @ApiModelProperty(value = "操作人 ID")
    private String CaoZuoRID;
    @ApiModelProperty(value = "操作人姓名")
    private String CaoZuoRXM;
    @ApiModelProperty(value = "婴儿标志")
    private String YingErBZ;
    @ApiModelProperty(value = "母亲就诊 ID")
    private String MuQinZYJZID;
    @ApiModelProperty(value = "产妇标志")
    private String ChanFuBZ;
}
smartor/src/main/java/com/smartor/domain/ServiceSubtaskVO.java
@@ -619,5 +619,10 @@
    @ApiModelProperty(value = "结束出院日期")
    private Date endOutHospTime;
    /**
     * ç§‘室与病区的查询是or还是and:   1:and(默认)     2:or
     */
    @ApiModelProperty(value = "科室与病区的查询是or还是and:   1:and(默认)     2:or  ")
    private String deptOrDistrict = "1";
}
smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -215,6 +215,12 @@
            List<ServiceCheck> serviceChecks = serviceCheckMapper.selectServiceCheckList(serviceCheck);
            //获取患者信息
            PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patMedInhosp1.getPatid());
            if (Objects.isNull(patArchive)) {
                patMedInhosp1.setCheckFlag("2");
                patMedInhosp1.setLongTaskReason("患者基本信息为空");
                patMedInhospMapper.updatePatMedInhosp(patMedInhosp1);
                continue;
            }
            try {
                if (CollectionUtils.isEmpty(serviceChecks) || serviceChecks != null && serviceChecks.get(0).getCheckVisitFlag() == 1 || serviceChecks != null && serviceChecks.get(0).getCheckVisitFlag() == 3) {
                    //根据患者所在科室,获取该科室的长期任务
@@ -395,6 +401,8 @@
                        i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
                    }
                }
            } else {
                i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
            }
        } else {
            i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask);
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -326,7 +326,20 @@
    @Override
    public Boolean addFinshJZInfo(Map dataMap) {
        //这个先等等
        log.error("ServiceExternalServiceImpl---addFinshJZInfo的新增的值为:{}", dataMap);
//        Map yeWuXX = (Map) dataMap.get("YeWuXX");
//        Map<String, Object> BingRenXX = (Map<String, Object>) yeWuXX.get("BingRenXX");
//        Map<String, Object> JiuZhenXX = (Map<String, Object>) yeWuXX.get("JiuZhenXX");
//        ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
//        PatMedOuthosp patMedOuthosp = new PatMedOuthosp();
//        patMedOuthosp.setOuthospno(externalInHospPatientInfo.getBingAnHao());
//        patMedOuthosp.setSerialnum(externalInHospPatientInfo.getBingAnHao());
//        patMedOuthosp.setPatid(Long.valueOf(externalInHospPatientInfo.getBingRenID()));
//        patMedOuthosp.setPatname(externalInHospPatientInfo.getXingMing());
//        patMedOuthosp.setHospitalname(externalInHospPatientInfo.getZuZhiJGMC());
//        patMedOuthosp.setHospitalcode(externalInHospPatientInfo.getZuZhiJGID());
//        patMedOuthosp.setIcd10code();
        return null;
    }
@@ -530,13 +543,17 @@
        patArchive.setNation(externalInHospPatientInfo.getMinZuMC());
        patArchive.setNativePlace(externalInHospPatientInfo.getGuoJiMC());
        if (ObjectUtils.isNotEmpty(externalInHospPatientAddrInfo)) {
            patArchive.setPlaceOfResidence(externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX());
            patArchive.setBirthplace(externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX());
            String por = externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX();
            patArchive.setPlaceOfResidence(por.replace(null, ""));
            String bp = externalInHospPatientAddrInfo.getShengFenMC() + externalInHospPatientAddrInfo.getShiDiQMC() + externalInHospPatientAddrInfo.getXianQuMC() + externalInHospPatientAddrInfo.getXiangZhenMC() + externalInHospPatientAddrInfo.getCunJiMC() + externalInHospPatientAddrInfo.getQiTaXX();
            patArchive.setBirthplace(bp.replace(null, ""));
        }
        patArchive.setBirthdate(externalInHospPatientInfo.getChuShengRQ());
        patArchive.setAge(externalInHospPatientInfo.getNianLing());
        patArchive.setAgeUnit(externalInHospPatientInfo.getNianLingDW());
        patArchive.setTelcode(externalInHospPatientInfo.getLianXiDH());
        if (StringUtils.isEmpty(externalInHospPatientInfo.getLianXiDH()))
            patArchive.setTelcode(externalInHospPatientInfo.getLianXiRDH());
        patArchive.setRelativetelcode(externalInHospPatientInfo.getLianXiRDH());
        patArchive.setGuid(externalInHospPatientInfo.getZuZhiJGID());
        patArchive.setOrgid(externalInHospPatientInfo.getZuZhiJGID());
@@ -584,6 +601,8 @@
            patMedInhosp.setLeavehospitaldistrictcode(externalInHospPatientInfo.getDangQianBQID());
            patMedInhosp.setHospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC());
            patMedInhosp.setLeavehospitaldistrictname(externalInHospPatientInfo.getDangQianBQMC());
            patMedInhosp.setTelcode(patArchive.getTelcode());
            patMedInhosp.setDrname("");
        }
        if (ObjectUtils.isNotEmpty(externalInHospPatientDiagnoseInfo)) {
            patMedInhosp.setIcd10code(StringUtils.isNotEmpty(patMedInhosp.getIcd10code()) ? patMedInhosp.getIcd10code() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanID() : externalInHospPatientDiagnoseInfo.getZhenDuanID());
@@ -594,7 +613,7 @@
            patMedInhosp.setPatid(patArchive.getId());
            patMedInhosp.setPatno(patArchive.getPatientno());
            patMedInhosp.setPatname(patArchive.getName());
            patMedInhosp.setDrname("");
            patMedInhosp.setSchemestatus(1L);
            patMedInhosp.setCreateTime(new Date());
        }
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskAnswerServiceImpl.java
@@ -236,6 +236,8 @@
                        }
                    }
                }
            } else {
                continue;
            }
            //将该key和value从redis中,删除
            redisCache.deleteObject(key);
@@ -246,6 +248,8 @@
            serviceSubtask.setSendstate(6L);
            serviceSubtask.setExcep(serviceSubTaskAnswerReq.getExcep());
            serviceSubtask.setFinishtime(new Date());
            serviceSubtask.setUpdateTime(new Date());
            log.error("将该key和value从redis中,serviceSubtask的值为--------:{}", serviceSubtask);
            if (score != null) serviceSubtask.setScore(BigDecimal.valueOf(score));
            serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
        }
@@ -342,7 +346,7 @@
        Map<String, Object> scriptInfoByCondition = serviceTaskService.getScriptInfoByCondition(serviceSubTaskQueryReq.getTaskid(), serviceSubTaskQueryReq.getPatid(), serviceSubTaskQueryReq.getIsFinish(), serviceSubTaskQueryReq.getPatfrom());
        if (ObjectUtils.isNotEmpty(scriptInfoByCondition) && ObjectUtils.isNotEmpty(scriptInfoByCondition.get("script"))) {
            log.error("-----------scriptInfoByCondition的值为:{}",scriptInfoByCondition);
            log.error("-----------scriptInfoByCondition的值为:{}", scriptInfoByCondition);
            if (scriptInfoByCondition.get("type").equals("1")) {
                List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOList = (List) scriptInfoByCondition.get("script");
                for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOList) {
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -1081,6 +1081,8 @@
                double score = redisCache.getCacheObject(phoneCallReqYQVO.getUuid() + "SCORE");
                serviceSubtask.setScore(BigDecimal.valueOf(score));
                serviceSubtask.setFinishtime(new Date());
                serviceSubtask.setUpdateTime(new Date());
                log.error("先更新一下分数,电话的serviceSubtask的值为:{}", serviceSubtask);
                serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
                Map<String, String> map = delRedisValue(null, id.toString());
                if (ObjectUtils.isNotEmpty(map)) redisCache.setCacheObject(map.get("cacheName"), map.get("val"));
@@ -1985,6 +1987,8 @@
            serviceSubtask.setSendstate(6L);
            serviceSubtask.setId(Long.valueOf(phoneCallRecordVO.getTaskid()));
            serviceSubtask.setFinishtime(new Date());
            serviceSubtask.setUpdateTime(new Date());
            log.error("电话拨打已完成serviceSubtask的值为:{}",serviceSubtask);
            serviceSubtaskMapper.updateServiceSubtask(serviceSubtask);
            //下载文件
            ftpService.downloadFolder("/" + LocalDate.now().toString(), profile + "/upload/vadio/voice/" + LocalDate.now().toString());
smartor/src/main/java/com/smartor/service/impl/ServiceTaskServiceImpl.java
@@ -10,6 +10,7 @@
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import com.smartor.domain.*;
import com.smartor.mapper.*;
@@ -353,7 +354,7 @@
                }
                //替换患者个人信息数据
                log.error("问题id:{},   é—®é¢˜å†…容:{}", svyLibTemplateScriptVO.getId(), svyLibTemplateScriptVO.getScriptContent());
                if (StringUtils.isNotEmpty(svyLibTemplateScriptVO.getScriptContent())) {
                if (StringUtils.isNotEmpty(svyLibTemplateScriptVO.getScriptContent()) && ObjectUtils.isNotEmpty(patArchive)) {
                    svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : ""));
                    svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : ""));
                    svyLibTemplateScriptVO.setScriptContent(svyLibTemplateScriptVO.getScriptContent().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : ""));
@@ -376,6 +377,8 @@
            serviceSubtask.setPatid(patid);
            serviceSubtask.setResult("完成");
            serviceSubtask.setFinishtime(new Date());
            serviceSubtask.setUpdateTime(new Date());
            log.error("serviceSubtask---xjInfo-的修改数据:{}", serviceSubtask);
            serviceSubtaskMapper.updateServiceSubtaskByCondition(serviceSubtask);
        }
        HeLibrary heLibrary = heLibraryMapper.selectHeLibraryById(Long.valueOf(templateId));
smartor/src/main/resources/mapper/smartor/PatMedInhospMapper.xml
@@ -59,11 +59,13 @@
        <result property="guid" column="guid"/>
        <result property="operator" column="operator"/>
        <result property="operatorId" column="operator_id"/>
        <result property="remark" column="remark"/>
    </resultMap>
    <sql id="selectPatMedInhospVo">
        select inhospid,
               patname,
               remark,
               guid,
               operator,
               operator_id,
@@ -122,6 +124,7 @@
        a.sex,
        b.guid,
        b.operator,
        b.remark,
        b.operator_id,
        b.inhospid,
        b.nurse_id,
@@ -253,6 +256,7 @@
        b.patname,
        b.operator_id,
        b.operator,
        b.remark,
        b.out_way_id,
        b.out_way_name,
        b.nurse_id,
@@ -403,6 +407,7 @@
            <if test="operator != null ">operator,</if>
            <if test="operatorId != null ">operator_id,</if>
            <if test="inhospno != null ">inhospno,</if>
            <if test="remark != null ">remark,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="serialnum != null">#{serialnum},</if>
@@ -455,6 +460,7 @@
            <if test="operator != null ">#{operator},</if>
            <if test="operatorId != null ">#{operatorId},</if>
            <if test="inhospno != null ">#{inhospno},</if>
            <if test="remark != null ">#{remark},</if>
        </trim>
    </insert>
@@ -510,6 +516,7 @@
            <if test="guid != null ">guid = #{guid},</if>
            <if test="operator != null ">operator = #{operator},</if>
            <if test="operatorId != null ">operator_id = #{operatorId},</if>
            <if test="remark != null ">remark = #{remark},</if>
        </trim>
        where inhospid = #{inhospid}
    </update>
smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -198,19 +198,39 @@
            <if test="longSendTime != null">
                AND date_format(long_send_time,'%y%m%d') &lt;= date_format(#{longSendTime},'%y%m%d')
            </if>
            <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                AND leavehospitaldistrictcode IN
                <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator=","
                         close=")">
                    #{leavehospitaldistrictcode}
                </foreach>
            <if test="deptOrDistrict==1">
                <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                    AND leavehospitaldistrictcode IN
                    <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
                             separator=","
                             close=")">
                        #{leavehospitaldistrictcode}
                    </foreach>
                </if>
                <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
                    AND deptcode IN
                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                             close=")">
                        #{leaveldeptcode}
                    </foreach>
                </if>
            </if>
            <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
                AND deptcode IN
                <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                         close=")">
                    #{leaveldeptcode}
                </foreach>
            <if test="deptOrDistrict==2">
                <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0">
                    AND leavehospitaldistrictcode IN
                    <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="("
                             separator=","
                             close=")">
                        #{leavehospitaldistrictcode}
                    </foreach>
                </if>
                <if test=" leaveldeptcodes != null and leaveldeptcodes.size()>0">
                    OR deptcode IN
                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","
                             close=")">
                        #{leaveldeptcode}
                    </foreach>
                </if>
            </if>
            <if test="senddate != null ">and senddate = #{senddate}</if>
@@ -575,8 +595,10 @@
            <if test="patfrom != null ">patfrom=#{patfrom},</if>
            <if test="taskGuid != null ">taskGuid=#{taskGuid},</if>
        </trim>
        <if test="patid != null ">and patid = #{patid}</if>
        <if test="taskid != null ">and taskid = #{taskid}</if>
        <where>
            <if test="patid != null ">and patid = #{patid}</if>
            <if test="taskid != null ">and taskid = #{taskid}</if>
        </where>
    </update>
    <update id="updateServiceSubtaskByCondition" parameterType="com.smartor.domain.ServiceSubtask">
smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -58,11 +58,13 @@
        <result property="nexttaskid" column="nexttaskid"/>
        <result property="nexttaskname" column="nexttaskname"/>
        <result property="appltype" column="appltype"/>
        <result property="patCycle" column="pat_cycle"/>
    </resultMap>
    <sql id="selectServiceTaskVo">
        select taskid,
               task_name,
               pat_cycle,
               appltype,
               send_day,
               long_task,
@@ -248,18 +250,18 @@
        service_task.orgid from service_task
        <where>
            service_task.del_flag=0
<!--            and taskid in (-->
<!--            select task_id from service_taskdept-->
<!--            <where>-->
<!--                <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">-->
<!--                    dept_code in-->
<!--                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","-->
<!--                             close=")">-->
<!--                        #{leaveldeptcode}-->
<!--                    </foreach>-->
<!--                </if>-->
<!--            </where>-->
<!--            )-->
            <!--            and taskid in (-->
            <!--            select task_id from service_taskdept-->
            <!--            <where>-->
            <!--                <if test="leaveldeptcodes != null and leaveldeptcodes.size()>0">-->
            <!--                    dept_code in-->
            <!--                    <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator=","-->
            <!--                             close=")">-->
            <!--                        #{leaveldeptcode}-->
            <!--                    </foreach>-->
            <!--                </if>-->
            <!--            </where>-->
            <!--            )-->
            <if test="taskName != null  and taskName != ''">and service_task.task_name like concat('%', #{taskName},
                '%')
            </if>
@@ -385,6 +387,7 @@
            <if test="compensateDate != null  and compensateDate != ''">compensate_date,</if>
            <if test="sendDay != null  ">send_day,</if>
            <if test="appltype != null  ">appltype,</if>
            <if test="patCycle != null  ">pat_cycle,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="taskName != null">#{taskName},</if>
@@ -438,6 +441,7 @@
            <if test="compensateDate != null  and compensateDate != ''">#{compensateDate}</if>
            <if test="sendDay != null  ">#{sendDay},</if>
            <if test="appltype != null  ">#{appltype},</if>
            <if test="patCycle != null  ">#{patCycle},</if>
        </trim>
    </insert>
@@ -497,6 +501,7 @@
            <if test="compensateDate != null  and compensateDate != ''">compensate_date = #{compensateDate}</if>
            <if test="sendDay != null  ">send_day = #{sendDay}</if>
            <if test="appltype != null  ">appltype = #{appltype}</if>
            <if test="patCycle != null  ">pat_cycle = #{patCycle}</if>
        </trim>
        where taskid = #{taskid}
    </update>