From ff9e04666e60a689c1030b963449a776897ef5cc Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Tue, 26 Sep 2017 20:38:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operate/web/service/impl/PatientWeightServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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())) { -- 1.8.3.1