Commit 3bd5759a4b8335822fe1447a1a56ef2f31e37735
1 parent
ee0c33c42f
Exists in
master
and in
6 other branches
美生县医院系统数据分析报告-4.4.2.逾期儿童检查
Showing 4 changed files with 79 additions and 3 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
3bd5759
| ... | ... | @@ -693,5 +693,21 @@ |
| 693 | 693 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 694 | 694 | return babyCheckFacade.getBabyRiskStatis(buildTime, loginState.getId()); |
| 695 | 695 | } |
| 696 | + /** | |
| 697 | + * 统计管理-孕产妇数据统计-4.4.儿童客户关系管理-4.2.2逾期儿童检查 | |
| 698 | + * | |
| 699 | + * @param hospitalId | |
| 700 | + * @param startDate | |
| 701 | + * @param endDate | |
| 702 | + * @return | |
| 703 | + */ | |
| 704 | + @RequestMapping(value = "/getBabyCheckOverdue", method = RequestMethod.GET) | |
| 705 | + @ResponseBody | |
| 706 | + @TokenRequired | |
| 707 | + public BaseResponse getBabyCheckOverdue(@RequestParam(required = true)String hospitalId, | |
| 708 | + @RequestParam(required = true)Date startDate, | |
| 709 | + @RequestParam(required = true)Date endDate) { | |
| 710 | + return babyCheckFacade.getBabyCheckOverdue(hospitalId,startDate,endDate); | |
| 711 | + } | |
| 696 | 712 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
3bd5759
| ... | ... | @@ -607,6 +607,7 @@ |
| 607 | 607 | /** |
| 608 | 608 | * 统计管理-孕产妇数据统计-3.产后评估 |
| 609 | 609 | * |
| 610 | + * @param hospitalId | |
| 610 | 611 | * @param startDate |
| 611 | 612 | * @param endDate |
| 612 | 613 | * @return |
| ... | ... | @@ -622,6 +623,7 @@ |
| 622 | 623 | /** |
| 623 | 624 | * 统计管理-孕产妇数据统计-2.3.2-初诊之后的逾期 |
| 624 | 625 | * |
| 626 | + * @param hospitalId | |
| 625 | 627 | * @param startDate |
| 626 | 628 | * @param endDate |
| 627 | 629 | * @return |
| ... | ... | @@ -637,6 +639,7 @@ |
| 637 | 639 | /** |
| 638 | 640 | * 统计管理-孕产妇数据统计-2.3.2-最后一次检查逾期 |
| 639 | 641 | * |
| 642 | + * @param hospitalId | |
| 640 | 643 | * @param startDate |
| 641 | 644 | * @param endDate |
| 642 | 645 | * @return |
| 643 | 646 | |
| ... | ... | @@ -652,8 +655,10 @@ |
| 652 | 655 | /** |
| 653 | 656 | * 统计管理-孕产妇数据统计-2.3.2-乡镇级别,最后一次检查逾期 |
| 654 | 657 | * |
| 658 | + * @param hospitalId | |
| 655 | 659 | * @param startDate |
| 656 | 660 | * @param endDate |
| 661 | + * @param areaId | |
| 657 | 662 | * @return |
| 658 | 663 | */ |
| 659 | 664 | @RequestMapping(value = "/getAreaFinallyOverdue", method = RequestMethod.GET) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
3bd5759
| ... | ... | @@ -26,11 +26,13 @@ |
| 26 | 26 | import com.mongodb.BasicDBObject; |
| 27 | 27 | import org.apache.commons.collections.CollectionUtils; |
| 28 | 28 | import org.apache.commons.collections.map.HashedMap; |
| 29 | +import org.bson.types.ObjectId; | |
| 29 | 30 | import org.springframework.beans.factory.annotation.Autowired; |
| 30 | 31 | import org.springframework.beans.factory.annotation.Qualifier; |
| 31 | 32 | import org.springframework.data.domain.Sort; |
| 32 | 33 | import org.springframework.data.mongodb.core.MongoTemplate; |
| 33 | 34 | import org.springframework.data.mongodb.core.aggregation.Aggregation; |
| 35 | +import org.springframework.data.mongodb.core.aggregation.AggregationOperation; | |
| 34 | 36 | import org.springframework.data.mongodb.core.aggregation.AggregationResults; |
| 35 | 37 | import org.springframework.data.mongodb.core.query.Criteria; |
| 36 | 38 | import org.springframework.data.mongodb.core.query.Query; |
| ... | ... | @@ -5061,6 +5063,56 @@ |
| 5061 | 5063 | br.setErrorcode(ErrorCodeConstants.SUCCESS); |
| 5062 | 5064 | br.setErrormsg("成功"); |
| 5063 | 5065 | br.setObject(data); |
| 5066 | + return br; | |
| 5067 | + } | |
| 5068 | + | |
| 5069 | + public BaseResponse getBabyCheckOverdue(String hospitalId, Date startDate, Date endDate) { | |
| 5070 | + BaseResponse br = new BaseResponse(); | |
| 5071 | + List <Map <String, Object>> mapList=new ArrayList<>(); | |
| 5072 | + Criteria criteria = Criteria.where("nextDate") | |
| 5073 | + .gte(startDate).lte(endDate) | |
| 5074 | + .and("hospitalId").is(hospitalId) | |
| 5075 | + .and("yn").is(1); | |
| 5076 | + List<BabyModel> babyModelList = mongoTemplate.find(Query.query(criteria), BabyModel.class); | |
| 5077 | + List<Object> ids=new ArrayList<>(); | |
| 5078 | + for (BabyModel babyModel : babyModelList) { | |
| 5079 | + if(babyModel.getId().length()>24){ | |
| 5080 | + ids.add(babyModel.getId()); | |
| 5081 | + }else { | |
| 5082 | + ids.add(new ObjectId(babyModel.getId())); | |
| 5083 | + } | |
| 5084 | + } | |
| 5085 | + //分组查询 | |
| 5086 | + Criteria criteria2 = Criteria.where("_id").in(ids) | |
| 5087 | + .and("nextDate").lt(new Date()); | |
| 5088 | + AggregationOperation match = Aggregation.match(criteria2); | |
| 5089 | + AggregationOperation group = Aggregation.group("lastCheckDoctor").count().as("count"); | |
| 5090 | + Aggregation aggregation= Aggregation.newAggregation(match, group); | |
| 5091 | + AggregationResults<HashMap> result = mongoTemplate.aggregate(aggregation,"lyms_baby", HashMap.class); | |
| 5092 | + int count=0;//逾期合计 | |
| 5093 | + for (HashMap mappedResult : result.getMappedResults()) { | |
| 5094 | + Map <String, Object> map=new HashMap<>(); | |
| 5095 | + | |
| 5096 | + if (null!=mappedResult.get("_id")) { | |
| 5097 | + //接生医生姓名 | |
| 5098 | + String doctor = ""; | |
| 5099 | + Users users = usersService.getUsers(Integer.parseInt(mappedResult.get("_id").toString())); | |
| 5100 | + if (users != null && users.getYn() == YnEnums.YES.getId()) { | |
| 5101 | + doctor = users.getName(); | |
| 5102 | + } | |
| 5103 | + map.put("name", doctor); | |
| 5104 | + map.put("count", mappedResult.get("count")); | |
| 5105 | + count+=Integer.parseInt(mappedResult.get("count").toString()); | |
| 5106 | + mapList.add(map); | |
| 5107 | + } | |
| 5108 | + } | |
| 5109 | + Map<String, Object> totalMap=new HashedMap(); | |
| 5110 | + totalMap.put("name","合计(逾期未检)"); | |
| 5111 | + totalMap.put("count",count); | |
| 5112 | + mapList.add(totalMap); | |
| 5113 | + br.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 5114 | + br.setErrormsg("成功"); | |
| 5115 | + br.setObject(mapList); | |
| 5064 | 5116 | return br; |
| 5065 | 5117 | } |
| 5066 | 5118 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
3bd5759
| ... | ... | @@ -5039,7 +5039,11 @@ |
| 5039 | 5039 | .and("yn").is(1); |
| 5040 | 5040 | final long count = mongoTemplate.count(Query.query(criteria2), AntExRecordModel.class); |
| 5041 | 5041 | if(count==0){ |
| 5042 | - ids.add(new ObjectId(antExChuModel.getId())); | |
| 5042 | + if(antExChuModel.getId().length()>24){ | |
| 5043 | + ids.add(antExChuModel.getId()); | |
| 5044 | + }else { | |
| 5045 | + ids.add(new ObjectId(antExChuModel.getId())); | |
| 5046 | + } | |
| 5043 | 5047 | } |
| 5044 | 5048 | } |
| 5045 | 5049 | //分组查询 |
| ... | ... | @@ -5094,7 +5098,7 @@ |
| 5094 | 5098 | Map <String, Object> map=new HashMap<>(); |
| 5095 | 5099 | |
| 5096 | 5100 | if (null!=mappedResult.get("_id")) { |
| 5097 | - //接生医生姓名 | |
| 5101 | + //医生姓名 | |
| 5098 | 5102 | String doctor = ""; |
| 5099 | 5103 | Users users = usersService.getUsers(Integer.parseInt(mappedResult.get("_id").toString())); |
| 5100 | 5104 | if (users != null && users.getYn() == YnEnums.YES.getId()) { |
| ... | ... | @@ -5120,7 +5124,6 @@ |
| 5120 | 5124 | public BaseResponse getAreaFinallyOverdue(String hospitalId, String areaId,Date startDate, Date endDate) { |
| 5121 | 5125 | BaseResponse br = new BaseResponse(); |
| 5122 | 5126 | List <Map <String, Object>> mapList=new ArrayList<>(); |
| 5123 | - String name1 = CommonsHelper.getName1(areaId, basicConfigService); | |
| 5124 | 5127 | Criteria criteria = Criteria.where("bookbuildingDate") |
| 5125 | 5128 | .gte(startDate).lte(endDate) |
| 5126 | 5129 | .and("areaRegisterId").is(areaId) |