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 ae3cc3e..9673900 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 @@ -169,7 +169,7 @@ public class TrackDownFacade { //查询分娩追访记录 TrackDown tc = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId).and("trackDownDateType").is(trackType).and("yn").is(1)).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); if (tc != null) { - map.put("nextCheckTime", tc.getReservatDate()==null?"--": DateUtil.getyyyy_MM_dd(tc.getReservatDate())); // 预约预约时间 + map.put("nextCheckTime", tc.getReservatDate() == null ? "--" : DateUtil.getyyyy_MM_dd(tc.getReservatDate())); // 预约预约时间 map.put("yyfsDate", 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)); /** 复查次数 */ @@ -187,7 +187,7 @@ public class TrackDownFacade { if (examinationModel.getNextCheckTime() != null) { map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(examinationModel.getNextCheckTime())); //预约产检日期 } - }else{ + } else { //初诊 AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(parentId)).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class); if (antExChuModel != null) { @@ -419,6 +419,7 @@ public class TrackDownFacade { temp.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), new Date())); /** 孕周 */ } } + //产检次数 temp.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)); TrackDown trackDown = mongoTemplate.findOne(Query.query(Criteria.where("yn").is(1).and("parentId").is(downRecord.getParentId()).and("trackDownDateType").is(downRecord.getTrackType())).with(new Sort(Sort.Direction.DESC, "created")), TrackDown.class); @@ -432,28 +433,38 @@ public class TrackDownFacade { temp.put("yyTime", "--"); // 预约预约时间 } - //如果是产前筛查去预约结果 - if (downRecord.getTrackType() == TrackDownDateEnums.C.getId()||downRecord.getTrackType() == TrackDownDateEnums.I.getId()) { - + //如果是产前检查取预约结果 + // if (downRecord.getTrackType() == TrackDownDateEnums.C.getId()||downRecord.getTrackType() == TrackDownDateEnums.I.getId()) { - //复诊 - AntenatalExaminationModel examinationModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId())).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class); - if (examinationModel != null) { - temp.put("cjDate", DateUtil.getyyyy_MM_dd(examinationModel.getCheckDate())); /** 产检日期 */ - if (examinationModel.getNextCheckTime() != null) { - temp.put("yyTime", DateUtil.getyyyy_MM_dd(examinationModel.getNextCheckTime())); /** 预约产检日期 */ - } - }else{ - //初诊 - AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId())).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class); - if (antExChuModel != null) { - temp.put("cjDate", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); /** 产检日期 */ - if (antExChuModel.getNextCheckTime() != null) { - temp.put("yyTime", DateUtil.getyyyy_MM_dd(antExChuModel.getNextCheckTime())); /** 预约产检日期 */ - } + //复诊 + AntenatalExaminationModel examinationModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId())).with(new Sort(Sort.Direction.DESC, "created")), AntenatalExaminationModel.class); + if (examinationModel != null) { + temp.put("cjDate", DateUtil.getyyyy_MM_dd(examinationModel.getCheckDate())); /** 产检日期 */ + if (examinationModel.getNextCheckTime() != null) { + temp.put("yyTime", DateUtil.getyyyy_MM_dd(examinationModel.getNextCheckTime())); /** 预约产检日期 */ + } + } else { + //初诊 + AntExChuModel antExChuModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId())).with(new Sort(Sort.Direction.DESC, "created")), AntExChuModel.class); + if (antExChuModel != null) { + temp.put("cjDate", DateUtil.getyyyy_MM_dd(antExChuModel.getCheckTime())); /** 产检日期 */ + if (antExChuModel.getNextCheckTime() != null) { + temp.put("yyTime", DateUtil.getyyyy_MM_dd(antExChuModel.getNextCheckTime())); /** 预约产检日期 */ } } } + // } + + //如果是产筛追访列表,查询产筛预约时间 + if (downRecord.getTrackType() == TrackDownDateEnums.D.getId() || downRecord.getTrackType() == TrackDownDateEnums.H.getId()) {//产前筛查 + try { + //申请产筛单 + SieveApplyOrderModel sieveModel = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(downRecord.getParentId())).with(new Sort(Sort.Direction.DESC, "created")), SieveApplyOrderModel.class); + temp.put("yyTime", sieveModel.getCheckDate()); + } catch (Exception e) { + e.printStackTrace(); + } + } return temp; } }