diff --git a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/app/dept/AppDeptController.java b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/app/dept/AppDeptController.java new file mode 100644 index 0000000..843f0e1 --- /dev/null +++ b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/controller/app/dept/AppDeptController.java @@ -0,0 +1,34 @@ + +package com.zteits.urbanops.module.system.controller.app.dept; + +import com.zteits.urbanops.framework.common.pojo.CommonResult; +import com.zteits.urbanops.framework.common.util.object.BeanUtils; +import com.zteits.urbanops.module.system.controller.admin.dept.vo.dept.*; +import com.zteits.urbanops.module.system.dal.dataobject.dept.DeptDO; +import com.zteits.urbanops.module.system.service.dept.DeptService; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 部门") +@RestController +@RequestMapping("/system/dept") +@Validated +public class AppDeptController { + + @Resource + private DeptService deptService; + + @GetMapping("/sub-list") + @Operation(summary = "获取二级部门列表") + public CommonResult> getSubDeptList() { + List list = deptService.getSubDeptListAll(); + return success(BeanUtils.toBean(list, DeptRespVO.class)); + } +} diff --git a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java index b457a13..05a226c 100644 --- a/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java +++ b/urbanops-module-system/src/main/java/com/zteits/urbanops/module/system/service/dept/DeptServiceImpl.java @@ -192,6 +192,7 @@ public class DeptServiceImpl implements DeptService { } @Override + @DataPermission(enable = false) public List getSubDeptList() { List list = deptMapper.selectList(DeptDO::getParentId, 100); Long companyId = SecurityFrameworkUtils.getCompanyId();