| | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.JsonUtils2; |
| | | import com.zt.common.utils.UUIDUtil; |
| | | import com.zt.life.modules.taskReliability.dao.AlgorithmDao; |
| | | import com.zt.life.modules.taskReliability.dao.ModelLineDao; |
| | | import com.zt.life.modules.taskReliability.dao.ModelNodeDao; |
| | | import com.zt.life.modules.taskReliability.dao.ModelRbdDao; |
| | | import com.zt.life.modules.taskReliability.dao.*; |
| | | import com.zt.life.modules.taskReliability.dto.ModelLinePair; |
| | | import com.zt.life.modules.taskReliability.model.Algorithm; |
| | | import com.zt.life.modules.taskReliability.model.ModelLine; |
| | | import com.zt.life.modules.taskReliability.model.ModelNode; |
| | | import com.zt.life.modules.taskReliability.model.ModelRbd; |
| | | import com.zt.life.modules.taskReliability.model.*; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private ModelRbdDao modelRbdDao; |
| | | @Autowired |
| | | private AlgorithmDao algorithmDao; |
| | | @Autowired |
| | | private ModelNodeAlgorithmDao modelNodeAlgorithmDao; |
| | | |
| | | /** |
| | | * 分页查询 |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void insert(ModelRbd modelRbd) { |
| | | if (modelRbd==null) return; |
| | | if (modelRbd.getModelId()==null) return; |
| | | Long modelId = modelRbd.getModelId(); |
| | | if (modelRbd.getId()==null) return; |
| | | Long modelId = modelRbd.getId(); |
| | | |
| | | // 删除既有数据 |
| | | modelRbdDao.deleteByModelId(modelId); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(ModelRbd modelRbd) { |
| | | if (modelRbd==null) return; |
| | | if (modelRbd.getModelId()==null) return; |
| | | Long modelId = modelRbd.getModelId(); |
| | | if (modelRbd.getId()==null) return; |
| | | Long modelId = modelRbd.getId(); |
| | | |
| | | // 删除既有数据 |
| | | modelRbdDao.deleteByModelId(modelId); |
| | |
| | | result = getAlgorithmFromRbd(modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList); |
| | | |
| | | // 5. 保存模型 |
| | | if (saveFlag) saveModel(modelId, modelNodeList, modelLineList, algorithmList); |
| | | if (saveFlag) saveModel(modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList); |
| | | |
| | | return result; |
| | | } |
| | |
| | | hasSimplified = false; |
| | | hasSimplified = simplifySeries(modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList, hasSimplified); |
| | | hasSimplified = simplifyParallel(modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList, hasSimplified); |
| | | hasSimplified = simplifyOperator("switch", modelId, modelNodeList, modelLineList, algorithmList, hasSimplified); |
| | | hasSimplified = simplifyOperator("vote", modelId, modelNodeList, modelLineList, algorithmList, hasSimplified); |
| | | hasSimplified = simplifyOperator("switch", modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList, hasSimplified); |
| | | hasSimplified = simplifyOperator("vote", modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList, hasSimplified); |
| | | hasSimplified = simplifyBridge(modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList, hasSimplified); |
| | | isEnd = simplifyEnd(modelId, modelNodeList, modelLineList, algorithmList, modelNodeAndVnodeList); |
| | | } while (!isEnd && hasSimplified); |
| | | |
| | | // 合并碎片化了的串联 |
| | | |
| | | // 合并碎片化了的并联 |
| | | |
| | | return isEnd; |
| | | } |
| | |
| | | algorithm.setAlgorithmType(endNode.getNodeType()); |
| | | algorithm.setComputerList(node.getId().toString()); |
| | | algorithm.setObjectList(node.getName()); |
| | | algorithm.setStep(algorithmList.size()); |
| | | algorithm.setStep(algorithmList.size()==0 ? 0 : algorithmList.get(algorithmList.size()-1).getStep()+1); |
| | | algorithmList.add(algorithm); |
| | | |
| | | // 新增结束的虚节点 |
| | |
| | | if ("start,switch,vote".contains(endNode.getNodeType()) || endNode.getOutLineNum()!=1) { |
| | | result.remove(endNode); |
| | | } |
| | | List<ModelNode> seriesNodes = result.stream().filter(item -> |
| | | List<ModelNode> realSeriesNodes = result.stream().filter(item -> |
| | | !"connect".equals(item.getNodeType())).collect(Collectors.toList()); |
| | | if (seriesNodes.size()<2) continue; |
| | | |
| | | // 替换成虚节点 |
| | | replaceToVnodeSeries(modelId, modelNodeList, modelLineList, |
| | | algorithmList, modelNodeAndVnodeList, result, seriesNodes); |
| | | if (realSeriesNodes.size()<1) { |
| | | if (result.size() < 2) continue; |
| | | // 替换成连线 |
| | | replaceToLineSeries(modelNodeList, modelLineList, result); |
| | | } else if (realSeriesNodes.size()==1) { |
| | | if (result.size() < 2) continue; // path上只有该产品节点(node/vnode)自己,无需做什么 |
| | | // 将path替换成该节点 |
| | | replaceToTheNodeSeries(modelNodeList, modelLineList, |
| | | result, realSeriesNodes.get(0)); |
| | | } else { |
| | | // 将path替换成虚节点 |
| | | replaceToVnodeSeries(modelId, modelNodeList, modelLineList, |
| | | algorithmList, modelNodeAndVnodeList, result, realSeriesNodes); |
| | | } |
| | | hasSimplified = true; |
| | | } |
| | | |
| | | return hasSimplified; |
| | | } |
| | | |
| | | private void replaceToLineSeries(List<ModelNode> modelNodeList, |
| | | List<ModelLine> modelLineList, |
| | | List<ModelNode> path) { |
| | | // 获取path的起点的出口线 |
| | | ModelNode finalNodeStart = path.get(0); |
| | | ModelNode finalNodeEnd = path.get(path.size()-1); |
| | | List<ModelLine> outLines = modelLineList.stream().filter(item -> |
| | | item.getBeginCell().equals(finalNodeStart.getPicId())).collect(Collectors.toList()); |
| | | |
| | | // 删除path上的所有中间连线及path的结束点以外的节点 |
| | | for (int i=0; i<path.size(); i++) { |
| | | ModelNode finalNode = path.get(i); |
| | | if (i < path.size() - 1) { |
| | | // 将入口线删除 |
| | | List<ModelLine> lines = modelLineList.stream().filter(item -> |
| | | item.getEndCell().equals(finalNode.getPicId())).collect(Collectors.toList()); |
| | | modelLineList.removeAll(lines); |
| | | // 删除节点 |
| | | modelNodeList.remove(finalNode); |
| | | calcInOutLineNum(finalNode, modelLineList); |
| | | } |
| | | } |
| | | |
| | | // 将path的起点的出口线改为连接到path的结束点 |
| | | for (ModelLine line : outLines) { |
| | | line.setBeginCell(finalNodeEnd.getPicId()); |
| | | } |
| | | |
| | | calcInOutLineNum(finalNodeStart, modelLineList); |
| | | calcInOutLineNum(finalNodeEnd, modelLineList); |
| | | } |
| | | |
| | | private void replaceToTheNodeSeries(List<ModelNode> modelNodeList, |
| | | List<ModelLine> modelLineList, |
| | | List<ModelNode> path, |
| | | ModelNode theNode) { |
| | | // 获取path的起点的出口线 |
| | | ModelNode finalNodeStart = path.get(0); |
| | | List<ModelLine> outLines = modelLineList.stream().filter(item -> |
| | | item.getBeginCell().equals(finalNodeStart.getPicId())).collect(Collectors.toList()); |
| | | // 获取path的结束点的入口线 |
| | | ModelNode finalNodeEnd = path.get(path.size()-1); |
| | | List<ModelLine> inLines = modelLineList.stream().filter(item -> |
| | | item.getEndCell().equals(finalNodeEnd.getPicId())).collect(Collectors.toList()); |
| | | |
| | | // 删除path上的所有中间连线及theNode以外的节点 |
| | | for (int i=0; i<path.size(); i++) { |
| | | ModelNode finalNode = path.get(i); |
| | | if (i < path.size() - 1) { |
| | | // 将入口线删除 |
| | | List<ModelLine> lines = modelLineList.stream().filter(item -> |
| | | item.getEndCell().equals(finalNode.getPicId())).collect(Collectors.toList()); |
| | | modelLineList.removeAll(lines); |
| | | } |
| | | if (!finalNode.getId().equals(theNode.getId())) { |
| | | modelNodeList.remove(finalNode); |
| | | calcInOutLineNum(finalNode, modelLineList); |
| | | } |
| | | } |
| | | |
| | | // 将path的起点的出口线改为连接到theNode |
| | | for (ModelLine line : outLines) { |
| | | line.setBeginCell(theNode.getPicId()); |
| | | } |
| | | // 将path的结束点的入口线改为连接到theNode |
| | | for (ModelLine line : inLines) { |
| | | line.setEndCell(theNode.getPicId()); |
| | | } |
| | | |
| | | calcInOutLineNum(finalNodeStart, modelLineList); |
| | | calcInOutLineNum(finalNodeEnd, modelLineList); |
| | | calcInOutLineNum(theNode, modelLineList); |
| | | } |
| | | |
| | | private void replaceToVnodeSeries(Long modelId, |
| | |
| | | List<ModelNode> path, |
| | | List<ModelNode> seriesNodes) { |
| | | // 新增algorithm |
| | | List<String> computerList = createVnodeComputerList("series", algorithmList, modelNodeAndVnodeList, seriesNodes); |
| | | Algorithm algorithm = new Algorithm(); |
| | | Long id = UUIDUtil.generateId(); |
| | | algorithm.setId(id); |
| | |
| | | algorithm.setComputerId(id); |
| | | algorithm.setModelType("series"); |
| | | algorithm.setAlgorithmType("series"); |
| | | algorithm.setComputerList(joinNodeId(seriesNodes, ",")); |
| | | algorithm.setObjectList(joinNodeName(seriesNodes, ",")); |
| | | algorithm.setStep(algorithmList.size()); |
| | | algorithm.setComputerList(computerList.get(0)); |
| | | algorithm.setObjectList(computerList.get(1)); |
| | | algorithm.setStep(algorithmList.size()==0 ? 0 : algorithmList.get(algorithmList.size()-1).getStep()+1); |
| | | algorithmList.add(algorithm); |
| | | |
| | | // 新增虚节点 |
| | |
| | | vnode.setModelId(modelId); |
| | | vnode.setNodeType("vnode"); |
| | | vnode.setName("v"+algorithm.getStep()); |
| | | vnode.setPositionX(path.get(0).getPositionX()); |
| | | vnode.setPositionY(path.get(0).getPositionY()); |
| | | modelNodeList.add(vnode); |
| | | modelNodeAndVnodeList.add(vnode); |
| | | |
| | |
| | | } |
| | | |
| | | calcInOutLineNum(vnode, modelLineList); |
| | | } |
| | | |
| | | private List<String> createVnodeComputerList(String type, |
| | | List<Algorithm> algorithmList, |
| | | List<ModelNode> modelNodeAndVnodeList, |
| | | List<ModelNode> nodes) { |
| | | // 调整节点顺序 |
| | | List<ModelNode> sortedNodes = null; |
| | | if ("bridge".equals(type)) { |
| | | if (nodes.get(1).getPositionY() < nodes.get(4).getPositionY()) { |
| | | sortedNodes = nodes; |
| | | } else { |
| | | sortedNodes = new ArrayList<>(); |
| | | sortedNodes.add(nodes.get(3)); |
| | | sortedNodes.add(nodes.get(4)); |
| | | sortedNodes.add(nodes.get(2)); |
| | | sortedNodes.add(nodes.get(0)); |
| | | sortedNodes.add(nodes.get(1)); |
| | | } |
| | | } else if ("parallel".equals(type)) { |
| | | // 把虚节点内部的并联节点全部拿出来,进行大排序 |
| | | sortedNodes = new ArrayList<>(); |
| | | for (ModelNode node : nodes) { |
| | | if ("node".equals(node.getNodeType())) { |
| | | sortedNodes.add(node); |
| | | } else { |
| | | // vnode |
| | | Algorithm algorithm = algorithmList.stream().filter(item -> |
| | | item.getId().equals(node.getId())).collect(Collectors.toList()).get(0); |
| | | if (type.equals(algorithm.getAlgorithmType())) { |
| | | String[] pNodesStrArr = algorithm.getComputerList().split(","); |
| | | for (String pNodeStr : pNodesStrArr) { |
| | | sortedNodes.add(modelNodeAndVnodeList.stream().filter(item -> |
| | | pNodeStr.equals(item.getId().toString())).collect(Collectors.toList()).get(0)); |
| | | } |
| | | algorithmList.remove(algorithm); |
| | | modelNodeAndVnodeList.remove(node); |
| | | } else { |
| | | sortedNodes.add(node); |
| | | } |
| | | } |
| | | } |
| | | sortedNodes.sort(Comparator.comparing(ModelNode::getPositionY)); |
| | | } else { |
| | | sortedNodes = Arrays.asList(new ModelNode[nodes.size()]); |
| | | Collections.copy(sortedNodes, nodes); |
| | | if ("series".equals(type)) { |
| | | Collections.reverse(sortedNodes); |
| | | } else { |
| | | sortedNodes.sort(Comparator.comparing(ModelNode::getPositionY)); |
| | | } |
| | | } |
| | | |
| | | String computerIdList = ""; |
| | | String objectList = ""; |
| | | if ("parallel".equals(type)) { |
| | | for (ModelNode node : sortedNodes) { |
| | | objectList += "".equals(objectList) ? node.getName() : "," + node.getName(); |
| | | computerIdList += "".equals(computerIdList) ? node.getId().toString() : "," + node.getId().toString(); |
| | | } |
| | | } else { |
| | | for (ModelNode node : sortedNodes) { |
| | | if ("node".equals(node.getNodeType())) { |
| | | objectList += "".equals(objectList) ? node.getName() : "," + node.getName(); |
| | | computerIdList += "".equals(computerIdList) ? node.getId().toString() : "," + node.getId().toString(); |
| | | } else { |
| | | // vnode |
| | | Algorithm algorithm = algorithmList.stream().filter(item -> |
| | | item.getId().equals(node.getId())).collect(Collectors.toList()).get(0); |
| | | if ("series".equals(type) && type.equals(algorithm.getAlgorithmType())) { |
| | | objectList += "".equals(objectList) ? algorithm.getObjectList() : "," + algorithm.getObjectList(); |
| | | computerIdList += "".equals(computerIdList) ? algorithm.getComputerList() : "," + algorithm.getComputerList(); |
| | | algorithmList.remove(algorithm); |
| | | modelNodeAndVnodeList.remove(node); |
| | | } else { |
| | | objectList += "".equals(objectList) ? node.getName() : "," + node.getName(); |
| | | computerIdList += "".equals(computerIdList) ? node.getId().toString() : "," + node.getId().toString(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | List<String> result = new ArrayList<>(); |
| | | result.add(computerIdList); |
| | | result.add(objectList); |
| | | return result; |
| | | } |
| | | |
| | | private void seekPathSeries(List<ModelNode> modelNodeList, |
| | |
| | | if ("connect".equals(startNode.getNodeType()) && pathOneGroup.size()==lines.size()) { |
| | | // 替换成虚节点 |
| | | replaceToVnode("parallel", modelId, modelNodeList, modelLineList, |
| | | algorithmList, startNode, endNode, branchNodeList); |
| | | algorithmList, modelNodeAndVnodeList, startNode, endNode, branchNodeList); |
| | | } else { |
| | | // 新增虚节点 |
| | | ModelNode vnode = new ModelNode(); |
| | |
| | | vnode.setPicId(id.toString()); |
| | | vnode.setModelId(modelId); |
| | | vnode.setNodeType("vnode"); |
| | | // 位置设置为并联中第一个节点的位置 |
| | | vnode.setPositionX(branchNodeList.get(0).getPositionX()); |
| | | vnode.setPositionY(branchNodeList.get(0).getPositionY()); |
| | | // vnode.setPositionX(startNode.getPositionX()); |
| | | // vnode.setPositionY(startNode.getPositionY()); |
| | | modelNodeList.add(vnode); |
| | | modelNodeAndVnodeList.add(vnode); |
| | | ModelLine modelLineNew = new ModelLine(); |
| | |
| | | modelLineNew.setEndCell(startNode.getPicId()); |
| | | modelLineList.add(modelLineNew); |
| | | replaceToVnode("parallel", modelId, modelNodeList, modelLineList, |
| | | algorithmList, vnode, endNode, branchNodeList); |
| | | algorithmList, modelNodeAndVnodeList, vnode, endNode, branchNodeList); |
| | | calcInOutLineNum(startNode, modelLineList); |
| | | } |
| | | hasSimplified = true; |
| | |
| | | branchNodeList.add(node4); |
| | | branchNodeList.add(node5); |
| | | |
| | | if ("connect".contains(startNode.getNodeType()) && startNode.getInLineNum()==2) { |
| | | if ("connect".equals(startNode.getNodeType()) && startNode.getInLineNum()==2) { |
| | | // 替换成虚节点 |
| | | replaceToVnode("bridge", modelId, modelNodeList, modelLineList, |
| | | algorithmList, startNode, endNode, branchNodeList); |
| | | algorithmList, modelNodeAndVnodeList, startNode, endNode, branchNodeList); |
| | | } else { |
| | | // 新增虚节点 |
| | | ModelNode vnode = new ModelNode(); |
| | |
| | | vnode.setPicId(id.toString()); |
| | | vnode.setModelId(modelId); |
| | | vnode.setNodeType("vnode"); |
| | | // 将位置设置为第一个分支的 |
| | | vnode.setPositionX(node2.getPositionX()); |
| | | vnode.setPositionY(node2.getPositionY()); |
| | | // vnode.setPositionX(startNode.getPositionX()); |
| | | // vnode.setPositionY(startNode.getPositionY()); |
| | | modelNodeList.add(vnode); |
| | | modelNodeAndVnodeList.add(vnode); |
| | | ModelLine modelLineNew = new ModelLine(); |
| | |
| | | modelLineNew.setEndCell(startNode.getPicId()); |
| | | modelLineList.add(modelLineNew); |
| | | replaceToVnode("bridge", modelId, modelNodeList, modelLineList, |
| | | algorithmList, vnode, endNode, branchNodeList); |
| | | algorithmList, modelNodeAndVnodeList, vnode, endNode, branchNodeList); |
| | | calcInOutLineNum(startNode, modelLineList); |
| | | } |
| | | |
| | |
| | | List<ModelNode> modelNodeList, |
| | | List<ModelLine> modelLineList, |
| | | List<Algorithm> algorithmList, |
| | | List<ModelNode> modelNodeAndVnodeList, |
| | | boolean hasSimplified) { |
| | | List<ModelNode> opNodes = modelNodeList.stream().filter(item -> |
| | | operator.equals(item.getNodeType())).collect(Collectors.toList()); |
| | |
| | | } |
| | | if (thisNodeSuccess) { |
| | | replaceToVnode(opNode.getNodeType(), modelId, modelNodeList, modelLineList, |
| | | algorithmList, opNode, endNode, branchNodeList); |
| | | algorithmList, modelNodeAndVnodeList, opNode, endNode, branchNodeList); |
| | | hasSimplified = true; |
| | | } |
| | | } |
| | |
| | | List<ModelNode> modelNodeList, |
| | | List<ModelLine> modelLineList, |
| | | List<Algorithm> algorithmList, |
| | | List<ModelNode> modelNodeAndVnodeList, |
| | | ModelNode startNode, |
| | | ModelNode endNode, |
| | | List<ModelNode> branchNodeList) { |
| | | // 新增algorithm |
| | | List<String> computerList = createVnodeComputerList(type, algorithmList, modelNodeAndVnodeList, branchNodeList); |
| | | Algorithm algorithm = new Algorithm(); |
| | | Long id = UUIDUtil.generateId(); |
| | | algorithm.setId(id); |
| | |
| | | algorithm.setComputerId(id); |
| | | algorithm.setModelType(type); |
| | | algorithm.setAlgorithmType(type); |
| | | algorithm.setComputerList(joinNodeId(branchNodeList, ",")); |
| | | algorithm.setObjectList(joinNodeName(branchNodeList, ",")); |
| | | algorithm.setStep(algorithmList.size()); |
| | | algorithm.setComputerList(computerList.get(0)); |
| | | algorithm.setObjectList(computerList.get(1)); |
| | | algorithm.setStep(algorithmList.size()==0 ? 0 : algorithmList.get(algorithmList.size()-1).getStep()+1); |
| | | algorithmList.add(algorithm); |
| | | |
| | | // 替换为虚节点 |
| | |
| | | modelNode.setModelId(modelId); |
| | | modelNode.setPicId(jsonObject.get("id").toString()); |
| | | modelNode.setNodeType(JsonUtils2.getJsonValueByPath(jsonObject, "data/nodeType".split("/")).toString()); |
| | | modelNode.setPositionX(Double.valueOf(JsonUtils2.getJsonValueByPath(jsonObject, "position/x".split("/")).toString())); |
| | | modelNode.setPositionY(Double.valueOf(JsonUtils2.getJsonValueByPath(jsonObject, "position/y".split("/")).toString())); |
| | | if ("node".equals(modelNode.getNodeType())) { |
| | | modelNode.setDataId(Long.valueOf(JsonUtils2.getJsonValueByPath(jsonObject, "data/dataId".split("/")).toString())); |
| | | // modelNode.setNodeTypeExt(JsonUtils2.getJsonValueByPath(jsonObject, "data/nodeTypeExt".split("/")).toString()); |
| | | Object label = JsonUtils2.getJsonValueByPath(jsonObject, "attrs/label/textWrap/text".split("/")); |
| | | modelNode.setName(label==null ? "" : label.toString()); |
| | | modelNode.setNodeTypeExt(JsonUtils2.getJsonValueByPath(jsonObject, "data/nodeTypeExt".split("/")).toString()); |
| | | Object name = JsonUtils2.getJsonValueByPath(jsonObject, "attrs/text/text".split("/")); |
| | | modelNode.setName(name==null ? "" : name.toString()); |
| | | } |
| | | modelNodeList.add(modelNode); |
| | | } |
| | | } |
| | | // calcLineSortAll(modelNodeList, modelLineList); |
| | | } |
| | | |
| | | /* |
| | | private void calcLineSortAll(List<ModelNode> modelNodeList, |
| | | List<ModelLine> modelLineList) { |
| | | for (ModelNode node : modelNodeList) { |
| | | List<ModelLine> inLines = modelLineList.stream().filter(item -> |
| | | item.getEndCell().equals(node.getPicId())).collect(Collectors.toList()); |
| | | if (inLines.size() < 1) continue; |
| | | for (ModelLine line : inLines) { |
| | | ModelNode beginNode = modelNodeList.stream().filter(item -> |
| | | line.getBeginCell().equals(item.getPicId())).collect(Collectors.toList()).get(0); |
| | | line.setLineSort(beginNode.getPositionY()); |
| | | } |
| | | } |
| | | } |
| | | */ |
| | | |
| | | private void analyzeRbdAndSave(Long modelId, String content, boolean saveFlag) { |
| | | String diagramJsonStr = content; |
| | |
| | | } // end for |
| | | } while (hasLeastOne); |
| | | |
| | | if (saveFlag) saveModel(modelId, modelNodeList, modelLineList, algoList); |
| | | // if (saveFlag) saveModel(modelId, modelNodeList, modelLineList, algoList); |
| | | } |
| | | |
| | | private void handleOneLine(List<ModelLine> modelLineList, |
| | |
| | | private void saveModel(Long modelId, |
| | | List<ModelNode> modelNodeList, |
| | | List<ModelLine> modelLineList, |
| | | List<Algorithm> algoList) { |
| | | List<Algorithm> algoList, |
| | | List<ModelNode> modelNodeAndVnodeList) { |
| | | // 删除既有数据 |
| | | modelNodeDao.deleteByModelId(modelId); |
| | | modelLineDao.deleteByModelId(modelId); |
| | | algorithmDao.deleteByModelId(modelId); |
| | | modelNodeAlgorithmDao.deleteByModelId(modelId); |
| | | |
| | | // 插入数据 |
| | | for (ModelNode modelNode : modelNodeList) { |
| | |
| | | for (Algorithm algorithm : algoList) { |
| | | algorithmDao.insert(algorithm); |
| | | } |
| | | for (ModelNode modelNode : modelNodeAndVnodeList) { |
| | | modelNodeAlgorithmDao.insert(ModelNodeAlgorithm.from(modelNode)); |
| | | } |
| | | } |
| | | |
| | | } |