2424import cn .hutool .core .lang .UUID ;
2525import cn .hutool .core .map .MapUtil ;
2626import cn .hutool .core .util .CharsetUtil ;
27- import java .util .HashMap ;
28- import java .util .Map ;
2927import cn .hutool .core .util .EnumUtil ;
3028import cn .hutool .core .util .ObjectUtil ;
3129import cn .hutool .core .util .StrUtil ;
@@ -790,20 +788,20 @@ private Map<String, Long> buildMultiLevelDeptMapping(List<String> deptNames) {
790788 * <p>
791789 * 支持两种格式:
792790 * <ul>
793- * <li>多级部门:公司A: 研发部: 前端组</li>
791+ * <li>多级部门:公司A/ 研发部/ 前端组</li>
794792 * <li>单级部门:研发部</li>
795793 * </ul>
796- * 使用冒号(:) 作为层级分隔符,会逐级查找对应的部门
794+ * 使用左斜杠/ 作为层级分隔符,会逐级查找对应的部门
797795 * </p>
798796 *
799797 * @param deptPath 部门路径
800798 * @return 部门信息,未找到时返回null
801799 */
802800 private DeptDO findDeptByHierarchicalPath (String deptPath ) {
803801 CheckUtils .throwIfBlank (deptPath , "部门路径不能为空" );
804-
805- // 根据是否包含冒号选择处理方式
806- return deptPath . contains ( ":" ) ? findMultiLevelDept ( deptPath ) : findSingleLevelDept (deptPath .trim ());
802+ return deptPath . contains ( StringConstants . SLASH )
803+ ? findMultiLevelDept ( deptPath )
804+ : findSingleLevelDept (deptPath .trim ());
807805 }
808806
809807 /**
@@ -816,7 +814,7 @@ private DeptDO findDeptByHierarchicalPath(String deptPath) {
816814 * @return 部门信息,未找到时返回null
817815 */
818816 private DeptDO findMultiLevelDept (String deptPath ) {
819- String [] pathParts = deptPath .split (":" );
817+ String [] pathParts = deptPath .split (StringConstants . SLASH );
820818 CheckUtils .throwIf (pathParts .length == 0 , "部门路径格式错误:{}" , deptPath );
821819
822820 // 从根部门开始逐级查找
0 commit comments