Commit f9c9b1aee1a5d550d72bc06f7eebb670abc96d43
1 parent
b733801b1d
Exists in
master
and in
6 other branches
统计
Showing 2 changed files with 25 additions and 8 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RiskReportFacade.java
View file @
f9c9b1a
| ... | ... | @@ -817,7 +817,7 @@ |
| 817 | 817 | } |
| 818 | 818 | final List<String> organizations = currentUserHospPermissions.subList(i, end); |
| 819 | 819 | Callable callable = new AreaHighRiskCountExportTask(basicConfigService,usersService,patientsService,organizationService, |
| 820 | - riskLevelConfig,organizations,countRequest.getExportType(),this,countRequest); | |
| 820 | + riskLevelConfig,organizations,this,countRequest); | |
| 821 | 821 | Future f = commonThreadPool.submit(callable); |
| 822 | 822 | futures.add(f); |
| 823 | 823 | } |
| ... | ... | @@ -839,6 +839,24 @@ |
| 839 | 839 | } |
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | + | |
| 843 | + if (countRequest.getExportType() < 3) | |
| 844 | + { | |
| 845 | + Collections.sort(datas, new Comparator<Map<String, Object>>() { | |
| 846 | + @Override | |
| 847 | + public int compare(Map<String, Object> o1, Map<String, Object> o2) { | |
| 848 | + | |
| 849 | + Object value1 = o1.get("highRiskPatTotal"); | |
| 850 | + int num1 = Integer.parseInt(String.valueOf(value1)); | |
| 851 | + | |
| 852 | + Object value2 = o1.get("highRiskPatTotal"); | |
| 853 | + int num2 = Integer.parseInt(String.valueOf(value2)); | |
| 854 | + | |
| 855 | + return num1 == num2 ? 0 : (num1 > num2 ? 1 : -1); | |
| 856 | + } | |
| 857 | + }); | |
| 858 | + } | |
| 859 | + | |
| 842 | 860 | |
| 843 | 861 | OutputStream out = response.getOutputStream(); |
| 844 | 862 | Map<String, String> cnames = new LinkedHashMap<>(); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/AreaHighRiskCountExportTask.java
View file @
f9c9b1a
| ... | ... | @@ -35,7 +35,6 @@ |
| 35 | 35 | private UsersService usersService; |
| 36 | 36 | private OrganizationService organizationService; |
| 37 | 37 | private BasicConfigService basicConfigService; |
| 38 | - private Integer exportType; | |
| 39 | 38 | private List<String> organizations; |
| 40 | 39 | |
| 41 | 40 | private List<BasicConfig> riskLevelConfig; |
| ... | ... | @@ -48,7 +47,6 @@ |
| 48 | 47 | OrganizationService organizationService, |
| 49 | 48 | List<BasicConfig> riskLevelConfig, |
| 50 | 49 | List<String> organizations, |
| 51 | - Integer exportType, | |
| 52 | 50 | RiskReportFacade riskReportFacade, |
| 53 | 51 | RiskPatientsCountRequest countRequest) |
| 54 | 52 | { |
| ... | ... | @@ -58,7 +56,6 @@ |
| 58 | 56 | this.patientsService = patientsService; |
| 59 | 57 | this.organizations = organizations; |
| 60 | 58 | this.riskLevelConfig = riskLevelConfig; |
| 61 | - this.exportType = exportType; | |
| 62 | 59 | this.riskReportFacade = riskReportFacade; |
| 63 | 60 | this.countRequest = countRequest; |
| 64 | 61 | } |
| 65 | 62 | |
| ... | ... | @@ -86,13 +83,13 @@ |
| 86 | 83 | if (CollectionUtils.isNotEmpty(riskLevelConfig)) { |
| 87 | 84 | for (BasicConfig config : riskLevelConfig) { |
| 88 | 85 | |
| 89 | - if (exportType == 1) | |
| 86 | + if (countRequest.getExportType() == 1) | |
| 90 | 87 | { |
| 91 | 88 | data.put("cityName", city == null ? "" : city.getName()); |
| 92 | 89 | data.put("areaName", area == null ? "" : area.getName()); |
| 93 | 90 | data.put("streetName", street == null ? "" : street.getName()); |
| 94 | 91 | } |
| 95 | - else if (exportType == 2) | |
| 92 | + else if (countRequest.getExportType() == 2) | |
| 96 | 93 | { |
| 97 | 94 | data.put("areaName", area == null ? "" : area.getName()); |
| 98 | 95 | data.put("streetName", street == null ? "" : street.getName()); |
| 99 | 96 | |
| ... | ... | @@ -103,9 +100,11 @@ |
| 103 | 100 | int riskPatientCount = 0; |
| 104 | 101 | PatientsQuery query1 = riskReportFacade.getRequestQuery(countRequest); |
| 105 | 102 | query1.setHospitalId(String.valueOf(organization.getId())); |
| 103 | + //高危等级 | |
| 104 | + query1.setrLevel(config.getId()); | |
| 106 | 105 | |
| 107 | 106 | |
| 108 | - if (exportType == 3) | |
| 107 | + if (countRequest.getExportType() == 3) | |
| 109 | 108 | { |
| 110 | 109 | List<Patients> patientses = patientsService.queryPatient(query1); |
| 111 | 110 | if (CollectionUtils.isNotEmpty(patientses)) |
| ... | ... | @@ -220,7 +219,7 @@ |
| 220 | 219 | } |
| 221 | 220 | } |
| 222 | 221 | |
| 223 | - if (exportType < 3) | |
| 222 | + if (countRequest.getExportType() < 3) | |
| 224 | 223 | { |
| 225 | 224 | data.put("highRiskPatTotal", highRiskPatTotal); |
| 226 | 225 | datas.add(data); |