|
|
|
@ -21,6 +21,7 @@ import com.engine.organization.util.db.DBType;
|
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
import com.engine.organization.util.detach.DetachUtil;
|
|
|
|
|
import com.engine.organization.util.tree.SearchTreeUtil;
|
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
@ -143,18 +144,31 @@ public class JobBrowserService extends BrowserService {
|
|
|
|
|
private List<TreeNode> getCurrentTreeNode(SearchTreeParams params) {
|
|
|
|
|
// 分权
|
|
|
|
|
DetachUtil detachUtil = new DetachUtil(user.getUID());
|
|
|
|
|
List<Long> jclRoleLevelList = Arrays.stream(detachUtil.getJclRoleLevels().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
|
|
List<Long> jclRoleLevelList;
|
|
|
|
|
if (StringUtils.isNotBlank(detachUtil.getJclRoleLevels())) {
|
|
|
|
|
jclRoleLevelList = Arrays.stream(detachUtil.getJclRoleLevels().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
|
|
|
|
}else{
|
|
|
|
|
jclRoleLevelList = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
List<TreeNode> treeNodes = new ArrayList<>();
|
|
|
|
|
if (StringUtils.isBlank(params.getId())) {
|
|
|
|
|
// 集团总部
|
|
|
|
|
SearchTree topGroup = SearchTreeUtil.getTopGroup();
|
|
|
|
|
topGroup.setIsParent(true);
|
|
|
|
|
if(detachUtil.isDETACH()&& StringUtils.isNotBlank(detachUtil.getJclRoleLevels())) {
|
|
|
|
|
topGroup.setIsParent(true);
|
|
|
|
|
}else{
|
|
|
|
|
topGroup.setIsParent(false);
|
|
|
|
|
}
|
|
|
|
|
treeNodes.add(topGroup);
|
|
|
|
|
} else {
|
|
|
|
|
// 分部存在下级的ID
|
|
|
|
|
List<String> compHasSubs;
|
|
|
|
|
if (detachUtil.isDETACH()) {
|
|
|
|
|
compHasSubs = MapperProxyFactory.getProxy(CompMapper.class).hasDetachSubs(jclRoleLevelList);
|
|
|
|
|
if(CollectionUtils.isNotEmpty(jclRoleLevelList)) {
|
|
|
|
|
compHasSubs = MapperProxyFactory.getProxy(CompMapper.class).hasDetachSubs(jclRoleLevelList);
|
|
|
|
|
}else{
|
|
|
|
|
compHasSubs = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
compHasSubs = MapperProxyFactory.getProxy(CompMapper.class).hasSubs();
|
|
|
|
|
}
|
|
|
|
@ -164,8 +178,12 @@ public class JobBrowserService extends BrowserService {
|
|
|
|
|
if ("0".equals(params.getId())) {
|
|
|
|
|
List<CompPO> compList;
|
|
|
|
|
if (detachUtil.isDETACH()) {
|
|
|
|
|
compList = MapperProxyFactory.getProxy(CompMapper.class).getCompsByIds(jclRoleLevelList);
|
|
|
|
|
detachUtil.filterCompanyList(compList);
|
|
|
|
|
if(CollectionUtils.isNotEmpty(jclRoleLevelList)) {
|
|
|
|
|
compList = MapperProxyFactory.getProxy(CompMapper.class).getCompsByIds(jclRoleLevelList);
|
|
|
|
|
detachUtil.filterCompanyList(compList);
|
|
|
|
|
}else{
|
|
|
|
|
compList = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
compList = MapperProxyFactory.getProxy(CompMapper.class).listParent();
|
|
|
|
|
}
|
|
|
|
|