| | |
| | | |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.system.api.domain.poji.sys.SysUser; |
| | | import com.ruoyi.system.domain.pojo.sys.SysMenu; |
| | | import com.ruoyi.system.service.sys.ISysMenuService; |
| | | import com.ruoyi.system.service.sys.ISysUserService; |
| | | 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.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.web.domain.AjaxResult.success; |
| | | |
| | | /** |
| | | * @ClassName StaffMenuController |
| | |
| | | @Autowired |
| | | private ISysMenuService menuService; |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | |
| | | |
| | | @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(); |
| | | AjaxResult ajax = success(); |
| | | ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptId(deptId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | return ajax; |
| | |
| | | public AjaxResult deptUserStaffMenuTreeselect(@PathVariable("deptUserId") Long deptUserId) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectStaffMenuList(userId); |
| | | AjaxResult ajax = AjaxResult.success(); |
| | | SysUser sysUser = sysUserService.selectUserById(deptUserId); |
| | | List<SysMenu> menus = menuService.selectStaffDeptMenuList(deptUserId); |
| | | AjaxResult ajax = success(); |
| | | ajax.put("checkedKeys", menuService.selectStaffMenuListByDeptUserId(deptUserId)); |
| | | ajax.put("menus", menuService.buildMenuTreeSelect(menus)); |
| | | ajax.put("dataScopeEmployee", sysUser.getDataScopeEmployee()); |
| | | return ajax; |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单下拉树列表 |
| | | */ |
| | | @GetMapping("/treedeptselect") |
| | | public AjaxResult treedeptselect(SysMenu menu) |
| | | { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectStaffMenuList(menu, userId); |
| | | return success(menuService.buildMenuTreeSelect(menus)); |
| | | } |
| | | } |