diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java b/platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java index 556ec17..656d828 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/PatientCheckTicket.java @@ -19,7 +19,7 @@ public class PatientCheckTicket extends BaseModel { private String hospitalId; private String pid; private String consumeHospitalId; - private Integer status; // 1:创建未使用, 2:产检使用,3:分娩销毁 + private Integer status; // 1:创建未使用, 2:产检使用,3:分娩销毁 4:建档删除 删除 private Date created; private Date consumeDate; 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 4625425..5fe1b75 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 @@ -976,24 +976,31 @@ public class BookbuildingFacade { * @return */ public BaseResponse deletePregnantById(String id, Integer userId) { - AntExChuQuery antExChuQuery = new AntExChuQuery(); - antExChuQuery.setParentId(id); - antExChuQuery.setYn(YnEnums.YES.getId()); - //获取初诊记录 - List antExChulist = antenatalExaminationService.queryAntExChu(antExChuQuery); - String hospital = autoMatchFacade.getHospitalId(userId); - Patients patients = yunBookbuildingService.findOneById(id); - -// if (CollectionUtils.isNotEmpty(antExChulist)) - if (!deleteProcessHandler.deleteBookBuild(patients.getPid(), patients.getBookbuildingDate(), hospital)) { - return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("孕妇存在检查记录,不能删除建档"); - } - yunBookbuildingService.deletePregnantById(id); - //删除建档需要删除产筛数据 - SieveQuery sieveQuery = new SieveQuery(); - sieveQuery.setYn(YnEnums.YES.getId()); - sieveQuery.setParentId(id); - sieveService.deleteById(sieveQuery); + + if(org.apache.commons.lang.StringUtils.isNotEmpty(id)){ + //获取初诊记录 + String hospital = autoMatchFacade.getHospitalId(userId); + Patients patients = yunBookbuildingService.findOneById(id); + + if (!deleteProcessHandler.deleteBookBuild(patients.getPid(), patients.getBookbuildingDate(), hospital)) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.DONT_DELETE).setErrormsg("孕妇存在检查记录,不能删除建档"); + } + yunBookbuildingService.deletePregnantById(id); + //删除建档需要删除产筛数据 + SieveQuery sieveQuery = new SieveQuery(); + sieveQuery.setYn(YnEnums.YES.getId()); + sieveQuery.setParentId(id); + sieveService.deleteById(sieveQuery); + + PatientCheckTicketQuery patientCheckTicketQuery=new PatientCheckTicketQuery(); + patientCheckTicketQuery.setPatientId(id); + + PatientCheckTicket patientCheckTicket=new PatientCheckTicket(); + patientCheckTicket.setStatus(4); + patientCheckTicket.setPatientId(id); + patientCheckTicketService.findAndModify(patientCheckTicketQuery,patientCheckTicket); + } + return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); }