Commit 90fd379a94a700506f0d7b1e956eaab9f6a73794
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyStatisticsManagerController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PredictedStatisticsFacade.java
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
90fd379
... | ... | @@ -52,8 +52,17 @@ |
52 | 52 | private String buildDoctor; |
53 | 53 | |
54 | 54 | private String enable; |
55 | + private String enableNot; | |
55 | 56 | private String source; |
56 | 57 | |
58 | + public String getEnableNot() { | |
59 | + return enableNot; | |
60 | + } | |
61 | + | |
62 | + public void setEnableNot(String enableNot) { | |
63 | + this.enableNot = enableNot; | |
64 | + } | |
65 | + | |
57 | 66 | public String getSource() { |
58 | 67 | return source; |
59 | 68 | } |
... | ... | @@ -583,6 +592,10 @@ |
583 | 592 | |
584 | 593 | if (!StringUtils.isEmpty(dueType)) { |
585 | 594 | condition = condition.and("dueType", dueType, MongoOper.IS); |
595 | + } | |
596 | + | |
597 | + if (!StringUtils.isEmpty(enableNot)) { | |
598 | + condition = condition.and("enable", enableNot, MongoOper.NE); | |
586 | 599 | } |
587 | 600 | |
588 | 601 | if (null != hospitalIdList) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BabyStatisticsManagerController.java
View file @
90fd379
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | Map<String, String> header = new LinkedHashMap<>(); |
111 | 111 | header.put("name", "姓名"); |
112 | 112 | header.put("sex", "性别"); |
113 | - header.put("monthAge", "月龄"); | |
113 | + header.put("monthAge", "建档月龄"); | |
114 | 114 | header.put("birth", "出生日期"); |
115 | 115 | header.put("buildDate", "建档日期"); |
116 | 116 | header.put("diagnose", "高危诊断"); |
... | ... | @@ -195,7 +195,7 @@ |
195 | 195 | Map<String, String> header = new LinkedHashMap<>(); |
196 | 196 | header.put("name", "姓名"); |
197 | 197 | header.put("sex", "性别"); |
198 | - header.put("monthAge", "月龄"); | |
198 | + header.put("monthAge", "体检月龄"); | |
199 | 199 | header.put("birth", "出生日期"); |
200 | 200 | header.put("checkDate", "检查日期"); |
201 | 201 | header.put("diagnose", "高危诊断"); |
... | ... | @@ -280,7 +280,7 @@ |
280 | 280 | Map<String, String> header = new LinkedHashMap<>(); |
281 | 281 | header.put("name", "姓名"); |
282 | 282 | header.put("sex", "性别"); |
283 | - header.put("monthAge", "月龄"); | |
283 | + header.put("monthAge", "体检月龄"); | |
284 | 284 | header.put("birth", "出生日期"); |
285 | 285 | header.put("checkDate", "检查日期"); |
286 | 286 | header.put("diagnose", "高危诊断"); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyStatisticsManagerFacade.java
View file @
90fd379
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | import org.springframework.beans.factory.annotation.Autowired; |
23 | 23 | import org.springframework.stereotype.Component; |
24 | 24 | |
25 | +import java.math.BigDecimal; | |
25 | 26 | import java.util.*; |
26 | 27 | |
27 | 28 | /** |
... | ... | @@ -57,6 +58,7 @@ |
57 | 58 | babyModelQuery.setBuildDateStart(DateUtil.getSNDate(babyStatisticsManagerBuildDoctorGroupRequest.getBuildDate())[0]); |
58 | 59 | babyModelQuery.setBuildDateEnd(DateUtil.getSNDate(babyStatisticsManagerBuildDoctorGroupRequest.getBuildDate())[1]); |
59 | 60 | } |
61 | + babyModelQuery.setEnableNot("2"); | |
60 | 62 | String hospitalId; |
61 | 63 | try { |
62 | 64 | hospitalId = autoMatchFacade.getHospitalId(babyStatisticsManagerBuildDoctorGroupRequest.getOperatorId()); |
63 | 65 | |
64 | 66 | |
... | ... | @@ -74,14 +76,20 @@ |
74 | 76 | BabyStatisticsManagerBuildDoctorGroupQueryModel babyStatisticsManagerBuildDoctorGroupQueryModel = new BabyStatisticsManagerBuildDoctorGroupQueryModel(); |
75 | 77 | String buildDoctorName; |
76 | 78 | try { |
77 | - buildDoctorName = usersService.getUsers(Integer.valueOf(hashMap.get("_id").toString())).getName(); | |
79 | + if ("a9e5507f-e7da-4ec6-b8db-9a1e4d1b7c29".equals(hashMap.get("_id").toString())) { | |
80 | + buildDoctorName = "产科病房"; | |
81 | + } else { | |
82 | + buildDoctorName = usersService.getUsers(Integer.valueOf(hashMap.get("_id").toString())).getName(); | |
83 | + } | |
78 | 84 | } catch (Exception e) { |
79 | - buildDoctorName = "-"; | |
85 | + buildDoctorName = null; | |
80 | 86 | } |
81 | - babyStatisticsManagerBuildDoctorGroupQueryModel.setBuildDoctorName(buildDoctorName); | |
82 | - babyStatisticsManagerBuildDoctorGroupQueryModel.setBuildDoctorId(hashMap.get("_id") == null ? null : hashMap.get("_id").toString()); | |
83 | - babyStatisticsManagerBuildDoctorGroupQueryModel.setCount(hashMap.get("count").toString()); | |
84 | - babyStatisticsManagerBuildDoctorGroupQueryModelList.add(babyStatisticsManagerBuildDoctorGroupQueryModel); | |
87 | + if (StringUtils.isNotEmpty(buildDoctorName)) { | |
88 | + babyStatisticsManagerBuildDoctorGroupQueryModel.setBuildDoctorName(buildDoctorName); | |
89 | + babyStatisticsManagerBuildDoctorGroupQueryModel.setBuildDoctorId(hashMap.get("_id") == null ? null : hashMap.get("_id").toString()); | |
90 | + babyStatisticsManagerBuildDoctorGroupQueryModel.setCount(hashMap.get("count").toString()); | |
91 | + babyStatisticsManagerBuildDoctorGroupQueryModelList.add(babyStatisticsManagerBuildDoctorGroupQueryModel); | |
92 | + } | |
85 | 93 | } |
86 | 94 | } |
87 | 95 | |
... | ... | @@ -112,12 +120,12 @@ |
112 | 120 | }); |
113 | 121 | |
114 | 122 | // 干掉空名字医生 |
115 | - Iterator<BabyStatisticsManagerBuildDoctorGroupQueryModel> iterator = babyStatisticsManagerBuildDoctorGroupQueryModelList.iterator(); | |
116 | - while (iterator.hasNext()) { | |
117 | - if (("-").equals(iterator.next().getBuildDoctorName())) { | |
118 | - iterator.remove(); | |
119 | - } | |
120 | - } | |
123 | + // Iterator<BabyStatisticsManagerBuildDoctorGroupQueryModel> iterator = babyStatisticsManagerBuildDoctorGroupQueryModelList.iterator(); | |
124 | + // while (iterator.hasNext()) { | |
125 | + // if (("-").equals(iterator.next().getBuildDoctorName())) { | |
126 | + // iterator.remove(); | |
127 | + // } | |
128 | + // } | |
121 | 129 | |
122 | 130 | babyStatisticsManagerBuildDoctorGroupResult.setData(babyStatisticsManagerBuildDoctorGroupQueryModelList); |
123 | 131 | babyStatisticsManagerBuildDoctorGroupResult.setErrorcode(ErrorCodeConstants.SUCCESS); |
... | ... | @@ -149,6 +157,7 @@ |
149 | 157 | return babyStatisticsManagerBuildDoctorListResult; |
150 | 158 | } |
151 | 159 | babyModelQuery.setHospitalId(hospitalId); |
160 | + babyModelQuery.setEnableNot("2"); | |
152 | 161 | List<BabyModel> babyModelList = babyService.queryBabyWithQuery(babyModelQuery); |
153 | 162 | List<BabyStatisticsManagerBuildDoctorListQueryModel> babyStatisticsManagerBuildDoctorListQueryModelList = new ArrayList<>(); |
154 | 163 | if (CollectionUtils.isNotEmpty(babyModelList)) { |
... | ... | @@ -477,7 +486,6 @@ |
477 | 486 | babyCheckModelQuery.setPage(babyStatisticsManagerWeekAgeListRequest.getPage()); |
478 | 487 | babyCheckModelQuery.setNeed("need"); |
479 | 488 | } |
480 | - List<BabyCheckModel> babyCheckModelList = babyCheckService.queryBabyCheckRecord(babyCheckModelQuery); | |
481 | 489 | |
482 | 490 | String hospitalId; |
483 | 491 | try { |
... | ... | @@ -488,6 +496,7 @@ |
488 | 496 | return babyStatisticsManagerWeekAgeListResult; |
489 | 497 | } |
490 | 498 | babyCheckModelQuery.setHospitalId(hospitalId); |
499 | + List<BabyCheckModel> babyCheckModelList = babyCheckService.queryBabyCheckRecord(babyCheckModelQuery); | |
491 | 500 | |
492 | 501 | List<BabyStatisticsManagerWeekAgeListQueryModel> babyStatisticsManagerWeekAgeListQueryModelList = new ArrayList<>(); |
493 | 502 | |
494 | 503 | |
... | ... | @@ -826,12 +835,12 @@ |
826 | 835 | }); |
827 | 836 | |
828 | 837 | // 检查人数 |
829 | - List<Integer> result = new ArrayList<>(); | |
838 | + List<Integer> temp = new ArrayList<>(); | |
830 | 839 | Integer total = 0; |
831 | 840 | ExceptionUtils.catchException("babyStatisticsManagerSelfConversionList list result :" + list); |
832 | 841 | // 从0开始,没有也填充 |
833 | 842 | int index = 0; |
834 | - for (Integer i = 0; i < 13; i++) { | |
843 | + for (Integer i = 0; i < 37; i++) { | |
835 | 844 | try { |
836 | 845 | while (!i.toString().equals(list.get(index).get("EXAMINE_MONTH").toString()) && i > Integer.valueOf(list.get(index).get("EXAMINE_MONTH").toString())) { |
837 | 846 | index++; |
838 | 847 | |
839 | 848 | |
840 | 849 | |
841 | 850 | |
842 | 851 | |
843 | 852 | |
844 | 853 | |
... | ... | @@ -840,49 +849,56 @@ |
840 | 849 | index++; |
841 | 850 | } |
842 | 851 | if (CollectionUtils.isEmpty(list) || list.size() < index) { |
843 | - result.add(0); | |
852 | + temp.add(0); | |
844 | 853 | } else if (list.size() < index && (list.get(index) == null || !i.toString().equals(list.get(index).get("EXAMINE_MONTH").toString()))) { |
845 | - result.add(0); | |
854 | + temp.add(0); | |
846 | 855 | } else { |
847 | 856 | try { |
848 | - result.add(Integer.valueOf(list.get(index).get("CNT").toString())); | |
857 | + temp.add(Integer.valueOf(list.get(index).get("CNT").toString())); | |
849 | 858 | total += Integer.valueOf(list.get(index).get("CNT").toString()); |
850 | 859 | index++; |
851 | 860 | } catch (Exception e) { |
852 | - result.add(0); | |
861 | + temp.add(0); | |
853 | 862 | index++; |
854 | 863 | } |
855 | 864 | } |
856 | 865 | } |
857 | 866 | |
858 | - Integer check18 = 0; | |
859 | - Integer check24 = 0; | |
860 | - Integer check30 = 0; | |
861 | - Integer check36 = 0; | |
862 | - for (Map<String, Object> other : list) { | |
863 | - if (null != other.get("EXAMINE_MONTH") && "18".equals(other.get("EXAMINE_MONTH").toString())) { | |
864 | - check18 = Integer.valueOf(other.get("CNT").toString()); | |
865 | - } | |
866 | - if (null != other.get("EXAMINE_MONTH") && "24".equals(other.get("EXAMINE_MONTH").toString())) { | |
867 | - check24 = Integer.valueOf(other.get("CNT").toString()); | |
868 | - } | |
869 | - if (null != other.get("EXAMINE_MONTH") && "30".equals(other.get("EXAMINE_MONTH").toString())) { | |
870 | - check30 = Integer.valueOf(other.get("CNT").toString()); | |
871 | - } | |
872 | - if (null != other.get("EXAMINE_MONTH") && "36".equals(other.get("EXAMINE_MONTH").toString())) { | |
873 | - check36 = Integer.valueOf(other.get("CNT").toString()); | |
874 | - } | |
875 | - } | |
876 | - result.add(check18); | |
877 | - result.add(check24); | |
878 | - result.add(check30); | |
879 | - result.add(check36); | |
867 | + // Integer check18 = 0; | |
868 | + // Integer check24 = 0; | |
869 | + // Integer check30 = 0; | |
870 | + // Integer check36 = 0; | |
871 | + // for (Map<String, Object> other : list) { | |
872 | + // if (null != other.get("EXAMINE_MONTH") && "18".equals(other.get("EXAMINE_MONTH").toString())) { | |
873 | + // check18 = Integer.valueOf(other.get("CNT").toString()); | |
874 | + // } | |
875 | + // if (null != other.get("EXAMINE_MONTH") && "24".equals(other.get("EXAMINE_MONTH").toString())) { | |
876 | + // check24 = Integer.valueOf(other.get("CNT").toString()); | |
877 | + // } | |
878 | + // if (null != other.get("EXAMINE_MONTH") && "30".equals(other.get("EXAMINE_MONTH").toString())) { | |
879 | + // check30 = Integer.valueOf(other.get("CNT").toString()); | |
880 | + // } | |
881 | + // if (null != other.get("EXAMINE_MONTH") && "36".equals(other.get("EXAMINE_MONTH").toString())) { | |
882 | + // check36 = Integer.valueOf(other.get("CNT").toString()); | |
883 | + // } | |
884 | + // } | |
885 | + // result.add(check18); | |
886 | + // result.add(check24); | |
887 | + // result.add(check30); | |
888 | + // result.add(check36); | |
880 | 889 | |
881 | - for (int i = 1; i < result.size(); i++) { | |
882 | - result.set(i, result.get(i) + result.get(i - 1)); | |
890 | + for (int i = 1; i < temp.size(); i++) { | |
891 | + temp.set(i, temp.get(i) + temp.get(i - 1)); | |
883 | 892 | } |
884 | - result.remove(0); | |
893 | + temp.remove(0); | |
885 | 894 | |
895 | + List<Integer> result = new ArrayList<>(); | |
896 | + result.addAll(temp.subList(0, 12)); | |
897 | + result.add(temp.get(17)); | |
898 | + result.add(temp.get(23)); | |
899 | + result.add(temp.get(29)); | |
900 | + result.add(temp.get(35)); | |
901 | + | |
886 | 902 | // 未检查人数 |
887 | 903 | List<Integer> resultOther = new ArrayList<>(); |
888 | 904 | for (Integer i : result) { |
... | ... | @@ -891,9 +907,9 @@ |
891 | 907 | |
892 | 908 | // 下面的表格 |
893 | 909 | Integer check1 = result.get(0); |
894 | - Integer check3 = result.get(2) - result.get(0); | |
895 | - Integer check6 = result.get(5) - result.get(2); | |
896 | - Integer check12 = result.get(11) - result.get(5); | |
910 | + Integer check3 = result.get(2); | |
911 | + Integer check6 = result.get(5); | |
912 | + Integer check12 = result.get(11); | |
897 | 913 | |
898 | 914 | Integer checkOther = total - result.get(11); |
899 | 915 | |
900 | 916 | |
901 | 917 | |
902 | 918 | |
903 | 919 | |
... | ... | @@ -902,15 +918,20 @@ |
902 | 918 | babyCount.add(total); |
903 | 919 | percent.add("100%"); |
904 | 920 | babyCount.add(check1); |
905 | - percent.add(Math.round((double) check1 * 100 / (double) total) / 1.00 + "%"); | |
921 | + // percent.add(Math.round((double) check1 * 100 / (double) total) / 1.00 + "%"); | |
922 | + percent.add(new BigDecimal((double) check1 * 100 / (double) total).setScale(2, BigDecimal.ROUND_HALF_UP) + "%"); | |
906 | 923 | babyCount.add(check3); |
907 | - percent.add(Math.round((double) check3 * 100 / (double) total) / 1.00 + "%"); | |
924 | + // percent.add(Math.round((double) check3 * 100 / (double) total) / 1.00 + "%"); | |
925 | + percent.add(new BigDecimal((double) check3 * 100 / (double) total).setScale(2, BigDecimal.ROUND_HALF_UP) + "%"); | |
908 | 926 | babyCount.add(check6); |
909 | - percent.add(Math.round((double) check6 * 100 / (double) total) / 1.00 + "%"); | |
927 | + // percent.add(Math.round((double) check6 * 100 / (double) total) / 1.00 + "%"); | |
928 | + percent.add(new BigDecimal((double) check6 * 100 / (double) total).setScale(2, BigDecimal.ROUND_HALF_UP) + "%"); | |
910 | 929 | babyCount.add(check12); |
911 | - percent.add(Math.round((double) check12 * 100 / (double) total) / 1.00 + "%"); | |
930 | + // percent.add(Math.round((double) check12 * 100 / (double) total) / 1.00 + "%"); | |
931 | + percent.add(new BigDecimal((double) check12 * 100 / (double) total).setScale(2, BigDecimal.ROUND_HALF_UP) + "%"); | |
912 | 932 | babyCount.add(checkOther); |
913 | - percent.add(Math.round((double) checkOther * 100 / (double) total) / 1.00 + "%"); | |
933 | + // percent.add(Math.round((double) checkOther * 100 / (double) total) / 1.00 + "%"); | |
934 | + percent.add(new BigDecimal((double) checkOther * 100 / (double) total).setScale(2, BigDecimal.ROUND_HALF_UP) + "%"); | |
914 | 935 | |
915 | 936 | babyStatisticsManagerSelfConversionListResult.setResult(result); |
916 | 937 | babyStatisticsManagerSelfConversionListResult.setResultOther(resultOther); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PredictedStatisticsFacade.java
View file @
90fd379
... | ... | @@ -70,6 +70,7 @@ |
70 | 70 | patientsQuery.setDueDateEnd(endDate); |
71 | 71 | patientsQuery.setNeed(YnEnums.YES.name()); |
72 | 72 | patientsQuery.setYn(YnEnums.YES.getId()); |
73 | + patientsQuery.setNotEnable("2"); | |
73 | 74 | patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(predictedStatisticsRequest.getOperatorId())); |
74 | 75 | List<Integer> typeList = new ArrayList<>(); |
75 | 76 | typeList.add(1); |
... | ... | @@ -134,6 +135,7 @@ |
134 | 135 | Date endDate = DateUtil.getMonthEndTime(temp); |
135 | 136 | patientsQuery.setDueDateStart(startDate); |
136 | 137 | patientsQuery.setDueDateEnd(endDate); |
138 | + patientsQuery.setNotEnable("2"); | |
137 | 139 | int count = patientsService.queryPatientCount(patientsQuery); |
138 | 140 | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM"); |
139 | 141 | String dateStr = simpleDateFormat.format(new Date()); |