buzhanyi 2 years ago
parent
commit
729f39cada

+ 18 - 0
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDeptController.java

@@ -57,6 +57,24 @@ public class SysDeptController extends BaseController {
         return success(depts);
     }
 
+    /**
+     * 获取部门列表,
+     */
+    @PreAuthorize("@ss.hasPermi('system:dept:listAll')")
+    @GetMapping("/listAll")
+    public AjaxResult listAll(SysDept dept) {
+        List<SysDept> depts = deptService.selectDeptListAll(dept);
+        for (SysDept sysDept : depts) {
+            for (SysDept dept1 : depts) {
+                if (dept1.getDeptId().equals(sysDept.getParentId())) {
+                    sysDept.setParentName(dept1.getDeptName());
+                    break;
+                }
+            }
+        }
+        return success(depts);
+    }
+
     /**
      * 获取部门树列表
      */