Commit 794d0d689c6e343d7e02c276127ca24a57f28cee

Authored by litao@lymsh.com
1 parent 3e28086273

体重管理相关代码

Showing 1 changed file with 5 additions and 1 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 794d0d6
... ... @@ -59,6 +59,10 @@
59 59 if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) {
60 60 return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT);
61 61 }
  62 +
  63 + if(pw != null && StringUtils.isNotEmpty(patientWeight.getBeforeWeight())) {
  64 + return RespBuilder.buildErro(ResponseCode.PATIENT_WEIGHT_IS_EXIST);
  65 + }
62 66 Map<Integer, String> weights = new HashMap<>();
63 67 Map<String, String> dayWeights = new HashMap<>();
64 68 if(pw != null) {
... ... @@ -272,7 +276,7 @@
272 276 if(MapUtils.isNotEmpty(pw.getWeights())) {
273 277 weights = pw.getWeights();
274 278 }
275   - if(patients != null) {
  279 + if(patients != null && StringUtils.isNotEmpty(nowWeight)) {
276 280 weights.put(DateUtil.getWeek(patients.getLastMenses(), new Date()), nowWeight);
277 281 }
278 282 pw.setWeights(weights);