Commit a2bd6756b1d40f48b3ca94d2b38b05f0c74c2125
1 parent
22064a7526
Exists in
master
and in
6 other branches
改bug
Showing 2 changed files with 23 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java
View file @
a2bd675
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | @ResponseBody |
43 | 43 | @TokenRequired |
44 | 44 | @RequestMapping(value = "/patients", method = RequestMethod.GET) |
45 | - public BaseObjectResponse patients(@RequestParam String provinceId, String cityId, String areaId, String streetId, @RequestParam Integer statistType, Integer statistVal, | |
45 | + public BaseObjectResponse patients(@RequestParam String provinceId, String cityId, String areaId, String streetId, Integer statistType, Integer statistVal, | |
46 | 46 | Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request) { |
47 | 47 | return reportService.patients(provinceId, cityId, areaId, streetId, statistType, statistVal, ageType, patientType, startDate, endDate, getUserId(request)); |
48 | 48 | } |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | @ResponseBody |
58 | 58 | @TokenRequired |
59 | 59 | @RequestMapping(value = "/patients/export", method = RequestMethod.GET) |
60 | - public void patientsExport(String provinceId, String cityId, String areaId, String streetId, @RequestParam Integer statistType, | |
60 | + public void patientsExport(String provinceId, String cityId, String areaId, String streetId, Integer statistType, | |
61 | 61 | Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) { |
62 | 62 | reportService.patientsExport(provinceId, cityId, areaId, streetId, statistType, ageType, patientType, startDate, endDate, getUserId(request), response); |
63 | 63 | // reportService.patientsExport(provinceId, cityId, aredId, streetId, statistType, ageType, patientType, startDate, endDate, 1000000185, response); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java
View file @
a2bd675
... | ... | @@ -196,6 +196,7 @@ |
196 | 196 | Map<String, Object> restMap = new HashMap<>(); |
197 | 197 | List<List<String>> tabList = new ArrayList<>(); |
198 | 198 | List<String> titleList = new ArrayList<>(); |
199 | + List<String> countList = new ArrayList<>(); | |
199 | 200 | List<String> xDatas = new ArrayList<>(); |
200 | 201 | List<Map<String, Object>> series = new ArrayList<>(); |
201 | 202 | List<String> legend = Arrays.asList("建档总数"); |
... | ... | @@ -349,6 +350,7 @@ |
349 | 350 | |
350 | 351 | tabList.add(0, titleList); |
351 | 352 | setTabListInfo(tabList, StringUtils.isNotEmpty(aredId) ? 2 : 3); |
353 | + setCountList(tabList, countList, StringUtils.isNotEmpty(aredId) ? 3 : 4); | |
352 | 354 | |
353 | 355 | barMap.put("data", bar); |
354 | 356 | barMap.put("type", "bar"); |
355 | 357 | |
356 | 358 | |
... | ... | @@ -436,11 +438,29 @@ |
436 | 438 | return RespBuilder.buildSuccess(restMap); |
437 | 439 | } |
438 | 440 | |
441 | + private void setCountList(List<List<String>> tabList, List<String> countList, int index) { | |
442 | + countList.add(tabList.size() + ""); | |
443 | + countList.add("合计"); | |
444 | + countList.add("建档总数"); | |
445 | + if(tabList.size() > 1) { | |
446 | + for (int i = index; i < tabList.get(0).size(); i++) { | |
447 | + int count = 0; | |
448 | + for (int j = 1; j < tabList.size(); j++) { | |
449 | + count += Integer.parseInt(tabList.get(j).get(i)); | |
450 | + } | |
451 | + countList.add(count + ""); | |
452 | + } | |
453 | + | |
454 | + } | |
455 | + tabList.add(countList); | |
456 | + | |
457 | + } | |
458 | + | |
439 | 459 | private void setTabListInfo(List<List<String>> tabList, int index) { |
440 | 460 | if(CollectionUtils.isNotEmpty(tabList)) { |
461 | + int seq = 0; | |
441 | 462 | for (int i = 0; i < tabList.size(); i++) { |
442 | 463 | List<String> list = tabList.get(i); |
443 | - int seq = 0; | |
444 | 464 | if(i == 0) { |
445 | 465 | list.add(0, "序号" ); |
446 | 466 | list.add("合计"); |