mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-09-17 19:06:39 +08:00
issues-I9RU4S
This commit is contained in:
parent
721535c69a
commit
6a8029235d
@ -64,13 +64,11 @@ public class EmployeeManager extends ServiceImpl<EmployeeDao, EmployeeEntity> {
|
|||||||
* ISSUES:I9RU4S (对员工赋角色后,不能取消员工的角色,只能修改员工角色)
|
* ISSUES:I9RU4S (对员工赋角色后,不能取消员工的角色,只能修改员工角色)
|
||||||
* https://gitee.com/lab1024/smart-admin/issues/I9RU4S
|
* https://gitee.com/lab1024/smart-admin/issues/I9RU4S
|
||||||
* 问题:如果员工的角色仅剩一个,则不能删除
|
* 问题:如果员工的角色仅剩一个,则不能删除
|
||||||
* 解决:如果roleIdList.size() == 0 即 roleIdList.isEmpty() 则删除当前员工下的所有角色
|
* 解决:如果roleIdList为空,则删除该员工所有角色
|
||||||
*/
|
*/
|
||||||
if (roleIdList.isEmpty()) {
|
if (CollectionUtils.isEmpty(roleIdList)) {
|
||||||
this.updateEmployeeRole(employee.getEmployeeId(), null);
|
this.updateEmployeeRole(employee.getEmployeeId(), null);
|
||||||
}
|
} else if(CollectionUtils.isNotEmpty(roleIdList)) {
|
||||||
|
|
||||||
if (CollectionUtils.isNotEmpty(roleIdList)) {
|
|
||||||
List<RoleEmployeeEntity> roleEmployeeList = roleIdList.stream().map(e -> new RoleEmployeeEntity(e, employee.getEmployeeId())).collect(Collectors.toList());
|
List<RoleEmployeeEntity> roleEmployeeList = roleIdList.stream().map(e -> new RoleEmployeeEntity(e, employee.getEmployeeId())).collect(Collectors.toList());
|
||||||
this.updateEmployeeRole(employee.getEmployeeId(), roleEmployeeList);
|
this.updateEmployeeRole(employee.getEmployeeId(), roleEmployeeList);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user