| | |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.sangeshenbian.dao.ComplaintMapper; |
| | | import com.panzhihua.sangeshenbian.dao.ComplaintRejectMapper; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComplaintAuditRecord; |
| | | import com.panzhihua.sangeshenbian.model.entity.ComplaintProgress; |
| | | import com.panzhihua.sangeshenbian.model.entity.SystemUserLevel; |
| | |
| | | Page<ComplaintVO> page = complaintMapper.queryProcessingRecordPage(new Page<>(query.getPageNum(), query.getPageSize()), query.getKeyword(), accountLevel, targetId); |
| | | //查询上报下派记录 |
| | | List<Long> complaintIds = page.getRecords().stream().map(ComplaintVO::getId).collect(Collectors.toList()); |
| | | if (CollUtil.isEmpty(complaintIds)){ |
| | | return page; |
| | | } |
| | | List<ComplaintAuditRecord> list = complaintAuditRecordService.lambdaQuery() |
| | | .in(ComplaintAuditRecord::getComplaintId, complaintIds) |
| | | .in(ComplaintAuditRecord::getAuditType, 2, 3).list(); |
| | |
| | | Map<Long, List<ComplaintAuditRecord>> finalAuditRecordListMap = auditRecordListMap; |
| | | page.getRecords().forEach(item->{ |
| | | List<ComplaintAuditRecord> auditList = finalAuditRecordListMap.getOrDefault(item.getId(), CollUtil.newArrayList()); |
| | | item.setReportCount((int) auditList.stream().filter(auditRecord -> auditRecord.getAuditType().equals(2)).count()); |
| | | item.setReportCount((int) auditList.stream() |
| | | .filter(auditRecord -> auditRecord.getAuditType().equals(2) |
| | | && !auditRecord.getAuditStatus().equals(3)) //不统计撤回了的 |
| | | .count()); |
| | | item.setAssignmentCount((int) auditList.stream().filter(auditRecord -> auditRecord.getAuditType().equals(3)).count()); |
| | | List<ComplaintProgress> progressList = complaintProgressListMap.getOrDefault(item.getId(), CollUtil.newArrayList()); |
| | | item.setProgressCount(progressList.size()); |