mirror of https://gitee.com/stylefeng/roses
【7.2.3】更新获取组织机构树列表
parent
f916102f84
commit
e4f8f254dd
|
@ -25,6 +25,8 @@
|
|||
package cn.stylefeng.roses.kernel.system.api;
|
||||
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.HrOrganizationDTO;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.HrOrganizationRequest;
|
||||
import cn.stylefeng.roses.kernel.system.api.pojo.organization.OrganizationTreeNode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -52,4 +54,12 @@ public interface OrganizationServiceApi {
|
|||
* @date 2022/3/8 23:32
|
||||
*/
|
||||
HrOrganizationDTO getOrgDetail(Long orgId);
|
||||
|
||||
/**
|
||||
* 获取组织机构下拉选择树
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2022/6/8 14:40
|
||||
*/
|
||||
List<OrganizationTreeNode> getOrgTreeList(HrOrganizationRequest hrOrganizationRequest);
|
||||
}
|
||||
|
|
|
@ -199,4 +199,18 @@ public class HrOrganizationController {
|
|||
return new SuccessResponseData<>(zTreeNodes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有组织机构树(树形)
|
||||
* <p>
|
||||
* 一般用在组织机构选择界面
|
||||
*
|
||||
* @author fengshuonan
|
||||
* @date 2021/1/9 18:37
|
||||
*/
|
||||
@GetResource(name = "获取所有组织机构树(树形)", path = "/hrOrganization/getOrgTreeList")
|
||||
public ResponseData<List<OrganizationTreeNode>> getOrgTreeList(HrOrganizationRequest hrOrganizationRequest) {
|
||||
List<OrganizationTreeNode> list = hrOrganizationService.getOrgTreeList(hrOrganizationRequest);
|
||||
return new SuccessResponseData<>(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -369,6 +369,25 @@ public class HrOrganizationServiceImpl extends ServiceImpl<HrOrganizationMapper,
|
|||
return hrOrganizationDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrganizationTreeNode> getOrgTreeList(HrOrganizationRequest hrOrganizationRequest) {
|
||||
|
||||
List<OrganizationTreeNode> treeNodeList = CollectionUtil.newArrayList();
|
||||
|
||||
// 获取所有组织机构
|
||||
LambdaQueryWrapper<HrOrganization> wrapper = createWrapper(hrOrganizationRequest);
|
||||
List<HrOrganization> hrOrganizationList = this.list(wrapper);
|
||||
|
||||
// 组装节点
|
||||
for (HrOrganization hrOrganization : hrOrganizationList) {
|
||||
OrganizationTreeNode treeNode = OrganizationFactory.parseOrganizationTreeNode(hrOrganization);
|
||||
treeNodeList.add(treeNode);
|
||||
}
|
||||
|
||||
// 节点组装成树
|
||||
return new DefaultTreeBuildFactory<OrganizationTreeNode>().doTreeBuild(treeNodeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建组织架构的通用条件查询wrapper
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue