fix(性能测试): 修复删除测试时bug
This commit is contained in:
parent
36b4c7a70b
commit
7572ccdcbb
|
@ -117,21 +117,13 @@ public class PerformanceTestService {
|
|||
// delete load_test
|
||||
loadTestMapper.deleteByPrimaryKey(request.getId());
|
||||
|
||||
deleteFileByTestId(request.getId());
|
||||
detachFileByTestId(request.getId());
|
||||
}
|
||||
|
||||
public void deleteFileByTestId(String testId) {
|
||||
public void detachFileByTestId(String testId) {
|
||||
LoadTestFileExample loadTestFileExample = new LoadTestFileExample();
|
||||
loadTestFileExample.createCriteria().andTestIdEqualTo(testId);
|
||||
final List<LoadTestFile> loadTestFiles = loadTestFileMapper.selectByExample(loadTestFileExample);
|
||||
loadTestFileMapper.deleteByExample(loadTestFileExample);
|
||||
|
||||
if (!CollectionUtils.isEmpty(loadTestFiles)) {
|
||||
List<String> fileIds = loadTestFiles.stream().map(LoadTestFile::getFileId).collect(Collectors.toList());
|
||||
LoadTestFileExample example3 = new LoadTestFileExample();
|
||||
example3.createCriteria().andFileIdIn(fileIds);
|
||||
loadTestFileMapper.deleteByExample(example3);
|
||||
}
|
||||
}
|
||||
|
||||
public String save(SaveTestPlanRequest request, List<MultipartFile> files) {
|
||||
|
|
Loading…
Reference in New Issue