update 根据model部署
This commit is contained in:
+6
-6
@@ -75,24 +75,24 @@ public class ProcessNodeService extends ServiceImpl<ProcessNodeMapper, ProcessNo
|
||||
return processNodeList;
|
||||
}
|
||||
|
||||
List<String> nodeNameList = oldNodeList.stream()
|
||||
.map(ProcessNode::getNodeName).distinct().collect(Collectors.toList());
|
||||
List<String> nodeIdList = oldNodeList.stream()
|
||||
.map(ProcessNode::getXmlNodeId).distinct().collect(Collectors.toList());
|
||||
|
||||
// 给前端展示的节点
|
||||
List<ProcessNode> viewNodeList = oldNodeList.stream()
|
||||
.filter(node -> node.getIsView() == 1).collect(Collectors.toList());
|
||||
Map<String, String> map = CollStreamUtil.toMap(processNodeList, ProcessNode::getNodeName, ProcessNode::getXmlNodeId);
|
||||
Map<String, String> map = CollStreamUtil.toMap(processNodeList, ProcessNode::getXmlNodeId, ProcessNode::getNodeName);
|
||||
viewNodeList.forEach(viewNode -> {
|
||||
viewNode.setProcessDefinitionId(processDefinitionId);
|
||||
viewNode.setId(null);
|
||||
if (map.containsKey(viewNode.getNodeName())){
|
||||
viewNode.setXmlNodeId(map.get(viewNode.getNodeName()));
|
||||
if (map.containsKey(viewNode.getXmlNodeId())){
|
||||
viewNode.setNodeName(map.get(viewNode.getXmlNodeId()));
|
||||
}
|
||||
});
|
||||
|
||||
for (ProcessNode processNode : processNodeList) {
|
||||
// 如果旧列表里面不存在这个名字,即为新增节点
|
||||
if (!nodeNameList.contains(processNode.getNodeName())) {
|
||||
if (!nodeIdList.contains(processNode.getXmlNodeId())) {
|
||||
viewNodeList.add(processNode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user