Commit 9c110a89c1824ba9cd1b97b027847893db043572

Authored by zhangchao
1 parent 6dffd75f34
Exists in dev

#fix:优化小程序获取产检体重及身高

Showing 1 changed file with 9 additions and 7 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PatientWeightServiceImpl.java View file @ 9c110a8
... ... @@ -1417,14 +1417,9 @@
1417 1417  
1418 1418 @Override
1419 1419 public BaseResponse wxReport(String pid,Integer type) {
1420   - Map<String, Object> map = new LinkedHashMap<>();
1421   - AntExChuModel chuModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("yn").ne("0")).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class);
1422   - if (chuModel != null) {
1423   - map.put("beforeWeight", com.lyms.platform.common.utils.StringUtils.isNotEmpty(chuModel.getYqWeight()) ? chuModel.getYqWeight() : "");
1424   - map.put("height",com.lyms.platform.common.utils.StringUtils.isNotEmpty(chuModel.getHeight()) ? chuModel.getHeight() : "");
1425   - }
1426 1420 PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("yn").ne("0").and("type").is(type)), PatientWeight.class);
1427 1421 if (patientWeight != null) {
  1422 + Map<String, Object> map = new LinkedHashMap<>();
1428 1423 map.put("beforeWeight", patientWeight.getBeforeWeight());
1429 1424 Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
1430 1425 Map<String, String> dayWeights = sortMapByKey(patientWeight.getDayWeights());
... ... @@ -1449,7 +1444,14 @@
1449 1444 patientServiceQuery.setPid(pid);
1450 1445 patientServiceQuery.setSerEndTime(new Date());
1451 1446 List<PatientService> list= patientServiceService.queryPatientService(patientServiceQuery);
1452   - return RespBuilder.buildSuccess(list);
  1447 + AntExChuModel chuModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(pid).and("yn").ne("0")).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class);
  1448 + Map<String,Object> params=new HashMap<>();
  1449 + if (chuModel != null) {
  1450 + params.put("beforWeight",com.lyms.platform.common.utils.StringUtils.isNotEmpty(chuModel.getYqWeight()) ? chuModel.getYqWeight() : "");
  1451 + params.put("height",com.lyms.platform.common.utils.StringUtils.isNotEmpty(chuModel.getHeight()) ? chuModel.getHeight() : "");
  1452 + }
  1453 + params.put("list",list);
  1454 + return RespBuilder.buildSuccess(params);
1453 1455 }
1454 1456  
1455 1457 @Override