陈昶聿
8 小时以前 717abbe819892d3cded73b12772b216b48d7e357
smartor/src/main/java/com/smartor/service/impl/ServiceExternalServiceImpl.java
@@ -1,8 +1,6 @@
package com.smartor.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.json.JSON;
import cn.hutool.json.JSONUtil;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.ruoyi.common.core.domain.entity.SysDept;
@@ -10,8 +8,6 @@
import com.ruoyi.common.core.domain.entity.SysUserDept;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.base.BaseException;
import com.ruoyi.common.utils.AesUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.DtoConversionUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
@@ -21,7 +17,6 @@
import com.smartor.service.IPatMedOuthospService;
import com.smartor.service.IServiceExternalService;
import lombok.extern.slf4j.Slf4j;
import netscape.javascript.JSObject;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,8 +25,6 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
@@ -441,12 +434,6 @@
        ExternalInHospPatientInfo externalInHospPatientInfo = BeanUtil.mapToBean(BingRenXX, ExternalInHospPatientInfo.class, true);
        ExternalInDeptPatientInfo externalInDeptPatientInfo = BeanUtil.mapToBean(RuKeXX, ExternalInDeptPatientInfo.class, true);
        ExternalInDeptPatientInfo externalJZInfo = BeanUtil.mapToBean(JiuZhenXX, ExternalInDeptPatientInfo.class, true);
        if(ObjectUtils.isNotEmpty(externalJZInfo)){
            externalInHospPatientInfo.setJingGuanYSID(externalJZInfo.getJingGuanYSID());
            externalInHospPatientInfo.setJingGuanYSXM(externalJZInfo.getJingGuanYSXM());
        }
        externalInHospPatientInfo.setZeRenHSID(externalInDeptPatientInfo.getZeRenHSID());
        externalInHospPatientInfo.setZeRenHSXM(externalInDeptPatientInfo.getZeRenHSXM());
        externalInHospPatientInfo.setZhuZhiYSID(externalInDeptPatientInfo.getZhuZhiYSID());
@@ -1217,12 +1204,23 @@
                patMedOuthosp.setFuflag("1");
            }
        }
        Integer visitTimeNum = null;
        String visitTimeUnit = "天";
        for (ExternalWZInfo externalWZInfo : ExternalWZInfoList) {
            if (externalWZInfo.getWenZhenLXMC().equals("现病史")) {
                patMedOuthosp.setHpi(externalWZInfo.getNeiRong());
            }
            if (externalWZInfo.getWenZhenLXMC().equals("主诉")) {
                patMedOuthosp.setMainsuit(externalWZInfo.getNeiRong());
            }
            if (externalWZInfo.getWenZhenLXMC().equals("随访天数")) {
                String visitTimeNumStr = externalWZInfo.getNeiRong();
                if(StringUtils.isNotEmpty(visitTimeNumStr) && visitTimeNumStr.matches("^-?\\d+$")){
                    visitTimeNum = Integer.parseInt(visitTimeNumStr);
                }
            }
            if (externalWZInfo.getWenZhenLXMC().equals("随访天数单位")) {
                visitTimeUnit = externalWZInfo.getNeiRong();
            }
        }
        int i = 0;
@@ -1244,6 +1242,11 @@
            i = patMedOuthospService.insertPatMedOuthosp(patMedOuthosp);
        }
        Date adminDate = externalJZInfo.getJiuZhenRQ();
        //完成接诊 已经完成任务再次随访
        if(ObjectUtils.isNotEmpty(visitTimeNum) && ObjectUtils.isNotEmpty(adminDate)){
            patMedOuthospService.followUpAgainByPatMedOuthosp(patMedOuthosp, adminDate, visitTimeNum);
        }
        if (i > 0) {
            return true;