package com.bcxin.tenant.domain.utils;

public class BusinessUtil {
    public static String generateEmpMemberId(String orgId,String userId) {
        StringBuilder sb = new StringBuilder();
        sb.append(extractUnionId(userId));
        sb.append("_");
        sb.append(extractUnionId(orgId));

        return sb.toString();
    }

    private static String extractUnionId(String bsId) {
        int bsIndex = bsId.indexOf("--__");
        if (bsIndex > 0) {
            return bsId.substring(0, bsIndex);
        }

        return bsId;
    }
}
