diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java index 7997260..fa0e8cc 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TrackDownFacade.java @@ -124,29 +124,29 @@ public class TrackDownFacade { map.put("dueDate", DateUtil.getyyyy_MM_dd(patients.getDueDate())); /** 预产期 */ map.put("trackCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(TrackDownDateEnums.F.getId()).and("yn").is(1)), TrackDown.class)); /** 访视次数 */ map.put("fmDate", DateUtil.getyyyy_MM_dd(patients.getFmDate())); - } - - TrackDown tc = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(TrackDownDateEnums.E.getId()).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); - if (tc != null) { - map.put("reservatDate", DateUtil.getyyyy_MM_dd(tc.getReservatDate())); /** 预约住院日期 */ - } - map.put("fcCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(TrackDownDateEnums.G.getId()).and("yn").is(1)), TrackDown.class)); /** 复查次数 */ - map.put("checkCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("hospitalId").is(hospitalId)), AntenatalExaminationModel.class) + - mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId)), AntExChuModel.class)); /** 本院产检次数 */ - AntenatalExaminationModel examinationModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class); - if (examinationModel != null) { - map.put("checkTime", DateUtil.getyyyy_MM_dd(examinationModel.getCheckDate())); /** 产检日期 */ - map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(examinationModel.getNextCheckTime())); /** 预约产检日期 */ - } else { - AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class); - if (antExChuModel != null) { - map.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); /** 产检日期 */ - map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(antExChuModel.getNextCheckTime())); /** 预约产检日期 */ + TrackDown tc = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(TrackDownDateEnums.E.getId()).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); + if (tc != null) { + map.put("reservatDate", DateUtil.getyyyy_MM_dd(tc.getReservatDate())); /** 预约住院日期 */ + } + map.put("fcCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(TrackDownDateEnums.G.getId()).and("yn").is(1)), TrackDown.class)); /** 复查次数 */ + map.put("checkCount", mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId).and("hospitalId").is(hospitalId)), AntenatalExaminationModel.class) + + mongoTemplate.count(Query.query(Criteria.where("parentId").is(parentId)), AntExChuModel.class)); /** 本院产检次数 */ + AntenatalExaminationModel examinationModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class); + if (examinationModel != null) { + map.put("checkTime", DateUtil.getyyyy_MM_dd(examinationModel.getCheckDate())); /** 产检日期 */ + map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(examinationModel.getNextCheckTime())); /** 预约产检日期 */ } else { - map.put("checkTime", "--"); /** 产检日期 */ - map.put("nextCheckTime", "--"); /** 预约产检日期 */ + AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class); + if (antExChuModel != null) { + map.put("checkTime", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); /** 产检日期 */ + map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(antExChuModel.getNextCheckTime())); /** 预约产检日期 */ + } else { + map.put("checkTime", "--"); /** 产检日期 */ + map.put("nextCheckTime", "--"); /** 预约产检日期 */ + } } } + return RespBuilder.buildSuccess(map); }