fix: 脑图用例顺序优化

This commit is contained in:
chenjianxing 2021-10-26 15:05:06 +08:00 committed by jianxing
parent 1f4ed04192
commit 712c0d69c6
6 changed files with 40 additions and 32 deletions

View File

@ -506,6 +506,9 @@ public class ApiTestCaseService {
if (CollectionUtils.isEmpty(request.getSelectIds())) {
return;
}
// 尽量保持与用例顺序一致
Collections.reverse(request.getSelectIds());
ApiTestCaseExample example = new ApiTestCaseExample();
example.createCriteria().andApiDefinitionIdIn(request.getSelectIds());
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);
@ -517,6 +520,9 @@ public class ApiTestCaseService {
if (CollectionUtils.isEmpty(ids)) {
return;
}
// 尽量保持与用例顺序一致
Collections.reverse(ids);
ApiTestCaseExample example = new ApiTestCaseExample();
example.createCriteria().andIdIn(ids);
List<ApiTestCase> apiTestCases = apiTestCaseMapper.selectByExample(example);

View File

@ -348,6 +348,7 @@ public class TestCaseReviewService {
if (testCaseIds.isEmpty()) {
return;
}
// 如果是关联全部指令则根据条件查询未关联的案例
if (testCaseIds.get(0).equals("all")) {
List<TestCase> testCases = extTestCaseMapper.getTestCaseByNotInReview(request.getRequest());
@ -356,6 +357,9 @@ public class TestCaseReviewService {
}
}
// 尽量保持与用例顺序一致
Collections.reverse(testCaseIds);
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
TestCaseReviewTestCaseMapper batchMapper = sqlSession.getMapper(TestCaseReviewTestCaseMapper.class);
Long nextOrder = ServiceUtils.getNextOrder(request.getReviewId(), extTestReviewCaseMapper::getLastOrder);

View File

@ -87,6 +87,9 @@ public class TestPlanLoadCaseService {
TestPlanLoadCaseMapper testPlanLoadCaseMapper = sqlSession.getMapper(TestPlanLoadCaseMapper.class);
Long nextOrder = ServiceUtils.getNextOrder(request.getTestPlanId(), extTestPlanLoadCaseMapper::getLastOrder);
// 尽量保持与用例顺序一致
Collections.reverse(caseIds);
for (String id : caseIds) {
TestPlanLoadCase t = new TestPlanLoadCase();
t.setId(UUID.randomUUID().toString());

View File

@ -525,6 +525,9 @@ public class TestPlanService {
return;
}
// 尽量保持与用例顺序一致
Collections.reverse(testCaseIds);
TestCaseExample testCaseExample = new TestCaseExample();
testCaseExample.createCriteria().andIdIn(testCaseIds);
List<TestCase> testCaseList = testCaseMapper.selectByExample(testCaseExample);

View File

@ -71,30 +71,27 @@ name: "TestPlanMinder",
methods: {
handleAfterMount() {
listenNodeSelected(() => {
let param = {
request: {
planId: this.planId,
orders: this.condition.orders
},
result: this.result,
isDisable: true
}
loadSelectNodes(param, getPlanCasesForMinder, this.setParamCallback);
loadSelectNodes(this.getParam(), getPlanCasesForMinder, this.setParamCallback);
});
listenBeforeExecCommand((even) => {
if (even.commandName === 'expandtolevel') {
let level = Number.parseInt(even.commandArgs);
let param = {
request: {planId: this.planId},
result: this.result,
isDisable: true
}
handleExpandToLevel(level, even.minder.getRoot(), param, getPlanCasesForMinder, this.setParamCallback);
handleExpandToLevel(level, even.minder.getRoot(), this.getParam(), getPlanCasesForMinder, this.setParamCallback);
}
});
tagBatch([...this.tags, this.$t('test_track.plan.plan_status_prepare')]);
},
getParam() {
return {
request: {
planId: this.planId,
orders: this.condition.orders
},
result: this.result,
isDisable: true
}
},
setParamCallback(data, item) {
if (item.status === 'Pass') {
data.resource.push(this.$t('test_track.plan_view.pass'));

View File

@ -74,32 +74,27 @@ name: "TestReviewMinder",
methods: {
handleAfterMount() {
listenNodeSelected(() => {
let param = {
request: {
reviewId: this.reviewId,
orders: this.condition.orders
},
result: this.result,
isDisable: true
}
loadSelectNodes(param, getReviewCasesForMinder, this.setParamCallback);
loadSelectNodes(this.getParam(), getReviewCasesForMinder, this.setParamCallback);
});
listenBeforeExecCommand((even) => {
if (even.commandName === 'expandtolevel') {
let level = Number.parseInt(even.commandArgs);
let param = {
request: {
reviewId: this.reviewId,
},
result: this.result,
isDisable: true
}
handleExpandToLevel(level, even.minder.getRoot(), param, getReviewCasesForMinder, this.setParamCallback);
handleExpandToLevel(level, even.minder.getRoot(), this.getParam(), getReviewCasesForMinder, this.setParamCallback);
}
});
tagBatch([...this.tags, this.$t('test_track.plan.plan_status_prepare')]);
},
getParam() {
return {
request: {
reviewId: this.reviewId,
orders: this.condition.orders
},
result: this.result,
isDisable: true
}
},
setParamCallback(data, item) {
if (item.reviewStatus === 'Pass') {
data.resource.push(this.$t('test_track.plan_view.pass'));