Commit ea6e0e16e671279e01cd2e630acedcbf30f2af28
1 parent
6c9a3fa202
Exists in
master
and in
6 other branches
bbbbbb
Showing 1 changed file with 7 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
ea6e0e1
... | ... | @@ -601,12 +601,16 @@ |
601 | 601 | public BaseObjectResponse health(String parentId, Integer userId) { |
602 | 602 | String hospitalId = autoMatchFacade.getHospitalId(userId); |
603 | 603 | List<Map<String, Object>> restList = new ArrayList<>(); |
604 | - Patients p = mongoTemplate.findById(parentId, Patients.class); | |
604 | + Patients patients = mongoTemplate.findById(parentId, Patients.class); | |
605 | + if(patients == null) { | |
606 | + return RespBuilder.buildSuccess(); | |
607 | + } | |
608 | + Patients p = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(patients.getPid()).and("type").is(1)), Patients.class); | |
605 | 609 | if(p == null) { |
606 | 610 | return RespBuilder.buildSuccess(); |
607 | 611 | } |
608 | - AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(p.getPid()).and("yn").is(1).and("type").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
609 | - List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("pid").is(p.getPid()).and("type").is(1).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkDate")), AntenatalExaminationModel.class); | |
612 | + AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(p.getId()).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkTime")), AntExChuModel.class); | |
613 | + List<AntenatalExaminationModel> antexModels = mongoTemplate.find(Query.query(Criteria.where("parentId").is(p.getId()).and("yn").is(1).and("hospitalId").is(hospitalId)).with(new Sort(Sort.Direction.DESC, "checkDate")), AntenatalExaminationModel.class); | |
610 | 614 | |
611 | 615 | Map<String, Object> xyMap = new HashMap<>(); |
612 | 616 | List<Integer> szyMin = new ArrayList<>(); |