|
|
|
@ -30,6 +30,7 @@ import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
|
|
import com.ruoyi.system.mapper.SysUserPostMapper; |
|
|
|
|
import com.ruoyi.system.mapper.SysUserRoleMapper; |
|
|
|
|
import com.ruoyi.system.service.ISysConfigService; |
|
|
|
|
import com.ruoyi.system.service.ISysDeptService; |
|
|
|
|
import com.ruoyi.system.service.ISysUserService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -60,6 +61,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysConfigService configService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private ISysDeptService deptService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
protected Validator validator; |
|
|
|
|
|
|
|
|
@ -487,7 +491,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
|
int failureNum = 0; |
|
|
|
|
StringBuilder successMsg = new StringBuilder(); |
|
|
|
|
StringBuilder failureMsg = new StringBuilder(); |
|
|
|
|
String password = configService.selectConfigByKey("sys.user.initPassword"); |
|
|
|
|
for (SysUser user : userList) |
|
|
|
|
{ |
|
|
|
|
try |
|
|
|
@ -497,6 +500,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
|
if (StringUtils.isNull(u)) |
|
|
|
|
{ |
|
|
|
|
BeanValidators.validateWithException(validator, user); |
|
|
|
|
deptService.checkDeptDataScope(user.getDeptId()); |
|
|
|
|
String password = configService.selectConfigByKey("sys.user.initPassword"); |
|
|
|
|
user.setPassword(Md5Utils.hash(user.getLoginName() + password)); |
|
|
|
|
user.setCreateBy(operName); |
|
|
|
|
userMapper.insertUser(user); |
|
|
|
@ -508,6 +513,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
|
BeanValidators.validateWithException(validator, user); |
|
|
|
|
checkUserAllowed(u); |
|
|
|
|
checkUserDataScope(u.getUserId()); |
|
|
|
|
deptService.checkDeptDataScope(user.getDeptId()); |
|
|
|
|
user.setUserId(u.getUserId()); |
|
|
|
|
user.setUpdateBy(operName); |
|
|
|
|
userMapper.updateUser(user); |
|
|
|
|