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