yudao-module-system/src/main/java/cn/iocoder/yudao/module/system/api/dept/DeptApi.java
@@ -31,6 +31,13 @@ List<DeptRespDTO> getDeptList(Collection<Long> ids); /** * 获得全部部门列表 * * @return 部门信息数组 */ List<DeptRespDTO> getDeptList(); /** * 校验部门们是否有效。如下情况,视为无效: * 1. 部门编号不存在 * 2. 部门被禁用 @@ -58,4 +65,16 @@ */ List<DeptRespDTO> getChildDeptList(Long id); /** * 按名称获得部门编号,不存在时自动创建(挂在根部门下) * * <p>用于 Excel 导入等「只有名称没有编号」的场景:员工导入时部门是必填项, * 若客户表格里的部门名在系统中尚未建立,直接报错会导致整批导入失败, * 这里改为自动补建,保证导入可用。 * * @param name 部门名称 * @return 部门编号;名称为空时返回 {@code null} */ Long getOrCreateDeptByName(String name); }