|
|
@ -5,6 +5,9 @@ import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import javax.validation.Validator;
|
|
|
|
import javax.validation.Validator;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.op.system.domain.SysDatasource;
|
|
|
|
|
|
|
|
import com.op.system.mapper.*;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -23,11 +26,6 @@ import com.op.system.api.domain.SysUser;
|
|
|
|
import com.op.system.domain.SysPost;
|
|
|
|
import com.op.system.domain.SysPost;
|
|
|
|
import com.op.system.domain.SysUserPost;
|
|
|
|
import com.op.system.domain.SysUserPost;
|
|
|
|
import com.op.system.domain.SysUserRole;
|
|
|
|
import com.op.system.domain.SysUserRole;
|
|
|
|
import com.op.system.mapper.SysPostMapper;
|
|
|
|
|
|
|
|
import com.op.system.mapper.SysRoleMapper;
|
|
|
|
|
|
|
|
import com.op.system.mapper.SysUserMapper;
|
|
|
|
|
|
|
|
import com.op.system.mapper.SysUserPostMapper;
|
|
|
|
|
|
|
|
import com.op.system.mapper.SysUserRoleMapper;
|
|
|
|
|
|
|
|
import com.op.system.service.ISysConfigService;
|
|
|
|
import com.op.system.service.ISysConfigService;
|
|
|
|
import com.op.system.service.ISysUserService;
|
|
|
|
import com.op.system.service.ISysUserService;
|
|
|
|
|
|
|
|
|
|
|
@ -60,6 +58,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
protected Validator validator;
|
|
|
|
protected Validator validator;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private SysDatasourceMapper sysDatasourceMapper;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据条件分页查询用户列表
|
|
|
|
* 根据条件分页查询用户列表
|
|
|
@ -241,9 +241,24 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
|
|
insertUserPost(user);
|
|
|
|
insertUserPost(user);
|
|
|
|
// 新增用户与角色管理
|
|
|
|
// 新增用户与角色管理
|
|
|
|
insertUserRole(user);
|
|
|
|
insertUserRole(user);
|
|
|
|
|
|
|
|
// 加工厂数据权限
|
|
|
|
|
|
|
|
insertUserDB(user);
|
|
|
|
return rows;
|
|
|
|
return rows;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void insertUserDB(SysUser user) {
|
|
|
|
|
|
|
|
// 新增用户与园区数据源
|
|
|
|
|
|
|
|
SysDatasource qo = new SysDatasource();
|
|
|
|
|
|
|
|
qo.setDeptId(user.getDeptId());//
|
|
|
|
|
|
|
|
List<SysDatasource> dbs = sysDatasourceMapper.selectDBListByDept(qo);
|
|
|
|
|
|
|
|
List<SysDatasource> list = new ArrayList<SysDatasource>();
|
|
|
|
|
|
|
|
for (SysDatasource db : dbs) {
|
|
|
|
|
|
|
|
SysDatasource ur = new SysDatasource();
|
|
|
|
|
|
|
|
ur.setUserId(user.getUserId().toString());
|
|
|
|
|
|
|
|
ur.setDatasourceId(db.getId());
|
|
|
|
|
|
|
|
list.add(ur);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sysDatasourceMapper.batchUserDB(list);
|
|
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 注册用户信息
|
|
|
|
* 注册用户信息
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -273,6 +288,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
|
|
|
userPostMapper.deleteUserPostByUserId(userId);
|
|
|
|
userPostMapper.deleteUserPostByUserId(userId);
|
|
|
|
// 新增用户与岗位管理
|
|
|
|
// 新增用户与岗位管理
|
|
|
|
insertUserPost(user);
|
|
|
|
insertUserPost(user);
|
|
|
|
|
|
|
|
// 加工厂数据权限
|
|
|
|
|
|
|
|
insertUserDB(user);
|
|
|
|
return userMapper.updateUser(user);
|
|
|
|
return userMapper.updateUser(user);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|