| | |
| | | * @return |
| | | */ |
| | | public void hospitalReportExport(HospitalReportQuery query) throws IOException { |
| | | List<List<String>> head = hospitalReportHead(); |
| | | List<List<String>> head = hospitalReportHead(query.getDepartmentId()); |
| | | System.out.println(JSONObject.toJSONString(head)); |
| | | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | private List<List<String>> hospitalReportHead() { |
| | | private List<List<String>> hospitalReportHead(Long departmentId) { |
| | | SysDepartment department = sysDepartmentService.getById(departmentId); |
| | | List<SysDictDataVO> wasteTypeList = sysDictDataService.medicalWasteTypeList(); |
| | | List<List<String>> headTitles = Lists.newArrayList(); |
| | | headTitles.add(Lists.newArrayList("日期", "日期")); |
| | | String title = ""; |
| | | if (Objects.nonNull(department)) { |
| | | title = department.getDepartmentName() + "医废报表"; |
| | | } else { |
| | | title = "医废报表"; |
| | | } |
| | | headTitles.add(Lists.newArrayList(title, "日期", "日期")); |
| | | String finalTitle = title; |
| | | wasteTypeList.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList(item.getDictLabel(), "数量")); |
| | | headTitles.add(Lists.newArrayList(item.getDictLabel(), "重量(KG)")); |
| | | headTitles.add(Lists.newArrayList(finalTitle, item.getDictLabel(), "数量")); |
| | | headTitles.add(Lists.newArrayList(finalTitle, item.getDictLabel(), "重量(KG)")); |
| | | }); |
| | | headTitles.add(Lists.newArrayList("小计", "数量")); |
| | | headTitles.add(Lists.newArrayList("小计", "重量(KG)")); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "数量")); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "重量(KG)")); |
| | | headTitles.add(Lists.newArrayList(title, "是否超时", "是否超时")); |
| | | return headTitles; |
| | | } |
| | | |
| | |
| | | * @throws IOException |
| | | */ |
| | | public void disposalReportExport(DisposalReportQuery query) throws IOException { |
| | | List<List<String>> head = disposalReportHead(query.getWasteTypeCodeList()); |
| | | List<List<String>> head = disposalReportHead(query); |
| | | System.out.println(JSONObject.toJSONString(head)); |
| | | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | |
| | | /** |
| | | * 处置报表表头 |
| | | * |
| | | * @param wasteTypeCodeList |
| | | * @param query |
| | | * @return |
| | | */ |
| | | private List<List<String>> disposalReportHead(List<Long> wasteTypeCodeList) { |
| | | private List<List<String>> disposalReportHead(DisposalReportQuery query) { |
| | | //查询医废类型 |
| | | List<SysDictDataVO> sysDictDataVOS = sysDictDataService.medicalWasteTypeListByDictCode(wasteTypeCodeList); |
| | | List<SysDictDataVO> sysDictDataVOS = sysDictDataService.medicalWasteTypeListByDictCode(query.getWasteTypeCodeList()); |
| | | SysDepartment department = sysDepartmentService.getById(query.getDepartmentId()); |
| | | String title = ""; |
| | | if (Objects.nonNull(department)) { |
| | | title = department.getDepartmentName() + "处置报表"; |
| | | } else { |
| | | title = "处置报表"; |
| | | } |
| | | List<List<String>> headTitles = Lists.newArrayList(); |
| | | headTitles.add(Lists.newArrayList("日期")); |
| | | headTitles.add(Lists.newArrayList(title, "日期", "日期")); |
| | | String finalTitle = title; |
| | | sysDictDataVOS.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList("医疗废物接收量(kg)", item.getDictLabel())); |
| | | headTitles.add(Lists.newArrayList(finalTitle, "医疗废物接收量(kg)", item.getDictLabel())); |
| | | }); |
| | | String finalTitle1 = title; |
| | | sysDictDataVOS.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList("医疗废物处置量(kg)", item.getDictLabel())); |
| | | headTitles.add(Lists.newArrayList(finalTitle1, "医疗废物处置量(kg)", item.getDictLabel())); |
| | | }); |
| | | return headTitles; |
| | | } |
| | |
| | | } |
| | | |
| | | public void regulationReportExport(DisposalReportQuery query) throws IOException { |
| | | List<List<String>> head = regulationReportHead(query.getWasteTypeCodeList()); |
| | | List<List<String>> head = regulationReportHead(query); |
| | | System.out.println(JSONObject.toJSONString(head)); |
| | | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | |
| | | /** |
| | | * 监管报表表头 |
| | | * |
| | | * @param wasteTypeCodeList |
| | | * @param query |
| | | * @return |
| | | */ |
| | | private List<List<String>> regulationReportHead(List<Long> wasteTypeCodeList) { |
| | | private List<List<String>> regulationReportHead(DisposalReportQuery query) { |
| | | //查询医废类型 |
| | | List<SysDictDataVO> sysDictDataVOS = sysDictDataService.medicalWasteTypeListByDictCode(wasteTypeCodeList); |
| | | List<SysDictDataVO> sysDictDataVOS = sysDictDataService.medicalWasteTypeListByDictCode(query.getWasteTypeCodeList()); |
| | | SysDepartment department = sysDepartmentService.getById(query.getDepartmentId()); |
| | | String title = ""; |
| | | if (Objects.nonNull(department)) { |
| | | title = department.getDepartmentName() + "监管报表"; |
| | | } else { |
| | | title = "监管报表"; |
| | | } |
| | | List<List<String>> headTitles = Lists.newArrayList(); |
| | | headTitles.add(Lists.newArrayList("日期")); |
| | | headTitles.add(Lists.newArrayList(title, "日期", "日期")); |
| | | String finalTitle = title; |
| | | sysDictDataVOS.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList("医疗废物产生量(kg)", item.getDictLabel())); |
| | | headTitles.add(Lists.newArrayList(finalTitle, "医疗废物产生量(kg)", item.getDictLabel())); |
| | | }); |
| | | String finalTitle1 = title; |
| | | sysDictDataVOS.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList("医疗废物转移量(kg)", item.getDictLabel())); |
| | | headTitles.add(Lists.newArrayList(finalTitle1, "医疗废物转移量(kg)", item.getDictLabel())); |
| | | }); |
| | | String finalTitle2 = title; |
| | | sysDictDataVOS.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList("医疗废物处置量(kg)", item.getDictLabel())); |
| | | headTitles.add(Lists.newArrayList(finalTitle2, "医疗废物处置量(kg)", item.getDictLabel())); |
| | | }); |
| | | return headTitles; |
| | | } |