From ece1376f580153b09ea5aae66b731d6353f47781 Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Tue, 26 Sep 2017 19:50:42 +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 --- .../platform/operate/web/service/impl/PatientWeightServiceImpl.java | 6 +++++- 1 file changed, 5 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 74a273c..fd09bc9 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 @@ -61,7 +61,11 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class); PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientWeight.getPatientId()).and("hospitalId").is(hospitalId)), PatientWeight.class); if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) { - return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT); + 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()); } if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) { -- 1.8.3.1