mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-10-19 20:57:21 +08:00
chore(user): 用户导入多部门分隔符变更 : -> /
This commit is contained in:
Binary file not shown.
@@ -24,8 +24,6 @@ import cn.hutool.core.io.resource.ResourceUtil;
|
|||||||
import cn.hutool.core.lang.UUID;
|
import cn.hutool.core.lang.UUID;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.CharsetUtil;
|
import cn.hutool.core.util.CharsetUtil;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import cn.hutool.core.util.EnumUtil;
|
import cn.hutool.core.util.EnumUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -790,10 +788,10 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
|
|||||||
* <p>
|
* <p>
|
||||||
* 支持两种格式:
|
* 支持两种格式:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>多级部门:公司A:研发部:前端组</li>
|
* <li>多级部门:公司A/研发部/前端组</li>
|
||||||
* <li>单级部门:研发部</li>
|
* <li>单级部门:研发部</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* 使用冒号(:)作为层级分隔符,会逐级查找对应的部门
|
* 使用左斜杠/作为层级分隔符,会逐级查找对应的部门
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param deptPath 部门路径
|
* @param deptPath 部门路径
|
||||||
@@ -801,9 +799,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
|
|||||||
*/
|
*/
|
||||||
private DeptDO findDeptByHierarchicalPath(String deptPath) {
|
private DeptDO findDeptByHierarchicalPath(String deptPath) {
|
||||||
CheckUtils.throwIfBlank(deptPath, "部门路径不能为空");
|
CheckUtils.throwIfBlank(deptPath, "部门路径不能为空");
|
||||||
|
return deptPath.contains(StringConstants.SLASH)
|
||||||
// 根据是否包含冒号选择处理方式
|
? findMultiLevelDept(deptPath)
|
||||||
return deptPath.contains(":") ? findMultiLevelDept(deptPath) : findSingleLevelDept(deptPath.trim());
|
: findSingleLevelDept(deptPath.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -816,7 +814,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, UserDO, UserRes
|
|||||||
* @return 部门信息,未找到时返回null
|
* @return 部门信息,未找到时返回null
|
||||||
*/
|
*/
|
||||||
private DeptDO findMultiLevelDept(String deptPath) {
|
private DeptDO findMultiLevelDept(String deptPath) {
|
||||||
String[] pathParts = deptPath.split(":");
|
String[] pathParts = deptPath.split(StringConstants.SLASH);
|
||||||
CheckUtils.throwIf(pathParts.length == 0, "部门路径格式错误:{}", deptPath);
|
CheckUtils.throwIf(pathParts.length == 0, "部门路径格式错误:{}", deptPath);
|
||||||
|
|
||||||
// 从根部门开始逐级查找
|
// 从根部门开始逐级查找
|
||||||
|
Reference in New Issue
Block a user