Commit 96c2bcf5 by lepdou

bugfix

parent be9385c8
...@@ -189,23 +189,24 @@ public class PortalConfigService { ...@@ -189,23 +189,24 @@ public class PortalConfigService {
changeSets.addCreateItem(buildItem(namespaceId, ++maxLineNum, sourceItem)); changeSets.addCreateItem(buildItem(namespaceId, ++maxLineNum, sourceItem));
} else if (isModified(sourceValue, targetItem.getValue(), sourceComment, targetItem.getComment())) {//modified items } else if (isModified(sourceValue, targetItem.getValue(), sourceComment,
targetItem.getComment())) {//modified items
targetItem.setValue(sourceValue); targetItem.setValue(sourceValue);
targetItem.setComment(sourceComment); targetItem.setComment(sourceComment);
changeSets.addUpdateItem(targetItem); changeSets.addUpdateItem(targetItem);
} }
} }
}
//parse deleted items //parse deleted items
List<ItemDTO> deletedItems = new LinkedList<>(); List<ItemDTO> deletedItems = new LinkedList<>();
Map<String, ItemDTO> sourceItemMap = BeanUtils.mapByKey("key", sourceItems); Map<String, ItemDTO> sourceItemMap = BeanUtils.mapByKey("key", sourceItems);
for (ItemDTO targetItem: targetItems){ for (ItemDTO item : targetItems) {
if (sourceItemMap.get(targetItem.getKey()) == null){ if (sourceItemMap.get(item.getKey()) == null) {
deletedItems.add(targetItem); deletedItems.add(item);
}
} }
changeSets.setDeleteItems(deletedItems);
} }
changeSets.setDeleteItems(deletedItems);
return changeSets; return changeSets;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment