|
@@ -1644,7 +1644,7 @@ public class ExcelTabController extends BladeController {
|
|
|
String[] split = wbsInfo.getNodeName().split("__");
|
|
|
//查出当前节点里面本表的所有复制表
|
|
|
List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.getBaseMapper().selectList(Wrappers.<WbsTreeContract>query().lambda()
|
|
|
- .likeRight(WbsTreeContract::getNodeName,split[0])
|
|
|
+ .likeRight(WbsTreeContract::getNodeName,split[0] + "\\_\\_")
|
|
|
.eq(WbsTreeContract::getContractId, wbsInfo.getContractId())
|
|
|
.eq(WbsTreeContract::getParentId, wbsInfo.getParentId())
|
|
|
.eq(WbsTreeContract::getTableOwner, wbsInfo.getTableOwner()));
|
|
@@ -1674,8 +1674,9 @@ public class ExcelTabController extends BladeController {
|
|
|
wbsTreeContract.setPKeyId(newPkId);
|
|
|
wbsTreeContract.setCreateTime(new Date());
|
|
|
wbsTreeContract.setTabGroupId(tabGroupId);
|
|
|
+ wbsTreeContract.setCopyPkId(wbsInfo.getCopyPkId() == null ? pkeyId + "" : wbsInfo.getCopyPkId());
|
|
|
String nodeName;
|
|
|
- nodeName = wbsTreeContractList2.get(wbsTreeContractList2.size() - 1).getNodeName();
|
|
|
+ nodeName = wbsTreeContractList2.isEmpty() ? wbsInfo.getNodeName() :wbsTreeContractList2.get(wbsTreeContractList2.size() - 1).getNodeName();
|
|
|
if (nodeName.indexOf("__") >= 0) {
|
|
|
String[] oldName = nodeName.split("__");
|
|
|
nodeName = oldName[0] + "__" + (Integer.parseInt(oldName[1]) + 1);
|