You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
weaver-hrm-organization/src/com/engine/organization/service/impl/DepartmentServiceImpl.java

40 lines
1.6 KiB
Java

3 years ago
package com.engine.organization.service.impl;
import com.engine.core.impl.Service;
import com.engine.organization.entity.department.bo.DepartmentBO;
import com.engine.organization.entity.department.param.QuerySingleDeptListParam;
import com.engine.organization.entity.department.po.DepartmentPO;
import com.engine.organization.entity.department.vo.SingleDeptTreeVO;
import com.engine.organization.mapper.department.DepartmentMapper;
import com.engine.organization.service.DepartmentService;
import com.engine.organization.util.db.MapperProxyFactory;
import com.engine.organization.util.page.PageInfo;
import com.engine.organization.util.page.PageUtil;
import java.util.List;
/**
* @Author weaver_cl
* @Description: TODO
* @Date 2022/5/20
* @Version V1.0
**/
public class DepartmentServiceImpl extends Service implements DepartmentService {
@Override
public PageInfo<SingleDeptTreeVO> getDeptListByPid(QuerySingleDeptListParam param) {
//1.查询分部下所有部门
PageUtil.start(param.getCurrent(),param.getPageSize());
List<DepartmentPO> departmentPOS = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptListByCompId(param.getParentComp());
List<SingleDeptTreeVO> singleDeptTreeVOS = DepartmentBO.buildSingleDeptTreeVOS(departmentPOS);
PageInfo<SingleDeptTreeVO> pageInfos = new PageInfo<>(singleDeptTreeVOS,SingleDeptTreeVO.class);
pageInfos.setTotal(departmentPOS.size());
pageInfos.setPageNum(param.getCurrent());
pageInfos.setPageSize(param.getPageSize());
return pageInfos;
}
}