解决前两次的提交冲突
This commit is contained in:
parent
5f786cd3db
commit
48d410a8b7
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
import com.bonus.common.core.web.domain.BaseEntity;
|
||||||
|
import com.bonus.system.mapper.SysUserMapper;
|
||||||
import com.bonus.common.datascope.utils.CommonDataPermissionInfo;
|
import com.bonus.common.datascope.utils.CommonDataPermissionInfo;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -36,6 +37,9 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDeptMapper deptMapper;
|
private SysDeptMapper deptMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysUserMapper userMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysRoleMapper roleMapper;
|
private SysRoleMapper roleMapper;
|
||||||
|
|
||||||
|
|
@ -71,6 +75,38 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
return buildDeptTreeSelect(depts);
|
return buildDeptTreeSelect(depts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询部门人员树结构信息
|
||||||
|
*
|
||||||
|
* @param dept 部门信息
|
||||||
|
* @return 部门树信息集合
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TreeSelect> selectDeptUserTreeList(SysDept dept)
|
||||||
|
{
|
||||||
|
if (dept != null && dept.getDeptId() != null && dept.getDeptId() == 0L) {
|
||||||
|
List<SysDept> userList = userMapper.getTree(dept);
|
||||||
|
return buildDeptTreeSelect(userList);
|
||||||
|
}
|
||||||
|
List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept);
|
||||||
|
for (SysDept sysDept : depts) {
|
||||||
|
SysUser paramUser = new SysUser();
|
||||||
|
paramUser.setDeptId(sysDept.getDeptId());
|
||||||
|
List<SysUser> users = userMapper.selectUserList(paramUser);
|
||||||
|
|
||||||
|
List<SysUser> sysUsers = new ArrayList<>();
|
||||||
|
for (SysUser user : users) {
|
||||||
|
SysUser userResult = userMapper.selectUserById(user.getUserId());
|
||||||
|
user.setRoles(userResult.getRoles());
|
||||||
|
if (user.getDeptId().equals(sysDept.getDeptId())) {
|
||||||
|
sysUsers.add(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sysDept.setSysUsers(sysUsers);
|
||||||
|
}
|
||||||
|
return buildDeptTreeSelect(depts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
*
|
*
|
||||||
|
|
@ -228,7 +264,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
if (dept.getParentId() == null){
|
if (dept.getParentId() == null){
|
||||||
dept.setParentId(0L);
|
dept.setParentId(0L);
|
||||||
dept.setAncestors("0");
|
dept.setAncestors("0");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||||
// 如果父节点不为正常状态,则不允许新增子节点
|
// 如果父节点不为正常状态,则不允许新增子节点
|
||||||
|
|
@ -355,3 +391,4 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
return getChildList(list, t).size() > 0 ? true : false;
|
return getChildList(list, t).size() > 0 ? true : false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue