Commit 3bed6f556dbc5c8691e1d60ab2ae8c259ef494d7
1 parent
bef39fe383
Exists in
dev
#fix:优化五色专案管理数据统计按科室统计逻辑
Showing 2 changed files with 33 additions and 7 deletions
platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java
View file @
3bed6f5
... | ... | @@ -216,9 +216,17 @@ |
216 | 216 | ws.addCell(new Label(2, s+1, String.valueOf(map.get("buildSumNum")))); |
217 | 217 | ws.addCell(new Label(3, s+1, String.valueOf(map.get("newBuildSumNum")))); |
218 | 218 | ws.addCell(new Label(4, s+1, String.valueOf(map.get("unBuildSumNum")))); |
219 | - ws.addCell(new Label(5, s+1, new BigDecimal(String.valueOf(map.get("buildSumNum"))).multiply(new BigDecimal("100")).divide(new BigDecimal(String.valueOf(map.get("appointmentSumNum"))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
220 | - ws.addCell(new Label(6, s+1,new BigDecimal(String.valueOf(map.get("newBuildSumNum"))).multiply(new BigDecimal("100")).divide((new BigDecimal(String.valueOf(map.get("appointmentSumNum"))).add(new BigDecimal(String.valueOf(map.get("newBuildSumNum"))))).subtract(new BigDecimal(String.valueOf(map.get("buildSumNum")))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
219 | + if("0".equals(String.valueOf(map.get("appointmentSumNum")))){ | |
220 | + ws.addCell(new Label(5, s+1,"0.00%")); | |
221 | + }else { | |
222 | + ws.addCell(new Label(5, s+1, new BigDecimal(String.valueOf(map.get("buildSumNum"))).multiply(new BigDecimal("100")).divide(new BigDecimal(String.valueOf(map.get("appointmentSumNum"))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
221 | 223 | |
224 | + } | |
225 | + if ("0".equals(String.valueOf(map.get("buildSumNum")))){ | |
226 | + ws.addCell(new Label(6, s+1,"0.00%")); | |
227 | + }else { | |
228 | + ws.addCell(new Label(6, s+1,new BigDecimal(String.valueOf(map.get("newBuildSumNum"))).multiply(new BigDecimal("100")).divide((new BigDecimal(String.valueOf(map.get("buildSumNum")))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
229 | + } | |
222 | 230 | |
223 | 231 | |
224 | 232 | for (int t = 0, len = dataList.size(); t < len; t++){ |
... | ... | @@ -228,8 +236,16 @@ |
228 | 236 | ws.addCell(new Label(9, s+1+t, String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0))); |
229 | 237 | ws.addCell(new Label(10, s+1+t, String.valueOf(map.get("newBuildNum")!=null?map.get("newBuildNum"):0))); |
230 | 238 | ws.addCell(new Label(11, s+1+t, String.valueOf(map.get("unBuildNum")!=null?map.get("unBuildNum"):0))); |
231 | - ws.addCell(new Label(12, s+1+t, new BigDecimal(String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0)).multiply(new BigDecimal("100")).divide(new BigDecimal(String.valueOf(map.get("appointmentNum")!=null?map.get("appointmentNum"):0)),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
232 | - ws.addCell(new Label(13, s+1+t,new BigDecimal(String.valueOf(map.get("newBuildNum")!=null?map.get("newBuildNum"):0)).multiply(new BigDecimal("100")).divide((new BigDecimal(String.valueOf(map.get("appointmentNum")!=null?map.get("appointmentNum"):0)).add(new BigDecimal(String.valueOf(map.get("newBuildNum")!=null?map.get("newBuildNum"):0)))).subtract(new BigDecimal(String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
239 | + if (map.get("appointmentNum")==null){ | |
240 | + ws.addCell(new Label(12, s+1+t,"0.00%")); | |
241 | + }else { | |
242 | + ws.addCell(new Label(12, s+1+t, new BigDecimal(String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0)).multiply(new BigDecimal("100")).divide(new BigDecimal(String.valueOf(map.get("appointmentNum")!=null?map.get("appointmentNum"):0)),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
243 | + } | |
244 | + if (map.get("buildNum")==null){ | |
245 | + ws.addCell(new Label(13, s+1+t,"0.00%")); | |
246 | + }else { | |
247 | + ws.addCell(new Label(13, s+1+t,new BigDecimal(String.valueOf(map.get("newBuildNum")!=null?map.get("newBuildNum"):0)).multiply(new BigDecimal("100")).divide((new BigDecimal(String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%")); | |
248 | + } | |
233 | 249 | } |
234 | 250 | |
235 | 251 | ws.mergeCells(0, s+1, 0, s+dataList.size()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientDtController.java
View file @
3bed6f5
... | ... | @@ -822,7 +822,7 @@ |
822 | 822 | for (int i = 0,j=modelList.size(); i < j; i++) { |
823 | 823 | AppointmentModel appointmentModel= modelList.get(i); |
824 | 824 | String depts=appointmentModel.getDept(); |
825 | - if (StringUtils.isNotEmpty(depts)&&StringUtils.isNotEmpty(appointmentModel.getDoctor())){ | |
825 | + if (StringUtils.isNotEmpty(depts)){ | |
826 | 826 | AppointmentData appointmentData= params.get(depts); |
827 | 827 | if (appointmentData==null){ |
828 | 828 | appointmentData=new AppointmentData(); |
829 | 829 | |
... | ... | @@ -832,9 +832,12 @@ |
832 | 832 | String phone=appointmentModel.getPhone(); |
833 | 833 | String username=appointmentModel.getName(); |
834 | 834 | if (StringUtils.isNotEmpty(idCard)){ |
835 | + patientsQuery.setName(null); | |
836 | + patientsQuery.setPhone(null); | |
835 | 837 | patientsQuery.setCardNo(idCard); |
836 | 838 | }else { |
837 | 839 | if (StringUtils.isNotEmpty(username)&&StringUtils.isNotEmpty(phone)){ |
840 | + patientsQuery.setCardNo(null); | |
838 | 841 | patientsQuery.setName(username); |
839 | 842 | patientsQuery.setPhone(phone); |
840 | 843 | }else { |
841 | 844 | |
... | ... | @@ -848,11 +851,11 @@ |
848 | 851 | if (CollectionUtils.isNotEmpty(patientsList)){ |
849 | 852 | //已经建档 |
850 | 853 | //新建档人数等于当天建档人数 |
854 | + appointmentData.setBuildNum(appointmentData.getBuildNum()!=null?appointmentData.getBuildNum()+1:1); | |
851 | 855 | Patients patients= patientsList.get(0); |
852 | 856 | if (DateUtil.isBetween(patients.getCreated(),DateUtil.parseYMDHMS(startTime),DateUtil.parseYMDHMS(endTime))){ |
853 | 857 | appointmentData.setNewBuildNum(appointmentData.getNewBuildNum()!=null?appointmentData.getNewBuildNum()+1:1); |
854 | 858 | } |
855 | - appointmentData.setBuildNum(appointmentData.getBuildNum()!=null?appointmentData.getBuildNum()+1:1); | |
856 | 859 | }else { |
857 | 860 | //未建档 |
858 | 861 | appointmentData.setUnBuildNum(appointmentData.getUnBuildNum()!=null?appointmentData.getUnBuildNum()+1:1); |
... | ... | @@ -862,6 +865,7 @@ |
862 | 865 | params.put(depts,appointmentData); |
863 | 866 | } |
864 | 867 | } |
868 | + System.out.println(params); | |
865 | 869 | // 使用TreeMap进行排序 |
866 | 870 | Map<String, AppointmentData> sortedMap = new TreeMap<>(new ChineseComparator()); |
867 | 871 | sortedMap.putAll(params); |
868 | 872 | |
... | ... | @@ -953,9 +957,12 @@ |
953 | 957 | String phone=appointmentModel.getPhone(); |
954 | 958 | String username=appointmentModel.getName(); |
955 | 959 | if (StringUtils.isNotEmpty(idCard)){ |
960 | + patientsQuery.setName(null); | |
961 | + patientsQuery.setPhone(null); | |
956 | 962 | patientsQuery.setCardNo(idCard); |
957 | 963 | }else { |
958 | 964 | if (StringUtils.isNotEmpty(username)&&StringUtils.isNotEmpty(phone)){ |
965 | + patientsQuery.setCardNo(null); | |
959 | 966 | patientsQuery.setName(username); |
960 | 967 | patientsQuery.setPhone(phone); |
961 | 968 | }else { |
962 | 969 | |
... | ... | @@ -1053,9 +1060,12 @@ |
1053 | 1060 | String phone=appointmentModel.getPhone(); |
1054 | 1061 | String username=appointmentModel.getName(); |
1055 | 1062 | if (StringUtils.isNotEmpty(idCard)){ |
1063 | + patientsQuery.setName(null); | |
1064 | + patientsQuery.setPhone(null); | |
1056 | 1065 | patientsQuery.setCardNo(idCard); |
1057 | 1066 | }else { |
1058 | 1067 | if (StringUtils.isNotEmpty(username)&&StringUtils.isNotEmpty(phone)){ |
1068 | + patientsQuery.setCardNo(null); | |
1059 | 1069 | patientsQuery.setName(username); |
1060 | 1070 | patientsQuery.setPhone(phone); |
1061 | 1071 | }else { |
1062 | 1072 | |
... | ... | @@ -1069,11 +1079,11 @@ |
1069 | 1079 | if (CollectionUtils.isNotEmpty(patientsList)){ |
1070 | 1080 | //已经建档 |
1071 | 1081 | //新建档人数等于当天建档人数 |
1082 | + appointmentData.put("buildNum",appointmentData.get("buildNum")!=null?Integer.valueOf(String.valueOf(appointmentData.get("buildNum")))+1:1); | |
1072 | 1083 | Patients patients= patientsList.get(0); |
1073 | 1084 | if (DateUtil.isBetween(patients.getCreated(),DateUtil.parseYMDHMS(startTime),DateUtil.parseYMDHMS(endTime))){ |
1074 | 1085 | appointmentData.put("newBuildNum",appointmentData.get("newBuildNum")!=null?Integer.valueOf(String.valueOf(appointmentData.get("newBuildNum")))+1:1); |
1075 | 1086 | } |
1076 | - appointmentData.put("buildNum",appointmentData.get("buildNum")!=null?Integer.valueOf(String.valueOf(appointmentData.get("buildNum")))+1:1); | |
1077 | 1087 | }else { |
1078 | 1088 | //未建档 |
1079 | 1089 | appointmentData.put("unBuildNum",appointmentData.get("unBuildNum")!=null?Integer.valueOf(String.valueOf(appointmentData.get("unBuildNum")))+1:1); |