| | |
| | | if (needSetWidth) { |
| | | Map<Integer, Integer> maxWidthMap = cache.computeIfAbsent(writeSheetHolder.getSheetNo(), k -> new HashMap<>()); |
| | | int columnWidth = calculateWidth(cellDataList, cell, isHead); |
| | | if (columnWidth >= 16) { |
| | | columnWidth = 16; |
| | | if (columnWidth >= 17) { |
| | | columnWidth = 17; |
| | | } |
| | | if (columnWidth > 0) { |
| | | columnWidth = Math.min(columnWidth, 255); // 最大支持255字符 |
| | |
| | | private Integer usedNum; |
| | | |
| | | @ApiModelProperty("未使用数量") |
| | | private Integer unused; |
| | | private Integer unUsedNum; |
| | | |
| | | @ApiModelProperty("使用率") |
| | | private BigDecimal useRate; |
| | |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("预警消息") |
| | | @ExcelProperty(value = "预警消息", index = 3) |
| | | @ExcelProperty(value = "预警信息", index = 3) |
| | | private String message; |
| | | |
| | | @ApiModelProperty("预警状态 1:未解除;2:已解除") |
| | |
| | | * @return |
| | | */ |
| | | public void hospitalReportExport(HospitalReportQuery query) throws IOException { |
| | | List<List<String>> head = hospitalReportHead(query.getDepartmentId()); |
| | | List<List<String>> head = hospitalReportHead(query); |
| | | System.out.println(JSONObject.toJSONString(head)); |
| | | // 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | private List<List<String>> hospitalReportHead(Long departmentId) { |
| | | SysDepartment department = sysDepartmentService.getById(departmentId); |
| | | private List<List<String>> hospitalReportHead(HospitalReportQuery query) { |
| | | SysDepartment department = sysDepartmentService.getById(query.getDepartmentId()); |
| | | List<SysDictDataVO> wasteTypeList = sysDictDataService.medicalWasteTypeList(); |
| | | List<List<String>> headTitles = Lists.newArrayList(); |
| | | String title = ""; |
| | |
| | | }); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "数量")); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "重量(kg)")); |
| | | headTitles.add(Lists.newArrayList(title, "是否超时", "是否超时")); |
| | | if (query.getDateType().equals(1)) { |
| | | headTitles.add(Lists.newArrayList(title, "是否超时", "是否超时")); |
| | | } |
| | | return headTitles; |
| | | } |
| | | |
| | |
| | | .between(Objects.nonNull(query.getLastUseTimeStart()) |
| | | && Objects.nonNull(query.getLastUseTimeEnd()), |
| | | MwBox::getLastUseTime, query.getLastUseTimeStart(), query.getLastUseTimeEnd()) |
| | | .orderByDesc(MwBox::getBoxNumber) |
| | | .orderByDesc(MwBox::getCreateTime) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | return PageDTO.of(page, MwBoxVO.class); |
| | | } |
| | |
| | | ).map(MwMicroEquipmentStaticsVO::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP); |
| | | long count = staticsData.stream().filter(e -> e.getWasteType().equals(sysDictData.getDictCode()) |
| | | && finalSdf.format(e.getUseTime()).equals(date)).count(); |
| | | departmentReportItemVO.getData().add(weight); |
| | | departmentReportItemVO.getData().add(BigDecimal.valueOf(count)); |
| | | totalWeight = totalWeight.add(weight); |
| | | departmentReportItemVO.getData().add(weight); |
| | | totalCount = totalCount.add(BigDecimal.valueOf(count)); |
| | | totalWeight = totalWeight.add(weight); |
| | | } |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | departmentReportItemVO.getData().add(totalCount); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | result.add(departmentReportItemVO); |
| | | } |
| | | |
| | |
| | | headTitles.add(Lists.newArrayList(title, "日期", "日期")); |
| | | String finalTitle = title; |
| | | medicalWasteTypeList.forEach(item -> { |
| | | headTitles.add(Lists.newArrayList(finalTitle, item.getDictLabel(), "总数量")); |
| | | headTitles.add(Lists.newArrayList(finalTitle, item.getDictLabel(), "总重量(kg)")); |
| | | headTitles.add(Lists.newArrayList(finalTitle, item.getDictLabel(), "数量")); |
| | | headTitles.add(Lists.newArrayList(finalTitle, item.getDictLabel(), "重量(kg)")); |
| | | }); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "总重量(KG)")); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "总数量")); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "数量")); |
| | | headTitles.add(Lists.newArrayList(title, "小计", "重量(kg)")); |
| | | return headTitles; |
| | | } |
| | | |