Commit ef00296e8465e89f2e4ecfe7a353b6cde430edac
1 parent
b67f5b8cbd
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 51 additions and 12 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
ef00296
... | ... | @@ -570,8 +570,6 @@ |
570 | 570 | * |
571 | 571 | * @param hospitalId |
572 | 572 | * @param type |
573 | - * @param antExChuNotList 建档未初诊 | |
574 | - * @param antExChuNotAlwaysList 建档一直未初诊 | |
575 | 573 | * @param startDate |
576 | 574 | * @param endDate |
577 | 575 | * @param page |
578 | 576 | |
... | ... | @@ -583,13 +581,11 @@ |
583 | 581 | @TokenRequired |
584 | 582 | public BaseResponse getAntExChuNotDetail(@RequestParam(required = true)String hospitalId, |
585 | 583 | @RequestParam(required = true)Integer type, |
586 | - @RequestParam(required = true)List<String> antExChuNotList, | |
587 | - @RequestParam(required = true)List<String> antExChuNotAlwaysList, | |
588 | 584 | @RequestParam(required = true)Date startDate, |
589 | 585 | @RequestParam(required = true)Date endDate, |
590 | 586 | @RequestParam(required = true)Integer page, |
591 | 587 | @RequestParam(required = true)Integer limit) { |
592 | - return reportService.getAntExChuNotDetail(hospitalId,type,antExChuNotList ,antExChuNotAlwaysList,startDate, endDate, page, limit); | |
588 | + return reportService.getAntExChuNotDetail(hospitalId,type,startDate, endDate, page, limit); | |
593 | 589 | } |
594 | 590 | /** |
595 | 591 | * 统计管理-孕产妇数据统计-分娩详情 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java
View file @
ef00296
... | ... | @@ -121,6 +121,6 @@ |
121 | 121 | |
122 | 122 | BaseResponse getFmAfterEvaluate(String hospitalId,String startDate,String endDate); |
123 | 123 | |
124 | - BaseResponse getAntExChuNotDetail(String hospitalId, Integer type, List<String> antExChuNotList,List<String> antExChuNotAlwaysList, Date startDate, Date endDate, Integer page, Integer limit); | |
124 | + BaseResponse getAntExChuNotDetail(String hospitalId, Integer type, Date startDate, Date endDate, Integer page, Integer limit); | |
125 | 125 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
ef00296
... | ... | @@ -4431,7 +4431,7 @@ |
4431 | 4431 | .and("checkTime").gte(startDate).lte(endDate); |
4432 | 4432 | long filingRoAntExChu = mongoTemplate.count(Query.query(criteria3), AntExChuModel.class); |
4433 | 4433 | //建档未初诊(包含外院初诊) |
4434 | - List<Object> antExChuNotList = new ArrayList<>();//后面详情会用到 | |
4434 | + List<Object> antExChuNotList = new ArrayList<>(); | |
4435 | 4435 | for (Object obj : filingParentIds) { |
4436 | 4436 | Criteria criteria0 = Criteria.where("parentId").is(obj) |
4437 | 4437 | .and("yn").is(YnEnums.YES.getId()) |
... | ... | @@ -4455,7 +4455,6 @@ |
4455 | 4455 | long antExChuWai = mongoTemplate.count(Query.query(criteria5), AntExChuModel.class); |
4456 | 4456 | //一直未初诊 |
4457 | 4457 | int filingNotAntExChu= 0; |
4458 | - List<Object> antExChuNotAlwaysList = new ArrayList<>();//后面详情用到 | |
4459 | 4458 | for (Object obj : antExChuNotList) { |
4460 | 4459 | Criteria criteria6= Criteria.where("parentId").is(obj) |
4461 | 4460 | .and("hospitalId").is(hospitalId) |
... | ... | @@ -4464,7 +4463,6 @@ |
4464 | 4463 | long count = mongoTemplate.count(Query.query(criteria6), AntExChuModel.class); |
4465 | 4464 | if(count==0){ |
4466 | 4465 | filingNotAntExChu++; |
4467 | - antExChuNotAlwaysList.add(obj); | |
4468 | 4466 | } |
4469 | 4467 | } |
4470 | 4468 | //当前时间范围初诊,之前建档 |
... | ... | @@ -4568,8 +4566,6 @@ |
4568 | 4566 | map.put("livingCount", boy+girl); |
4569 | 4567 | map.put("boyCount", boy); |
4570 | 4568 | map.put("girlCount", girl); |
4571 | - map.put("antExChuNotList", antExChuNotList);//后面详情用到。不用再次重复查询 | |
4572 | - map.put("antExChuNotAlwaysList", antExChuNotAlwaysList);//后面详情用到。不用再次重复查询 | |
4573 | 4569 | |
4574 | 4570 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
4575 | 4571 | br.setErrormsg("成功"); |
... | ... | @@ -4729,7 +4725,7 @@ |
4729 | 4725 | } |
4730 | 4726 | |
4731 | 4727 | @Override |
4732 | - public BaseResponse getAntExChuNotDetail(String hospitalId, Integer type,List<String> antExChuNotList,List<String> antExChuNotAlwaysList, Date startDate, Date endDate, Integer page, Integer limit) { | |
4728 | + public BaseResponse getAntExChuNotDetail(String hospitalId, Integer type, Date startDate, Date endDate, Integer page, Integer limit) { | |
4733 | 4729 | BaseListResponse br = new BaseListResponse(); |
4734 | 4730 | List <Map <String, Object>> antExRecordResult=new ArrayList<>(); |
4735 | 4731 | //1:下月初诊、2:外院初诊、3:一直未初诊 |
... | ... | @@ -4737,6 +4733,12 @@ |
4737 | 4733 | List<Patients> patientsList=new ArrayList<>(); |
4738 | 4734 | AntExRecordQuery antExRecordQuery = new AntExRecordQuery(); |
4739 | 4735 | PatientsQuery patientsQuery=new PatientsQuery(); |
4736 | + Map <String, List<String>> FilingIds= getFilingId(hospitalId,startDate,endDate); | |
4737 | + if(MapUtils.isEmpty(FilingIds)){ | |
4738 | + return br; | |
4739 | + } | |
4740 | + List<String> antExChuNotList=FilingIds.get("antExChuNotList"); | |
4741 | + List<String> antExChuNotAlwaysList=FilingIds.get("antExChuNotAlwaysList"); | |
4740 | 4742 | if(CollectionUtils.isNotEmpty(antExChuNotList)||CollectionUtils.isNotEmpty(antExChuNotAlwaysList)) { |
4741 | 4743 | switch (type) { |
4742 | 4744 | case 1: |
... | ... | @@ -4973,6 +4975,47 @@ |
4973 | 4975 | } |
4974 | 4976 | |
4975 | 4977 | return ResolveUtils.queryHighRisk(highScoreResult); |
4978 | + } | |
4979 | + /** | |
4980 | + * 建档未初诊(包含外院初诊)-详情用到id组 | |
4981 | + * @param hospitalId | |
4982 | + * @param startDate | |
4983 | + * @param endDate | |
4984 | + * @return 建档id | |
4985 | + */ | |
4986 | + public Map <String, List<String>> getFilingId(String hospitalId,Date startDate,Date endDate){ | |
4987 | + Map <String, List<String>> map=new HashedMap(); | |
4988 | + //建档 | |
4989 | + Criteria criteria = Criteria.where("bookbuildingDate").gte(startDate).lte(endDate) | |
4990 | + .and("hospitalId").is(hospitalId) | |
4991 | + .and("yn").is(YnEnums.YES.getId()); | |
4992 | + List<Patients> patientsList = mongoTemplate.find(Query.query(criteria), Patients.class); | |
4993 | + //建档未初诊(包含外院初诊) | |
4994 | + List<String> antExChuNotList = new ArrayList<>(); | |
4995 | + for (Patients patient : patientsList) { | |
4996 | + Criteria criteria2 = Criteria.where("parentId").is(patient.getId()) | |
4997 | + .and("yn").is(YnEnums.YES.getId()) | |
4998 | + .and("checkTime").gte(startDate).lte(endDate); | |
4999 | + long count = mongoTemplate.count(Query.query(criteria2), AntExChuModel.class); | |
5000 | + if(count==0){ | |
5001 | + antExChuNotList.add(patient.getId()); | |
5002 | + } | |
5003 | + } | |
5004 | + //一直未初诊 | |
5005 | + List<String> antExChuNotAlwaysList = new ArrayList<>(); | |
5006 | + for (String o : antExChuNotList) { | |
5007 | + Criteria criteria3= Criteria.where("parentId").is(o) | |
5008 | + .and("hospitalId").is(hospitalId) | |
5009 | + .and("yn").is(YnEnums.YES.getId()) | |
5010 | + .and("checkTime").gte(startDate); | |
5011 | + long count = mongoTemplate.count(Query.query(criteria3), AntExChuModel.class); | |
5012 | + if(count==0){ | |
5013 | + antExChuNotAlwaysList.add(o); | |
5014 | + } | |
5015 | + } | |
5016 | + map.put("antExChuNotList",antExChuNotList); | |
5017 | + map.put("antExChuNotAlwaysList",antExChuNotAlwaysList); | |
5018 | + return map; | |
4976 | 5019 | } |
4977 | 5020 | } |