REQ-3540: 添加副本名
This commit is contained in:
parent
b973f69794
commit
0bb59eb5b0
@ -101,7 +101,7 @@ class IndexSupport {
|
||||
List<IndexNode> nameLikeNodes = indexNodeDao.findValidChildrenNameRightLike(parentScope, rename);
|
||||
if (nameLikeNodes.size() == 1 && IndexNode.idEquals(rename, nameLikeNodes.get(0)))
|
||||
return;
|
||||
Pattern pattern = Pattern.compile(Pattern.quote(rename.getName()) + "\\((\\d+)\\)");
|
||||
Pattern pattern = Pattern.compile(Pattern.quote(rename.getName()) + "\\(副本(\\d+)\\)");
|
||||
int maxSeq = 0;
|
||||
for (IndexNode indexNode : nameLikeNodes) {
|
||||
if (indexNode.getId().equals(rename.getId()))
|
||||
@ -113,7 +113,7 @@ class IndexSupport {
|
||||
maxSeq = seq;
|
||||
}
|
||||
}
|
||||
String newName = String.format("%s(%d)", rename.getName(), maxSeq == 0 ? 1 : maxSeq + 1);
|
||||
String newName = String.format("%s(副本%d)", rename.getName(), maxSeq == 0 ? 1 : maxSeq + 1);
|
||||
indexNodeDao.rename(rename.getCode(), newName);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user