Commit ece1376f580153b09ea5aae66b731d6353f47781

Authored by litao@lymsh.com
1 parent db02e302f2

区域数据

Showing 1 changed file with 5 additions and 1 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ ece1376
... ... @@ -61,7 +61,11 @@
61 61 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
62 62 PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientWeight.getPatientId()).and("hospitalId").is(hospitalId)), PatientWeight.class);
63 63 if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) {
64   - return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT);
  64 + patients = mongoTemplate.findOne(Query.query(Criteria.where("source").is(patientWeight.getPatientId()).and("hospitalId").is(hospitalId).and("enable").is("2")), Patients.class);
  65 + if(patients == null) {
  66 + return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT);
  67 + }
  68 + patientWeight.setPatientId(patients.getId());
65 69 }
66 70  
67 71 if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) {