Commit f15a8d3a001d29a3dceb469a359428a450c5a970

Authored by 戈灵虎
1 parent 8fc67012

feat(dept): 添加移动端部门控制器并禁用数据权限

urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/app/dept/AppDeptController.java 0 → 100644
  1 +
  2 +package com.zteits.urbanops.module.system.controller.app.dept;
  3 +
  4 +import com.zteits.urbanops.framework.common.pojo.CommonResult;
  5 +import com.zteits.urbanops.framework.common.util.object.BeanUtils;
  6 +import com.zteits.urbanops.module.system.controller.admin.dept.vo.dept.*;
  7 +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO;
  8 +import com.zteits.urbanops.module.system.service.dept.DeptService;
  9 +import io.swagger.v3.oas.annotations.Operation;
  10 +import io.swagger.v3.oas.annotations.tags.Tag;
  11 +import jakarta.annotation.Resource;
  12 +import org.springframework.validation.annotation.Validated;
  13 +import org.springframework.web.bind.annotation.*;
  14 +
  15 +import java.util.List;
  16 +
  17 +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
  18 +
  19 +@Tag(name = "管理后台 - 部门")
  20 +@RestController
  21 +@RequestMapping("/system/dept")
  22 +@Validated
  23 +public class AppDeptController {
  24 +
  25 + @Resource
  26 + private DeptService deptService;
  27 +
  28 + @GetMapping("/sub-list")
  29 + @Operation(summary = "获取二级部门列表")
  30 + public CommonResult<List<DeptRespVO>> getSubDeptList() {
  31 + List<DeptDO> list = deptService.getSubDeptListAll();
  32 + return success(BeanUtils.toBean(list, DeptRespVO.class));
  33 + }
  34 +}
... ...
urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java
... ... @@ -192,6 +192,7 @@ public class DeptServiceImpl implements DeptService {
192 192 }
193 193  
194 194 @Override
  195 + @DataPermission(enable = false)
195 196 public List<DeptDO> getSubDeptList() {
196 197 List<DeptDO> list = deptMapper.selectList(DeptDO::getParentId, 100);
197 198 Long companyId = SecurityFrameworkUtils.getCompanyId();
... ...