feat(测试跟踪): 功能用例&缺陷管理附件功能改造

--story=1006991 --user=宋昌昌 【测试跟踪】功能用例&缺陷增加附件功能支持视频文件(1.20分支同步上) https://www.tapd.cn/55049933/s/1194201
This commit is contained in:
song-cc-rock 2022-07-05 14:12:56 +08:00 committed by jianxing
parent 4ccc8c0b03
commit d6587265cf
1 changed files with 6 additions and 0 deletions

View File

@ -178,6 +178,10 @@ public class TestCaseService {
private TestReviewTestCaseService testReviewTestCaseService;
@Resource
private FileAttachmentMetadataMapper fileAttachmentMetadataMapper;
@Resource
private FileMetadataMapper fileMetadataMapper;
@Resource
private FileContentMapper fileContentMapper;
private ThreadLocal<Integer> importCreateNum = new ThreadLocal<>();
private ThreadLocal<Integer> beforeImportCreateNum = new ThreadLocal<>();
@ -2620,10 +2624,12 @@ public class TestCaseService {
TestCaseFileExample testCaseFileExample = new TestCaseFileExample();
testCaseFileExample.createCriteria().andCaseIdEqualTo(testCaseFile.getCaseId()).andFileIdEqualTo(testCaseFile.getFileId());
testCaseFileMapper.updateByExampleSelective(newTestCaseFile, testCaseFileExample);
fileMetadataMapper.deleteByPrimaryKey(fileMetadata.getId());
}
if (StringUtils.isNotEmpty(filename) && fileContents.size() == 1) {
byte[] bytes = fileContents.get(0).getFile();
FileUtils.byteToFile(bytes, uploadPath, filename);
fileContentMapper.deleteByPrimaryKey(fileContents.get(0).getFileId());
}
});
}