| | |
| | | import com.sinata.common.core.domain.entity.SysDictData; |
| | | import com.sinata.common.utils.CollUtils; |
| | | import com.sinata.common.utils.DateUtils; |
| | | import com.sinata.system.domain.MedicalWasteStaticsVO; |
| | | import com.sinata.system.domain.MwCollectRecord; |
| | | import com.sinata.system.domain.MwWarningRecord; |
| | | import com.sinata.system.domain.SysDepartment; |
| | |
| | | import com.sinata.system.service.MwDisposalRecordService; |
| | | import com.sinata.system.service.MwWarningRecordService; |
| | | import com.sinata.system.service.SysDepartmentService; |
| | | import com.sinata.system.utils.ImageToBase64; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | private final MwDisposalRecordService mwDisposalRecordService; |
| | | private final MwDisposalHandleRecordService mwDisposalHandleRecordService; |
| | | |
| | | /** |
| | | * 机构分布-获取机构列表 |
| | | * |
| | | * @param type 1:全部 2:医院 3:处置单位 |
| | | * @return |
| | | */ |
| | | public List<SysDepartment> departmentList(Integer type) { |
| | | return sysDepartmentService.lambdaQuery().eq(type != 1, SysDepartment::getOrgType, type).list(); |
| | | } |
| | | |
| | | public MedicalWasteStaticsVO medicalWaste() { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 医院报表 |
| | |
| | | if (CollUtils.isNotEmpty(wasteTypeList)) { |
| | | vo.setLegend(wasteTypeList.stream().map(SysDictData::getDictLabel).collect(Collectors.toList())); |
| | | vo.getLegend().add("小计"); |
| | | List<DepartmentReportItemVO> list = new ArrayList<>(); |
| | | for (TransformVO transformVO : checkoutRecordVOList) { |
| | | BigDecimal totalCount = BigDecimal.ZERO; |
| | | BigDecimal totalWeight = BigDecimal.ZERO; |
| | |
| | | departmentReportItemVO.setName(transformVO.getHospitalName()); |
| | | departmentReportItemVO.setData(new ArrayList<>()); |
| | | departmentReportItemVO.setDriverName(transformVO.getDriverName()); |
| | | departmentReportItemVO.setHospitalSignature(transformVO.getHospitalSignature()); |
| | | departmentReportItemVO.setHospitalSignature(ImageToBase64.convertImageToBase64(transformVO.getHospitalSignature())); |
| | | departmentReportItemVO.setHandoverTime(transformVO.getCheckoutTime()); |
| | | for (SysDictData sysDictData : wasteTypeList) { |
| | | BigDecimal count = BigDecimal.valueOf(transformVO.getCollectRecordList().stream().filter(item -> item.getWasteType().equals(sysDictData.getDictCode())).count()); |
| | |
| | | } |
| | | departmentReportItemVO.getData().add(totalCount); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | list.add(departmentReportItemVO); |
| | | } |
| | | vo.setList(list); |
| | | } |
| | | } |
| | | } |
| | |
| | | SimpleDateFormat finalSdf = sdf; |
| | | //接收 |
| | | for (SysDictData sysDictData : wasteTypeList) { |
| | | departmentReportItemVO.getData().add(BigDecimal.ZERO); |
| | | if (CollUtils.isNotEmpty(receivedList)) { |
| | | BigDecimal totalWeight = receivedList.stream().filter(item -> item.getWasteType().equals(sysDictData.getDictCode()) && |
| | | finalSdf.format(item.getReceiveTime()).equals(date)).map(MwDisposalRecordReportVO::getWeight) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | } |
| | | BigDecimal totalWeight = receivedList.stream().filter(item -> item.getWasteType().equals(sysDictData.getDictCode()) && |
| | | finalSdf.format(item.getReceiveTime()).equals(date)).map(MwDisposalRecordReportVO::getWeight) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | } |
| | | //处置 |
| | | for (SysDictData sysDictData : wasteTypeList) { |
| | | departmentReportItemVO.getData().add(BigDecimal.ZERO); |
| | | if (CollUtils.isNotEmpty(disposaledList)) { |
| | | BigDecimal totalWeight = disposaledList.stream().filter(item -> item.getWasteType().equals(sysDictData.getDictCode()) && |
| | | finalSdf.format(item.getReceiveTime()).equals(date)).map(MwDisposalRecordReportVO::getWeight) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | } |
| | | BigDecimal totalWeight = disposaledList.stream().filter(item -> item.getWasteType().equals(sysDictData.getDictCode()) && |
| | | finalSdf.format(item.getDisposalTime()).equals(date)).map(MwDisposalRecordReportVO::getWeight) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | departmentReportItemVO.getData().add(totalWeight); |
| | | } |
| | | list.add(departmentReportItemVO); |
| | | } |
| | |
| | | } |
| | | for (SysDictData sysDictData : wasteTypeList) { |
| | | BigDecimal weight = checkoutRecordList.stream().filter(e -> e.getWasteType().equals(sysDictData.getDictCode()) && |
| | | finalSdf.format(e.getCollectTime()).equals(date)).map(MwCollectRecordVO::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | finalSdf.format(e.getCheckoutTime()).equals(date)).map(MwCollectRecordVO::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | departmentReportItemVO.getData().add(weight); |
| | | } |
| | | for (SysDictData sysDictData : wasteTypeList) { |