获取指定单据体的字段标识原创
金蝶云社区-Yan0211
Yan0211
2人赞赏了该文章 680次浏览 未经作者许可,禁止转载编辑于2023年08月30日 17:19:10
/**
 * 获取指定单据体的字段标识
 *
 * @param docEntityKey 单据体标识
 * @return 返回所有字段的key
 */
public static List<String> getEntityFieldKeyList(String docEntityKey) {
    List<String> resultList = Lists.newArrayList();
    EntityMetadata entityMetadata = (EntityMetadata) MetadataDao.readRuntimeMeta(MetadataDao.getIdByNumber(docEntityKey, MetaCategory.Entity), MetaCategory.Entity);
    if (entityMetadata != null) {
        List<EntityItem<?>> itemList = entityMetadata.getItems();
        if (CollectionUtils.isNotEmpty(itemList)) {
            itemList.forEach(forItem -> resultList.add(forItem.getKey()));
        }
    }
    return resultList;
}


赞 2