Commit 5eeb1956c2affea99c1d87d3c253e3ab9677a917
1 parent
1ac078363f
Exists in
master
and in
6 other branches
区域围产儿统计
Showing 1 changed file with 72 additions and 40 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
5eeb195
... | ... | @@ -3229,7 +3229,7 @@ |
3229 | 3229 | |
3230 | 3230 | public BaseResponse queryWcExportHospList(Integer userId, String provinceId, String cityId) { |
3231 | 3231 | //获取用户权限医院和筛选条件的交集 |
3232 | - List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions(userId, provinceId, | |
3232 | + List<String> currentUserHospPermissions = areaCountFacade.getCurrentUserHospPermissions2(userId, provinceId, | |
3233 | 3233 | cityId, null); |
3234 | 3234 | |
3235 | 3235 | List<Map> hospitals = new ArrayList<>(); |
3236 | 3236 | |
... | ... | @@ -3434,11 +3434,9 @@ |
3434 | 3434 | } |
3435 | 3435 | //查询机构数 |
3436 | 3436 | List<Organization> orgs = organizationService.queryOrganization(query); |
3437 | - int orgSize = CollectionUtils.isNotEmpty(orgs) ? orgs.size() : 0; | |
3438 | - items.add(String.valueOf(orgSize)); | |
3439 | - | |
3440 | - | |
3441 | 3437 | List<String> hids = getConditionHospitalIds(currentUserHospPermissions, orgs); |
3438 | + int orgSize = CollectionUtils.isNotEmpty(hids) ? hids.size() : 0; | |
3439 | + items.add(String.valueOf(orgSize)); | |
3442 | 3440 | if (CollectionUtils.isNotEmpty(hids)) { |
3443 | 3441 | |
3444 | 3442 | BabyModelQuery babyModelQuery = new BabyModelQuery(); |
3445 | 3443 | |
3446 | 3444 | |
3447 | 3445 | |
3448 | 3446 | |
3449 | 3447 | |
3450 | 3448 | |
3451 | 3449 | |
3452 | 3450 | |
3453 | 3451 | |
3454 | 3452 | |
3455 | 3453 | |
... | ... | @@ -3595,54 +3593,58 @@ |
3595 | 3593 | |
3596 | 3594 | private List<Map<String, String>> getWcQkBabyDatas(String hospitalId, String[] dates) { |
3597 | 3595 | |
3596 | + | |
3597 | + List<String> czParentIds = getPatientIdByPreType(hospitalId, CZ, null, null); | |
3598 | + List<String> ncParentIds = getPatientIdByPreType(hospitalId, NC, null, null); | |
3599 | + | |
3598 | 3600 | List<Map<String,String>> list = new ArrayList<>(); |
3599 | 3601 | //死胎,死产 |
3600 | 3602 | //城镇 |
3601 | - String czs = getNoBaby(hospitalId,CZ,dates); | |
3602 | - String ncs = getNoBaby(hospitalId,NC,dates); | |
3603 | + String czs = getNoBaby(hospitalId,CZ,dates,czParentIds); | |
3604 | + String ncs = getNoBaby(hospitalId,NC,dates,ncParentIds); | |
3603 | 3605 | |
3604 | - Map<String,String> map = new HashMap<>(); | |
3606 | + Map<String,String> map = new LinkedHashMap<>(); | |
3605 | 3607 | map.put("czs",czs); |
3606 | 3608 | map.put("ncs", ncs); |
3607 | 3609 | list.add(map); |
3608 | 3610 | |
3609 | 3611 | //缺陷 |
3610 | - String czqx = getQueXianBaby(hospitalId,CZ,dates); | |
3611 | - String ncqx = getQueXianBaby(hospitalId,CZ,dates); | |
3612 | + String czqx = getQueXianBaby(hospitalId,dates,czParentIds); | |
3613 | + String ncqx = getQueXianBaby(hospitalId,dates,ncParentIds); | |
3612 | 3614 | |
3613 | - Map<String,String> map1 = new HashMap<>(); | |
3615 | + Map<String,String> map1 = new LinkedHashMap<>(); | |
3614 | 3616 | map1.put("czqx",czqx); |
3615 | 3617 | map1.put("ncqx", ncqx); |
3616 | 3618 | list.add(map1); |
3617 | 3619 | |
3618 | - Map<String,String> map2 = new HashMap<>(); | |
3620 | + Map<String,String> map2 = new LinkedHashMap<>(); | |
3619 | 3621 | map2.put("czqtsw","-"); |
3620 | 3622 | map2.put("ncqtsw", "-"); |
3621 | 3623 | list.add(map2); |
3622 | 3624 | |
3623 | - Map<String,String> map3 = new HashMap<>(); | |
3625 | + Map<String,String> map3 = new LinkedHashMap<>(); | |
3624 | 3626 | map3.put("czqtsw", czs + czqx); |
3625 | 3627 | map3.put("ncqtsw", ncs + ncqx); |
3626 | 3628 | list.add(map3); |
3627 | 3629 | |
3628 | - String czst = getTsBaby( hospitalId,CZ,dates,2); | |
3629 | - String ncst = getTsBaby( hospitalId,NC,dates,2); | |
3630 | + String czst = getTsBaby( hospitalId,dates,czParentIds,2); | |
3631 | + String ncst = getTsBaby( hospitalId,dates,ncParentIds,2); | |
3630 | 3632 | |
3631 | - Map<String,String> map4 = new HashMap<>(); | |
3633 | + Map<String,String> map4 = new LinkedHashMap<>(); | |
3632 | 3634 | map4.put("czst", czst); |
3633 | 3635 | map4.put("ncst", ncst); |
3634 | 3636 | list.add(map4); |
3635 | 3637 | |
3636 | 3638 | |
3637 | - String czdt = getTsBaby( hospitalId,CZ,dates,3,4,5,6,7,8); | |
3638 | - String ncdt = getTsBaby( hospitalId,NC,dates,3,4,5,6,7,8); | |
3639 | + String czdt = getTsBaby( hospitalId,dates,czParentIds,3,4,5,6,7,8); | |
3640 | + String ncdt = getTsBaby( hospitalId,dates,ncParentIds,3,4,5,6,7,8); | |
3639 | 3641 | |
3640 | - Map<String,String> map5 = new HashMap<>(); | |
3642 | + Map<String,String> map5 = new LinkedHashMap<>(); | |
3641 | 3643 | map5.put("czdt", czdt); |
3642 | 3644 | map5.put("ncdt", ncdt); |
3643 | 3645 | list.add(map5); |
3644 | 3646 | |
3645 | - Map<String,String> map6 = new HashMap<>(); | |
3647 | + Map<String,String> map6 = new LinkedHashMap<>(); | |
3646 | 3648 | map6.put("czhj", czs+czqx+czst+czdt); |
3647 | 3649 | map6.put("nchj", ncs+ncqx+ncst+ncdt); |
3648 | 3650 | list.add(map6); |
3649 | 3651 | |
... | ... | @@ -3651,8 +3653,13 @@ |
3651 | 3653 | } |
3652 | 3654 | |
3653 | 3655 | |
3654 | - private String getTsBaby(String hospitalId,String type,String[] dates,Integer ...tireNumbers) { | |
3656 | + private String getTsBaby(String hospitalId,String[] dates,List<String> parentIds,Integer ...tireNumbers) { | |
3655 | 3657 | |
3658 | + if (CollectionUtils.isEmpty(parentIds)) | |
3659 | + { | |
3660 | + return "0"; | |
3661 | + } | |
3662 | + | |
3656 | 3663 | MatDeliverQuery matDeliverQuery1 = new MatDeliverQuery(); |
3657 | 3664 | matDeliverQuery1.setYn(YnEnums.YES.getId()); |
3658 | 3665 | if (dates != null) { |
3659 | 3666 | |
3660 | 3667 | |
... | ... | @@ -3661,19 +3668,22 @@ |
3661 | 3668 | matDeliverQuery1.setEndStart(DateUtil.parseYMDHMS(dates[1])); |
3662 | 3669 | } |
3663 | 3670 | } |
3664 | - matDeliverQuery1.setParentIdList(getPatientIdByPreType(hospitalId, type, null, null)); | |
3671 | + matDeliverQuery1.setParentIdList(parentIds); | |
3665 | 3672 | matDeliverQuery1.setTireNumbers(Arrays.asList(tireNumbers)); |
3666 | 3673 | matDeliverQuery1.setFmHospital(hospitalId); |
3667 | 3674 | int doubleCount = matDeliverService.count(matDeliverQuery1); |
3668 | 3675 | return String.valueOf(doubleCount); |
3669 | 3676 | } |
3670 | 3677 | |
3671 | - private String getQueXianBaby(String hospitalId,String type,String[] dates) { | |
3672 | - | |
3678 | + private String getQueXianBaby(String hospitalId,String[] dates,List<String> parentIds) { | |
3679 | + if (CollectionUtils.isEmpty(parentIds)) | |
3680 | + { | |
3681 | + return "0"; | |
3682 | + } | |
3673 | 3683 | BabyModelQuery babyModelQuery3 = new BabyModelQuery(); |
3674 | 3684 | babyModelQuery3.setDataStatus(false); |
3675 | 3685 | babyModelQuery3.setHospitalId(hospitalId); |
3676 | - babyModelQuery3.setParentIds(getPatientIdByPreType( hospitalId, type,null,null)); | |
3686 | + babyModelQuery3.setParentIds(parentIds); | |
3677 | 3687 | if (dates != null) { |
3678 | 3688 | babyModelQuery3.setBirthStart(DateUtil.parseYMD(dates[0])); |
3679 | 3689 | if (dates.length == 2) { |
... | ... | @@ -3722,7 +3732,7 @@ |
3722 | 3732 | } |
3723 | 3733 | |
3724 | 3734 | |
3725 | - Map<String,String> map = new HashMap<>(); | |
3735 | + Map<String,String> map = new LinkedHashMap<>(); | |
3726 | 3736 | BabyModelQuery babyModelQuery = new BabyModelQuery(); |
3727 | 3737 | if (dates != null) { |
3728 | 3738 | babyModelQuery.setBirthStart(DateUtil.parseYMD(dates[0])); |
3729 | 3739 | |
3730 | 3740 | |
3731 | 3741 | |
3732 | 3742 | |
3733 | 3743 | |
... | ... | @@ -3733,30 +3743,48 @@ |
3733 | 3743 | babyModelQuery.setDataStatus(false); |
3734 | 3744 | babyModelQuery.setBuildType(2); |
3735 | 3745 | |
3736 | - babyModelQuery.setSex(1); | |
3737 | - babyModelQuery.setParentIds(getPatientIdByPreType(hospitalId, CZ, fmAgeStart, fmAgeEnd)); | |
3738 | - int cznCount = babyService.queryBabyCount(babyModelQuery); | |
3746 | + int cznCount = 0; | |
3747 | + int czlCount = 0; | |
3748 | + List<String> czParentIds = getPatientIdByPreType(hospitalId, CZ, fmAgeStart, fmAgeEnd); | |
3749 | + if (CollectionUtils.isNotEmpty(czParentIds)); | |
3750 | + { | |
3751 | + babyModelQuery.setParentIds(czParentIds); | |
3739 | 3752 | |
3753 | + babyModelQuery.setSex(1); | |
3754 | + cznCount = babyService.queryBabyCount(babyModelQuery); | |
3755 | + | |
3756 | + babyModelQuery.setSex(0); | |
3757 | + czlCount = babyService.queryBabyCount(babyModelQuery); | |
3758 | + } | |
3759 | + | |
3760 | + | |
3740 | 3761 | map.put("cznCount", String.valueOf(cznCount)); |
3741 | 3762 | |
3742 | - babyModelQuery.setSex(0); | |
3743 | - babyModelQuery.setParentIds(getPatientIdByPreType(hospitalId, CZ, fmAgeStart, fmAgeEnd)); | |
3744 | - int czlCount = babyService.queryBabyCount(babyModelQuery); | |
3745 | 3763 | map.put("czlCount", String.valueOf(czlCount)); |
3746 | 3764 | |
3747 | 3765 | int czbmCount= 0; |
3748 | 3766 | map.put("czbmCount", String.valueOf(czbmCount)); |
3749 | 3767 | |
3750 | 3768 | |
3751 | - babyModelQuery.setSex(1); | |
3752 | - babyModelQuery.setParentIds(getPatientIdByPreType(hospitalId, NC, fmAgeStart, fmAgeEnd)); | |
3753 | - int ncnCount = babyService.queryBabyCount(babyModelQuery); | |
3769 | + List<String> ncParentIds = getPatientIdByPreType(hospitalId, NC, fmAgeStart, fmAgeEnd); | |
3754 | 3770 | |
3771 | + int ncnCount = 0; | |
3772 | + int nclCount = 0; | |
3773 | + if (CollectionUtils.isNotEmpty(ncParentIds)) | |
3774 | + { | |
3775 | + babyModelQuery.setParentIds(ncParentIds); | |
3776 | + | |
3777 | + babyModelQuery.setSex(1); | |
3778 | + ncnCount = babyService.queryBabyCount(babyModelQuery); | |
3779 | + | |
3780 | + babyModelQuery.setSex(0); | |
3781 | + nclCount = babyService.queryBabyCount(babyModelQuery); | |
3782 | + } | |
3783 | + | |
3784 | + | |
3755 | 3785 | map.put("ncnCount", String.valueOf(ncnCount)); |
3756 | 3786 | |
3757 | - babyModelQuery.setSex(0); | |
3758 | - babyModelQuery.setParentIds(getPatientIdByPreType(hospitalId, NC, fmAgeStart, fmAgeEnd)); | |
3759 | - int nclCount = babyService.queryBabyCount(babyModelQuery); | |
3787 | + | |
3760 | 3788 | map.put("nclCount", String.valueOf(nclCount)); |
3761 | 3789 | |
3762 | 3790 | int ncbmCount= 0; |
3763 | 3791 | |
3764 | 3792 | |
... | ... | @@ -3825,15 +3853,19 @@ |
3825 | 3853 | list.add(dataMap); |
3826 | 3854 | } |
3827 | 3855 | |
3828 | - private String getNoBaby(String hospitalId,String type,String[] dates) | |
3856 | + private String getNoBaby(String hospitalId,String type,String[] dates,List<String> parentIds) | |
3829 | 3857 | { |
3858 | + if (CollectionUtils.isEmpty(parentIds)) | |
3859 | + { | |
3860 | + return "0"; | |
3861 | + } | |
3830 | 3862 | List<String> PregnancyOuts = new ArrayList<>(); |
3831 | 3863 | PregnancyOuts.add("1"); |
3832 | 3864 | PregnancyOuts.add("3"); |
3833 | 3865 | |
3834 | 3866 | MatDeliverQuery matDeliverQuery10 = new MatDeliverQuery(); |
3835 | 3867 | matDeliverQuery10.setYn(YnEnums.YES.getId()); |
3836 | - matDeliverQuery10.setParentIdList(getPatientIdByPreType(hospitalId, type, 0, 100)); | |
3868 | + matDeliverQuery10.setParentIdList(parentIds); | |
3837 | 3869 | if (dates != null) { |
3838 | 3870 | matDeliverQuery10.setCreatedStart(DateUtil.parseYMD(dates[0])); |
3839 | 3871 | if (dates.length == 2) { |