diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java index c231313..d907465 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java @@ -570,8 +570,6 @@ public class ReportController extends BaseController { * * @param hospitalId * @param type - * @param antExChuNotList 建档未初诊 - * @param antExChuNotAlwaysList 建档一直未初诊 * @param startDate * @param endDate * @param page @@ -583,13 +581,11 @@ public class ReportController extends BaseController { @TokenRequired public BaseResponse getAntExChuNotDetail(@RequestParam(required = true)String hospitalId, @RequestParam(required = true)Integer type, - @RequestParam(required = true)List antExChuNotList, - @RequestParam(required = true)List antExChuNotAlwaysList, @RequestParam(required = true)Date startDate, @RequestParam(required = true)Date endDate, @RequestParam(required = true)Integer page, @RequestParam(required = true)Integer limit) { - return reportService.getAntExChuNotDetail(hospitalId,type,antExChuNotList ,antExChuNotAlwaysList,startDate, endDate, page, limit); + return reportService.getAntExChuNotDetail(hospitalId,type,startDate, endDate, page, limit); } /** * 统计管理-孕产妇数据统计-分娩详情 diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java index b0dd12b..2c2e155 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java @@ -121,5 +121,5 @@ public interface IReportService extends IBaseService { BaseResponse getFmAfterEvaluate(String hospitalId,String startDate,String endDate); - BaseResponse getAntExChuNotDetail(String hospitalId, Integer type, List antExChuNotList,List antExChuNotAlwaysList, Date startDate, Date endDate, Integer page, Integer limit); + BaseResponse getAntExChuNotDetail(String hospitalId, Integer type, Date startDate, Date endDate, Integer page, Integer limit); } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java index f22c5ae..4de068d 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java @@ -4431,7 +4431,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService .and("checkTime").gte(startDate).lte(endDate); long filingRoAntExChu = mongoTemplate.count(Query.query(criteria3), AntExChuModel.class); //建档未初诊(包含外院初诊) - List antExChuNotList = new ArrayList<>();//后面详情会用到 + List antExChuNotList = new ArrayList<>(); for (Object obj : filingParentIds) { Criteria criteria0 = Criteria.where("parentId").is(obj) .and("yn").is(YnEnums.YES.getId()) @@ -4455,7 +4455,6 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService long antExChuWai = mongoTemplate.count(Query.query(criteria5), AntExChuModel.class); //一直未初诊 int filingNotAntExChu= 0; - List antExChuNotAlwaysList = new ArrayList<>();//后面详情用到 for (Object obj : antExChuNotList) { Criteria criteria6= Criteria.where("parentId").is(obj) .and("hospitalId").is(hospitalId) @@ -4464,7 +4463,6 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService long count = mongoTemplate.count(Query.query(criteria6), AntExChuModel.class); if(count==0){ filingNotAntExChu++; - antExChuNotAlwaysList.add(obj); } } //当前时间范围初诊,之前建档 @@ -4568,8 +4566,6 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService map.put("livingCount", boy+girl); map.put("boyCount", boy); map.put("girlCount", girl); - map.put("antExChuNotList", antExChuNotList);//后面详情用到。不用再次重复查询 - map.put("antExChuNotAlwaysList", antExChuNotAlwaysList);//后面详情用到。不用再次重复查询 br.setErrorcode(ErrorCodeConstants.SUCCESS); br.setErrormsg("成功"); @@ -4729,7 +4725,7 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService } @Override - public BaseResponse getAntExChuNotDetail(String hospitalId, Integer type,List antExChuNotList,List antExChuNotAlwaysList, Date startDate, Date endDate, Integer page, Integer limit) { + public BaseResponse getAntExChuNotDetail(String hospitalId, Integer type, Date startDate, Date endDate, Integer page, Integer limit) { BaseListResponse br = new BaseListResponse(); List > antExRecordResult=new ArrayList<>(); //1:下月初诊、2:外院初诊、3:一直未初诊 @@ -4737,6 +4733,12 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService List patientsList=new ArrayList<>(); AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); PatientsQuery patientsQuery=new PatientsQuery(); + Map > FilingIds= getFilingId(hospitalId,startDate,endDate); + if(MapUtils.isEmpty(FilingIds)){ + return br; + } + List antExChuNotList=FilingIds.get("antExChuNotList"); + List antExChuNotAlwaysList=FilingIds.get("antExChuNotAlwaysList"); if(CollectionUtils.isNotEmpty(antExChuNotList)||CollectionUtils.isNotEmpty(antExChuNotAlwaysList)) { switch (type) { case 1: @@ -4974,4 +4976,45 @@ public class ReportServiceImpl extends BaseServiceImpl implements IReportService return ResolveUtils.queryHighRisk(highScoreResult); } + /** + * 建档未初诊(包含外院初诊)-详情用到id组 + * @param hospitalId + * @param startDate + * @param endDate + * @return 建档id + */ + public Map > getFilingId(String hospitalId,Date startDate,Date endDate){ + Map > map=new HashedMap(); + //建档 + Criteria criteria = Criteria.where("bookbuildingDate").gte(startDate).lte(endDate) + .and("hospitalId").is(hospitalId) + .and("yn").is(YnEnums.YES.getId()); + List patientsList = mongoTemplate.find(Query.query(criteria), Patients.class); + //建档未初诊(包含外院初诊) + List antExChuNotList = new ArrayList<>(); + for (Patients patient : patientsList) { + Criteria criteria2 = Criteria.where("parentId").is(patient.getId()) + .and("yn").is(YnEnums.YES.getId()) + .and("checkTime").gte(startDate).lte(endDate); + long count = mongoTemplate.count(Query.query(criteria2), AntExChuModel.class); + if(count==0){ + antExChuNotList.add(patient.getId()); + } + } + //一直未初诊 + List antExChuNotAlwaysList = new ArrayList<>(); + for (String o : antExChuNotList) { + Criteria criteria3= Criteria.where("parentId").is(o) + .and("hospitalId").is(hospitalId) + .and("yn").is(YnEnums.YES.getId()) + .and("checkTime").gte(startDate); + long count = mongoTemplate.count(Query.query(criteria3), AntExChuModel.class); + if(count==0){ + antExChuNotAlwaysList.add(o); + } + } + map.put("antExChuNotList",antExChuNotList); + map.put("antExChuNotAlwaysList",antExChuNotAlwaysList); + return map; + } }