Commit 68a839583b67143aa9a07d8c00cf9796c7185b96

Authored by litao
1 parent de1cd49146

报表数据完善

Showing 3 changed files with 32 additions and 26 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ReportController.java View file @ 68a8395
... ... @@ -258,7 +258,8 @@
258 258 @RequestMapping(value = "/coupon/info/export", method = RequestMethod.GET)
259 259 public void couponInfoExport(HttpServletRequest request, HttpServletResponse response, Date startDate, Date endDate, Integer type,
260 260 String provinceId, String cityId, String areaId, String hospitalId, String tempId, String couponType, Integer exportType) {
261   - Map<String, Object> param = CollectionUtils.createMap("userId", getUserId(request), "startDate", startDate,
  261 + Map<String, Object> param = CollectionUtils.createMap("userId", "1000000185", "startDate", startDate,
  262 +// Map<String, Object> param = CollectionUtils.createMap("userId", getUserId(request), "startDate", startDate,
262 263 "endDate", endDate != null ? DateUtil.addDay(endDate, 1) : endDate, "hospitalId", CollectionUtils.asList(hospitalId), "provinceId", provinceId, "cityId", cityId, "areaId", areaId, "type", type,
263 264 "tempId", tempId, "couponType",couponType, "exportType", exportType);
264 265 reportService.exportCouponInfo(param, response);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/ReportServiceImpl.java View file @ 68a8395
... ... @@ -754,7 +754,7 @@
754 754 Patients patients = mongoTemplate.findById(babyModel.getParentId(), Patients.class);
755 755 map.put("username", babyModel.getName());
756 756 if(patients != null) {
757   - map.put("phone", patients.getPhone());
  757 + map.put("phone", com.lyms.platform.common.utils.StringUtils.encryPhone(patients.getPhone()));
758 758  
759 759 String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId()) + findName(patients.getStreetRegisterId()) + findName(patients.getAddressRegister());
760 760 map.put("residenceAddress", residenceAddress.replace("null", "")); /** 居住地 */
... ... @@ -768,7 +768,7 @@
768 768 private void setUserSendInfo(String userId, Map<String, Object> map) {
769 769 Patients patients = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(userId)), Patients.class);
770 770 if(patients != null) {
771   - map.put("phone", patients.getPhone());
  771 + map.put("phone", com.lyms.platform.common.utils.StringUtils.encryPhone(patients.getPhone()));
772 772 map.put("username", patients.getUsername());
773 773  
774 774 String residenceAddress = findName(patients.getProvinceRegisterId()) + findName(patients.getCityRegisterId()) + findName(patients.getAreaRegisterId()) + findName(patients.getStreetRegisterId()) + findName(patients.getAddressRegister());
... ... @@ -925,7 +925,7 @@
925 925 map.put("week", week);
926 926 map.put("number", number);
927 927 map.put("doctorName", doctorName);
928   - map.put("phone", phone);
  928 + map.put("phone", com.lyms.platform.common.utils.StringUtils.encryPhone(phone));
929 929 }
930 930  
931 931 public static class SortTempModel {
932 932  
933 933  
934 934  
... ... @@ -1022,11 +1022,21 @@
1022 1022 PageResult pageResult = (PageResult) resp.getData();
1023 1023 Map<String,Object> map = (Map<String, Object>) pageResult.getGrid();
1024 1024 List<Map<String, Object>> couponInfos = (List<Map<String, Object>>) map.get("couponInfos");
  1025 + List<Map<String, Object>> userSendInfos = (List<Map<String, Object>>) map.get("userSendInfos");
1025 1026  
  1027 + /**
  1028 + * 1 = 孕期优惠券使用统计详情导出
  1029 + * 2 = 产后优惠券使用统计详情导出
  1030 + * 3 = 儿童优惠券使用统计详情导出
  1031 + */
1026 1032 Integer exportType = (Integer) param.get("exportType");
  1033 +
  1034 + /**
  1035 + * 1 = 发放人数 2 = 发放券数 3 = 使用人数 4 = 使用券数
  1036 + */
1027 1037 Integer type = (Integer) param.get("type");
1028   - if(type == 1) { /** 孕期 */
1029   - exportPregnancy(couponInfos, response);
  1038 + if(exportType == 1 && type == 1) { /** 孕期发放人数 */
  1039 + exportPregnancy(userSendInfos, response);
1030 1040 } else if(type == 2 || type == 3) { /** 产后和儿童类似 */
1031 1041 exportPostpartum(couponInfos, response);
1032 1042 }
1033 1043  
1034 1044  
1035 1045  
1036 1046  
1037 1047  
1038 1048  
... ... @@ -1067,33 +1077,28 @@
1067 1077 ResponseUtil.responseExcel(cnames, results, response);
1068 1078 }
1069 1079  
1070   - private void exportPregnancy(List<Map<String, Object>> couponInfos, HttpServletResponse response) {
  1080 + private void exportPregnancy(List<Map<String, Object>> userSendInfos, HttpServletResponse response) {
1071 1081 Map<String, String> cnames = new LinkedHashMap<>();
1072 1082 cnames.put("id", "#");
1073   - cnames.put("checkDate", "产检日期");
  1083 + cnames.put("create_date", "发放日期");
1074 1084 cnames.put("username", "姓名");
1075   - cnames.put("week", "产检孕周");
1076   - cnames.put("number", "产检第次");
1077   - cnames.put("type", "产检券类型");
1078   - cnames.put("sequence_id", "产检券号");
1079   - cnames.put("operatorOrgName", "产检机构");
1080   - cnames.put("doctorName", "产检医生");
1081   - cnames.put("send_hospital", "产检券发放机构");
  1085 + cnames.put("send_hospital", "发放机构");
  1086 + cnames.put("doctoer_name", "发放医生");
  1087 + cnames.put("householdAddress", "居住地");
  1088 + cnames.put("residenceAddress", "户籍地");
1082 1089 cnames.put("phone", "联系电话");
1083 1090  
1084 1091 List<Map<String,Object>> results = new ArrayList<>();
1085 1092 int i = 0;
1086   - for (Map<String, Object> m : couponInfos) {
  1093 + for (Map<String, Object> m : userSendInfos) {
1087 1094 Map<String, Object> result = new LinkedHashMap<>();
1088 1095 result.put("id", ++i);
1089   - result.put("checkDate", DateUtil.getyyyy_MM_dd((Date) m.get("checkDate")));
  1096 + result.put("create_date", m.get("create_date"));
1090 1097 result.put("username", m.get("username"));
1091   - result.put("week", m.get("week"));
1092   - result.put("number", m.get("number"));
1093   - result.put("sequence_id", m.get("sequence_id"));
1094   - result.put("operatorOrgName", m.get("operatorOrgName"));
1095   - result.put("doctorName", m.get("doctorName"));
1096 1098 result.put("send_hospital", m.get("send_hospital"));
  1099 + result.put("doctoer_name", m.get("doctoer_name"));
  1100 + result.put("householdAddress", m.get("householdAddress"));
  1101 + result.put("residenceAddress", m.get("residenceAddress"));
1097 1102 result.put("phone", m.get("phone"));
1098 1103 results.add(result);
1099 1104 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/PageUtil.java View file @ 68a8395
... ... @@ -27,12 +27,12 @@
27 27 // Integer pageSize = map.get("pageSize") == null ? 15 : Integer.parseInt(map.get("pageSize").toString());
28 28 // Integer currentPage = map.get("currentPage") == null ? 1 : Integer.parseInt(map.get("currentPage").toString());
29 29  
30   - if(map.get("currentPage") == null || map.get("pageSize") == null) { /** 为了详情导出 不做分页 */
  30 + /* if(map.get("currentPage") == null || map.get("pageSize") == null) { *//** 为了详情导出 不做分页 *//*
31 31 return;
32   - }
  32 + }*/
33 33  
34   - Integer pageSize = map.get("pageSize") == null ? 15 : Integer.parseInt(map.get("pageSize").toString());
35   - Integer currentPage = map.get("currentPage") == null ? 1 : Integer.parseInt(map.get("currentPage").toString());
  34 + Integer pageSize = map.get("pageSize") == null ? 0 : Integer.parseInt(map.get("pageSize").toString());
  35 + Integer currentPage = map.get("currentPage") == null ? 0 : Integer.parseInt(map.get("currentPage").toString());
36 36 if(pageSize < 1) {
37 37 pageSize = 10;
38 38 }