Commit 0ad1ba4c470f53659a752a10e0887741527ae7c7
1 parent
dd3937a191
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 86 additions and 1 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/AreaCountController.java
View file @
0ad1ba4
| ... | ... | @@ -527,5 +527,27 @@ |
| 527 | 527 | patientSyncMysqlFacade.getPublicHygieneServiceCountExport(provinceId,cityId,areaId,streetId,dateTime,response); |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | + /** | |
| 531 | + * 公共卫生项目统计 中医指导明细 | |
| 532 | + * @param request | |
| 533 | + * @param provinceId | |
| 534 | + * @param cityId | |
| 535 | + * @param areaId | |
| 536 | + * @param streetId | |
| 537 | + * @param dateTime | |
| 538 | + * @return | |
| 539 | + */ | |
| 540 | + @RequestMapping(method = RequestMethod.GET, value = "/getBabyZyzdItems") | |
| 541 | + @ResponseBody | |
| 542 | + @TokenRequired | |
| 543 | + public BaseResponse getBabyZyzdItems(HttpServletRequest request, | |
| 544 | + Integer page, Integer limit, | |
| 545 | + @RequestParam String areaId, | |
| 546 | + @RequestParam( required = false) String streetId, | |
| 547 | + @RequestParam Date dateTime) { | |
| 548 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 549 | + return patientSyncMysqlFacade.getBabyZyzdItems(page,limit,areaId,streetId,dateTime); | |
| 550 | + } | |
| 551 | + | |
| 530 | 552 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientSyncMysqlFacade.java
View file @
0ad1ba4
| ... | ... | @@ -7,9 +7,11 @@ |
| 7 | 7 | import com.lyms.platform.common.result.BaseObjectResponse; |
| 8 | 8 | import com.lyms.platform.common.result.BaseResponse; |
| 9 | 9 | import com.lyms.platform.common.result.PageResult; |
| 10 | +import com.lyms.platform.common.result.RespBuilder; | |
| 10 | 11 | import com.lyms.platform.common.utils.*; |
| 11 | 12 | import com.lyms.platform.operate.web.result.BabyCheckPageResult; |
| 12 | 13 | import com.lyms.platform.operate.web.result.BabyPageResult; |
| 14 | +import com.lyms.platform.operate.web.service.impl.BaseServiceImpl; | |
| 13 | 15 | import com.lyms.platform.operate.web.utils.ResponseUtil; |
| 14 | 16 | import com.lyms.platform.operate.web.utils.UnitConstants; |
| 15 | 17 | import com.lyms.platform.operate.web.utils.UnitUtils; |
| ... | ... | @@ -52,7 +54,7 @@ |
| 52 | 54 | */ |
| 53 | 55 | |
| 54 | 56 | @Component |
| 55 | -public class PatientSyncMysqlFacade { | |
| 57 | +public class PatientSyncMysqlFacade extends BaseServiceImpl { | |
| 56 | 58 | @Autowired |
| 57 | 59 | private PatientsService patientsService; |
| 58 | 60 | @Autowired |
| ... | ... | @@ -3478,6 +3480,10 @@ |
| 3478 | 3480 | Aggregation aggregation24= Aggregation.newAggregation(match24, group24); |
| 3479 | 3481 | AggregationResults<HashMap> result24 = mongoTemplate.aggregate(aggregation24,"lyms_babycheck", HashMap.class); |
| 3480 | 3482 | data24=result24.getMappedResults().size(); |
| 3483 | + | |
| 3484 | +// data24 = (int) mongoTemplate.count(new Query(Criteria.where("hospitalId").is(hospitalId) | |
| 3485 | +// .and("yn") | |
| 3486 | +// .is(YnEnums.YES.getId()).and("birth").gte(end).lte(start)),BabyCheckModel.class); | |
| 3481 | 3487 | int lastDate24= null==hospitalDate.get("data24")?0:Integer.parseInt(hospitalDate.get("data24").toString()); |
| 3482 | 3488 | hospitalDate.put("data24",data24+lastDate24); |
| 3483 | 3489 | |
| ... | ... | @@ -3521,6 +3527,9 @@ |
| 3521 | 3527 | cnames.put("data20", "产后访视率%"); |
| 3522 | 3528 | cnames.put("data21", "孕产妇系统管理人数"); |
| 3523 | 3529 | cnames.put("data22", "孕产妇系统管理率%"); |
| 3530 | + cnames.put("data23", "本年度儿童中医指导数"); | |
| 3531 | + cnames.put("data24", "本年度儿童数"); | |
| 3532 | + cnames.put("data25", "中医指导管理率%"); | |
| 3524 | 3533 | List<Map<String, Object>> results = new ArrayList<>(); |
| 3525 | 3534 | |
| 3526 | 3535 | BaseObjectResponse baseObjectResponse= (BaseObjectResponse) getPublicHygieneServiceCount(provinceId, cityId, areaId, streetId, dateTime); |
| ... | ... | @@ -3529,6 +3538,60 @@ |
| 3529 | 3538 | results.add(map); |
| 3530 | 3539 | } |
| 3531 | 3540 | ResponseUtil.responseExcel(cnames, results, response); |
| 3541 | + } | |
| 3542 | + | |
| 3543 | + public BaseResponse getBabyZyzdItems( Integer page, Integer limit, String areaId, String streetId, Date dateTime) { | |
| 3544 | + //获得区县下的街道 | |
| 3545 | + List<BasicConfig> regions = getRegions(areaId,streetId); | |
| 3546 | + List<String> hospitalIds = new ArrayList<>(); | |
| 3547 | + for (BasicConfig region : regions) { | |
| 3548 | + //获得街道下的医院 | |
| 3549 | + List<Organization> organizations = getOrganization(region.getId()); | |
| 3550 | + for (Organization organization : organizations) { | |
| 3551 | + String hospitalId= StringUtils.getIntToVal(organization.getId()); | |
| 3552 | + hospitalIds.add(hospitalId); | |
| 3553 | + } | |
| 3554 | + } | |
| 3555 | + | |
| 3556 | + if (CollectionUtils.isNotEmpty(hospitalIds)) | |
| 3557 | + { | |
| 3558 | + Criteria criteria = Criteria.where("yn").ne(0).and("hospitalId").in(hospitalIds); | |
| 3559 | + criteria.and("articleTypes").in(Arrays.asList(1,2,3,4,5)); | |
| 3560 | + Query query = new Query(criteria); | |
| 3561 | + PageResult pageResult = findMongoPage(BabyCheckModel.class, query.with(new Sort(Sort.Direction.DESC, "created")), page, limit); | |
| 3562 | + List <BabyCheckModel> babyCheckModelList = (List <BabyCheckModel>) pageResult.getGrid(); | |
| 3563 | + List <Map <String, Object>> list = new ArrayList(); | |
| 3564 | + for (BabyCheckModel babyCheckModel : babyCheckModelList) { | |
| 3565 | + Map <String, Object> map = new HashMap <>(); | |
| 3566 | + map.put("checkId", babyCheckModel.getId()); | |
| 3567 | + if (StringUtils.isNotEmpty(babyCheckModel.getBuildId())) { | |
| 3568 | + BabyModel babyModel = mongoTemplate.findOne(Query.query(Criteria.where("_id").is(babyCheckModel.getBuildId())), BabyModel.class); | |
| 3569 | + if (babyModel == null) { | |
| 3570 | + System.out.println("no baby "+ babyCheckModel.getBuildId()); | |
| 3571 | + continue; | |
| 3572 | + } | |
| 3573 | + map.put("id", babyModel.getId()); | |
| 3574 | + map.put("babyName", babyModel.getName()); | |
| 3575 | + map.put("sex", babyModel.getSex() != 0 ? "男" : "女"); | |
| 3576 | + map.put("mName", babyModel.getMname()); | |
| 3577 | + map.put("mCardNo", babyModel.getMcertNo()); | |
| 3578 | + map.put("monthAge", DateUtil.getMonth(babyModel.getBirth(), babyCheckModel.getCheckDate())); | |
| 3579 | + map.put("birth",DateUtil.getyyyy_MM_dd(babyModel.getBirth())); | |
| 3580 | + map.put("mphone",babyModel.getMphone()); | |
| 3581 | + } | |
| 3582 | + map.put("checkTime", DateUtil.getyyyy_MM_dd(babyCheckModel.getCheckDate())); | |
| 3583 | + map.put("nextCheckTime", DateUtil.getyyyy_MM_dd(babyCheckModel.getNextDate())); | |
| 3584 | + map.put("height", babyCheckModel.getHeight()); | |
| 3585 | + map.put("weight", babyCheckModel.getWeight()); | |
| 3586 | + map.put("articleTypes", babyCheckModel.getArticleTypes()); | |
| 3587 | + | |
| 3588 | + list.add(map); | |
| 3589 | + } | |
| 3590 | + pageResult.setGrid(list); | |
| 3591 | + return RespBuilder.buildSuccess(pageResult); | |
| 3592 | + } | |
| 3593 | + return RespBuilder.buildSuccess(null); | |
| 3594 | + | |
| 3532 | 3595 | } |
| 3533 | 3596 | } |