Commit 4370e23ab406b66694027425632c446bf9fed9f2
1 parent
fc9b4dc777
Exists in
master
and in
6 other branches
两癌
Showing 2 changed files with 30 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
4370e23
| ... | ... | @@ -728,5 +728,15 @@ | 
| 728 | 728 | @RequestParam(required = true)Date endDate) { | 
| 729 | 729 | return babyCheckFacade.getBabyCheckOverdue(hospitalId,startDate,endDate); | 
| 730 | 730 | } | 
| 731 | + | |
| 732 | + | |
| 733 | + @RequestMapping(value = "/getbabyZyzdCount", method = RequestMethod.GET) | |
| 734 | + @ResponseBody | |
| 735 | + @TokenRequired | |
| 736 | + public BaseResponse getbabyZyzdCount(@RequestParam(required = true) String checkDate, | |
| 737 | + HttpServletRequest request) { | |
| 738 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 739 | + return babyCheckFacade.getbabyZyzdCount(checkDate,loginState.getId()); | |
| 740 | + } | |
| 731 | 741 | } | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
4370e23
| ... | ... | @@ -5509,5 +5509,25 @@ | 
| 5509 | 5509 | smsConfigFacade.saveMsg(messages, babyModel.getHospitalId()); | 
| 5510 | 5510 | } | 
| 5511 | 5511 | } | 
| 5512 | + | |
| 5513 | + public BaseResponse getbabyZyzdCount(String checkDate, Integer userId) { | |
| 5514 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
| 5515 | + BabyCheckModelQuery babyCheckModelQuery = new BabyCheckModelQuery(); | |
| 5516 | + babyCheckModelQuery.setYn(YnEnums.YES.getId()); | |
| 5517 | + babyCheckModelQuery.setHospitalId(hospitalId); | |
| 5518 | + String[] checkDates = checkDate.split(" - "); | |
| 5519 | + Date start = DateUtil.parseYMD(checkDates[0]); | |
| 5520 | + Date end = DateUtil.parseYMD(checkDates[1]); | |
| 5521 | + | |
| 5522 | + Aggregation aggregation4 = | |
| 5523 | + Aggregation.newAggregation( | |
| 5524 | + Aggregation.match(Criteria.where("hospitalId").is(hospitalId).and("tcmGuide").exists(true).and("yn") | |
| 5525 | + .is(YnEnums.YES.getId()).and("checkDate").gte(DateUtil.getDayFirstSecond(start)).lte(DateUtil.getDayLastSecond(end))), | |
| 5526 | + Aggregation.group("buildId").count().as("总人数")); | |
| 5527 | + AggregationResults <BasicDBObject> results = | |
| 5528 | + mongoTemplate.aggregate(aggregation4, "lyms_babycheck", BasicDBObject.class); | |
| 5529 | + int count = results.getMappedResults().size(); | |
| 5530 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(count).setErrormsg("成功"); | |
| 5531 | + } | |
| 5512 | 5532 | } |