upd: 编码规范
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ import java.util.Set;
|
|||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface RoleDeptMapper {
|
public interface RoleDeptMapper {
|
||||||
void insertBatchWithRoleId(@Param("roleId") Long roleId, @Param("depts") Set<Dept> depts);
|
void insertBatchWithRoleId(@Param("depts") Set<Dept> depts, @Param("roleId") Long roleId);
|
||||||
void deleteByRoleId(@Param("roleId") Long roleId);
|
void deleteByRoleId(@Param("roleId") Long roleId);
|
||||||
void deleteByRoleIds(@Param("roleIds") Set<Long> roleIds);
|
void deleteByRoleIds(@Param("roleIds") Set<Long> roleIds);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -88,7 +88,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||||||
save(BeanUtil.copyProperties(resources, Role.class));
|
save(BeanUtil.copyProperties(resources, Role.class));
|
||||||
// 判断是否有部门数据,若有,则需创建关联
|
// 判断是否有部门数据,若有,则需创建关联
|
||||||
if (CollectionUtil.isNotEmpty(resources.getDepts())) {
|
if (CollectionUtil.isNotEmpty(resources.getDepts())) {
|
||||||
roleDeptMapper.insertBatchWithRoleId(resources.getId(), resources.getDepts());
|
roleDeptMapper.insertBatchWithRoleId(resources.getDepts(), resources.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +111,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||||||
roleDeptMapper.deleteByRoleId(resources.getId());
|
roleDeptMapper.deleteByRoleId(resources.getId());
|
||||||
// 判断是否有部门数据,若有,则需更新关联
|
// 判断是否有部门数据,若有,则需更新关联
|
||||||
if (CollectionUtil.isNotEmpty(resources.getDepts())) {
|
if (CollectionUtil.isNotEmpty(resources.getDepts())) {
|
||||||
roleDeptMapper.insertBatchWithRoleId(resources.getId(), resources.getDepts());
|
roleDeptMapper.insertBatchWithRoleId(resources.getDepts(), resources.getId());
|
||||||
}
|
}
|
||||||
// 更新相关缓存
|
// 更新相关缓存
|
||||||
delCaches(role.getId(), null);
|
delCaches(role.getId(), null);
|
||||||
|
|||||||
Reference in New Issue
Block a user