Commit cf93c28a6ca27e39908332598a7a158ca4764424

Authored by litao@lymsh.com
1 parent bba1b5c33b

改bug

Showing 4 changed files with 42 additions and 4 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ cf93c28
... ... @@ -63,6 +63,17 @@
63 63 // reportService.patientsExport(provinceId, cityId, aredId, streetId, statistType, ageType, patientType, startDate, endDate, 1000000185, response);
64 64 }
65 65  
  66 + /**
  67 + * 统计报表导出
  68 + * @return
  69 + */
  70 + @ResponseBody
  71 +// @TokenRequired
  72 + @RequestMapping(value = "/patients/export2", method = RequestMethod.GET)
  73 + public void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, HttpServletRequest request, HttpServletResponse response) {
  74 +// reportService.patientsExport2(provinceId, cityId, areaId, streetId, ageType, patientType, startDate, endDate, getUserId(request), response);
  75 + reportService.patientsExport2(provinceId, cityId, areaId, streetId, ageType, patientType, startDate, endDate, 1000000185, response);
  76 + }
66 77  
67 78 /**
68 79 * 未发放优惠券统计
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/IReportService.java View file @ cf93c28
... ... @@ -101,5 +101,7 @@
101 101 BaseObjectResponse patients(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer statistVal, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId);
102 102  
103 103 void patientsExport(String provinceId, String cityId, String aredId, String streetId, Integer statistType, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
  104 +
  105 + void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response);
104 106 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ cf93c28
... ... @@ -536,7 +536,6 @@
536 536 cnames.put("bookbuildingDate", "建档日期");
537 537 cnames.put("doctorName", "建档医生");
538 538  
539   -
540 539 List<Map<String,Object>> results = new ArrayList<>();
541 540 if(org.apache.commons.collections.CollectionUtils.isNotEmpty(patients)) {
542 541 int i = 0;
... ... @@ -564,6 +563,29 @@
564 563 }
565 564 }
566 565  
  566 + ResponseUtil.responseExcel(cnames, results, response);
  567 + }
  568 +
  569 + @Override
  570 + public void patientsExport2(String provinceId, String cityId, String areaId, String streetId, Integer ageType, Integer patientType, Date startDate, Date endDate, Integer userId, HttpServletResponse response) {
  571 + Map<String, Object> restMap = (Map<String, Object>) patients(provinceId, cityId, areaId, streetId, 1, 1, ageType, patientType, startDate, endDate, userId).getData();
  572 + List<List<String>> tabList = (List<List<String>>) restMap.get("tabList");
  573 + List<String> titles = tabList.get(0);
  574 + Map<String, String> cnames = new LinkedHashMap<>();
  575 + for (int i = 0; i < titles.size(); i++) {
  576 + cnames.put(i + "", titles.get(i));
  577 + }
  578 + List<Map<String,Object>> results = new ArrayList<>();
  579 + if(tabList.size() > 1) {
  580 + for (int i = 1; i < tabList.size(); i++) {
  581 + Map<String, Object> result = new LinkedHashMap<>();
  582 + List<String> list = tabList.get(i);
  583 + for (int j = 0; j < list.size(); j++) {
  584 + result.put(j + "", list.get(j));
  585 + }
  586 + results.add(result);
  587 + }
  588 + }
567 589 ResponseUtil.responseExcel(cnames, results, response);
568 590 }
569 591  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java View file @ cf93c28
... ... @@ -546,15 +546,18 @@
546 546 /**
547 547 * 获取高危等级(颜色)
548 548 */
549   - public List<String> getRiskLevels(Patients p) {
550   - List<String> colors = new ArrayList<>();
  549 + public List<Map<String, Object>> getRiskLevels(Patients p) {
  550 + List<Map<String, Object>> colors = new ArrayList<>();
551 551 if (p != null && StringUtils.isNotEmpty(p.getRiskLevelId())) {
552 552 List<String> ids = JsonUtil.jkstr2Obj(p.getRiskLevelId(), List.class);
553 553 if(CollectionUtils.isNotEmpty(ids)) {
554 554 for (String id : ids) {
555 555 String name = findName(id);
556 556 if(StringUtils.isNotEmpty(name)) {
557   - colors.add( "risk_" + RiskDefaultTypeEnum.getColor(name));
  557 + Map<String, Object> temp = new HashMap<>();
  558 + temp.put("color", "risk_" + RiskDefaultTypeEnum.getColor(name));
  559 + temp.put("name", name.replace("预警", ""));
  560 + colors.add(temp);
558 561 }
559 562 }
560 563 }