From 60b2e9cb90083d2a6e2806ec620a43348b0f5411 Mon Sep 17 00:00:00 2001 From: "CITE\\amentis" Date: Fri, 4 Oct 2024 09:54:04 +0300 Subject: [PATCH] build description common model fix --- .../service/description/DescriptionServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java index bae6f279e..554958935 100644 --- a/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/description/DescriptionServiceImpl.java @@ -1713,7 +1713,8 @@ public class DescriptionServiceImpl implements DescriptionService { if (commonModel.getDescriptionTemplate() != null && commonModel.getDescriptionTemplate().getDefinition() != null && !this.conventionService.isListNullOrEmpty(commonModel.getDescriptionTemplate().getDefinition().getPages())) { if (commonModel.getProperties() != null && commonModel.getProperties().getFieldSets() != null && !commonModel.getProperties().getFieldSets().isEmpty()){ for (String fieldSetId: commonModel.getProperties().getFieldSets().keySet()){ - fieldSetsMap.put(fieldSetId, this.commonModelPropertyDefinitionFieldSetToPersist(commonModel.getProperties().getFieldSets().get(fieldSetId), commonModel.getDescriptionTemplate())); + PropertyDefinitionFieldSetPersist fieldSetPersist = this.commonModelPropertyDefinitionFieldSetToPersist(commonModel.getProperties().getFieldSets().get(fieldSetId), commonModel.getDescriptionTemplate()); + if (fieldSetPersist != null && !this.conventionService.isListNullOrEmpty(fieldSetPersist.getItems())) fieldSetsMap.put(fieldSetId, fieldSetPersist); } } } @@ -1733,7 +1734,8 @@ public class DescriptionServiceImpl implements DescriptionService { if (!this.conventionService.isListNullOrEmpty(commonModel.getItems())){ List items = new ArrayList<>(); for (PropertyDefinitionFieldSetItemModel fieldSetItem: commonModel.getItems()) { - items.add(this.commonModelPropertyDefinitionFieldSetItemToPersist(fieldSetItem, descriptionTemplate)); + PropertyDefinitionFieldSetItemPersist fieldSetItemPersist = this.commonModelPropertyDefinitionFieldSetItemToPersist(fieldSetItem, descriptionTemplate); + if (fieldSetItemPersist != null && !fieldSetItemPersist.getFields().isEmpty()) items.add(fieldSetItemPersist); } persist.setItems(items); return persist;