Commit 14caae9d666a5878469665f60be12c4a1e242d29

Authored by litao@lymsh.com
1 parent 292963e0df

改app的曲线返回

Showing 1 changed file with 6 additions and 0 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 14caae9
... ... @@ -266,6 +266,7 @@
266 266 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
267 267 PatientWeight pw = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(patientWeight.getPatientId())), PatientWeight.class);
268 268 Map<Integer, String> weights = new HashMap<>();
  269 + Map<String, String> dayWeights = new HashMap<>();
269 270 if(pw == null && StringUtils.isEmpty(patientWeight.getBeforeWeight())) {
270 271 return RespBuilder.buildErro(ResponseCode.NEED_ADD_PATIENT_WEIGHT);
271 272 }
... ... @@ -276,6 +277,11 @@
276 277 if(MapUtils.isNotEmpty(pw.getWeights())) {
277 278 weights = pw.getWeights();
278 279 }
  280 + if(MapUtils.isNotEmpty(pw.getDayWeights())) {
  281 + dayWeights = pw.getDayWeights();
  282 + }
  283 + dayWeights.put(DateUtil.getyyyy_MM_dd(new Date()), nowWeight);
  284 + pw.setDayWeights(dayWeights);
279 285 if(patients != null && StringUtils.isNotEmpty(nowWeight)) {
280 286 weights.put(DateUtil.getWeek(patients.getLastMenses(), new Date()), nowWeight);
281 287 }