das接口修改

This commit is contained in:
chenhaojie 2024-07-10 09:47:00 +08:00
parent 2915bfe96c
commit dcbb1e9dc6

View File

@ -107,10 +107,9 @@ public class SysUserServiceImpl implements SysUserService {
List<Long> errorRole = new ArrayList<>(); List<Long> errorRole = new ArrayList<>();
for (String strRoleId : roles) { for (String strRoleId : roles) {
if (StringUtils.hasText(strRoleId)) { if (StringUtils.hasText(strRoleId)) {
long roleId=Long.getLong(strRoleId); long roleCount = sysRoleMapper.existRoleByRoleId(Long.valueOf(strRoleId));
long roleCount = sysRoleMapper.existRoleByRoleId(roleId);
if (roleCount == 0) { if (roleCount == 0) {
errorRole.add(roleId); errorRole.add(Long.valueOf(strRoleId));
} }
} }
} }
@ -162,10 +161,9 @@ public class SysUserServiceImpl implements SysUserService {
sysUserRoleMapper.delete(accountRoleQueryWrapper); sysUserRoleMapper.delete(accountRoleQueryWrapper);
//绑定角色 //绑定角色
for (String strRoleId : sysUserDto.getRoleList()) { for (String strRoleId : sysUserDto.getRoleList()) {
long roleId = Long.getLong(strRoleId);
SysUserRole accountRole = new SysUserRole(); SysUserRole accountRole = new SysUserRole();
accountRole.setUserId(sysUser.getId()); accountRole.setUserId(sysUser.getId());
accountRole.setRoleId(roleId); accountRole.setRoleId(Long.valueOf(strRoleId));
accountRole.setRevision(1); accountRole.setRevision(1);
accountRole.setCreatedTime(new Date()); accountRole.setCreatedTime(new Date());
accountRole.setUpdatedTime(new Date()); accountRole.setUpdatedTime(new Date());