添加:角色管理配置资料中心权限功能
This commit is contained in:
@@ -9,6 +9,7 @@ import com.adc.da.slrs.zlTree.entity.ZlTree;
|
||||
import com.adc.da.slrs.zlTree.entity.ZlTreeData;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeDataService;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -64,7 +65,6 @@ public class ZlTreeController extends BaseController<ZlTree> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询树结构")
|
||||
public ResponseMessage<List<TreeData>> getFileMaterial(){
|
||||
@@ -72,6 +72,13 @@ public class ZlTreeController extends BaseController<ZlTree> {
|
||||
return Result.success(fileMaterial);
|
||||
}
|
||||
|
||||
@GetMapping("/permissConfig")
|
||||
@ApiOperation("查询树结构-角色管理")
|
||||
public ResponseMessage<List<TreeData>> getFileMaterialM(){
|
||||
List<TreeData> fileMaterial = iZlTreeService.getLeftTreeM();
|
||||
return Result.success(fileMaterial);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改树节点")
|
||||
|
||||
@@ -25,6 +25,12 @@ public interface IZlTreeService extends IService<ZlTree> {
|
||||
*/
|
||||
List<TreeData> getLeftTree();
|
||||
|
||||
/**
|
||||
* 角色管理-查询树结构
|
||||
* @return
|
||||
*/
|
||||
List<TreeData> getLeftTreeM();
|
||||
|
||||
|
||||
/**
|
||||
* 获取类型
|
||||
|
||||
+37
-1
@@ -1,10 +1,15 @@
|
||||
package com.adc.da.slrs.zlTree.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
|
||||
import com.adc.da.slrs.sarRole.service.ITsRoleService;
|
||||
import com.adc.da.slrs.sarUser.dao.TsUserDao;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.zlTree.dao.ZlTreeDao;
|
||||
import com.adc.da.slrs.zlTree.entity.TreeData;
|
||||
import com.adc.da.slrs.zlTree.entity.ZlTree;
|
||||
import com.adc.da.slrs.zlTree.entity.ZlTreeData;
|
||||
import com.adc.da.slrs.zlTree.service.IZlTreeService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -31,10 +36,41 @@ public class ZlTreeServiceImpl extends ServiceImpl<ZlTreeDao, ZlTree> implements
|
||||
|
||||
@Autowired
|
||||
ZlTreeDao zlTreeDao;
|
||||
|
||||
@Autowired
|
||||
private ITsUserService tsUserService;
|
||||
|
||||
@Override
|
||||
public List<TreeData> getLeftTree() {
|
||||
// 获取当前登录人
|
||||
String loginUserId = LoginUserUtil.getUserId();
|
||||
// 查询当前登录人的权限菜单
|
||||
List<String> recourceIdList = tsUserService.getResourceUserId(loginUserId);
|
||||
|
||||
TreeData res=new TreeData();
|
||||
QueryWrapper<ZlTree> wrapper=new QueryWrapper<>();
|
||||
wrapper.lambda().in(ZlTree::getId, recourceIdList);
|
||||
wrapper.orderByAsc("length(sort),sort");
|
||||
List<ZlTree> list=this.list(wrapper);
|
||||
List<TreeData> treeData=new ArrayList<>();
|
||||
//代码遍历生成树
|
||||
for (ZlTree zlTree:list) {
|
||||
if (StringUtils.isNotBlank(zlTree.getParentId())){
|
||||
TreeData zlTreeData=new TreeData();
|
||||
BeanUtils.copyProperties(zlTree,zlTreeData);
|
||||
treeData.add(zlTreeData);
|
||||
}else {
|
||||
BeanUtils.copyProperties(zlTree,res);
|
||||
}
|
||||
}
|
||||
//递归生成树
|
||||
digui(res,treeData);
|
||||
List<TreeData> treeData1=new ArrayList<>();
|
||||
treeData1.add(res);
|
||||
return treeData1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TreeData> getLeftTreeM() {
|
||||
TreeData res=new TreeData();
|
||||
QueryWrapper<ZlTree> wrapper=new QueryWrapper<>();
|
||||
wrapper.orderByAsc("length(sort),sort");
|
||||
|
||||
Reference in New Issue
Block a user