|
@@ -313,6 +313,12 @@ public class PredictionStruTreeServiceImpl extends ServiceImpl<PredictionStruTre
|
|
|
parentTreeNode.setUpdateTime(new Date());
|
|
|
predictionStruTreeMapper.updateById(parentTreeNode);
|
|
|
}
|
|
|
+ List<PredictionTable> predictionTables = predictionTableMapper.selectList(new LambdaQueryWrapper<PredictionTable>()
|
|
|
+ .eq(PredictionTable::getPredictionId, predictionId)
|
|
|
+ .eq(PredictionTable::getStruId, struId));
|
|
|
+ if (!CollectionUtils.isEmpty(predictionTables)) {
|
|
|
+ predictionTableMapper.deleteBatchIds(predictionTables.stream().map(PredictionTable::getId).toList());
|
|
|
+ }
|
|
|
}
|
|
|
return predictionInfo;
|
|
|
}
|
|
@@ -354,13 +360,13 @@ public class PredictionStruTreeServiceImpl extends ServiceImpl<PredictionStruTre
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 查询指定结构下第一个结构的左序号
|
|
|
+ // 查询指定结构下最大结构的左序号
|
|
|
PredictionStruTree firstStruTree = predictionStruTreeMapper.selectOne(new LambdaQueryWrapper<PredictionStruTree>()
|
|
|
.eq(PredictionStruTree::getPredictionId, pasteStructureReq.getPredictionId())
|
|
|
.ne(PredictionStruTree::getIsDelete, RpConstant.IS_DELETE)
|
|
|
.eq(PredictionStruTree::getParentStruId, selectStruTree.getStruId())
|
|
|
- .orderByAsc(PredictionStruTree::getLeftNo)
|
|
|
- .last("limit 0, 1"));
|
|
|
+ .orderByDesc(PredictionStruTree::getLeftNo)
|
|
|
+ .last("limit 1"));
|
|
|
|
|
|
PredictionStruTree parentStruTree = predictionStruTreeMapper.selectOne(new LambdaQueryWrapper<PredictionStruTree>()
|
|
|
.eq(PredictionStruTree::getPredictionId, pasteStructureReq.getPredictionId())
|
|
@@ -370,7 +376,7 @@ public class PredictionStruTreeServiceImpl extends ServiceImpl<PredictionStruTre
|
|
|
if (pasteStructureReq.getOptType() == 1) {
|
|
|
int no = 0;
|
|
|
if (ObjectUtils.isNotEmpty(firstStruTree)) {
|
|
|
- no = firstStruTree.getRightNo();
|
|
|
+ no = firstStruTree.getRightNo() + 1;
|
|
|
} else {
|
|
|
no = selectStruTree.getRightNo();
|
|
|
}
|
|
@@ -635,7 +641,8 @@ public class PredictionStruTreeServiceImpl extends ServiceImpl<PredictionStruTre
|
|
|
.eq(PredictionStruTree::getPredictionId, copyPredictionId)
|
|
|
.eq(PredictionStruTree::getIsDelete, RpConstant.NOT_DELETE)
|
|
|
.ge(PredictionStruTree::getLeftNo, copyLeftNo)
|
|
|
- .le(PredictionStruTree::getLeftNo, copyRightNo));
|
|
|
+ .le(PredictionStruTree::getLeftNo, copyRightNo)
|
|
|
+ .orderByAsc(PredictionStruTree::getLeftNo));
|
|
|
|
|
|
// 父级节点
|
|
|
Map<String, String> parentMapFlag = new HashMap<String, String>();
|