mirror of https://gitee.com/stylefeng/roses
【8.1.1】【sys】更新批量保存用户角色
parent
b1d5cd9b4a
commit
993dcd4f2a
|
@ -59,4 +59,12 @@ public interface SysUserRoleService extends IService<SysUserRole>, SysUserRoleSe
|
|||
*/
|
||||
void updateOtherOrgBusinessRole(Long userId, Long excludeOrgId, List<NewUserRoleBindItem> currentOrgBindRoleList);
|
||||
|
||||
/**
|
||||
* 批量保存用户角色
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @since 2024/2/12 23:13
|
||||
*/
|
||||
void quickBatchSaveUserRole(List<SysUserRole> batchUserRole);
|
||||
|
||||
}
|
|
@ -4,8 +4,10 @@ import cn.hutool.core.bean.BeanUtil;
|
|||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
|
||||
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
|
||||
import cn.stylefeng.roses.kernel.dsctn.api.context.DataSourceContext;
|
||||
import cn.stylefeng.roses.kernel.event.sdk.publish.BusinessEventPublisher;
|
||||
import cn.stylefeng.roses.kernel.log.api.util.BusinessLogUtil;
|
||||
import cn.stylefeng.roses.kernel.rule.enums.DbTypeEnum;
|
||||
import cn.stylefeng.roses.kernel.rule.exception.base.ServiceException;
|
||||
import cn.stylefeng.roses.kernel.sys.api.SysRoleLimitServiceApi;
|
||||
import cn.stylefeng.roses.kernel.sys.api.SysRoleServiceApi;
|
||||
|
@ -339,6 +341,16 @@ public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUs
|
|||
userRoleCache.remove(userId.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void quickBatchSaveUserRole(List<SysUserRole> batchUserRole) {
|
||||
if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) {
|
||||
this.getBaseMapper().insertBatchSomeColumn(batchUserRole);
|
||||
} else {
|
||||
this.saveBatch(batchUserRole);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空用户绑定的所有系统角色,这个界面只管分配系统角色
|
||||
*
|
||||
|
|
|
@ -412,6 +412,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void quickBatchSaveUser(List<SysUser> batchUser) {
|
||||
if (DbTypeEnum.MYSQL.equals(DataSourceContext.me().getCurrentDbType())) {
|
||||
this.getBaseMapper().insertBatchSomeColumn(batchUser);
|
||||
|
|
Loading…
Reference in New Issue