From 093093e6501b3de78984e1e14c3587bfd2af674f Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Sun, 5 Jan 2025 12:32:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=AC=E5=8F=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/SysDeptController.java | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysDeptController.java b/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysDeptController.java index ed68688..397f90f 100644 --- a/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysDeptController.java +++ b/bonus-modules/bonus-system/src/main/java/com/bonus/system/controller/SysDeptController.java @@ -61,24 +61,6 @@ public class SysDeptController extends BaseController return error("系统异常"); } - @GetMapping("/deptList") - @SysLog(title = "运营人员获取公司列表", businessType = OperaType.QUERY,logType = 0,module = "系统管理->部门管理") - public TableDataInfo deptList(SysDept dept) { - if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { - throw new ServiceException("抱歉,您无权查看公司列表!"); - } - List deptList = new ArrayList<>(); - try{ - startPage(); - dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); - deptList = deptService.getDeptList(dept); - return getDataTable(deptList); - }catch (Exception e){ - log.error(e.toString(),e); - } - return getDataTableError(deptList); - } - /** * 查询部门列表(排除节点) */ @@ -176,4 +158,37 @@ public class SysDeptController extends BaseController } return error("系统异常"); } + + /** + * 根据登录用户获取公司详细信息 + */ + @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dept:query")) + @GetMapping(value = "/company_info") + public AjaxResult getCompanyInfo() { + try{ + Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId(); + return success(deptService.selectDeptById(companyId)); + } catch (Exception e){ + log.error(e.toString(),e); + } + return error("系统异常"); + } + + @GetMapping("/deptList") + @SysLog(title = "获取公司列表", businessType = OperaType.QUERY,logType = 0,module = "系统管理->部门管理") + public TableDataInfo deptList(SysDept dept) { + if (!SecurityUtils.isAdmin(SecurityUtils.getUserId())) { + throw new ServiceException("抱歉,您无权查看公司列表!"); + } + List deptList = new ArrayList<>(); + try{ + startPage(); + dept.setCompanyId(SecurityUtils.getLoginUser().getSysUser().getCompanyId()); + deptList = deptService.getDeptList(dept); + return getDataTable(deptList); + }catch (Exception e){ + log.error(e.toString(),e); + } + return getDataTableError(deptList); + } }