|
|
@@ -1,26 +1,26 @@
|
|
|
package org.dromara.system.controller.system;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
+import cn.hutool.core.convert.Convert;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
-import jakarta.validation.constraints.*;
|
|
|
-import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.validation.annotation.Validated;
|
|
|
-import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
-import org.dromara.common.log.annotation.Log;
|
|
|
-import org.dromara.common.web.core.BaseController;
|
|
|
-import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
+import jakarta.validation.constraints.NotNull;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.core.validate.AddGroup;
|
|
|
import org.dromara.common.core.validate.EditGroup;
|
|
|
-import org.dromara.common.log.enums.BusinessType;
|
|
|
import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
-import org.dromara.system.domain.vo.ErpDeptVo;
|
|
|
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
+import org.dromara.common.log.annotation.Log;
|
|
|
+import org.dromara.common.log.enums.BusinessType;
|
|
|
+import org.dromara.common.web.core.BaseController;
|
|
|
import org.dromara.system.domain.bo.ErpDeptBo;
|
|
|
+import org.dromara.system.domain.vo.ErpDeptVo;
|
|
|
import org.dromara.system.service.IErpDeptService;
|
|
|
-import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* erp部门
|
|
|
@@ -42,8 +42,22 @@ public class ErpDeptController extends BaseController {
|
|
|
*/
|
|
|
//@SaCheckPermission("system:erpDept:list")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo<ErpDeptVo> list(ErpDeptBo bo, PageQuery pageQuery) {
|
|
|
- return erpDeptService.queryPageList(bo, pageQuery);
|
|
|
+ public R<List<ErpDeptVo>> list(ErpDeptBo dept) {
|
|
|
+ List<ErpDeptVo> depts = erpDeptService.selectDeptList(dept);
|
|
|
+ return R.ok(depts);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询部门列表(排除节点)
|
|
|
+ *
|
|
|
+ * @param deptId 部门ID
|
|
|
+ */
|
|
|
+ @GetMapping("/list/exclude/{deptId}")
|
|
|
+ public R<List<ErpDeptVo>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) {
|
|
|
+ List<ErpDeptVo> depts = erpDeptService.selectDeptList(new ErpDeptBo());
|
|
|
+ depts.removeIf(d -> d.getDeptId().equals(deptId)
|
|
|
+ || StringUtils.splitList(d.getAncestors()).contains(Convert.toStr(deptId)));
|
|
|
+ return R.ok(depts);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -66,7 +80,7 @@ public class ErpDeptController extends BaseController {
|
|
|
@GetMapping("/{deptId}")
|
|
|
public R<ErpDeptVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
@PathVariable("deptId") Long deptId) {
|
|
|
- return R.ok(erpDeptService.queryById(deptId));
|
|
|
+ return R.ok(erpDeptService.selectDeptById(deptId));
|
|
|
}
|
|
|
|
|
|
/**
|