Browse Source

【CHG】级联接口增加数据权限

ZhaoMn 4 years ago
parent
commit
e001eeaa85

+ 4 - 1
railway-admin/src/main/java/com/railway/web/controller/business/baseinfo/BusStationController.java

@@ -13,6 +13,7 @@ import com.railway.common.core.controller.BaseController;
 import com.railway.common.core.domain.AjaxResult;
 import com.railway.common.core.domain.entity.SysDept;
 import com.railway.common.core.page.TableDataInfo;
+import com.railway.common.utils.SecurityUtils;
 import com.railway.common.utils.StringUtils;
 import com.railway.system.service.ISysDeptService;
 import io.swagger.annotations.Api;
@@ -92,7 +93,9 @@ public class BusStationController extends BaseController {
   @GetMapping(value = "cascade")
   public TableDataInfo cascade() {
     // 构建机构树
-    List<SysDept> depts = deptService.selectDeptList();
+    SysDept dept = new SysDept();
+    dept.setDeptId(SecurityUtils.getDeptId());
+    List<SysDept> depts = deptService.selectDeptList(dept);
     List<SysDept> deptTrees = deptService.buildDeptTree(depts);
     List<CascadeDeptVo> cascadeDeptList = busStationService.buildCascadeDept(deptTrees);
     Map<Long, CascadeDeptVo> cascadeDeptVoMap = new LinkedHashMap<>();

+ 1 - 0
railway-system/src/main/java/com/railway/system/service/impl/SysDeptServiceImpl.java

@@ -43,6 +43,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
    * @return 部门信息集合
    */
   @Override
+  @DataScope(deptAlias = "d")
   public List<SysDept> selectDeptList() {
     SysDept dept = new SysDept();
     dept.setStatus(UserConstants.DEPT_NORMAL);