Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
wulin 2020-11-26 17:36:02 +08:00
commit 5edf34ff25
3 changed files with 15 additions and 6 deletions

View File

@ -266,7 +266,7 @@ public class TestController {
R r = resultRecordService.initFlowRecord(resultRecordId); R r = resultRecordService.initFlowRecord(resultRecordId);
} }
// http://localhost:8080/lz_management/test/getAuth?userId=314 // http://localhost:8080/lz_management/test/getAuth?userId=298
@RequestMapping("/test/getAuth") @RequestMapping("/test/getAuth")
public R getAuth(Long userId) throws Exception{ public R getAuth(Long userId) throws Exception{
Map<String,Integer> map = staffRoleService.getRoleByUserId(userId); Map<String,Integer> map = staffRoleService.getRoleByUserId(userId);

View File

@ -491,13 +491,13 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
Map<String ,Integer> map = new HashMap<>(); Map<String ,Integer> map = new HashMap<>();
List<StaffRole> staffRoleList = staffRoleMapper.selectAllByStaffId(userId); List<StaffRole> staffRoleList = staffRoleMapper.selectAllByStaffId(userId);
List<StaffMenu> staffMenus = new ArrayList<>(); List<StaffMenu> staffMenus = new ArrayList<>();
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId);
List<StaffMenu> commonStaffList= staffMenuService.selectByParentId( RoleMenuEnums.COMMON_STAFF.getType()); List<StaffMenu> commonStaffList= staffMenuService.selectByParentId( RoleMenuEnums.COMMON_STAFF.getType());
if(CollectionUtils.isNotEmpty(commonStaffList)){ if(CollectionUtils.isNotEmpty(commonStaffList)){
staffMenus.addAll(commonStaffList); staffMenus.addAll(commonStaffList);
} }
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId);
if(new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){ if(departmentsStaffRelateEntity !=null && new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){
List<StaffMenu> staffMenuDepartmentList= staffMenuService.selectByParentId( RoleMenuEnums.DEPARTMENT_PM.getType()); List<StaffMenu> staffMenuDepartmentList= staffMenuService.selectByParentId( RoleMenuEnums.DEPARTMENT_PM.getType());
if(CollectionUtils.isNotEmpty(staffMenuDepartmentList)){ if(CollectionUtils.isNotEmpty(staffMenuDepartmentList)){
staffMenus.addAll(staffMenuDepartmentList); staffMenus.addAll(staffMenuDepartmentList);

View File

@ -103,8 +103,17 @@ public class AssessServiceImpl implements AssessService {
public List<String> roleDepartments(Long staffId) { public List<String> roleDepartments(Long staffId) {
StaffRole staffRole = staffRoleService.selectByStaffId(staffId); StaffRole staffRole = staffRoleService.selectByStaffId(staffId);
if(staffRole == null){ if(staffRole == null){
log.info("staffRole 为空"); log.info("staffRole 为空,不存在次人员权限配置信息staffId" + staffId);
return Collections.EMPTY_LIST; //判断是否是领导
DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(staffId);
if(entity == null || 0 == entity.getIsLeader()){
log.info("非 leader,此人员无管理部门权限");
return Collections.EMPTY_LIST;
}
List<String> depIds = staffService.selectAllDeparmentIdsByDepartmentParentId(entity.getDepartmentId());
log.info("获取部门领导管理部门ids: " + JSON.toJSONString(depIds));
return depIds;
} }
log.info("获取 roleDepartment,staffRole: " + JSON.toJSONString(staffRole)); log.info("获取 roleDepartment,staffRole: " + JSON.toJSONString(staffRole));
// 0 标识全部部门 // 0 标识全部部门