mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-05 05:29:29 +08:00
fix(测试跟踪): 公共用例复制报错
--bug=1027593 --user=王旭 【测试跟踪】新建功能用例-添加到公共用例库-切换项目-复制该用例-报错该模块下已存在该测试用例 https://www.tapd.cn/55049933/s/1392526
This commit is contained in:
parent
73211d44a5
commit
4ce718eb9e
@ -2179,11 +2179,13 @@ public class TestCaseService {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TestCaseWithBLOBs batchCopy = new TestCaseWithBLOBs();
|
||||
BeanUtils.copyBean(batchCopy, list.get(i));
|
||||
batchCopy.setNodeId(request.getNodeId());
|
||||
batchCopy.setName("copy_" + batchCopy.getName());
|
||||
batchCopy.setProjectId(SessionUtils.getCurrentProjectId());
|
||||
checkTestCaseExist(batchCopy, false);
|
||||
String oldTestCaseId = batchCopy.getId();
|
||||
String id = UUID.randomUUID().toString();
|
||||
batchCopy.setId(id);
|
||||
batchCopy.setName("copy_" + batchCopy.getName());
|
||||
if (batchCopy.getName().length() > 255) {
|
||||
batchCopy.setName(batchCopy.getName().substring(0, 250) + batchCopy.getName().substring(batchCopy.getName().length() - 5));
|
||||
}
|
||||
@ -2194,14 +2196,12 @@ public class TestCaseService {
|
||||
batchCopy.setReviewStatus(TestCaseReviewStatus.Prepare.name());
|
||||
batchCopy.setStatus(TestCaseReviewStatus.Prepare.name());
|
||||
batchCopy.setNodePath(StringUtils.EMPTY);
|
||||
batchCopy.setNodeId(request.getNodeId());
|
||||
batchCopy.setCasePublic(false);
|
||||
batchCopy.setRefId(id);
|
||||
if (!(batchCopy.getProjectId()).equals(SessionUtils.getCurrentProjectId())) {
|
||||
String versionId = baseProjectVersionMapper.getDefaultVersion(SessionUtils.getCurrentProjectId());
|
||||
batchCopy.setVersionId(versionId);
|
||||
}
|
||||
batchCopy.setProjectId(SessionUtils.getCurrentProjectId());
|
||||
batchCopy.setOrder(nextOrder += ServiceUtils.ORDER_STEP);
|
||||
batchCopy.setCustomNum(String.valueOf(nextNum));
|
||||
batchCopy.setNum(nextNum++);
|
||||
|
Loading…
Reference in New Issue
Block a user