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 +