Commit c0ba7363a0ad804dbafe73736619b26be9322956

Authored by haorp
1 parent c1a877d7de
Exists in dev

体重管理报告数据不一致优化

Showing 1 changed file with 7 additions and 3 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java View file @ c0ba736
... ... @@ -3915,16 +3915,20 @@
3915 3915 if (p != null) {
3916 3916 AntExChuModel chuModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(p.getPid()).and("yn").ne("0")).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class);
3917 3917 if (chuModel != null) {
  3918 + // 营养报告体重优先取后填的,其他逻辑不动
  3919 + PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(p.getId())), PatientWeight.class);
  3920 + if(patientWeight.getModified().compareTo(chuModel.getModified())>0){
  3921 + patientBaseResult.setWeight(StringUtils.isNotEmpty(patientWeight.getNowWeight()) ? patientWeight.getNowWeight() : "");
  3922 + }else{
  3923 + patientBaseResult.setWeight(StringUtils.isNotEmpty(chuModel.getWeight()) ? chuModel.getWeight() : "");
  3924 + }
3918 3925 patientBaseResult.setBeforWeight(StringUtils.isNotEmpty(chuModel.getYqWeight()) ? chuModel.getYqWeight() : "");
3919 3926 patientBaseResult.setHeight(StringUtils.isNotEmpty(chuModel.getHeight()) ? chuModel.getHeight() : "");
3920 3927 if (StringUtils.isNotEmpty(chuModel.getHeight()) && StringUtils.isNotEmpty(chuModel.getWeight())) {
3921   - patientBaseResult.setWeight(StringUtils.isNotEmpty(chuModel.getWeight()) ? chuModel.getWeight() : "");
3922 3928 patientBaseResult.setBmi(patientWeightService.getBmi(chuModel.getYqWeight(), chuModel.getHeight()));
3923 3929 } else {
3924   - PatientWeight patientWeight = mongoTemplate.findOne(Query.query(Criteria.where("patientId").is(p.getId())), PatientWeight.class);
3925 3930 if (patientWeight != null) {
3926 3931 patientBaseResult.setHeight(StringUtils.isNotEmpty(patientWeight.getBeforeHeight()) ? patientWeight.getBeforeHeight() : "");
3927   - patientBaseResult.setWeight(StringUtils.isNotEmpty(patientWeight.getNowWeight()) ? patientWeight.getNowWeight() : "");
3928 3932 patientBaseResult.setBeforWeight(StringUtils.isNotEmpty(patientWeight.getBeforeWeight()) ? patientWeight.getBeforeWeight() : "");
3929 3933 patientBaseResult.setBmi(patientWeight.getBmi());
3930 3934 List <Map <String, Object>> dayWeights2 = patientWeight.getDayWeights2();