解决循环或轮询编排bug
This commit is contained in:
@@ -68,5 +68,13 @@ public interface TestCaseStepMapper
|
||||
*/
|
||||
public List<TestCaseStep> selectTestCaseStepListByCaseId(Long caseId);
|
||||
|
||||
/**
|
||||
* 根据用例id查询所有用例步骤列表并按照步骤顺序排序
|
||||
*
|
||||
* @param caseId 用例id
|
||||
* @return 用例步骤集合
|
||||
*/
|
||||
public List<Long> selectAllTestCaseStepIdListByCaseId(Long caseId);
|
||||
|
||||
int deleteTestCaseStepByCaseId(Long caseId);
|
||||
}
|
||||
|
||||
@@ -76,10 +76,20 @@ public class TestCaseStepServiceImpl implements ITestCaseStepService {
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertBatchTestCaseStep(TestCaseStepAddQO qo) {
|
||||
testCaseStepMapper.deleteTestCaseStepByCaseId(qo.getCaseId());
|
||||
List<Long> allTestCaseStepIdList =
|
||||
testCaseStepMapper.selectAllTestCaseStepIdListByCaseId(qo.getCaseId());
|
||||
int i = 0;
|
||||
for (TestCaseStep testCaseStep1 : qo.getList()) {
|
||||
i += insertTestCaseStep(testCaseStep1);
|
||||
if (testCaseStep1.getId() != null) {
|
||||
allTestCaseStepIdList.remove(testCaseStep1.getId());
|
||||
updateTestCaseStep(testCaseStep1);
|
||||
} else {
|
||||
insertTestCaseStep(testCaseStep1);
|
||||
}
|
||||
i ++;
|
||||
}
|
||||
for (Long testCaseStepId : allTestCaseStepIdList) {
|
||||
deleteTestCaseStepById(testCaseStepId);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -235,4 +235,9 @@
|
||||
where case_id = #{caseId} and del_flag = '0' and parent_id is null
|
||||
ORDER BY step_num
|
||||
</select>
|
||||
|
||||
<select id="selectAllTestCaseStepIdListByCaseId" parameterType="Long" resultType="Long">
|
||||
select id from test_case_step
|
||||
where case_id = #{caseId} and del_flag = '0'
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user