diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java index fcedfac..2459511 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java @@ -52,6 +52,8 @@ public class MatDeliverFacade { private PersonService personService; @Autowired private UsersService usersService; + @Autowired + private StopPregnancyService stopPregnancyService; private static Map ONE_ENUMS = new HashMap<>(); @@ -230,7 +232,7 @@ public class MatDeliverFacade { List patientsList = patientsService.queryPatient(patientsQuery); for (Patients patients : patientsList) { //判断分娩日期是否大于24孕周 - if (fmDate.getTime()>=DateUtil.addDay(patients.getLastMenses(), 168).getTime()) { + if (fmDate.getTime() >= DateUtil.addDay(patients.getLastMenses(), 168).getTime()) { patients.setFmDate(fmDate); patients.setType(3); patientsService.updatePatient(patients); @@ -438,15 +440,15 @@ public class MatDeliverFacade { return new BaseResponse().setErrormsg("没有相关的产妇记录").setErrorcode(ErrorCodeConstants.BUSINESS_ERROR); }*/ //外院的孕妇 - Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false,null); + Patients patients1 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 1, false, null); //外院的产妇 // Patients patients2 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, null, 3); //http://jira.healthbaby.com.cn/browse/WEB-204 修改bug //本院的孕妇 - Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 1, false,null); + Patients patients = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 1, false, null); //本院产妇 - Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 3, false,null); + Patients patients3 = antenatalExaminationFacade.findOnePatient(deliverQueryRequest.getCardNo(), deliverQueryRequest.getVcCardNo(), null, hospital, 3, false, null); //本院产妇,并且本院没建档需要提醒补录记录 if (null != patients3 && null == patients) { patients = patients3; @@ -462,7 +464,7 @@ public class MatDeliverFacade { if (days < 168 && patients.getFmDate() == null) { return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR1).setErrormsg("当前孕妇的孕周小于24孕周,不能进行分娩"); } - if(null!=patients.getDueStatus() && 1 == patients.getDueStatus()){ + if (null != patients.getDueStatus() && 1 == patients.getDueStatus()) { return new BaseResponse().setErrorcode(ErrorCodeConstants.BUSINESS_ERROR).setErrormsg(" 该孕妇在系统中已终止妊娠不能再进行分娩,请重新建档"); } @@ -471,8 +473,7 @@ public class MatDeliverFacade { matDeliverQuery.setYn(YnEnums.YES.getId()); List list = matDeliverService.query(matDeliverQuery); MatDeliverListResult matDeliverListResult = new MatDeliverListResult(); - matDeliverListResult.convertToResult(list, patients); - + matDeliverListResult.convertToResult(patients); if (CollectionUtils.isNotEmpty(list)) { List list12 = new ArrayList<>(); @@ -500,6 +501,14 @@ public class MatDeliverFacade { } }); matDeliverListResult.setData(list12); + } else { + StopPregQuery stopPregQuery = new StopPregQuery(); + stopPregQuery.setYn(YnEnums.YES.getId()); + stopPregQuery.setPatientId(patients.getId()); + List list2 = stopPregnancyService.queryStopPreg(stopPregQuery); + if (CollectionUtils.isEmpty(list2)) { + matDeliverListResult.setDueType("1"); + } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatDeliverListResult.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatDeliverListResult.java index e9e88f2..97f1961 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatDeliverListResult.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/MatDeliverListResult.java @@ -84,7 +84,7 @@ public class MatDeliverListResult { this.tireNumber1 = tireNumber1; } - public MatDeliverListResult convertToResult(List destList, Patients patients) { + public MatDeliverListResult convertToResult(Patients patients) { setId(patients.getId()); try { if (null != patients.getBirth()) { @@ -98,9 +98,9 @@ public class MatDeliverListResult { if (null != patients.getDueDate()) { setyChanQi(DateUtil.getyyyy_MM_dd(patients.getDueDate())); } - if (null != patients.getBuildType()) { + /* if (null != patients.getBuildType()) { setDueType(2 == patients.getBuildType() ? "1" : "0"); - } + }*/ setIsGravida(patients.getType()==3?"0":"1"); setName(patients.getUsername()); setPhone(patients.getPhone());