Commit f731d73faea29c07da68c421ec09b9776a84b6e6
1 parent
387e2a02
修改工单管理数据权限按道路归属单位workerCompanyId查询
Showing
2 changed files
with
12 additions
and
4 deletions
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/controller/admin/maininfo/MainInfoController.java
| 1 | 1 | package com.zteits.urbanops.module.workorder.controller.admin.maininfo; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.collection.CollUtil; | |
| 3 | 4 | import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog; |
| 4 | 5 | import com.zteits.urbanops.framework.common.biz.system.permission.PermissionCommonApi; |
| 5 | 6 | import com.zteits.urbanops.framework.common.biz.system.permission.dto.DeptDataPermissionRespDTO; |
| ... | ... | @@ -43,8 +44,7 @@ import java.util.stream.Collectors; |
| 43 | 44 | |
| 44 | 45 | import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.EXPORT; |
| 45 | 46 | import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; |
| 46 | -import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getBusiLine; | |
| 47 | -import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.getLoginUserDeptId; | |
| 47 | +import static com.zteits.urbanops.framework.security.core.util.SecurityFrameworkUtils.*; | |
| 48 | 48 | |
| 49 | 49 | @Tag(name = "管理后台 - 工单信息") |
| 50 | 50 | @RestController |
| ... | ... | @@ -157,7 +157,15 @@ public class MainInfoController { |
| 157 | 157 | } |
| 158 | 158 | //获取登录人权限 |
| 159 | 159 | DeptDataPermissionRespDTO deptDataPermission = permissionApi.getDeptDataPermission(loginUser.getId()); |
| 160 | - pageReqVO.setDeptIds(deptDataPermission.getDeptIds()); | |
| 160 | + if (Boolean.TRUE.equals(deptDataPermission.getAll())) { | |
| 161 | + // 1. 全部数据权限:不拼条件 | |
| 162 | + } else if (CollUtil.isNotEmpty(deptDataPermission.getDeptIds())) { | |
| 163 | + // 2. 有部门权限(本部门/部门及子部门/自定义部门) | |
| 164 | + pageReqVO.setDeptIds(deptDataPermission.getDeptIds()); | |
| 165 | + } else if (Boolean.TRUE.equals(deptDataPermission.getSelf())) { | |
| 166 | + // 3. 仅本人(只有没有任何部门权限时才会走到这里) | |
| 167 | + pageReqVO.setUserId(loginUser.getId()); | |
| 168 | + } | |
| 161 | 169 | PageResult<MainInfoDO> pageResult = mainInfoService.getMainInfoPage(pageReqVO); |
| 162 | 170 | |
| 163 | 171 | if (pageResult == null) { | ... | ... |
urbanops-module-workorder/src/main/java/com/zteits/urbanops/module/workorder/dal/mysql/maininfo/MainInfoMapper.java
| ... | ... | @@ -80,7 +80,7 @@ public interface MainInfoMapper extends BaseMapperX<MainInfoDO> { |
| 80 | 80 | .likeIfPresent(MainInfoDO::getRemark, reqVO.getRemark()) |
| 81 | 81 | .likeIfPresent(MainInfoDO::getHandleResult, reqVO.getHandleResult()) |
| 82 | 82 | .betweenIfPresent(MainInfoDO::getCreateTime, reqVO.getCreateTime()) |
| 83 | - .inIfPresent(MainInfoDO::getDeptId, reqVO.getDeptIds()) | |
| 83 | + .inIfPresent(MainInfoDO::getWorkerCompanyId, reqVO.getDeptIds()) | |
| 84 | 84 | .orderByDesc(MainInfoDO::getId); |
| 85 | 85 | return selectPage(reqVO, queryWrapper); |
| 86 | 86 | } | ... | ... |