build description common model fix

(cherry picked from commit 60b2e9cb90)
This commit is contained in:
CITE\amentis 2024-10-04 09:54:04 +03:00 committed by CITE\dtziotzios
parent 7951f5e50d
commit 3c0efa35d3
1 changed files with 4 additions and 2 deletions

View File

@ -1658,7 +1658,8 @@ public class DescriptionServiceImpl implements DescriptionService {
if (commonModel.getDescriptionTemplate() != null && commonModel.getDescriptionTemplate().getDefinition() != null && !this.conventionService.isListNullOrEmpty(commonModel.getDescriptionTemplate().getDefinition().getPages())) { 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()){ if (commonModel.getProperties() != null && commonModel.getProperties().getFieldSets() != null && !commonModel.getProperties().getFieldSets().isEmpty()){
for (String fieldSetId: commonModel.getProperties().getFieldSets().keySet()){ 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);
} }
} }
} }
@ -1678,7 +1679,8 @@ public class DescriptionServiceImpl implements DescriptionService {
if (!this.conventionService.isListNullOrEmpty(commonModel.getItems())){ if (!this.conventionService.isListNullOrEmpty(commonModel.getItems())){
List<PropertyDefinitionFieldSetItemPersist> items = new ArrayList<>(); List<PropertyDefinitionFieldSetItemPersist> items = new ArrayList<>();
for (PropertyDefinitionFieldSetItemModel fieldSetItem: commonModel.getItems()) { 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); persist.setItems(items);
return persist; return persist;