package com.ruoyi.system.controller.sys;
|
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
import com.ruoyi.system.domain.pojo.sys.SysMenu;
|
import com.ruoyi.system.service.sys.ISysMenuService;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import java.util.List;
|
|
/**
|
* @ClassName StaffMenuController
|
* @Description TODO
|
* @Author jqs
|
* @Date 2023/6/25 16:19
|
* @Version 1.0
|
*/
|
@RestController
|
@RequestMapping("/staffMenu")
|
public class StaffMenuController {
|
|
|
@Autowired
|
private ISysMenuService menuService;
|
|
@ApiOperation(value = "加载对应部门员工菜单列表树")
|
@GetMapping(value = "/roleStaffMenuTreeselect/{deptId}")
|
public AjaxResult deptStaffMenuTreeselect(@PathVariable("deptId") Long deptId)
|
{
|
Long userId = SecurityUtils.getUserId();
|
List<SysMenu> menus = menuService.selectStaffMenuList(userId);
|
AjaxResult ajax = AjaxResult.success();
|
ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptId(deptId));
|
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
return ajax;
|
}
|
|
|
@ApiOperation(value = "加载对应部门用户员工菜单列表树")
|
@GetMapping(value = "/deptUserStaffMenuTreeselect/{deptUserId}")
|
public AjaxResult deptUserStaffMenuTreeselect(@PathVariable("deptUserId") Long deptUserId)
|
{
|
Long userId = SecurityUtils.getUserId();
|
List<SysMenu> menus = menuService.selectStaffMenuList(userId);
|
AjaxResult ajax = AjaxResult.success();
|
ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptUserId(deptUserId));
|
ajax.put("menus", menuService.buildMenuTreeSelect(menus));
|
return ajax;
|
}
|
|
}
|