From c7f2afdbfa0e9268cb5989bcd195fceedc3d5f37 Mon Sep 17 00:00:00 2001 From: wulin Date: Tue, 24 Nov 2020 11:12:58 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=BB=84=E6=97=B6=E6=9D=83?= =?UTF-8?q?=E9=99=90=E9=87=8C=E9=9D=A2=E5=8D=95=E7=8B=AC=E5=8A=A0=E7=BB=A9?= =?UTF-8?q?=E6=95=88=E7=AE=A1=E7=90=86=E4=BA=BA=E5=91=98=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=89=8D=E7=AB=AF=E5=B1=95=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E4=B8=80=E8=87=B4=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/service/StaffRoleService.java | 3 +- .../controller/EvaluationGroupController.java | 29 ++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/lz/modules/flow/service/StaffRoleService.java b/src/main/java/com/lz/modules/flow/service/StaffRoleService.java index 549f8f5a..26bde5a1 100644 --- a/src/main/java/com/lz/modules/flow/service/StaffRoleService.java +++ b/src/main/java/com/lz/modules/flow/service/StaffRoleService.java @@ -71,8 +71,9 @@ public interface StaffRoleService extends IService { List selectAllGroupManageRoles(); List selectAllStaffRoleByDepartmentLevel(List asList); - + //获取指定组的请按不管理人员 List selectByEvaluationGroupId(Long id); StaffRole selectStaffRolesByStaffIdDepartmentLevelList(Long loginUserId, List asList); + } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java b/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java index 9ff5ef53..3311846b 100644 --- a/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java +++ b/src/main/java/com/lz/modules/performance/controller/EvaluationGroupController.java @@ -2,6 +2,7 @@ package com.lz.modules.performance.controller; import com.alibaba.fastjson.JSONObject; +import com.google.common.base.Joiner; import com.lz.common.utils.PageUtils; import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; @@ -91,9 +92,35 @@ public class EvaluationGroupController extends AbstractController { return Long.parseLong(s); } }).collect(Collectors.toList()); - + //下面的操作是防止在权限里面单独加绩效管理人员时,导致前端展示不一致问题 + //搜索管理表里面的人员去重 + List staffRoles = staffRoleService.selectAllGroupManageRoles(); + if(staffRoles.size() > 0){ + List roleIds = staffRoles.stream().map(new Function() { + @Override + public Long apply(StaffRole staffRole) { + return staffRole.getStaffId(); + } + }).collect(Collectors.toList()); + ids.addAll(roleIds); + } + //获取管理特定组的 + staffRoles = staffRoleService.selectByEvaluationGroupId(evaluationGroup.getId()); + if(staffRoles.size() > 0){ + List roleIds = staffRoles.stream().map(new Function() { + @Override + public Long apply(StaffRole staffRole) { + return staffRole.getStaffId(); + } + }).collect(Collectors.toList()); + ids.addAll(roleIds); + } + //去重 + Map mapIds = ids.stream().collect(Collectors.toMap(Long::longValue,Function.identity(), (e, r) -> e)); + ids = mapIds.values().stream().collect(Collectors.toList()); //指定人员,搜索人员信息 List staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(ids); + evaluationGroupDto.setManagers(staffSimpleDtos); } if(evaluationGroup.getOutIds() != null && evaluationGroup.getOutIds().length() > 0){