From 21baf76da2522b750ec9855b45f37eda88de768b Mon Sep 17 00:00:00 2001 From: 15036302109 Date: Fri, 15 Dec 2023 14:22:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=95=91=E6=8F=B4=E9=98=9F?= =?UTF-8?q?=E4=BC=8D=E7=AE=A1=E7=90=86,=E8=A1=8C=E6=94=BF=E5=85=AC?= =?UTF-8?q?=E6=96=87=E5=8F=B0=E8=B4=A6,=E5=85=AC=E6=96=87=E6=B5=81?= =?UTF-8?q?=E8=BD=AC=E4=B8=89=E4=B8=AA=E6=A8=A1=E5=9D=97=E6=9D=83=E9=99=90?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/EhsDocumentServiceImpl.java | 9 +++- .../impl/EhsFloodDroughtTeamServiceImpl.java | 11 ++++- .../impl/EhsRescueTeamServiceImpl.java | 10 +++++ .../mapper/ehs/EhsRescueTeamMapper.xml | 33 +++++++------- .../views/ehs/ehsFloodDroughtTeam/index.vue | 42 ++++++++++++++--- .../src/views/ehs/ehsRescueTeam/index.vue | 45 ++++++++++++++++--- 6 files changed, 118 insertions(+), 32 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java index dba040a..70e8d60 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsDocument/service/impl/EhsDocumentServiceImpl.java @@ -48,6 +48,13 @@ public class EhsDocumentServiceImpl extends ServiceImpl selectEhsDocumentList(EhsDocument ehsDocument) { + // 按部门区分权限,局端没有查询全部的权限 + SysUser currentUser = SecurityUtils.getLoginUser().getUser(); + ehsDocument.setDeptId(currentUser.getDept().getDeptId().longValue()); + return ehsDocumentMapper.selectEhsDocumentList(ehsDocument); + } + /*@Override public List selectEhsDocumentList(EhsDocument ehsDocument) { // 如果登录用户不是县级部门(即不是根节点parent_id=0),那么只能查询本部门的;县级部门(根节点)则查询全部 SysUser currentUser = SecurityUtils.getLoginUser().getUser(); @@ -57,7 +64,7 @@ public class EhsDocumentServiceImpl extends ServiceImpl selectEhsFloodDroughtTeamList(EhsFloodDroughtTeam ehsFloodDroughtTeam) { + // 如果不是局端,那么只能查询自己部门下的数据 + SysUser currentUser = SecurityUtils.getLoginUser().getUser(); + Long deptParentId = currentUser.getDept().getParentId(); + if (deptParentId != null && deptParentId.longValue() != 0) { + ehsFloodDroughtTeam.setDeptId(currentUser.getDept().getDeptId().longValue()); + } List teamList = ehsFloodDroughtTeamMapper.selectEhsFloodDroughtTeamList(ehsFloodDroughtTeam); + // 给队伍设置人数信息 teamList.stream().forEach(item -> { Long count = ehsFloodDroughtTeamMapper.getWorkerNumByTeamId(item.getId()); - if (count != null){ + if (count != null) { item.setRescueWorkerNum(count); } }); diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java index ddfd584..193c942 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRescueTeam/service/impl/EhsRescueTeamServiceImpl.java @@ -3,6 +3,8 @@ package com.ruoyi.ehsRescueTeam.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.ehsRescueTeam.domain.EhsRescueTeam; import com.ruoyi.ehsRescueTeam.domain.RescueTeamImportTemplate; @@ -47,7 +49,15 @@ public class EhsRescueTeamServiceImpl extends ServiceImpl selectEhsRescueTeamList(EhsRescueTeam ehsRescueTeam) { + // 如果不是局端,那么只能查询自己部门下的数据 + SysUser currentUser = SecurityUtils.getLoginUser().getUser(); + Long deptParentId = currentUser.getDept().getParentId(); + if (deptParentId != null && + deptParentId.longValue() != 0) { + ehsRescueTeam.setDeptId(currentUser.getDept().getDeptId().longValue()); + } List ehsRescueTeamList = ehsRescueTeamMapper.selectEhsRescueTeamList(ehsRescueTeam); + // 给队伍设置人数信息 ehsRescueTeamList.stream().forEach(item->{ Long count = ehsRescueTeamMapper.getWorkerNumByTeamId(item.getId()); if (count != null){ diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamMapper.xml index ac1570a..5ccb208 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsRescueTeamMapper.xml @@ -5,18 +5,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -26,14 +26,15 @@