diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java index 969366e43..40625b660 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java @@ -29,6 +29,7 @@ import com.jero.modules.system.entity.SysDictItem; import com.jero.modules.system.entity.SysUser; import com.jero.modules.system.entity.SysUserRole; import com.jero.modules.system.mapper.SysUserMapper; +import com.jero.modules.system.service.IProjectUserDutyTerritoryService; import com.jero.modules.system.service.ISysUserRoleService; import com.jero.modules.system.service.ISysUserService; import com.jero.modules.system.service.impl.SysDictItemServiceImpl; @@ -105,6 +106,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl projectLawsInventoryEOList = projectLawsInventoryEOMapper.selectList(lawsInventoryEOQueryWrapper); + //不是管理员,但是viewer + boolean administrator = sysUserService.isAdministrator(); + boolean viewer = sysUserService.isViewer(currentUser.getId()); + if (!administrator && viewer) { + //筛选符合条件的 + List dutyTerritoryList = projectUserDutyTerritoryService.queryDutyTerritoryByUserId(currentUser.getId()); + if (ObjectUtils.isNotEmpty(dutyTerritoryList)) { + projectLawsInventoryEOList = projectLawsInventoryEOList.stream().filter(e -> dutyTerritoryList.contains(e.getDutyTerritory())).collect(Collectors.toList()); + } else { + return result; + } + } if(CollectionUtils.isNotEmpty(projectLawsInventoryEOList)){ List projectLawsInventoryIdList = projectLawsInventoryEOList.stream().distinct().map(ProjectLawsInventoryEO::getId).collect(Collectors.toList()); @@ -672,7 +687,8 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl userRoleList = this.sysUserRoleService.list(new QueryWrapper().lambda().eq(SysUserRole::getUserId, currentUser.getId())); // 查询用户所有角色 if(CollectionUtils.isNotEmpty(userRoleList)){ @@ -709,7 +725,7 @@ public class ProjectTaskInventoryEOServiceImpl extends ServiceImpl
-
+
{{ $t('CuiBan') }}
-
+
{{$t('BatchMaintenanceProgress')}}
-
+
{{$t('BatchChangeStatus')}}
-
+
{{$t('CertificationDirectory')}}
-
+
{{$t('export')}}
@@ -347,11 +347,13 @@ list: '/project/projectTaskInventoryEO/list', exportXls: '/project/projectTaskInventoryEO/exportXls' }, + isRoleSwitching:true, loading: false, visibleoperationFailed:false, NotSelectedNoEngineerValue:[], dataSource: [], selectionRowsArray:[], + roleSwitchingList:[], roleCodes:[], long: '' } @@ -378,6 +380,7 @@ this.queryParam.dutyTerritory = this.areaOfResponsibility.dutyTerritory } this.getList() + this.getRoleByUserId() this.long = localStorage.getItem('language') || 'zh-cn' }, methods: { @@ -385,6 +388,22 @@ searchQuery() { this.getList() }, + getRoleByUserId(callback) { + getAction('/project/projectLawsInventoryEO/getRoleByUserId', { projectLibraryId: this.$route.query.id }).then((res) => { + if (res.success) { + this.roleSwitchingList = res.result || [] + if(this.roleSwitchingList.length == 1){ + if(this.roleSwitchingList[0].roleCode == '13'){ + this.isRoleSwitching = false + } + } + + } else { + this.roleSwitchingList = [] + } + callback && callback() + }) + }, searchReset() { this.queryParam = {} this.getList() diff --git a/jero-web/src/views/projectManagement/components/listOfRegulations.vue b/jero-web/src/views/projectManagement/components/listOfRegulations.vue index 6faf0743a..87109f960 100644 --- a/jero-web/src/views/projectManagement/components/listOfRegulations.vue +++ b/jero-web/src/views/projectManagement/components/listOfRegulations.vue @@ -124,15 +124,15 @@ {{ $t('export') }}
-
+
{{ $t('BatchDelete') }}
-
+
{{ $t('ExportReport') }}
-
+
{{ $t('batchSettingInformation') }}
@@ -989,7 +989,8 @@ detailedSuccessList: [], detailedWarningList: [], rowKeysSuccessList: [], - rowKeysWarningList: [] + rowKeysWarningList: [], + rolecode:false, } }, @@ -1102,7 +1103,7 @@ } else { this.isDisplay = false if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12' || - this.formInlineRoleSwitching.roleSwitchingCode == '') { + this.formInlineRoleSwitching.roleSwitchingCode == '' || this.formInlineRoleSwitching.roleSwitchingCode == '13') { this.isRoleSwitching = false } }