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 @@