部门联查岗位
This commit is contained in:
parent
96e8042156
commit
ec71f31859
|
|
@ -20,4 +20,6 @@ public class QuerySingleDeptListParam extends BaseQueryParam {
|
||||||
|
|
||||||
private Long parentComp;
|
private Long parentComp;
|
||||||
|
|
||||||
|
private Long parentDept;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.entity.job.bo;
|
||||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||||
import com.engine.organization.entity.job.param.JobSearchParam;
|
import com.engine.organization.entity.job.param.JobSearchParam;
|
||||||
import com.engine.organization.entity.job.po.JobPO;
|
import com.engine.organization.entity.job.po.JobPO;
|
||||||
|
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||||
import com.engine.organization.mapper.job.JobMapper;
|
import com.engine.organization.mapper.job.JobMapper;
|
||||||
import com.engine.organization.transmethod.JobTransMethod;
|
import com.engine.organization.transmethod.JobTransMethod;
|
||||||
import com.engine.organization.util.db.MapperProxyFactory;
|
import com.engine.organization.util.db.MapperProxyFactory;
|
||||||
|
|
@ -28,8 +29,8 @@ public class JobBO {
|
||||||
.id(param.getId() == null ? 0 : param.getId())
|
.id(param.getId() == null ? 0 : param.getId())
|
||||||
.jobNo(param.getJobNo())
|
.jobNo(param.getJobNo())
|
||||||
.jobName(param.getJobName())
|
.jobName(param.getJobName())
|
||||||
.parentComp(null==param.getParentComp()?param.getSubcompanyid1():param.getParentComp())
|
.parentComp(null == param.getParentComp() ? param.getSubcompanyid1() : param.getParentComp())
|
||||||
.parentDept(null==param.getParentDept()?param.getDepartmentid():param.getParentDept())
|
.parentDept(null == param.getParentDept() ? param.getDepartmentid() : param.getParentDept())
|
||||||
.sequenceId(param.getSequenceId())
|
.sequenceId(param.getSequenceId())
|
||||||
.schemeId(param.getSchemeId())
|
.schemeId(param.getSchemeId())
|
||||||
.parentJob(param.getParentJob())
|
.parentJob(param.getParentJob())
|
||||||
|
|
@ -47,6 +48,29 @@ public class JobBO {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static List<SingleJobTreeVO> buildSingleJobTreeVOS(List<JobPO> jobPOS, Long parentDept) {
|
||||||
|
if (CollectionUtils.isEmpty(jobPOS)) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
Map<Long, JobPO> poMaps = jobPOS.stream().collect(Collectors.toMap(JobPO::getId, item -> item));
|
||||||
|
|
||||||
|
List<SingleJobTreeVO> singleJobTreeVOS = jobPOS.stream().map(e ->
|
||||||
|
SingleJobTreeVO
|
||||||
|
.builder()
|
||||||
|
.id(e.getId())
|
||||||
|
.jobNo(e.getJobNo())
|
||||||
|
.jobName(e.getJobName())
|
||||||
|
.parentJobName(null == poMaps.get(e.getParentJob()) ? "" : poMaps.get(e.getParentJob()).getJobName())
|
||||||
|
.parentJob(e.getParentJob())
|
||||||
|
.parentDept(e.getParentDept())
|
||||||
|
.build()).collect(Collectors.toList());
|
||||||
|
//获取非一级部门
|
||||||
|
Map<Long, List<SingleJobTreeVO>> collects = singleJobTreeVOS.stream().filter(item -> null != item.getParentJob()).collect(Collectors.groupingBy(SingleJobTreeVO::getParentJob));
|
||||||
|
|
||||||
|
return singleJobTreeVOS.stream().peek(e -> e.setChildren(collects.get(e.getId()))).filter(item -> parentDept.equals(item.getParentDept()) && null == item.getParentJob()).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<JobListDTO> buildDTOList(Collection<JobListDTO> list) {
|
public static List<JobListDTO> buildDTOList(Collection<JobListDTO> list) {
|
||||||
// 递归添加父级数据
|
// 递归添加父级数据
|
||||||
Map<Long, JobListDTO> poMaps = list.stream().collect(Collectors.toMap(JobListDTO::getId, item -> item));
|
Map<Long, JobListDTO> poMaps = list.stream().collect(Collectors.toMap(JobListDTO::getId, item -> item));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.engine.organization.entity.job.vo;
|
||||||
|
|
||||||
|
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||||
|
import com.engine.organization.annotation.OrganizationTable;
|
||||||
|
import com.engine.organization.annotation.TableTitle;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: TODO
|
||||||
|
* @author:dxfeng
|
||||||
|
* @createTime: 2022/06/02
|
||||||
|
* @version: 1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@OrganizationTable(pageId = "434c1b24-e248-11ec-8a67-00e04c680716",
|
||||||
|
tableType = WeaTableType.NONE)
|
||||||
|
public class SingleJobTreeVO {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@TableTitle(title = "编号", dataIndex = "jobNo", key = "jobNo")
|
||||||
|
private String jobNo;
|
||||||
|
|
||||||
|
@TableTitle(title = "编号", dataIndex = "jobName", key = "jobName")
|
||||||
|
private String jobName;
|
||||||
|
|
||||||
|
@TableTitle(title = "编号", dataIndex = "parentJobName", key = "parentJobName")
|
||||||
|
private String parentJobName;
|
||||||
|
|
||||||
|
private Long parentJob;
|
||||||
|
|
||||||
|
private Long parentDept;
|
||||||
|
|
||||||
|
private List<SingleJobTreeVO> children;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -30,6 +30,13 @@ public interface JobMapper {
|
||||||
*/
|
*/
|
||||||
List<JobListDTO> listNoFilter();
|
List<JobListDTO> listNoFilter();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<JobPO> listAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据ID查询元素
|
* 根据ID查询元素
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -289,6 +289,12 @@
|
||||||
where delete_type = 0
|
where delete_type = 0
|
||||||
and parent_dept = #{departmentId}
|
and parent_dept = #{departmentId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listAll" resultMap="BaseResultMap">
|
||||||
|
select
|
||||||
|
<include refid="baseColumns"/>
|
||||||
|
from jcl_org_job t
|
||||||
|
where delete_type = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<sql id="likeSQL">
|
<sql id="likeSQL">
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.service;
|
||||||
import com.api.browser.bean.SearchConditionGroup;
|
import com.api.browser.bean.SearchConditionGroup;
|
||||||
import com.engine.organization.entity.department.param.*;
|
import com.engine.organization.entity.department.param.*;
|
||||||
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
||||||
|
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||||
import com.engine.organization.util.page.PageInfo;
|
import com.engine.organization.util.page.PageInfo;
|
||||||
|
|
||||||
|
|
@ -27,6 +28,15 @@ public interface DepartmentService {
|
||||||
*/
|
*/
|
||||||
PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param);
|
PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门联查岗位
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 列表左侧树
|
* 列表左侧树
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ import com.engine.organization.entity.department.dto.DepartmentListDTO;
|
||||||
import com.engine.organization.entity.department.param.*;
|
import com.engine.organization.entity.department.param.*;
|
||||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||||
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
||||||
|
import com.engine.organization.entity.job.bo.JobBO;
|
||||||
import com.engine.organization.entity.job.po.JobPO;
|
import com.engine.organization.entity.job.po.JobPO;
|
||||||
|
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||||
import com.engine.organization.entity.searchtree.SearchTree;
|
import com.engine.organization.entity.searchtree.SearchTree;
|
||||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||||
import com.engine.organization.mapper.comp.CompMapper;
|
import com.engine.organization.mapper.comp.CompMapper;
|
||||||
|
|
@ -109,6 +111,18 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
|
||||||
return pageInfos;
|
return pageInfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param) {
|
||||||
|
List<JobPO> jobPOS = MapperProxyFactory.getProxy(JobMapper.class).listAll();
|
||||||
|
PageInfo<JobPO> pageInfo = new PageInfo<>(jobPOS);
|
||||||
|
List<SingleJobTreeVO> singleDeptTreeVOS = JobBO.buildSingleJobTreeVOS(jobPOS, param.getParentDept());
|
||||||
|
PageInfo<SingleJobTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS, SingleJobTreeVO.class);
|
||||||
|
pageInfos.setTotal(pageInfo.getTotal());
|
||||||
|
pageInfos.setPageNum(param.getCurrent());
|
||||||
|
pageInfos.setPageSize(param.getPageSize());
|
||||||
|
return pageInfos;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,18 @@ public class DepartmentController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("/getJobListByPid")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public ReturnResult getJobListByPid(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody QuerySingleDeptListParam querySingleDeptListParam) {
|
||||||
|
try {
|
||||||
|
User user = HrmUserVarify.getUser(request, response);
|
||||||
|
return ReturnResult.successed(getDepartmentWrapper(user).getJobListByPid(querySingleDeptListParam));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ReturnResult.exceptionHandle(e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 左侧树接口
|
* 左侧树接口
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.engine.common.util.ServiceUtil;
|
||||||
import com.engine.core.impl.Service;
|
import com.engine.core.impl.Service;
|
||||||
import com.engine.organization.entity.department.param.*;
|
import com.engine.organization.entity.department.param.*;
|
||||||
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
|
||||||
|
import com.engine.organization.entity.job.vo.SingleJobTreeVO;
|
||||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||||
import com.engine.organization.service.DepartmentService;
|
import com.engine.organization.service.DepartmentService;
|
||||||
import com.engine.organization.service.impl.DepartmentServiceImpl;
|
import com.engine.organization.service.impl.DepartmentServiceImpl;
|
||||||
|
|
@ -33,6 +34,16 @@ public class DepartmentWrapper extends Service {
|
||||||
return ReturnResult.successed(singleDeptTreeVOS);
|
return ReturnResult.successed(singleDeptTreeVOS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门联查岗位
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param) {
|
||||||
|
return getDepartmentService(user).getJobListByPid(param);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 左侧树
|
* 左侧树
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue