From 14caae9d666a5878469665f60be12c4a1e242d29 Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Thu, 21 Sep 2017 17:39:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9app=E7=9A=84=E6=9B=B2=E7=BA=BF?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= 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, 6 insertions(+) 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 2973b27..84cc0bb 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 @@ -266,6 +266,7 @@ 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())), PatientWeight.class); Map weights = new HashMap<>(); + Map dayWeights = new HashMap<>(); if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) { return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT); } @@ -276,6 +277,11 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient if(MapUtils.isNotEmpty(pw.getWeights())) { weights = pw.getWeights(); } + if(MapUtils.isNotEmpty(pw.getDayWeights())) { + dayWeights = pw.getDayWeights(); + } + dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight); + pw.setDayWeights(dayWeights); if(patients != null && StringUtils.isNotEmpty(nowWeight)) { weights.put(DateUtil.getWeek(patients.getLastMenses(), new Date()), nowWeight); } -- 1.8.3.1