|
|
@ -28,6 +28,7 @@ import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
|
import com.ruoyi.system.mapper.SysUserPostMapper;
|
|
|
|
import com.ruoyi.system.mapper.SysUserPostMapper;
|
|
|
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
|
|
|
import com.ruoyi.system.mapper.SysUserRoleMapper;
|
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
|
|
|
|
|
import com.ruoyi.system.service.ISysDeptService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
import com.ruoyi.system.service.ISysUserService;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -58,6 +59,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private ISysConfigService configService;
|
|
|
|
private ISysConfigService configService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private ISysDeptService deptService;
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
protected Validator validator;
|
|
|
|
protected Validator validator;
|
|
|
|
|
|
|
|
|
|
|
@ -489,7 +493,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
int failureNum = 0;
|
|
|
|
int failureNum = 0;
|
|
|
|
StringBuilder successMsg = new StringBuilder();
|
|
|
|
StringBuilder successMsg = new StringBuilder();
|
|
|
|
StringBuilder failureMsg = new StringBuilder();
|
|
|
|
StringBuilder failureMsg = new StringBuilder();
|
|
|
|
String password = configService.selectConfigByKey("sys.user.initPassword");
|
|
|
|
|
|
|
|
for (SysUser user : userList)
|
|
|
|
for (SysUser user : userList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
@ -499,6 +502,8 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
if (StringUtils.isNull(u))
|
|
|
|
if (StringUtils.isNull(u))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BeanValidators.validateWithException(validator, user);
|
|
|
|
BeanValidators.validateWithException(validator, user);
|
|
|
|
|
|
|
|
deptService.checkDeptDataScope(user.getDeptId());
|
|
|
|
|
|
|
|
String password = configService.selectConfigByKey("sys.user.initPassword");
|
|
|
|
user.setPassword(SecurityUtils.encryptPassword(password));
|
|
|
|
user.setPassword(SecurityUtils.encryptPassword(password));
|
|
|
|
user.setCreateBy(operName);
|
|
|
|
user.setCreateBy(operName);
|
|
|
|
userMapper.insertUser(user);
|
|
|
|
userMapper.insertUser(user);
|
|
|
@ -510,6 +515,7 @@ public class SysUserServiceImpl implements ISysUserService
|
|
|
|
BeanValidators.validateWithException(validator, user);
|
|
|
|
BeanValidators.validateWithException(validator, user);
|
|
|
|
checkUserAllowed(u);
|
|
|
|
checkUserAllowed(u);
|
|
|
|
checkUserDataScope(u.getUserId());
|
|
|
|
checkUserDataScope(u.getUserId());
|
|
|
|
|
|
|
|
deptService.checkDeptDataScope(user.getDeptId());
|
|
|
|
user.setUserId(u.getUserId());
|
|
|
|
user.setUserId(u.getUserId());
|
|
|
|
user.setUpdateBy(operName);
|
|
|
|
user.setUpdateBy(operName);
|
|
|
|
userMapper.updateUser(user);
|
|
|
|
userMapper.updateUser(user);
|
|
|
|