From 6f9d7e9acc18df3570e8de81a13bd255e142a45d Mon Sep 17 00:00:00 2001 From: 15036302109 Date: Mon, 5 Feb 2024 17:28:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=9F=E4=BC=8D=E6=96=B0=E5=A2=9E=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=8E=BF=E7=9B=B4=E5=8D=95=E4=BD=8D=E3=80=81=E8=A1=97?= =?UTF-8?q?=E9=81=93=E5=8F=8A=E4=B9=A1=E9=95=87=E8=B4=A6=E5=8F=B7=E5=BA=94?= =?UTF-8?q?=E5=B0=86=E6=B7=BB=E5=8A=A0=E6=95=91=E6=8F=B4=E9=98=9F=E4=BC=8D?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E2=80=9C=E6=89=80=E5=B1=9E=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E2=80=9D=E9=BB=98=E8=AE=A4=E4=B8=BA=E6=9C=AC=E5=8D=95=E4=BD=8D?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=EF=BC=8C=E5=B1=80=E7=AB=AF=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E6=97=B6=E6=89=8D=E5=8F=AF=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/system/SysDeptController.java | 29 ++++++++++--------- .../ehsRescueTeam/domain/EhsRescueTeam.java | 2 +- .../ruoyi/system/mapper/SysDeptMapper.java | 2 ++ .../ruoyi/system/service/ISysDeptService.java | 5 ++++ .../service/impl/SysDeptServiceImpl.java | 13 +++++++++ .../resources/mapper/system/SysDeptMapper.xml | 13 +++++++++ ruoyi-ui/src/api/system/dept.js | 8 +++++ .../src/views/ehs/ehsRescueTeam/index.vue | 25 +++++++++++++--- 8 files changed, 79 insertions(+), 18 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java index a8233e5..925d506 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDeptController.java @@ -1,18 +1,5 @@ package com.ruoyi.web.controller.system; -import java.util.List; -import org.apache.commons.lang3.ArrayUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.UserConstants; import com.ruoyi.common.core.controller.BaseController; @@ -21,6 +8,13 @@ import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.service.ISysDeptService; +import org.apache.commons.lang3.ArrayUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 部门信息 @@ -141,4 +135,13 @@ public class SysDeptController extends BaseController List depts = deptService.selectAllDeptList(dept); return success(depts); } + /** + * 根据客户需求,查询部分部门数据 + */ + @GetMapping("/getPartDeptInfo") + public AjaxResult getPartDeptInfo(SysDept dept) + { + List depts = deptService.getPartDeptInfo(dept); + return success(depts); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/domain/EhsRescueTeam.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/domain/EhsRescueTeam.java index 128abb2..d6e8ce3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/domain/EhsRescueTeam.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/domain/EhsRescueTeam.java @@ -40,7 +40,7 @@ public class EhsRescueTeam extends BaseEntity { /** * 队伍级别 */ - @Excel(name = "队伍级别") + @Excel(name = "队伍级别", dictType = "team_level") private String teamLevel; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index c958c88..70c8cf2 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -123,4 +123,6 @@ public interface SysDeptMapper * @return 部门信息集合 */ public List selectAllDeptList(SysDept dept); + + public List getPartDeptInfo(SysDept dept); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java index 1305f33..85e8038 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java @@ -128,4 +128,9 @@ public interface ISysDeptService * @return 部门信息集合 */ public List selectAllDeptList(SysDept dept); + + /** + * 根据客户需求,查询部分部门数据 + */ + public List getPartDeptInfo(SysDept dept); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java index 60d1310..542d6c1 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -345,4 +346,16 @@ public class SysDeptServiceImpl implements ISysDeptService public List selectAllDeptList(SysDept dept){ return deptMapper.selectAllDeptList(dept); } + + /** + * 根据客户需求,查询部分部门数据 + */ + public List getPartDeptInfo(SysDept dept) { + Long deptId = SecurityUtils.getLoginUser().getDeptId();// 当前登录用户部门 + // 如果不是局端,那么查询当前登录用户的部门信息,否则查询全部信息 + if (!Objects.equals(100L, deptId)){ + dept.setDeptId(deptId); + } + return deptMapper.getPartDeptInfo(dept); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 5a12433..8c3afc3 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -60,6 +60,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by d.parent_id, d.order_num +