From 794d0d689c6e343d7e02c276127ca24a57f28cee Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Wed, 20 Sep 2017 14:53:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E9=87=8D=E7=AE=A1=E7=90=86=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BB=A3=E7=A0=81?= 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 d112207..fa530a1 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 @@ -59,6 +59,10 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) { return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT); } + + if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) { + return RespBuilder.buildErro(ResponseCode.PATIENT_WEIGHT_IS_EXIST); + } Map weights = new HashMap<>(); Map dayWeights = new HashMap<>(); if(pw != null) { @@ -272,7 +276,7 @@ public class PatientWeightServiceImpl extends BaseServiceImpl implements Patient if(MapUtils.isNotEmpty(pw.getWeights())) { weights = pw.getWeights(); } - if(patients != null) { + if(patients != null && StringUtils.isNotEmpty(nowWeight)) { weights.put(DateUtil.getWeek(patients.getLastMenses(), new Date()), nowWeight); } pw.setWeights(weights); -- 1.8.3.1