diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java index 9d97088..92aee79 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java @@ -227,6 +227,14 @@ public class AntenatalExaminationFacade { if (CollectionUtils.isNotEmpty(list)) { return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊"); } + + // 修改关联券的使用状态,如果已使用,则返回错误码 + if (StringUtils.isNotBlank(model.getBarCode())) { + String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); + if (code != null) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); + } + } Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId()); patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor()); @@ -237,13 +245,7 @@ public class AntenatalExaminationFacade { patientsService.updatePatient(patients); patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime())); antenatalExaminationService.addOneBabyAnt(model); - // 修改关联券的使用状态,如果已使用,则返回错误码 - if (StringUtils.isNotBlank(model.getBarCode())) { - String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId()); - if (code != null) { - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); - } - } + //修改最后一次检查时间 setLashCTimes(antExAddRequest.getParentId()); @@ -369,6 +371,13 @@ public class AntenatalExaminationFacade { antExChuQuery1.setYn(YnEnums.YES.getId()); List data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1); //初诊只能建一次 + // 修改关联券的使用状态,如果已使用,则返回错误码 + if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { + String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); + if (code != null) { + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); + } + } if (CollectionUtils.isEmpty(data1)) { Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId()); PatientsQuery patientsQuery = new PatientsQuery(); @@ -392,13 +401,6 @@ public class AntenatalExaminationFacade { antExChuModel.setYn(YnEnums.YES.getId()); antExChuModel.setHospitalId(autoMatchFacade.getHospitalId(userId)); antenatalExaminationService.addOneAntEx(antExChuModel); - // 修改关联券的使用状态,如果已使用,则返回错误码 - if (StringUtils.isNotBlank(antExChuModel.getBarCode())) { - String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId()); - if (code != null) { - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code); - } - } //修改患者风险等级 patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor());