获取单据头或者单据体标识原创
金蝶云社区-Cchen
Cchen
0人赞赏了该文章 72次浏览 未经作者许可,禁止转载编辑于2024年04月26日 18:28:29
public static List<String> getEntityFieldKeyList(String docEntityKey,String entryName) {
   List<String> noUpFiles = new ArrayList<>();//不处理的字段标识
   noUpFiles.add("id");
   noUpFiles.add("billno");
   noUpFiles.add("seq");
   List<String> resultList = Lists.newArrayList();
   MainEntityType mainType = EntityMetadataCache.getDataEntityType(docEntityKey);
   DataEntityPropertyCollection properties = mainType.getProperties();
   for (IDataEntityProperty property : properties) {
       String name = property.getName();
       if (property instanceof EntryProp) {
           String entryName1 = property.getName();
           if (StringUtils.isNotBlank(entryName)){
               if (entryName.equals(entryName1)){
                   DataEntityPropertyCollection entryProperties = ((EntryProp) property)._collectionItemPropertyType.getProperties();
                   for (IDataEntityProperty entryProperty : entryProperties) {
                       String fileName = entryProperty.getName();
                       if (!noUpFiles.contains(fileName)) {
                           resultList.add(fileName);
                       }
                   }
               }
           }else {
               if (!noUpFiles.contains(entryName1)){
                   resultList.add(entryName1);
               }
           }
       }else {
           if (StringUtils.isBlank(entryName)){
               if (!noUpFiles.contains(name)){
                   resultList.add(name);
               }
           }
       }
   }
   return resultList;
}


赞 0