获取单据头或者单据体所有字段标识原创
407次浏览
编辑于2024年08月28日 10:48:11
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;
}
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
0人点赞
还没有人点赞,快来当第一个点赞的人吧!
打赏
0人打赏
还没有人打赏,快来当第一个打赏的人吧!
推荐阅读