Просмотр исходного кода

绩效评价-整改审核评价计划列表修改

master
CMM 1 год назад
Родитель
Сommit
1e2a0e9794
1 измененных файлов: 24 добавлений и 18 удалений
  1. +24
    -18
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java

+ 24
- 18
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/RectifyAuditManage.java Просмотреть файл

@@ -108,13 +108,6 @@ public class RectifyAuditManage {
// 获取分组所在的评价计划ID
List<Long> appraisalIds =
groups.stream().map(PerformanceAppraisalProjectGroup::getAppraisalId).collect(Collectors.toList());
Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.in(PerformanceAppraisal::getId, appraisalIds).orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page, wrapper);
if (0L == page.getTotal()) {
return PageVo.empty();
}

// 获取评价计划内的所有需整改核查项目信息(整改状态为整改待审核、整改审核不通过、整改审核通过)
List<PerformanceAppraisalProject> paps = performanceAppraisalProjectService.list(Wrappers
@@ -128,6 +121,17 @@ public class RectifyAuditManage {
if (CollUtil.isEmpty(paps)) {
return PageVo.empty();
}

Set<Long> appraisalIdList = paps.stream().map(PerformanceAppraisalProject::getAppraisalId).collect(Collectors.toSet());

Page<PerformanceAppraisal> page = req.page();
LambdaQueryWrapper<PerformanceAppraisal> wrapper = Wrappers.lambdaQuery(PerformanceAppraisal.class)
.in(PerformanceAppraisal::getId, appraisalIdList).orderByDesc(PerformanceAppraisal::getUpdateOn);
performanceAppraisalService.page(page, wrapper);
if (0L == page.getTotal()) {
return PageVo.empty();
}

// 按评价计划分组
Map<Long, List<PerformanceAppraisalProject>> papsMap =
paps.stream().collect(Collectors.groupingBy(PerformanceAppraisalProject::getAppraisalId));
@@ -136,17 +140,19 @@ public class RectifyAuditManage {
PerformanceAppraisalVO vo = BeanUtil.copyProperties(p, PerformanceAppraisalVO.class);
// 统计评价计划待核查项目数量(整改状态为:整改待审核)
List<PerformanceAppraisalProject> projects = papsMap.get(p.getId());
List<PerformanceAppraisalProject> unRectifyAuditProjects =
projects.stream().filter(d -> RectifyStatusEnum.TO_BE_REVIEWED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
vo.setUnRectifyAuditNumber(unRectifyAuditProjects.size());
// 统计评价计划已核查项目数量(整改状态为:整改核查不通过、整改审核通过)
List<PerformanceAppraisalProject> rectifiedAuditProjects =
paps.stream()
.filter(d -> RectifyStatusEnum.NOT_APPROVED.getCode().equals(d.getRectifyStatus())
|| RectifyStatusEnum.APPROVED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
vo.setRectifiedAuditNumber(rectifiedAuditProjects.size());
if (CollUtil.isNotEmpty(projects)) {
List<PerformanceAppraisalProject> unRectifyAuditProjects =
projects.stream().filter(d -> RectifyStatusEnum.TO_BE_REVIEWED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
vo.setUnRectifyAuditNumber(unRectifyAuditProjects.size());
// 统计评价计划已核查项目数量(整改状态为:整改核查不通过、整改审核通过)
List<PerformanceAppraisalProject> rectifiedAuditProjects =
paps.stream()
.filter(d -> RectifyStatusEnum.NOT_APPROVED.getCode().equals(d.getRectifyStatus())
|| RectifyStatusEnum.APPROVED.getCode().equals(d.getRectifyStatus()))
.collect(Collectors.toList());
vo.setRectifiedAuditNumber(rectifiedAuditProjects.size());
}
return vo;
}).collect(Collectors.toList());
return PageVo.of(res, page.getTotal());


Загрузка…
Отмена
Сохранить