Commit f90e7aac1614a6ea67f1ff5751000370c03830e4
1 parent
d382d65519
Exists in
master
and in
6 other branches
儿童统计
Showing 2 changed files with 69 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyCheckController.java
View file @
f90e7aa
... | ... | @@ -599,5 +599,22 @@ |
599 | 599 | public BaseResponse getQhdQhdBabyPsychology(@RequestParam(required = false) Integer mage) { |
600 | 600 | return RespBuilder.buildSuccess(QhdBabyPsychologyEnums.getListMap(null!=mage?mage:null)); |
601 | 601 | } |
602 | + | |
603 | + | |
604 | + /** | |
605 | + * 查询每个医生 做的 儿保 心里 高危 营养等科室的总和 | |
606 | + * @param checkTime | |
607 | + * @param request | |
608 | + * @return | |
609 | + */ | |
610 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyDoctorCount") | |
611 | + @ResponseBody | |
612 | + @TokenRequired | |
613 | + public BaseResponse getBabyDoctorCount(@RequestParam(required = true) String checkTime, | |
614 | + HttpServletRequest request) { | |
615 | + return babyCheckFacade.getBabyDoctorCount(checkTime, getUserId(request)); | |
616 | + } | |
617 | + | |
618 | + | |
602 | 619 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
f90e7aa
... | ... | @@ -19,10 +19,7 @@ |
19 | 19 | import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; |
20 | 20 | import com.lyms.platform.operate.web.utils.MongoUtil; |
21 | 21 | import com.lyms.platform.permission.dao.master.CouponMapper; |
22 | -import com.lyms.platform.permission.model.CheckItem; | |
23 | -import com.lyms.platform.permission.model.Organization; | |
24 | -import com.lyms.platform.permission.model.PatientService; | |
25 | -import com.lyms.platform.permission.model.Users; | |
22 | +import com.lyms.platform.permission.model.*; | |
26 | 23 | import com.lyms.platform.permission.service.*; |
27 | 24 | import com.lyms.platform.pojo.*; |
28 | 25 | import com.lyms.platform.query.*; |
... | ... | @@ -4567,6 +4564,57 @@ |
4567 | 4564 | AggregationResults <BasicDBObject> outputTypeCount4 = |
4568 | 4565 | mongoTemplate.aggregate(aggregation4, "lyms_babycheck", BasicDBObject.class); |
4569 | 4566 | return outputTypeCount4.getMappedResults().size(); |
4567 | + } | |
4568 | + | |
4569 | + public BaseResponse getBabyDoctorCount(String checkTime, Integer userId) { | |
4570 | + | |
4571 | + | |
4572 | + String hospialId = autoMatchFacade.getHospitalId(userId); | |
4573 | + UsersQuery query = new UsersQuery(); | |
4574 | + query.setOrgId(Integer.parseInt(hospialId)); | |
4575 | + query.setYn(YnEnums.YES.getId()); | |
4576 | + List<Users> users = usersService.queryUsers(query); | |
4577 | + | |
4578 | + Date startDate = null; | |
4579 | + Date endDate = null; | |
4580 | + if (StringUtils.isNotEmpty(checkTime)) | |
4581 | + { | |
4582 | + String[] arrs = checkTime.split(" - "); | |
4583 | + startDate = DateUtil.getDayFirstSecond(DateUtil.parseYMD(arrs[0])); | |
4584 | + endDate = DateUtil.getDayLastSecond(DateUtil.parseYMD(arrs[1])); | |
4585 | + } | |
4586 | + | |
4587 | + List<Map> datas = new ArrayList<>(); | |
4588 | + if (CollectionUtils.isNotEmpty(users)) | |
4589 | + { | |
4590 | + for (Users user : users) | |
4591 | + { | |
4592 | + Map data = new HashMap(); | |
4593 | + Integer uId = user.getId(); | |
4594 | + | |
4595 | + //儿保检查 | |
4596 | + int checkCount = (int)mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospialId).and("checkDate").gte(startDate).lte(endDate).and("yn").is(YnEnums.YES.getId())),BabyCheckModel.class); | |
4597 | + //营养专科 | |
4598 | + int babyNutritioncount = (int)mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospialId).and("checkDate").gte(startDate).lte(endDate).and("yn").is(YnEnums.YES.getId())),BabyNutritionSpecialtyModel.class); | |
4599 | + //高危儿专科 | |
4600 | + int babyHightcount = (int)mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospialId).and("checkDate").gte(startDate).lte(endDate).and("yn").is(YnEnums.YES.getId())),BabyHighRiskBabyModel.class); | |
4601 | + //心里专科 | |
4602 | + int babyPsychologiscount = (int)mongoTemplate.count(Query.query(Criteria.where("hospitalId").is(hospialId).and("checkDate").gte(startDate).lte(endDate).and("yn").is(YnEnums.YES.getId())),BabyPsychologistModel.class); | |
4603 | + | |
4604 | + int count = checkCount+babyNutritioncount+babyHightcount+babyPsychologiscount; | |
4605 | + if (count == 0) | |
4606 | + { | |
4607 | + continue; | |
4608 | + } | |
4609 | + data.put("doctorId",uId); | |
4610 | + data.put("doctorName",user.getName()); | |
4611 | + data.put("count",count); | |
4612 | + | |
4613 | + datas.add(data); | |
4614 | + } | |
4615 | + } | |
4616 | + return new BaseObjectResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setData(datas).setErrormsg("成功"); | |
4617 | + | |
4570 | 4618 | } |
4571 | 4619 | } |