!50 部门联查岗位

Merge pull request !50 from dxfeng/feature/dxf
pull/51/MERGE
dxfeng 3 years ago committed by Gitee
commit 614467b865
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -20,4 +20,6 @@ public class QuerySingleDeptListParam extends BaseQueryParam {
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.param.JobSearchParam;
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.transmethod.JobTransMethod;
import com.engine.organization.util.db.MapperProxyFactory;
@ -28,8 +29,8 @@ public class JobBO {
.id(param.getId() == null ? 0 : param.getId())
.jobNo(param.getJobNo())
.jobName(param.getJobName())
.parentComp(null==param.getParentComp()?param.getSubcompanyid1():param.getParentComp())
.parentDept(null==param.getParentDept()?param.getDepartmentid():param.getParentDept())
.parentComp(null == param.getParentComp() ? param.getSubcompanyid1() : param.getParentComp())
.parentDept(null == param.getParentDept() ? param.getDepartmentid() : param.getParentDept())
.sequenceId(param.getSequenceId())
.schemeId(param.getSchemeId())
.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) {
// 递归添加父级数据
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();
/**
*
*
* @return
*/
List<JobPO> listAll();
/**
* ID
*

@ -289,6 +289,12 @@
where delete_type = 0
and parent_dept = #{departmentId}
</select>
<select id="listAll" resultMap="BaseResultMap">
select
<include refid="baseColumns"/>
from jcl_org_job t
where delete_type = 0
</select>
<sql id="likeSQL">

@ -3,6 +3,7 @@ package com.engine.organization.service;
import com.api.browser.bean.SearchConditionGroup;
import com.engine.organization.entity.department.param.*;
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.util.page.PageInfo;
@ -27,6 +28,15 @@ public interface DepartmentService {
*/
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.po.DepartmentPO;
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.vo.SingleJobTreeVO;
import com.engine.organization.entity.searchtree.SearchTree;
import com.engine.organization.entity.searchtree.SearchTreeParams;
import com.engine.organization.mapper.comp.CompMapper;
@ -109,6 +111,18 @@ public class DepartmentServiceImpl extends Service implements DepartmentService
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
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.organization.entity.department.param.*;
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.service.DepartmentService;
import com.engine.organization.service.impl.DepartmentServiceImpl;
@ -33,6 +34,16 @@ public class DepartmentWrapper extends Service {
return ReturnResult.successed(singleDeptTreeVOS);
}
/**
*
*
* @param param
* @return
*/
public PageInfo<SingleJobTreeVO> getJobListByPid(QuerySingleDeptListParam param) {
return getDepartmentService(user).getJobListByPid(param);
}
/**
*
*

Loading…
Cancel
Save