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);