| | |
| | | vo.setLegend(wasteTypeList.stream().map(SysDictDataVO::getDictLabel).collect(Collectors.toList())); |
| | | vo.getLegend().add("小计"); |
| | | String treeCode = sysDepartmentService.getTreeCodeByDepartmentId(query.getDepartmentId()); |
| | | List<SysDictData> medicalWasteTypeList = sysDictDataService.lambdaQuery().eq(SysDictData::getDictType, "medical_waste_type").orderByDesc(SysDictData::getDictCode).list(); |
| | | |
| | | List<MwMicroEquipmentStaticsVO> staticsData = baseMapper.getStaticsData(query, treeCode); |
| | | SimpleDateFormat sdf = new SimpleDateFormat(DateUtils.YYYY_MM_DD_HH_MM_SS); |
| | | switch (query.getDateType()) { |
| | |
| | | SimpleDateFormat finalSdf = sdf; |
| | | BigDecimal totalWeight = BigDecimal.ZERO; |
| | | BigDecimal totalCount = BigDecimal.ZERO; |
| | | for (SysDictData sysDictData : medicalWasteTypeList) { |
| | | for (SysDictDataVO sysDictData : wasteTypeList) { |
| | | BigDecimal weight = staticsData.stream().filter(e -> e.getWasteType().equals(sysDictData.getDictCode()) |
| | | && finalSdf.format(e.getUseTime()).equals(date) |
| | | ).map(MwMicroEquipmentStaticsVO::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add).setScale(2, RoundingMode.HALF_UP); |
| | |
| | | totalRow.setData(new ArrayList<>()); |
| | | |
| | | // 计算各类型废物的重量和数量总计 |
| | | for (SysDictData sysDictData : medicalWasteTypeList) { |
| | | for (SysDictDataVO sysDictData : wasteTypeList) { |
| | | BigDecimal totalTypeWeight = BigDecimal.ZERO; |
| | | BigDecimal totalTypeCount = BigDecimal.ZERO; |
| | | |
| | | for (DepartmentReportItemVO item : result) { |
| | | // 每种废物类型占用两列(重量和数量) |
| | | int index = medicalWasteTypeList.indexOf(sysDictData); |
| | | int index = wasteTypeList.indexOf(sysDictData); |
| | | int weightIndex = index * 2; |
| | | int countIndex = weightIndex + 1; |
| | | |