From e8d215521042bfd951512d98a7e2106a2585a318 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E5=BB=BA=E8=B6=85?= <3182967682@qq.com> Date: Wed, 25 Nov 2020 14:17:22 +0800 Subject: [PATCH 1/4] fix --- .../performance/service/impl/AssessServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java index a7f404ec..6421ba46 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java @@ -103,8 +103,17 @@ public class AssessServiceImpl implements AssessService { public List roleDepartments(Long staffId) { StaffRole staffRole = staffRoleService.selectByStaffId(staffId); if(staffRole == null){ - log.info("staffRole 为空"); - return Collections.EMPTY_LIST; + log.info("staffRole 为空,不存在次人员权限配置信息,staffId:" + staffId); + //判断是否是领导 + DepartmentsStaffRelateEntity entity = departmentsStaffRelateService.selectByStaffId(staffId); + if(entity == null || 0 == entity.getIsLeader()){ + log.info("非 leader,此人员无管理部门权限"); + return Collections.EMPTY_LIST; + } + + List depIds = staffService.selectAllDeparmentIdsByDepartmentParentId(entity.getDepartmentId()); + log.info("获取部门领导管理部门ids: " + JSON.toJSONString(depIds)); + return depIds; } log.info("获取 roleDepartment,staffRole: " + JSON.toJSONString(staffRole)); // 0 标识全部部门 From d025acf253bba43c82fac5da148538ed37d94730 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Thu, 26 Nov 2020 15:06:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/lz/modules/app/controller/TestController.java | 2 +- .../lz/modules/flow/service/impl/StaffRoleServiceImpl.java | 6 +++--- src/main/resources/application-dev.yml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/lz/modules/app/controller/TestController.java b/src/main/java/com/lz/modules/app/controller/TestController.java index 08db18ad..06241cca 100644 --- a/src/main/java/com/lz/modules/app/controller/TestController.java +++ b/src/main/java/com/lz/modules/app/controller/TestController.java @@ -266,7 +266,7 @@ public class TestController { 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") public R getAuth(Long userId) throws Exception{ Map map = staffRoleService.getRoleByUserId(userId); diff --git a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java index c40b9aa8..02b35589 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/StaffRoleServiceImpl.java @@ -491,13 +491,13 @@ public class StaffRoleServiceImpl extends ServiceImpl map = new HashMap<>(); List staffRoleList = staffRoleMapper.selectAllByStaffId(userId); List staffMenus = new ArrayList<>(); - DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId); + List commonStaffList= staffMenuService.selectByParentId( RoleMenuEnums.COMMON_STAFF.getType()); if(CollectionUtils.isNotEmpty(commonStaffList)){ staffMenus.addAll(commonStaffList); } - - if(new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){ + DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(userId); + if(departmentsStaffRelateEntity !=null && new Integer(1).equals(departmentsStaffRelateEntity.getIsLeader())){ List staffMenuDepartmentList= staffMenuService.selectByParentId( RoleMenuEnums.DEPARTMENT_PM.getType()); if(CollectionUtils.isNotEmpty(staffMenuDepartmentList)){ staffMenus.addAll(staffMenuDepartmentList); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index a33a1510..9b9172a0 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,9 +3,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - username: ldd_biz - password: Hello1234 + url: jdbc:mysql://rm-bp1xhc66ruz72t68p.mysql.rds.aliyuncs.com:3306/lz_manger?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: lz_manger + password: N8zfBwhOC initial-size: 10 max-active: 100 min-idle: 10 From b4ad918561be94587e5e20dc336c355ee5d9d57b Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Thu, 26 Nov 2020 15:20:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 964f818f..db651ada 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -3,9 +3,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://rm-bp1xhc66ruz72t68p.mysql.rds.aliyuncs.com:3306/lz_manger?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - username: lz_manger - password: N8zfBwhOC + url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: ldd_biz + password: Hello1234 initial-size: 10 max-active: 100 min-idle: 10 From 437d245624f04c80c3ea093d282866a9e0b556c0 Mon Sep 17 00:00:00 2001 From: quyixiao <2621048238@qq.com> Date: Thu, 26 Nov 2020 15:24:05 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BA=BF=E4=B8=8A?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 6 +++--- src/main/resources/application-prod.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index b6f4c220..70cd2e92 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -3,9 +3,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://rm-bp1xhc66ruz72t68p.mysql.rds.aliyuncs.com:3306/lz_manger?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - username: lz_manger - password: N8zfBwhOC + url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: ldd_biz + password: Hello1234 initial-size: 10 max-active: 100 min-idle: 10 diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index db651ada..964f818f 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -3,9 +3,9 @@ spring: type: com.alibaba.druid.pool.DruidDataSource druid: driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://172.16.157.238:3306/lz_management?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai - username: ldd_biz - password: Hello1234 + url: jdbc:mysql://rm-bp1xhc66ruz72t68p.mysql.rds.aliyuncs.com:3306/lz_manger?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai + username: lz_manger + password: N8zfBwhOC initial-size: 10 max-active: 100 min-idle: 10