From 5f7fb4961842c776046d4f1dd4d2488ffa513bb9 Mon Sep 17 00:00:00 2001 From: zhangchao Date: Sat, 11 May 2024 10:41:19 +0800 Subject: [PATCH] =?UTF-8?q?#fix:=E4=BC=98=E5=8C=96=E5=8D=B1=E6=80=A5?= =?UTF-8?q?=E5=80=BC=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E3=80=81=E6=96=B0=E5=A2=9E=E5=BB=BA=E6=A1=A3=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../permission/service/impl/LisServiceImpl.java | 186 +++++++++++++++++- .../operate/web/facade/BookbuildingFacade.java | 213 +++++++++++++++------ .../resources/spring/applicationContext-quartz.xml | 18 ++ 3 files changed, 347 insertions(+), 70 deletions(-) diff --git a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java index d4c65b1..c5ff35f 100644 --- a/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java +++ b/platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/LisServiceImpl.java @@ -1,8 +1,14 @@ package com.lyms.platform.permission.service.impl; +import com.lyms.platform.biz.dal.AssayConfigDao; +import com.lyms.platform.biz.param.ReferConfigQuery; import com.lyms.platform.biz.service.AntenatalExaminationService; +import com.lyms.platform.biz.service.LisCrisisItemService; import com.lyms.platform.biz.service.PatientsService; +import com.lyms.platform.biz.service.ReferConfigService; import com.lyms.platform.common.constants.ErrorCodeConstants; +import com.lyms.platform.common.dao.operator.MongoCondition; +import com.lyms.platform.common.dao.operator.MongoOper; import com.lyms.platform.common.enums.YnEnums; import com.lyms.platform.common.result.BaseResponse; import com.lyms.platform.common.utils.DateUtil; @@ -14,12 +20,10 @@ import com.lyms.platform.permission.model.LisReportModel; import com.lyms.platform.permission.model.LisReportQuery; import com.lyms.platform.permission.service.LisService; import com.lyms.platform.permission.service.OrganizationService; -import com.lyms.platform.pojo.AntExChuModel; -import com.lyms.platform.pojo.AntenatalExaminationModel; -import com.lyms.platform.pojo.BasicConfig; -import com.lyms.platform.pojo.Patients; +import com.lyms.platform.pojo.*; import com.lyms.platform.query.AntExChuQuery; import com.lyms.platform.query.AntExQuery; +import com.lyms.platform.query.LisCrisisItemQuery; import com.lyms.platform.query.PatientsQuery; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -28,11 +32,12 @@ import org.apache.commons.lang.StringUtils; import org.codehaus.jackson.type.TypeReference; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.data.domain.Sort; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.stereotype.Service; -import java.util.ArrayList; -import java.util.List; +import java.math.BigDecimal; +import java.util.*; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; @@ -154,8 +159,12 @@ public class LisServiceImpl implements LisService { List lisReportModels = masterLisMapper.queryLisDataByModel(lisReportQuery); saveLisUpdateData(lisReportModels.get(0)); - + //TODO 处理大同危急值逻辑 + if ("2100002419".equals(model.getHospitalId())){ + saveLisCrisisItemList(model); + } } catch (Exception e) { + System.out.println("LisSaveTask ->Exception,"+e); continue; } @@ -166,6 +175,167 @@ public class LisServiceImpl implements LisService { } } + @Autowired + private ReferConfigService referConfigService; + + @Autowired + private LisCrisisItemService lisCrisisItemService; + /** + * 根据Lis数据同步大同高危急值 + * @param model + */ + public void saveLisCrisisItemList(LisReportModel model){ + System.out.println("saveLisCrisisItemList startup"); + //1获取孕妇pid + String hospitalId=model.getHospitalId(); + Patients patients = null; + List list= null; + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setHospitalId(hospitalId); + patientsQuery.setName(model.getName()); + patientsQuery.setSort("created"); + patientsQuery.setVcCardNo(model.getVcCardNo()); + list = patientsService.queryPatient(patientsQuery); + if (list != null && list.size() > 0) { + patients = list.get(list.size() - 1); + } else { + patientsQuery.setPhone(model.getPhone()); + patientsQuery.setVcCardNo(null); + list = patientsService.queryPatient(patientsQuery); + if(list != null && list.size() > 0){ + patients = list.get(list.size() - 1); + } + + } + if(patients == null){ + System.out.println("lis query patients null"); + return; + } + + + LisCrisisItem crisisItem = new LisCrisisItem(); + crisisItem.setPid(patients.getPid()); + crisisItem.setPatientId(patients.getId()); + crisisItem.setPhone(patients.getPhone()); + crisisItem.setCardNo(patients.getCardNo()); + crisisItem.setPatientName(patients.getUsername()); + crisisItem.setServiceType(patients.getServiceType()); + crisisItem.setServiceStatus(patients.getServiceStatus()); + crisisItem.setLastMenses(patients.getLastMenses()); + crisisItem.setWeek(DateUtil.getWeek(patients.getLastMenses(), model.getPublishTime())); + crisisItem.setPublishTime(model.getPublishTime()); + try { + crisisItem.setAge(Integer.valueOf(model.getAge())); + }catch (Exception e){ + System.out.println("saveLisCrisisItemList->Exception e,"+e); + } + + // crisisItem.setApplyDoctorCode(model.getApplyDoctorCode()); + crisisItem.setApplyDoctorName(model.getApplyDoctor()); + crisisItem.setHospitalId(hospitalId); + crisisItem.setStatus(1); + crisisItem.setStatusName("待处理"); + crisisItem.setSyncStatus(0); + if (StringUtils.isNotEmpty(model.getItemJson())){ + ReferConfigQuery referConfigQuery = new ReferConfigQuery(); + referConfigQuery.setYn(YnEnums.YES.getId()); + referConfigQuery.setHospitalId(Integer.valueOf(hospitalId)); + referConfigQuery.setLimit(50); + List referValueList = referConfigService.queryRefer(referConfigQuery); + Map referValueMap = new HashMap<>(); + for (ReferValue referValue : referValueList) { + referValueMap.put(referValue.getCode(), referValue); + } + + List itemList= JsonUtil.jsonToList(model.getItemJson(),LisReportItemModel.class); + // crisis init + for (LisReportItemModel item : itemList) { + + ReferValue referValue = referValueMap.get(item.getCode().trim()); + if (referValue != null) { + //TODO 处理危急值逻辑 + boolean flag=buildEmergency(item.getResult(),referValue); + System.out.println("saveLisCrisisItemList flag"+flag); + if (flag) { + crisisItem.setId(model.getLisId() + "_" + item.getCode()); + crisisItem.setName(model.getType()); + crisisItem.setClassify(model.getType()); + crisisItem.setClassifyName(model.getType()); + crisisItem.setResult(item.getResult()); + //crisisItem.setFlag(item.getFlag()); + crisisItem.setItemCode(item.getCode().trim()); + crisisItem.setItemName(item.getName().trim()); + crisisItem.setRef(buildRef(referValue)); + crisisItem.setUnit(item.getUnit()); + lisCrisisItemService.addLisCrisisItem(crisisItem); + + //当前孕妇关联的初诊复诊医生危急通知 + /* Set sets = antenatalExaminationFacade.getCrisisUnionDoc(patients); + + if (CollectionUtils.isNotEmpty(sets)) { + for (String doctorId : sets) { + LisCrisisNotify notify = new LisCrisisNotify(); + notify.setHospitalId(patients.getHospitalId()); + notify.setPatientId(patients.getId()); + notify.setStatus(0); + notify.setYn(1); + notify.setModified(new Date()); + notify.setCreated(new Date()); + notify.setDoctorId(doctorId); + + lisCrisisNotifyService.addLisCrisisNotify(notify); + } + }*/ + + + } + } + + } + System.out.println("saveLisCrisisItemList end"); + } + + } + + private boolean buildEmergency(String result,ReferValue referValue) { + boolean b=false; + if (StringUtils.isEmpty(result)){ + return b; + } + BigDecimal bd=new BigDecimal(result); + if (StringUtils.isNotBlank(referValue.getEmergencyMin()) && StringUtils.isNotBlank(referValue.getEmergencyMax())) { + if (bd.compareTo(new BigDecimal(referValue.getEmergencyMin()))<0 || + bd.compareTo(new BigDecimal((referValue.getEmergencyMax())))>0 ){ + b=true; + } + } else { + if (StringUtils.isNotBlank(referValue.getEmergencyMin())) { + if (bd.compareTo(new BigDecimal(referValue.getEmergencyMin()))<0){ + b=true; + } + } else if (StringUtils.isNotBlank(referValue.getEmergencyMax())) { + if (bd.compareTo(new BigDecimal(referValue.getEmergencyMax()))>0){ + b=true; + } + } + } + return b; + } + + + + private String buildRef(ReferValue referValue) { + if (StringUtils.isNotBlank(referValue.getEmergencyMin()) && StringUtils.isNotBlank(referValue.getEmergencyMax())) { + return "<"+referValue.getEmergencyMin() + " || " + ">"+referValue.getEmergencyMax(); + } else { + if (StringUtils.isNotBlank(referValue.getEmergencyMin())) { + return "<" + referValue.getEmergencyMin(); + } else if (StringUtils.isNotBlank(referValue.getEmergencyMax())) { + return ">" + referValue.getEmergencyMax(); + } + } + return ""; + } /** * 根据孕妇,修改检查项为空,检查项结果 @@ -195,7 +365,7 @@ public class LisServiceImpl implements LisService { } if(patients == null){ - System.out.println("lis query patients nulll"); + System.out.println("lis query patients null"); return; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java index 41f5a9b..f6e9f0b 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java @@ -1198,7 +1198,7 @@ public class BookbuildingFacade { mr.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date())); mr.setWxTempId(WxTempleteIdEnums.CHAN_JIAN_TI_XING.getId()); messages.add(mr); - // smsConfigFacade.saveMsg(messages, patient.getHospitalId()); + smsConfigFacade.saveMsg(messages, patient.getHospitalId()); } catch (InterruptedException e) { logger.error("sendbuildingMsg Exception " + e); } @@ -1268,12 +1268,101 @@ public class BookbuildingFacade { } /** + * 建档短信提醒 + */ + public void bookbuildingSyncMsg() { + logger.info("bookbuildingMsg startup"); + List hospitalList = new ArrayList<>(); + hospitalList.add("2100002419"); + hospitalList.add("1000000016"); + hospitalList.add("2100002421"); + hospitalList.add("1000000115"); + hospitalList.add("2100001296"); + hospitalList.add("2100001306"); + + PatientsQuery patientsQuery = new PatientsQuery(); + patientsQuery.setHospitalList(hospitalList); + patientsQuery.setExtEnable(false); + patientsQuery.setBuildTypeNot(1); + patientsQuery.setYn(YnEnums.YES.getId()); + String time = DateUtil.getyyyy_MM_dd(DateUtil.addDay(new Date(), -1)); + Date createdTimeStart = DateUtil.parseYMDHMS(time + " 00:00:00"); + Date createdTimeEnd = DateUtil.parseYMDHMS(time + " 23:59:59"); + patientsQuery.setCreatedTimeStart(createdTimeStart); + patientsQuery.setCreatedTimeEnd(createdTimeEnd); + final List patientList = patientsService.queryPatient(patientsQuery); + + if (CollectionUtils.isNotEmpty(patientList)) { + final String date= DateUtil.getyyyy_MM_dd(DateUtil.addDay(new Date(),0)); + final String planTime = date+ " 16:30:00"; + commonThreadPool.execute(new Runnable() { + @Override + public void run() { + for (Patients patients : patientList) { + //TODO 处理建档短信提醒逻辑 + List messages = new ArrayList<>(); + final String hospitalId=patients.getHospitalId(); + String title = "建档成功提醒短信"; + String messageContent = "【" + getHospitalName(hospitalId) + "】" + "您已成功建档!请微信-添加朋友-公众号-搜索“美生孕育”关注;点击开通成功提醒,手机号获取验证码成功登录宝贝孕程小程序。请您经常登录【宝贝孕程】小程序并持续关注【美生孕育】公众号,以便于您享受孕期的私有化服务,会依据您的年龄、孕周、单双胎、高危风险因素给予专题文章、个性指导、产检提醒等,让您了解、掌握和促进健康孕育,让我们携手并进一起迎接小宝宝的降生。"; + MsgRequest request = new MsgRequest(); + //1 推送服务, 2 推送和短信服务,3短信服务 + request.setServiceType(3); + //短信发送状态 + request.setSmsStatus(SmsStatusEnums.WFS.getId()); + //平台ID + request.setTypeId(ProjectTypeEnums.YNXT.getId()); + //服务对象 1孕妇 2儿童 3产妇 + request.setObjType(1); + request.setPhone(patients.getPhone()); + request.setPlanTime(planTime); + request.setSubTypeId(SmsServiceEnums.DXFW.getId()); + request.setStatus(MsgStatusEnums.NO_SEND.getId()); + request.setTimeType(2); + request.setHospitalId(hospitalId); + request.setPatientId(patients.getId()); + request.setTempId(patients.getId()); + request.setCreated(DateUtil.getyyyy_MM_dd_hms(new Date())); + request.setFirst(messageContent); + request.setKeyword1(title); + request.setKeyword2(date); + messages.add(request); + smsConfigFacade.saveMsg(messages, hospitalId); + } + } + }); + } + logger.info("bookbuildingMsg end"); + } + + private static String getHospitalName(String hospitalId){ + //TODO 暂时这样处理后期优化 + if ("2100002419".equals(hospitalId)){ + return "大同市第一人民医院"; + }else if ("1000000016".equals(hospitalId)){ + return "秦皇岛市第二医院"; + }else if ("2100002421".equals(hospitalId)){ + return "邢台威县人民医院"; + }else if ("1000000115".equals(hospitalId)){ + return "南和区人民医院"; + }else if("2100001296".equals(hospitalId)){ + return "临城县人民医院"; + }else if("2100001306".equals(hospitalId)){ + return "临西县人民医院"; + } + return ""; + } + + public static void main(String[] args) { + System.out.println( DateUtil.getyyyy_MM_dd(DateUtil.addDay(new Date(),0))+ " 16:30:00"); + } + + /** * 秦皇岛二院、大同产检提醒 上午9点推送 */ public void weekSync() { logger.info("weekSync startup"); - // final String hospitalId = "1000000016"; - List hospitalList=new ArrayList<>(); + // final String hospitalId = "1000000016"; + List hospitalList = new ArrayList<>(); hospitalList.add("2100002419"); hospitalList.add("1000000016"); PatientsQuery patientsQuery = new PatientsQuery(); @@ -1298,7 +1387,7 @@ public class BookbuildingFacade { if (StringUtils.isNotEmpty(week)) { sendbuildingMsg(patients, SmsServiceEnums.CJYYTX.getId(), "【产检提醒】", "亲爱的孕妈妈,您当前孕周为" + params.get("weekDay") + "。", week); - if ((CollectionUtils.isNotEmpty(patients.getRiskFactorId()) && patients.getRiskFactorId().size()>1 ) ||(!patients.getRiskFactorId().get(0).equals("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) ) { + if ((CollectionUtils.isNotEmpty(patients.getRiskFactorId()) && patients.getRiskFactorId().size() > 1) || (!patients.getRiskFactorId().get(0).equals("d42eec03-aa86-45b8-a4e0-78a0ff365fb6"))) { FactorProjectQuery factorProjectQuery = new FactorProjectQuery(); factorProjectQuery.setHospitalId(Integer.valueOf(patients.getHospitalId())); factorProjectQuery.setWeek(week); @@ -3975,22 +4064,22 @@ public class BookbuildingFacade { antExChuQuery.setParentId(patient.getId()); antExChuQuery.setYn(1); List antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); - AntExChuModel antExChuModel; - boolean a=false; - if (CollectionUtils.isNotEmpty(antExChuModelList)){ + AntExChuModel antExChuModel; + boolean a = false; + if (CollectionUtils.isNotEmpty(antExChuModelList)) { antExChuModel = antExChuModelList.get(0); - a=true; - }else { + a = true; + } else { antExChuModel = new AntExChuModel(); } List antExRecordModels = antExRecordService.queryAntExRecords(antExRecordQuery); AntExRecordModel antExRecordModel; - boolean r=false; - if (CollectionUtils.isNotEmpty(antExRecordModels)){ - antExRecordModel = antExRecordModels.get(0); - r=true; - }else { - antExRecordModel=new AntExRecordModel(); + boolean r = false; + if (CollectionUtils.isNotEmpty(antExRecordModels)) { + antExRecordModel = antExRecordModels.get(0); + r = true; + } else { + antExRecordModel = new AntExRecordModel(); } String riskFactor = map.get("name"); @@ -4045,9 +4134,9 @@ public class BookbuildingFacade { } } yunBookbuildingService.update(patient, patient.getId()); - if (a){ - antenatalExaminationService.updateAntExChu(antExChuModel,antExChuModel.getId()); - }else { + if (a) { + antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId()); + } else { antExChuModel.setParentId(patient.getId()); antExChuModel.setName(patient.getUsername()); antExChuModel.setYn(YnEnums.YES.getId()); @@ -4063,9 +4152,9 @@ public class BookbuildingFacade { //初诊是添加追访记录 addTrackDownInfo(patient.getOperator(), patient); } - if (r){ - antExRecordService.updateOne(antExRecordModel,antExRecordModel.getId()); - }else { + if (r) { + antExRecordService.updateOne(antExRecordModel, antExRecordModel.getId()); + } else { antExRecordModel.setHospitalId(antExChuModel.getHospitalId()); antExRecordModel.setLastMenses(antExChuModel.getLastMenses()); antExRecordModel.setName(antExChuModel.getName()); @@ -4091,12 +4180,12 @@ public class BookbuildingFacade { } }); } - }catch (Exception e){ - logger.error("testUpdateBatch2 Exception,"+e); + } catch (Exception e) { + logger.error("testUpdateBatch2 Exception," + e); } } - public void updateBatch(String name){ + public void updateBatch(String name) { try { final List> list = ExcelUtil.readExcl("E:\\建档数据同步\\" + name, 1);// for (final Map map : list) { @@ -4125,7 +4214,7 @@ public class BookbuildingFacade { if (patients.size()>1){ System.out.println(map.get("cardNo")); }*/ - Patients patient=patients.get(0); + Patients patient = patients.get(0); patient.setLastMenses(DateUtil.parseYMD(map.get("lastMenses"))); if (CollectionUtils.isNotEmpty(users)) { patient.setOperator(users.get(0).getId()); @@ -4150,27 +4239,27 @@ public class BookbuildingFacade { } - PersonModel resperson = null; - PersonModelQuery personModelQuery = new PersonModelQuery(); - personModelQuery.setCardNo(map.get("cardNo")); - personModelQuery.setYn(YnEnums.YES.getId()); - personModelQuery.setTypes(new Integer[]{1, 3}); //孕妇或者产妇基本信息 - List personModels = personService.queryPersons(personModelQuery); - - PersonModel pmodel = new PersonModel(); - pmodel.setName(map.get("username").trim()); - pmodel.setPhone(map.get("phone")); - pmodel.setCardNo(map.get("cardNo")); - pmodel.setType(type); - pmodel.setModified(new Date()); - if (CollectionUtils.isNotEmpty(personModels) && personModels.get(0) != null) { - resperson = personModels.get(0); - personService.updatePerson(pmodel, personModels.get(0).getId()); - } else { - pmodel.setYn(YnEnums.YES.getId()); - pmodel.setCreated(new Date()); - resperson = personService.addPerson(pmodel); - } + PersonModel resperson = null; + PersonModelQuery personModelQuery = new PersonModelQuery(); + personModelQuery.setCardNo(map.get("cardNo")); + personModelQuery.setYn(YnEnums.YES.getId()); + personModelQuery.setTypes(new Integer[]{1, 3}); //孕妇或者产妇基本信息 + List personModels = personService.queryPersons(personModelQuery); + + PersonModel pmodel = new PersonModel(); + pmodel.setName(map.get("username").trim()); + pmodel.setPhone(map.get("phone")); + pmodel.setCardNo(map.get("cardNo")); + pmodel.setType(type); + pmodel.setModified(new Date()); + if (CollectionUtils.isNotEmpty(personModels) && personModels.get(0) != null) { + resperson = personModels.get(0); + personService.updatePerson(pmodel, personModels.get(0).getId()); + } else { + pmodel.setYn(YnEnums.YES.getId()); + pmodel.setCreated(new Date()); + resperson = personService.addPerson(pmodel); + } patient.setYn(1); patient.setUsername(map.get("username")); patient.setCardNo(map.get("cardNo")); @@ -4221,9 +4310,9 @@ public class BookbuildingFacade { getTrackHospital(patient); //孕妇档案 - yunBookbuildingService.update(patient,patient.getId()); - }else { - Patients patient=new Patients(); + yunBookbuildingService.update(patient, patient.getId()); + } else { + Patients patient = new Patients(); patient.setLastMenses(DateUtil.parseYMD(map.get("lastMenses"))); if (CollectionUtils.isNotEmpty(users)) { patient.setOperator(users.get(0).getId()); @@ -4627,7 +4716,7 @@ public class BookbuildingFacade { try { patientServiceFacade.addPatientService(patientService, patient.getOperator(), "2100001504"); } catch (Exception e) { - System.out.println("孕妇建档服务开通异常!"+patient.toString()); + System.out.println("孕妇建档服务开通异常!" + patient.toString()); e.printStackTrace(); } } @@ -4832,7 +4921,7 @@ public class BookbuildingFacade { patient.setLastReportDoctorName(users.get(0).getName()); } } - patient.setLastMenses(DateUtil.getCurrentDueDate(map.get("currentDueDate"),map.get("checkDate"))); + patient.setLastMenses(DateUtil.getCurrentDueDate(map.get("currentDueDate"), map.get("checkDate"))); Integer type = 1; //1孕妇 2儿童 3产妇 //建档类型 0 未分娩建档 1儿童建档时建档 2 自动分娩类型 3 转诊自动建档 Integer buildType = 0; @@ -4948,7 +5037,7 @@ public class BookbuildingFacade { patient.setNextCheckTime(DateUtil.parseYMD(map.get("nextCheckTime"))); if (patient.getDueDate() != null) { } else { - patient.setDueDate(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.getCurrentDueDate(map.get("currentDueDate"),map.get("bookbuildingDate")), 42 * 7)))); + patient.setDueDate(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.getCurrentDueDate(map.get("currentDueDate"), map.get("bookbuildingDate")), 42 * 7)))); } OrganizationQuery organizationQuery = new OrganizationQuery(); organizationQuery.setYn(YnEnums.YES.getId()); @@ -5133,7 +5222,7 @@ public class BookbuildingFacade { patient.setLastReportDoctorName(users.get(0).getName()); } } - patient.setLastMenses(DateUtil.getCurrentDueDate(map.get("currentDueDate"),map.get("checkDate"))); + patient.setLastMenses(DateUtil.getCurrentDueDate(map.get("currentDueDate"), map.get("checkDate"))); Integer type = 1; //1孕妇 2儿童 3产妇 //建档类型 0 未分娩建档 1儿童建档时建档 2 自动分娩类型 3 转诊自动建档 Integer buildType = 0; @@ -5248,7 +5337,7 @@ public class BookbuildingFacade { patient.setNextCheckTime(DateUtil.parseYMD(map.get("nextCheckTime"))); if (patient.getDueDate() != null) { } else { - patient.setDueDate(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.getCurrentDueDate(map.get("currentDueDate"),map.get("checkDate")), 42 * 7)))); + patient.setDueDate(DateUtil.parseYMD(DateUtil.getyyyy_MM_dd(DateUtil.addDay(DateUtil.getCurrentDueDate(map.get("currentDueDate"), map.get("checkDate")), 42 * 7)))); } OrganizationQuery organizationQuery = new OrganizationQuery(); organizationQuery.setYn(YnEnums.YES.getId()); @@ -5265,10 +5354,10 @@ public class BookbuildingFacade { patient.setBookbuildingDoctor(String.valueOf(users.get(0).getId())); } } - // yunBookbuildingService.update(patient,patient.getId()); + // yunBookbuildingService.update(patient,patient.getId()); } - boolean a=false; + boolean a = false; antExRecordQuery.setType(1); AntExChuQuery antExChuQuery = new AntExChuQuery(); antExChuQuery.setParentId(patient.getId()); @@ -5280,7 +5369,7 @@ public class BookbuildingFacade { antExRecordModel = antExRecordModels.get(0); List antExChuModelList = antenatalExaminationService.queryAntExChu(antExChuQuery); antExChuModel = antExChuModelList.get(0); - a=true; + a = true; } else { antExRecordModel = new AntExRecordModel(); antExChuModel = new AntExChuModel(); @@ -5365,10 +5454,10 @@ public class BookbuildingFacade { antExRecordModel.setStatus(antExRecordModel.getDueDate().compareTo(new Date()) > 0 ? 2 : 1); antExRecordModel.setDueStatus(antExRecordModel.getStatus()); } - if (a){ - antExRecordService.updateOne(antExRecordModel,antExRecordModel.getId()); - antenatalExaminationService.updateAntExChu(antExChuModel,antExChuModel.getId()); - }else { + if (a) { + antExRecordService.updateOne(antExRecordModel, antExRecordModel.getId()); + antenatalExaminationService.updateAntExChu(antExChuModel, antExChuModel.getId()); + } else { antExRecordService.addOneRecord(antExRecordModel); antenatalExaminationService.addOneAntEx(antExChuModel); //初诊是添加追访记录 @@ -5377,7 +5466,7 @@ public class BookbuildingFacade { } if (num > 1) { - if (num==2){ + if (num == 2) { antExRecordQuery.setType(2); List antExRecordModels = antExRecordService.queryAntExRecords(antExRecordQuery); if (CollectionUtils.isNotEmpty(antExRecordModels)) { diff --git a/platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml b/platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml index 4659dbd..fecfabf 100644 --- a/platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml +++ b/platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml @@ -704,6 +704,22 @@ + + + + + + + + + + + + + + + + @@ -773,6 +789,8 @@ + + -- 1.8.3.1