|
@@ -1,5 +1,6 @@
|
|
|
package com.simuwang.manage.service.impl.system;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -110,7 +111,10 @@ public class SysRoleServiceImpl implements SysRoleService {
|
|
|
public void assignPerms(RoleMenuAssignCmd command) {
|
|
|
Integer roleId = command.getRoleId();
|
|
|
int i = this.mapper.delRoleMenuByUserId(roleId);
|
|
|
- int j = this.mapper.batchRoleMenus(roleId, command.getMenuIds());
|
|
|
+ int j = 0;
|
|
|
+ if (CollUtil.isNotEmpty(command.getMenuIds())) {
|
|
|
+ j = this.mapper.batchRoleMenus(roleId, command.getMenuIds());
|
|
|
+ }
|
|
|
if (this.logger.isInfoEnabled()) {
|
|
|
this.logger.info("给{}角色分配权限时删除了{}条记录,新增{}条记录", roleId, i, j);
|
|
|
}
|