|
@@ -239,7 +239,7 @@ public class FtaDiagramDataService {
|
|
|
.and(o -> o.eq(FtaNode::getMasterId, entity.getMasterId()).or()
|
|
|
.eq(FtaNode::getId, entity.getMasterId()))
|
|
|
.isNotNull(FtaNode::getDistributionTypeCode)
|
|
|
- .last(" LIMIT 1"));
|
|
|
+ .last(FtaConstants.SQL_LIMIT_1));
|
|
|
if (nodeMapper.selectCount(new LambdaQueryWrapper<FtaNode>()
|
|
|
.in(FtaNode::getTypeCode, typeCodeList)
|
|
|
.and(o -> o.eq(FtaNode::getMasterId, entity.getMasterId()).or()
|
|
@@ -1260,12 +1260,9 @@ public class FtaDiagramDataService {
|
|
|
List<FtaEdge> allEdges = generateEdgesByNodes(allNodes);
|
|
|
ArrayList<String> childrenIds = new ArrayList<>();
|
|
|
getRelevanceIdByNodeId(allEdges, sourceMiddleId, childrenIds);
|
|
|
- if (sourceMiddleId.equals(targetMiddleId)) {
|
|
|
+ if (allNodes.stream().filter(v -> childrenIds.contains(v.getId())).anyMatch(v -> targetMiddleId.equals(v.getId()))) {
|
|
|
throw new DescribeException(FtaParamDataExceptionEnum.getLanguageMessageByKey(FtaParamDataExceptionEnum.不允许将同源转移门复制到当前子集中, userInfo.getLanguageKey()), ResponseStatus.WARN.getStatus());
|
|
|
}
|
|
|
-// if (allNodes.stream().filter(v -> childrenIds.contains(v.getId())).anyMatch(v -> FtaNodeEnum.转移门.getIndex().equals(v.getTypeCode()))) {
|
|
|
-// throw new DescribeException(FtaParamDataExceptionEnum.getLanguageMessageByKey(FtaParamDataExceptionEnum.被复制的子集中包含转移门不允许复制为同源转移门, userInfo.getLanguageKey()), ResponseStatus.WARN.getStatus());
|
|
|
-// }
|
|
|
// 当被复制的是门,且复制类型为重复时:复制为同源转移门
|
|
|
return nodeCopyTransfer(userInfo, middleNode, targetGate);
|
|
|
} else if (FtaNodeEnum.重复事件.getIndex().equals(sourceChildrenNode.getTypeCode()) ||
|
|
@@ -1437,8 +1434,6 @@ public class FtaDiagramDataService {
|
|
|
analysisMapper.inserts(insertAnalysis);
|
|
|
}
|
|
|
nodeService.saveBatch(insertNodes);
|
|
|
- // 顶事件上面是没有数据的,如果被复制的是顶事件,需要额外增加一条连线
|
|
|
- String newEdgeId = UUIDUtil.getUuid();
|
|
|
JSONObject result = new JSONObject();
|
|
|
if (!CollectionUtils.isEmpty(copyAnalysisIds)) {
|
|
|
result.put(FtaConstants.REFRESH_ANALYSIS_TREE, true);
|
|
@@ -1743,7 +1738,7 @@ public class FtaDiagramDataService {
|
|
|
FtaOperator operator = operatorMapper.selectOne(new LambdaQueryWrapper<FtaOperator>()
|
|
|
.eq(FtaOperator::getAnalysisId, analysisId)
|
|
|
.isNull(FtaOperator::getFatherId)
|
|
|
- .orderByDesc(FtaOperator::getInsertTime).last(" LIMIT 1"));
|
|
|
+ .orderByDesc(FtaOperator::getInsertTime).last(FtaConstants.SQL_LIMIT_1));
|
|
|
if (operator != null) {
|
|
|
String projectId = analysisMapper.selectOne(new LambdaQueryWrapper<FtaAnalysis>()
|
|
|
.select(FtaAnalysis::getProjectId).eq(FtaAnalysis::getAnalysisId, analysisId)).getProjectId();
|