diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java index 6c384d6..76f4e4c 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java @@ -106,7 +106,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient patientWeight.setOperaterId(userId.toString()); patientWeight.setCreated(new Date()); if(StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { - patientWeight.setBmi(getBmi(patientWeight.getNowWeight(), patientWeight.getBeforeHeight())); + patientWeight.setBmi(getBmi(patientWeight.getBeforeWeight(), patientWeight.getBeforeHeight())); } patientWeight.setYn("1"); mongoTemplate.save(patientWeight); @@ -310,6 +310,12 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientWeight.getPatientId())), PatientWeight.class); Map dayWeights = new HashMap<>(); if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) { + /* patients = mongoTemplate.findOne(Query.query(Criteria.where("source").is(patientWeight.getPatientId()).and("hospitalId").is(hospitalId).and("enable").is("2")), Patients.class); + if(patients == null) { + return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT); + } + patientWeight.setPatientId(patients.getId()); + pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patients.getId()).and("hospitalId").is(hospitalId)), PatientWeight.class);*/ return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT); } if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) {