Commit 2b12f8806377d07f8f493574799eeb97fe8da68d

Authored by jiangjiazhi
1 parent 9c1d0f3749

1

Showing 1 changed file with 16 additions and 14 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java View file @ 2b12f88
... ... @@ -227,6 +227,14 @@
227 227 if (CollectionUtils.isNotEmpty(list)) {
228 228 return new BaseResponse().setErrorcode(ErrorCodeConstants.DATA_EXIST).setErrormsg("同一天只能建一次复诊");
229 229 }
  230 +
  231 + // 修改关联券的使用状态,如果已使用,则返回错误码
  232 + if (StringUtils.isNotBlank(model.getBarCode())) {
  233 + String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId());
  234 + if (code != null) {
  235 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
  236 + }
  237 + }
230 238 Patients patients = patientsService.findOnePatientById(antExAddRequest.getParentId());
231 239 patients.setLastCheckEmployeeId(antExAddRequest.getCheckDoctor());
232 240  
233 241  
... ... @@ -237,14 +245,8 @@
237 245 patientsService.updatePatient(patients);
238 246 patientsService.updatePatientOneCol(patients.getId(), com.lyms.platform.common.utils.StringUtils.isEmpty(antExAddRequest.getNextCheckTime()) == true ? null : DateUtil.parseYMD(antExAddRequest.getNextCheckTime()));
239 247 antenatalExaminationService.addOneBabyAnt(model);
240   - // 修改关联券的使用状态,如果已使用,则返回错误码
241   - if (StringUtils.isNotBlank(model.getBarCode())) {
242   - String code = patientCheckTicketService.updateTicket(model.getBarCode(), 2, model.getHospitalId());
243   - if (code != null) {
244   - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
245   - }
246   - }
247 248  
  249 +
248 250 //修改最后一次检查时间
249 251 setLashCTimes(antExAddRequest.getParentId());
250 252 //修改申请单状态
... ... @@ -369,6 +371,13 @@
369 371 antExChuQuery1.setYn(YnEnums.YES.getId());
370 372 List<AntExChuModel> data1 = antenatalExaminationService.queryAntExChu(antExChuQuery1);
371 373 //初诊只能建一次
  374 + // 修改关联券的使用状态,如果已使用,则返回错误码
  375 + if (StringUtils.isNotBlank(antExChuModel.getBarCode())) {
  376 + String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId());
  377 + if (code != null) {
  378 + return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
  379 + }
  380 + }
372 381 if (CollectionUtils.isEmpty(data1)) {
373 382 Patients patients = patientsService.findOnePatientById(excAddRequest.getParentId());
374 383 PatientsQuery patientsQuery = new PatientsQuery();
... ... @@ -392,13 +401,6 @@
392 401 antExChuModel.setYn(YnEnums.YES.getId());
393 402 antExChuModel.setHospitalId(autoMatchFacade.getHospitalId(userId));
394 403 antenatalExaminationService.addOneAntEx(antExChuModel);
395   - // 修改关联券的使用状态,如果已使用,则返回错误码
396   - if (StringUtils.isNotBlank(antExChuModel.getBarCode())) {
397   - String code = patientCheckTicketService.updateTicket(antExChuModel.getBarCode(), 2, antExChuModel.getHospitalId());
398   - if (code != null) {
399   - return new BaseResponse().setErrorcode(ErrorCodeConstants.PARAMETER_ERROR).setErrormsg(code);
400   - }
401   - }
402 404 //修改患者风险等级
403 405  
404 406 patients.setLastCheckEmployeeId(excAddRequest.getProdDoctor());