Merge branch 'master' into 7.2.3-dev

pull/30/head
fengshuonan 2022-06-09 16:29:59 +08:00
commit e0eb0e2bdf
7 changed files with 79 additions and 1 deletions

View File

@ -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);
}

View File

@ -28,6 +28,7 @@ import cn.stylefeng.roses.kernel.system.api.pojo.role.dto.SysRoleDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.role.dto.SysRoleMenuButtonDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.role.dto.SysRoleMenuDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.role.dto.SysRoleResourceDTO;
import cn.stylefeng.roses.kernel.system.api.pojo.role.request.SysRoleRequest;
import java.util.List;
import java.util.Set;
@ -118,4 +119,11 @@ public interface RoleServiceApi {
*/
List<SysRoleMenuButtonDTO> getRoleMenuButtonList(List<Long> roleIdList);
/**
*
*
* @author fengshuonan
* @date 2022/6/8 14:58
*/
List<SysRoleDTO> getRoleSelectList(SysRoleRequest sysRoleRequest);
}

View File

@ -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);
}
}

View File

@ -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
*

View File

@ -228,4 +228,15 @@ public class SysRoleController {
return new SuccessResponseData<>(sysRoleService.getRoleDataScope(sysRoleRequest));
}
/**
*
*
* @author fengshuonan
* @date 2022/6/8 14:57
*/
@GetResource(name = "获取角色下拉列表", path = "/sysRole/getRoleSelectList")
public ResponseData<List<SysRoleDTO>> getRoleSelectList(SysRoleRequest sysRoleRequest) {
return new SuccessResponseData<>(sysRoleService.getRoleSelectList(sysRoleRequest));
}
}

View File

@ -565,6 +565,22 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
return sysRoleMenuButtons.parallelStream().map(item -> BeanUtil.copyProperties(item, SysRoleMenuButtonDTO.class)).collect(Collectors.toList());
}
@Override
public List<SysRoleDTO> getRoleSelectList(SysRoleRequest sysRoleRequest) {
LambdaQueryWrapper<SysRole> wrapper = this.createWrapper(sysRoleRequest);
List<SysRole> list = this.list(wrapper);
ArrayList<SysRoleDTO> sysRoleDTOS = new ArrayList<>();
for (SysRole sysRole : list) {
SysRoleDTO sysRoleDTO = new SysRoleDTO();
BeanUtil.copyProperties(sysRole, sysRoleDTO);
sysRoleDTOS.add(sysRoleDTO);
}
return sysRoleDTOS;
}
/**
*
*

View File

@ -120,7 +120,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<roses.version>7.2.3</roses.version>
<hutool.version>5.7.6</hutool.version>
<fastjson.version>1.2.78</fastjson.version>
<fastjson.version>1.2.83</fastjson.version>
<lombok.versin>1.18.24</lombok.versin>
<mp.version>3.4.0</mp.version>
<mysql-connector-java.version>8.0.21</mysql-connector-java.version>