许鹏程
2023-05-25 213cc37cbf0b2515a4de56cc1e01813211bad183
product-server-org-admin/src/main/java/com/product/org/admin/service/OrganizationServiceV2.java
@@ -52,7 +52,7 @@
     *
     * @param values 多种类型的值 多个逗号分隔 列: [xxx~uuid],(xxx~user_id),{xxx_post_uuid}
     * @return 返回二维数组
     * 第一个维度:固定长度 3 ,下标0 代表机构(公司、部门) 下标 1 代表岗位 下标 2 代表 用户 ,可能为空
     * 第一个维度:固定长度 4 ,下标0 代表公司 下标1 代表部门 下标 2 代表岗位 下标 3 代表 用户 ,可能为空
     * 第二个维度: 长度未知,返回一维数组中对应含义的 值,可能为空
     * @auth cheng
     * @date 2022年4月20日18:21:09
@@ -69,17 +69,26 @@
            }
            String actualValue = val.substring(1, val.length() - 1);
            int index;
            int index = -1;
            if (val.startsWith("[") && val.endsWith("]")) {
                //机构
                index = 0;
                Map<String, Object> orgCacheByUuid = this.getOrgCacheByUuid(actualValue);
                if (orgCacheByUuid != null) {
                    Object org_level_type = orgCacheByUuid.get(CmnConst.ORG_LEVEL_TYPE);
                    if (org_level_type != null) {
                        index = NumberUtil.parseInt(org_level_type.toString());
                    }
                }
            } else if (val.startsWith("{") && val.endsWith("}")) {
                //岗位
                index = 1;
                index = 2;
            } else if (val.startsWith("(") && val.endsWith(")")) {
                //人员
                index = 2;
                index = 3;
            } else {
                continue;
            }
            if (index == -1) {
                continue;
            }
            if (typeValues[index] == null) {
@@ -92,6 +101,11 @@
        return typeValues;
    }
    public static void main(String[] args) {
        String[] a = new String[1];
        System.out.println(a.length);
    }
    /**
     * 获取所有的人员
     *