From 890c6fdafa857200ac05470a0437ecb302aeb1d3 Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Thu, 28 Sep 2017 03:35:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=BA=8F=E5=88=97=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/service/impl/PatientWeightServiceImpl.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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 b73538f..005845b 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 @@ -338,7 +338,8 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient // Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(pw)); // mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(pw.getId())), update, PatientWeight.class); patientWeightService2.update(Query.query(Criteria.where("id").is(pw.getId())), pw); - return RespBuilder.buildSuccess(pw.getId()); +// return RespBuilder.buildSuccess(pw.getId()); + return RespBuilder.buildSuccess(pw); } if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) { @@ -351,7 +352,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient patientWeight.setPid(patients.getPid()); // mongoTemplate.save(patientWeight); patientWeightService2.add(patientWeight); - return RespBuilder.buildSuccess(patientWeight.getId()); + return RespBuilder.buildSuccess(patientWeight); } else { // Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight)); // mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class); @@ -385,10 +386,10 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient return RespBuilder.buildSuccess(pw.getId()); } - if(StringUtils.isEmpty(patientWeight.getId()) && patients != null) { + if(patients != null) { patientWeight.setCreated(new Date()); patientWeight.setHospitalId(patients.getHospitalId()); - if(StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { + if (StringUtils.isNotBlank(patientWeight.getNowWeight()) && patientWeight.getBeforeHeight() != null) { patientWeight.setBmi(getBmi(patientWeight.getNowWeight(), patientWeight.getBeforeHeight())); } patientWeight.setYn("1"); @@ -396,12 +397,8 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient mongoTemplate.save(patientWeight); // patientWeightService2.add(patientWeight); return RespBuilder.buildSuccess(patientWeight.getId()); - } else { - Update update = MongoConvertHelper.convertToNativeUpdate(ReflectionUtils.getUpdateField(patientWeight)); - mongoTemplate.updateFirst(Query.query(Criteria.where("id").is(patientWeight.getId())), update, PatientWeight.class); -// patientWeightService2.update(Query.query(Criteria.where("id").is(patientWeight.getId())), patientWeight); - return RespBuilder.buildSuccess(patientWeight.getId()); } + return RespBuilder.buildSuccess("patients为null"); } private void setGuide(Integer week, Map map) { -- 1.8.3.1