mitao
2025-03-27 a382fedba62fa46b3d73c2e988fa6908412a99c9
medicalWaste-system/src/main/java/com/sinata/system/service/biz/StaticsService.java
@@ -6,6 +6,7 @@
import com.sinata.common.core.domain.entity.SysDictData;
import com.sinata.common.utils.CollUtils;
import com.sinata.common.utils.DateUtils;
import com.sinata.system.config.AutoColumnWidthStrategy;
import com.sinata.system.domain.MwCollectRecord;
import com.sinata.system.domain.MwWarningRecord;
import com.sinata.system.domain.SysDepartment;
@@ -19,8 +20,6 @@
import com.sinata.system.domain.vo.MwMedicalWasteBoxVO;
import com.sinata.system.domain.vo.SysDictDataVO;
import com.sinata.system.domain.vo.TransformVO;
import com.sinata.system.enums.DepartmentEnum;
import com.sinata.system.enums.MedicalWasteStatusEnum;
import com.sinata.system.service.ISysDictDataService;
import com.sinata.system.service.MwCheckoutRecordService;
import com.sinata.system.service.MwCollectRecordService;
@@ -82,8 +81,8 @@
        }
        vo.setLegend(wasteTypeList.stream().map(SysDictDataVO::getDictLabel).collect(Collectors.toList()));
        vo.getLegend().add("小计");
        List<MwCollectRecord> collectRecordList = mwCollectRecordService.lambdaQuery().eq(query.getReportType().equals(1), MwCollectRecord::getStatus, MedicalWasteStatusEnum.TEMPORARILY_STORED.getCode())
                .ne(query.getReportType().equals(2), MwCollectRecord::getStatus, MedicalWasteStatusEnum.TEMPORARILY_STORED.getCode())
        List<MwCollectRecord> collectRecordList = mwCollectRecordService.lambdaQuery()/*.eq(query.getReportType().equals(1), MwCollectRecord::getStatus, MedicalWasteStatusEnum.TEMPORARILY_STORED.getCode())
                .ne(query.getReportType().equals(2), MwCollectRecord::getStatus, MedicalWasteStatusEnum.TEMPORARILY_STORED.getCode())*/
                .eq(MwCollectRecord::getDepartmentId, query.getDepartmentId())
                .between(query.getReportType().equals(1), MwCollectRecord::getCollectTime, query.getStartTime(), query.getEndTime())
                .between(query.getReportType().equals(2), MwCollectRecord::getCheckoutTime, query.getStartTime(), query.getEndTime())
@@ -166,6 +165,7 @@
        FastExcel.write(response.getOutputStream())
                .head(head)
                .autoCloseStream(Boolean.TRUE)
                .registerWriteHandler(new AutoColumnWidthStrategy())
                .sheet("医院报表")
                .doWrite(getHospitalReportStaticsData(query));
    }
@@ -225,10 +225,8 @@
            vo.setDepartmentName(department.getDepartmentName());
        }
        SysDepartment region = sysDepartmentService.getDepartmentByParentId(department.getParentId());
        List<SysDepartment> hospitalList = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, region.getTreeCode()).eq(SysDepartment::getOrgType, DepartmentEnum.MEDICAL_INSTITUTION.getCode()).list();
        if (CollUtils.isNotEmpty(hospitalList)) {
        //List<SysDepartment> hospitalList = sysDepartmentService.lambdaQuery().likeRight(SysDepartment::getTreeCode, region.getTreeCode()).eq(SysDepartment::getOrgType, DepartmentEnum.MEDICAL_INSTITUTION.getCode()).list();
            List<TransformVO> checkoutRecordVOList = mwCheckoutRecordService.getCheckoutRecordList(query, region.getTreeCode());
            if (CollUtils.isNotEmpty(checkoutRecordVOList)) {
                //查询医废类型
                List<SysDictData> wasteTypeList = sysDictDataService.lambdaQuery().in(SysDictData::getDictCode, query.getWasteTypeCodeList()).orderByDesc(SysDictData::getDictCode).list();
                if (CollUtils.isNotEmpty(wasteTypeList)) {
@@ -258,8 +256,6 @@
                    }
                    vo.setList(list);
                }
            }
        }
        return vo;
    }
@@ -276,6 +272,7 @@
        FastExcel.write(response.getOutputStream())
                .head(head)
                .autoCloseStream(Boolean.TRUE)
                .registerWriteHandler(new AutoColumnWidthStrategy())
                .sheet("转运联单")
                .doWrite(getTransformReportStaticsData(query));
    }
@@ -409,6 +406,7 @@
        FastExcel.write(response.getOutputStream())
                .head(head)
                .autoCloseStream(Boolean.TRUE)
                .registerWriteHandler(new AutoColumnWidthStrategy())
                .sheet("处置报表")
                .doWrite(getDisposalReportStaticsData(query));
    }
@@ -533,6 +531,7 @@
        FastExcel.write(response.getOutputStream())
                .head(head)
                .autoCloseStream(Boolean.TRUE)
                .registerWriteHandler(new AutoColumnWidthStrategy())
                .sheet("监管报表")
                .doWrite(getRegulationReportStaticsData(query));
    }