|
|
@ -50,6 +50,7 @@ import com.engine.organization.thread.OrganizationSyncEc;
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
import com.engine.organization.util.coderule.CodeRuleUtil;
|
|
|
|
import com.engine.organization.util.coderule.CodeRuleUtil;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
import com.engine.organization.util.db.MapperProxyFactory;
|
|
|
|
|
|
|
|
import com.engine.organization.util.detach.DetachUtil;
|
|
|
|
import com.engine.organization.util.page.Column;
|
|
|
|
import com.engine.organization.util.page.Column;
|
|
|
|
import com.engine.organization.util.page.PageInfo;
|
|
|
|
import com.engine.organization.util.page.PageInfo;
|
|
|
|
import com.engine.organization.util.page.PageUtil;
|
|
|
|
import com.engine.organization.util.page.PageUtil;
|
|
|
@ -164,10 +165,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
PageInfo<JobListDTO> pageInfos;
|
|
|
|
PageInfo<JobListDTO> pageInfos;
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
|
|
|
|
String orderSql = PageInfoSortUtil.getSortSql(param.getSortParams());
|
|
|
|
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
|
|
|
|
List<JobListDTO> allList = getJobMapper().listNoFilter(orderSql);
|
|
|
|
|
|
|
|
new DetachUtil(user.getUID()).filterJobDTOList(allList);
|
|
|
|
// 通过子级遍历父级元素
|
|
|
|
// 通过子级遍历父级元素
|
|
|
|
if (filter) {
|
|
|
|
if (filter) {
|
|
|
|
// 根据条件获取元素
|
|
|
|
// 根据条件获取元素
|
|
|
|
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql);
|
|
|
|
List<JobListDTO> filterJobPOs = getJobMapper().listByFilter(jobPO, orderSql);
|
|
|
|
|
|
|
|
new DetachUtil(user.getUID()).filterJobDTOList(allList);
|
|
|
|
// 添加父级元素
|
|
|
|
// 添加父级元素
|
|
|
|
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
|
|
|
|
List<JobListDTO> jobListDTOS = JobBO.buildJobDTOList(allList, filterJobPOs);
|
|
|
|
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
|
|
|
List<JobListDTO> subList = PageUtil.subList(param.getCurrent(), param.getPageSize(), jobListDTOS);
|
|
|
@ -639,14 +642,11 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
* @param compPO
|
|
|
|
* @param compPO
|
|
|
|
* @param builderComps
|
|
|
|
* @param builderComps
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps) {
|
|
|
|
private void buildParentComps(CompPO compPO, Set<CompPO> builderComps,Map<Long, CompPO> allMaps) {
|
|
|
|
builderComps.add(compPO);
|
|
|
|
builderComps.add(compPO);
|
|
|
|
if (SearchTreeUtil.isTop(compPO.getParentCompany())) {
|
|
|
|
CompPO parentComp = allMaps.get(compPO.getParentCompany());
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
CompPO parentComp = getCompMapper().listById(compPO.getParentCompany());
|
|
|
|
|
|
|
|
if (null != parentComp && 0 == parentComp.getForbiddenTag()) {
|
|
|
|
if (null != parentComp && 0 == parentComp.getForbiddenTag()) {
|
|
|
|
buildParentComps(parentComp, builderComps);
|
|
|
|
buildParentComps(parentComp, builderComps,allMaps);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -689,8 +689,10 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) {
|
|
|
|
private List<SearchTree> buildTreeByCompAndDept(DepartmentPO departmentBuild, CompPO compBuild) {
|
|
|
|
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
|
|
|
|
List<DepartmentPO> filterDeparts = getDepartmentMapper().listByFilter(departmentBuild, "show_order");
|
|
|
|
|
|
|
|
new DetachUtil(user.getUID()).filterDepartmentList(filterDeparts);
|
|
|
|
// 查询分部信息
|
|
|
|
// 查询分部信息
|
|
|
|
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
|
|
|
|
List<CompPO> filterComps = getCompMapper().listByFilter(compBuild, "show_order");
|
|
|
|
|
|
|
|
new DetachUtil(user.getUID()).filterCompanyList(filterComps);
|
|
|
|
Set<DepartmentPO> builderDeparts = new HashSet<>();
|
|
|
|
Set<DepartmentPO> builderDeparts = new HashSet<>();
|
|
|
|
for (DepartmentPO departmentPO : filterDeparts) {
|
|
|
|
for (DepartmentPO departmentPO : filterDeparts) {
|
|
|
|
buildParentDepts(departmentPO, builderDeparts);
|
|
|
|
buildParentDepts(departmentPO, builderDeparts);
|
|
|
@ -704,9 +706,12 @@ public class JobServiceImpl extends Service implements JobService {
|
|
|
|
filterComps.addAll(compsByIds);
|
|
|
|
filterComps.addAll(compsByIds);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
List<CompPO> allCompanys = getCompMapper().list("show_order");
|
|
|
|
|
|
|
|
new DetachUtil(user.getUID()).filterCompanyList(allCompanys);
|
|
|
|
|
|
|
|
Map<Long, CompPO> allMaps = allCompanys.stream().collect(Collectors.toMap(CompPO::getId, item -> item, (k1, k2) -> k1));
|
|
|
|
Set<CompPO> builderComps = new HashSet<>();
|
|
|
|
Set<CompPO> builderComps = new HashSet<>();
|
|
|
|
for (CompPO compPO : filterComps) {
|
|
|
|
for (CompPO compPO : filterComps) {
|
|
|
|
buildParentComps(compPO, builderComps);
|
|
|
|
buildParentComps(compPO, builderComps,allMaps);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), deptTrees);
|
|
|
|
return SearchTreeUtil.builderTreeMode(CompBO.buildSetToSearchTree(builderComps), deptTrees);
|
|
|
|
}
|
|
|
|
}
|
|
|
|