package yem.base.common.utils;

import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.QueryServiceHelper;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Description  组织帮助类
 * @Author: zhangh
 * @CreateTime: 2025-02-08  11:13
 */
public class OrgUtil {
    public static List<Long> getOrgPattern(){
        DynamicObjectCollection typeColl = QueryServiceHelper.query("bos_org_pattern", "id,number",
                new QFilter[]{new QFilter("patterntype", "in", new String[]{"1", "2"})});
        List<Long> patternList = typeColl.stream().map(x -> x.getLong("id")).collect(Collectors.toList());
        return patternList;
    }
}
