2 次代碼提交 c7f13d7814 ... 9d0025bbb9

作者 SHA1 備註 提交日期
  LAPTOP-KB9HII50\70708 9d0025bbb9 代码修改 3 周之前
  LAPTOP-KB9HII50\70708 8ae421b3f8 代码修改 3 周之前

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/disease/service/BaseDiseaseHospitalService.java

@ -139,7 +139,7 @@ public class BaseDiseaseHospitalService extends BaseJpaService<BaseDiseaseHospit
    //筛查患者管理
    //筛查患者管理
    public PageEnvelop surveyRecordPage(String name, String idcard, String startDate, String endDate, String mobile,
    public PageEnvelop surveyRecordPage(String name, String idcard, String startDate, String endDate, String mobile,
                                        String status, Integer page, Integer size,String dept,String diseaseCode){
                                        String status, Integer page, Integer size,String dept,String diseaseCode){
        String sql = "SELECT DISTINCT r.*,s.name diseaseName,s.dept_name deptName,d.dict_value statusName ";
        String sql = "SELECT DISTINCT r.*,s.name diseaseName,s.dept_name deptName,d.dict_value statusName,s.survey_code surveyCode  ";
        String countSql = "select count(r.id) ";
        String countSql = "select count(r.id) ";
        String filter = " FROM wlyy_survey_record r " +
        String filter = " FROM wlyy_survey_record r " +
                " inner join base_disease_survey s on r.disease_code=s.id " +
                " inner join base_disease_survey s on r.disease_code=s.id " +

+ 29 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/common/CommonItemController.java

@ -1,12 +1,18 @@
package com.yihu.jw.hospital.module.common;
package com.yihu.jw.hospital.module.common;
import com.yihu.jw.entity.third.wlyyinfo.OauthWlyyConfigDO;
import com.yihu.jw.hospital.module.door.service.DoorOrderService;
import com.yihu.jw.hospital.module.door.service.DoorOrderService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.wlyy.dao.OauthWlyyConfigDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
@ -20,6 +26,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.File;
import java.io.IOException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
/**
/**
@ -36,7 +43,29 @@ public class CommonItemController extends EnvelopRestEndpoint {
    private DoorOrderService doorOrderService;
    private DoorOrderService doorOrderService;
    @Autowired
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private OauthWlyyConfigDao oauthWlyyConfigDao;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @ApiOperation("查询字典-获取i健康通用字典接口")
    @GetMapping(value= "getIjkDictByDictName")
    public Envelop getIjkDictByDictName(
            @ApiParam(name = "name", value = "name", required = false) @RequestParam(value = "name", required = false)String name
    ){
        try {
            OauthWlyyConfigDO oauthWlyyConfigDO = oauthWlyyConfigDao.findById("getIjkDictByDictName").orElse(null);
            List<NameValuePair> params = new ArrayList<>();
            if(StringUtils.isNotBlank(name)){
                params.add(new BasicNameValuePair("name",name));
            }
            String res = httpClientUtil.get(oauthWlyyConfigDO.getUrl(), params, "UTF-8");
            return ObjEnvelop.getSuccess("查询成功",res);
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("查询失败",-1);
        }
    }
    /**
    /**
     * 这个接口没用了
     * 这个接口没用了

+ 26 - 18
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/SynchronizePatientService.java

@ -8,6 +8,7 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.patient.BasePatientDischargeRecord;
import com.yihu.jw.entity.patient.BasePatientDischargeRecord;
import com.yihu.jw.entity.specialist.RehabilitationServiceItemDO;
import com.yihu.jw.entity.specialist.RehabilitationServiceItemDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.entity.specialist.rehabilitation.*;
@ -102,7 +103,7 @@ public class SynchronizePatientService  {
        String idcard = infoDO.getIdcard();
        String idcard = infoDO.getIdcard();
        String conNo = infoDO.getConNo();//就诊次数
        String conNo = infoDO.getConNo();//就诊次数
        String visitNo = infoDO.getVisitNo();//就诊号
        String visitNo = infoDO.getVisitNo();//就诊号
        String hisPid = infoDO.getHisPid();//就诊号
        String hisPid = infoDO.getHisPid();//his居民id
        JSONArray cardList = null;
        JSONArray cardList = null;
        BasePatientDO patient = null;
        BasePatientDO patient = null;
@ -236,10 +237,10 @@ public class SynchronizePatientService  {
                WlyyOutpatientVO outpatientVO = dsyyPrescriptionService.selectOutpatientInfoByHisId(hisPid,conNo);
                WlyyOutpatientVO outpatientVO = dsyyPrescriptionService.selectOutpatientInfoByHisId(hisPid,conNo);
                dept = outpatientVO.getDept();
                dept = outpatientVO.getDept();
                deptName = outpatientVO.getDeptName();
                deptName = outpatientVO.getDeptName();
//                List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
//                if(doctorMappingDOS.size()>0){
//                    doctorIdMz = doctorMappingDOS.get(0).getDoctor();
//                }
                List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
                if(doctorMappingDOS.size()>0){
                    doctorIdMz = doctorMappingDOS.get(0).getDoctor();
                }
                doctorNameMz = outpatientVO.getDoctorName();
                doctorNameMz = outpatientVO.getDoctorName();
                mzTime = DateUtil.dateToStrLong(outpatientVO.getConDate());
                mzTime = DateUtil.dateToStrLong(outpatientVO.getConDate());
            }catch (Exception e){
            }catch (Exception e){
@ -303,11 +304,13 @@ public class SynchronizePatientService  {
        infoDO.setTemplatePlanId(planTemplateDO.getId());
        infoDO.setTemplatePlanId(planTemplateDO.getId());
        infoDO.setTemplatePlanName(planTemplateDO.getTitle());
        infoDO.setTemplatePlanName(planTemplateDO.getTitle());
        if("1".equals(eventType)){
        if("1".equals(eventType)){
            doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
            if(StringUtils.isBlank(doctorIdMz)){
            if(StringUtils.isBlank(doctorIdMz)){
                infoDO.setStatus(4);
                rehabilitationPatientInfoDao.save(infoDO);
                return "医生信息查询不到";
                doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
                if(StringUtils.isBlank(doctorIdMz)){
                    infoDO.setStatus(4);
                    rehabilitationPatientInfoDao.save(infoDO);
                    return "医生信息查询不到";
                }
            }
            }
        }else {
        }else {
            doctorIdZy = findDoctorByName(doctorNameZy,planTemplateDO.getDepts());
            doctorIdZy = findDoctorByName(doctorNameZy,planTemplateDO.getDepts());
@ -445,6 +448,7 @@ public class SynchronizePatientService  {
        if (StringUtils.isBlank(type)){//为空
        if (StringUtils.isBlank(type)){//为空
            results.append("未分配居民下转type:"+type+"\n");
            results.append("未分配居民下转type:"+type+"\n");
            sql = " select * from base_patient_discharge_record where status is null and create_time>'"+preTimeStr+"'  order by create_time limit 30";
            sql = " select * from base_patient_discharge_record where status is null and create_time>'"+preTimeStr+"'  order by create_time limit 30";
//            sql = " select * from base_patient_discharge_record where status is null and create_time>'2025-07-01' order by create_time limit 100";
        }else{
        }else{
            results.append("指定状态居民下转type:"+type+"\n");
            results.append("指定状态居民下转type:"+type+"\n");
            sql = " select * from base_patient_discharge_record where status='"+type+"' and create_time>'"+preTimeStr+"'  order by create_time limit 30";
            sql = " select * from base_patient_discharge_record where status='"+type+"' and create_time>'"+preTimeStr+"'  order by create_time limit 30";
@ -500,6 +504,7 @@ public class SynchronizePatientService  {
                infoDO.setConNo(conNo);
                infoDO.setConNo(conNo);
                infoDO.setVisitNo(visitNo);
                infoDO.setVisitNo(visitNo);
                infoDO.setSignStatus(0);
                infoDO.setSignStatus(0);
                infoDO.setCrzq(DateUtil.dateToStrLong(re.getCreateTime()));
                infoDO.setDischargeRecordId(re.getId());
                infoDO.setDischargeRecordId(re.getId());
                rehabilitationPatientInfoDao.save(infoDO);
                rehabilitationPatientInfoDao.save(infoDO);
                re.setStatus("1");
                re.setStatus("1");
@ -511,7 +516,7 @@ public class SynchronizePatientService  {
                basePatientDischargeRecordDao.save(re);
                basePatientDischargeRecordDao.save(re);
                continue;
                continue;
            }
            }
            String turnDate = DateUtil.dateToStrShort(re.getCreateTime());//下转日期
            BasePatientDO patient = null;
            BasePatientDO patient = null;
            List<BasePatientDO> patientList = patientDao.getPatientByIdcard(re.getIdcard());//获取患者信息
            List<BasePatientDO> patientList = patientDao.getPatientByIdcard(re.getIdcard());//获取患者信息
            JSONArray cardList = dsyyPrescriptionService.findCardNo(idcard);
            JSONArray cardList = dsyyPrescriptionService.findCardNo(idcard);
@ -560,6 +565,7 @@ public class SynchronizePatientService  {
                        String mzbl = dsyyPrescriptionService.selectReportInfo("JHIDS-USD-HLWMZBL-014",SICK_ID,conNo,1,1);
                        String mzbl = dsyyPrescriptionService.selectReportInfo("JHIDS-USD-HLWMZBL-014",SICK_ID,conNo,1,1);
                        if(StringUtils.isNotBlank(mzbl)&&!"[]".equals(mzbl)){
                        if(StringUtils.isNotBlank(mzbl)&&!"[]".equals(mzbl)){
                            jaMzbl = JSONArray.parseArray(mzbl).getJSONObject(0);
                            jaMzbl = JSONArray.parseArray(mzbl).getJSONObject(0);
                            //判断门诊病历是否下转当天的数据
                            eventType = "1";
                            eventType = "1";
                            hisPid = SICK_ID;
                            hisPid = SICK_ID;
                            ssc = CARD_NO;
                            ssc = CARD_NO;
@ -634,10 +640,10 @@ public class SynchronizePatientService  {
                    WlyyOutpatientVO outpatientVO = dsyyPrescriptionService.selectOutpatientInfoByHisId(hisPid,conNo);
                    WlyyOutpatientVO outpatientVO = dsyyPrescriptionService.selectOutpatientInfoByHisId(hisPid,conNo);
                    dept = outpatientVO.getDept();
                    dept = outpatientVO.getDept();
                    deptName = outpatientVO.getDeptName();
                    deptName = outpatientVO.getDeptName();
//                    List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
//                    if(doctorMappingDOS.size()>0){
//                        doctorIdMz = doctorMappingDOS.get(0).getDoctor();
//                    }
                    List<DoctorMappingDO> doctorMappingDOS = doctorMappingDao.findByMappingCode(outpatientVO.getDoctor());
                    if(doctorMappingDOS.size()>0){
                        doctorIdMz = doctorMappingDOS.get(0).getDoctor();
                    }
                    doctorNameMz = outpatientVO.getDoctorName();
                    doctorNameMz = outpatientVO.getDoctorName();
                    mzTime = DateUtil.dateToStrLong(outpatientVO.getConDate());
                    mzTime = DateUtil.dateToStrLong(outpatientVO.getConDate());
                }catch (Exception e){
                }catch (Exception e){
@ -699,11 +705,13 @@ public class SynchronizePatientService  {
            infoDO.setTemplatePlanId(planTemplateDO.getId());
            infoDO.setTemplatePlanId(planTemplateDO.getId());
            infoDO.setTemplatePlanName(planTemplateDO.getTitle());
            infoDO.setTemplatePlanName(planTemplateDO.getTitle());
            if("1".equals(eventType)){
            if("1".equals(eventType)){
                doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
                if(StringUtils.isBlank(doctorIdMz)){
                if(StringUtils.isBlank(doctorIdMz)){
                    infoDO.setStatus(4);
                    rehabilitationPatientInfoDao.save(infoDO);
                    continue;
                    doctorIdMz = findDoctorByName(doctorNameMz,planTemplateDO.getDepts());
                    if(StringUtils.isBlank(doctorIdMz)){
                        infoDO.setStatus(4);
                        rehabilitationPatientInfoDao.save(infoDO);
                        continue;
                    }
                }
                }
            }else {
            }else {
                doctorIdZy = findDoctorByName(doctorNameZy,planTemplateDO.getDepts());
                doctorIdZy = findDoctorByName(doctorNameZy,planTemplateDO.getDepts());