无关风月
2025-06-26 a0e9fac251df54e5ed6159ce1fdb77d463ebdc48
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TStrainReportServiceImpl.java
@@ -58,30 +58,33 @@
    public PageInfo<TStrainReportProjectVO> pageListProject(TStrainReportProjectQuery query) {
        PageInfo<TStrainReportProjectVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TStrainReportProjectVO> list = this.baseMapper.pageListProject(query,pageInfo);
        List<TStrainReport> tStrainReports = this.baseMapper.selectList(new LambdaQueryWrapper<TStrainReport>().eq(TStrainReport::getStatus,3));
        LambdaQueryWrapper<TStrainReport> queryWrapper = new LambdaQueryWrapper<TStrainReport>().eq(TStrainReport::getStatus, 3);
        List<TStrainReport> tStrainReports = this.baseMapper.selectList(
                queryWrapper);
        List<TStrainReportDetail> tStrainReportDetails = strainReportDetailMapper.selectList(new LambdaQueryWrapper<TStrainReportDetail>());
        for (TStrainReportProjectVO tStrainReportProjectVO : list) {
            List<TStrainReport> collect = tStrainReports.stream().filter(e -> e.getProjectId().equals(tStrainReportProjectVO.getProjectId())).collect(Collectors.toList());
            List<TStrainReport> strainReports = tStrainReports.stream().filter(e -> e.getProjectId().equals(tStrainReportProjectVO.getProjectId())).collect(Collectors.toList());
            BigDecimal sum = new BigDecimal("0");
            BigDecimal sum1 = new BigDecimal("0");
            BigDecimal sum2 = new BigDecimal("0");
            Integer temp = 0;
            for (TStrainReport tStrainReport : collect) {
                List<TStrainReportDetail> collect1 = tStrainReportDetails.stream()
            for (TStrainReport tStrainReport : strainReports) {
                List<TStrainReportDetail> tStrainReportDetails1 = tStrainReportDetails.stream()
                        .filter(e -> e.getReportId().equals(tStrainReport.getId())&&
                                e.getEvaluateHumanType()==1).collect(Collectors.toList());
                List<TStrainReportDetail> collect2 = tStrainReportDetails.stream()
                List<TStrainReportDetail> tStrainReportDetails2 = tStrainReportDetails.stream()
                        .filter(e -> e.getReportId().equals(tStrainReport.getId())&&
                                e.getEvaluateHumanType()==2).collect(Collectors.toList());
                // 菌种工程积分
                sum1 = collect2.stream()
                        .filter(e -> e.getEvaluateHumanType().equals(1))
                sum1 = tStrainReportDetails2.stream()
                        .filter(e -> e.getEvaluateHumanType().equals(2))
                        .map(TStrainReportDetail::getEvaluateTotal)
                        .reduce(BigDecimal::add)
                        .orElse(BigDecimal.ZERO);
                // 菌种实验员积分
                sum2 = collect1.stream()
                        .filter(e -> e.getEvaluateHumanType().equals(2))
                sum2 = tStrainReportDetails1.stream()
                        .filter(e -> e.getEvaluateHumanType().equals(1))
                        .map(TStrainReportDetail::getEvaluateTotal)
                        .reduce(BigDecimal::add)
                        .orElse(BigDecimal.ZERO);