新增用户时保存所属公司,方便租赁推送查询用户信息
This commit is contained in:
parent
84f1113c21
commit
e718a2e1b4
|
|
@ -16,6 +16,7 @@ import com.bonus.sgzb.system.mapper.SysDeptMapper;
|
||||||
import com.bonus.sgzb.system.mapper.SysRoleMapper;
|
import com.bonus.sgzb.system.mapper.SysRoleMapper;
|
||||||
import com.bonus.sgzb.system.mapper.SysUserMapper;
|
import com.bonus.sgzb.system.mapper.SysUserMapper;
|
||||||
import com.bonus.sgzb.system.service.ISysDeptService;
|
import com.bonus.sgzb.system.service.ISysDeptService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -30,6 +31,7 @@ import java.util.stream.Collectors;
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class SysDeptServiceImpl implements ISysDeptService {
|
public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
@Resource
|
@Resource
|
||||||
|
|
@ -231,6 +233,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertDept(SysDept dept) {
|
public int insertDept(SysDept dept) {
|
||||||
|
log.info("insertDept========{}", dept);
|
||||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||||
// 如果父节点不为正常状态,则不允许新增子节点
|
// 如果父节点不为正常状态,则不允许新增子节点
|
||||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
||||||
|
|
|
||||||
|
|
@ -282,6 +282,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// 新增用户信息
|
// 新增用户信息
|
||||||
|
Long deptId = user.getDeptId();
|
||||||
|
SysDept sysDept = deptMapper.selectDeptById(deptId);
|
||||||
|
user.setCompanyId(sysDept.getCompanyId());
|
||||||
int rows = userMapper.insertUser(user);
|
int rows = userMapper.insertUser(user);
|
||||||
// 新增用户岗位关联
|
// 新增用户岗位关联
|
||||||
insertUserPost(user);
|
insertUserPost(user);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue