fix(测试跟踪): 关联附件关联人信息有误

--bug=1022825 --user=宋昌昌 【测试跟踪】功能用例关联附件,附件信息显示错误,并且有错位 https://www.tapd.cn/55049933/s/1338666
This commit is contained in:
song-cc-rock 2023-02-20 17:28:26 +08:00 committed by jianxing
parent 05a05d4bd2
commit d9fc47589c
3 changed files with 5 additions and 5 deletions

View File

@ -246,11 +246,11 @@ public class AttachmentService {
file.setIsRelatedDeleted(Boolean.FALSE); file.setIsRelatedDeleted(Boolean.FALSE);
file.setName(fileMetadata.getName()); file.setName(fileMetadata.getName());
file.setSize(fileMetadata.getSize()); file.setSize(fileMetadata.getSize());
List<User> users = userMap.get(fileMetadata.getCreateUser()); List<User> users = userMap.get(file.getCreator());
if (CollectionUtils.isNotEmpty(users)) { if (CollectionUtils.isNotEmpty(users)) {
file.setCreator(users.get(0).getName()); file.setCreator(users.get(0).getName());
} else { } else {
file.setCreator(fileMetadata.getCreateUser()); file.setCreator(file.getCreator());
} }
file.setCreateTime(fileMetadata.getCreateTime()); file.setCreateTime(fileMetadata.getCreateTime());
} else { } else {
@ -294,7 +294,7 @@ public class AttachmentService {
FileAttachmentMetadata fileAttachmentMetadata = new FileAttachmentMetadata(); FileAttachmentMetadata fileAttachmentMetadata = new FileAttachmentMetadata();
BeanUtils.copyBean(fileAttachmentMetadata, fileMetadata); BeanUtils.copyBean(fileAttachmentMetadata, fileMetadata);
fileAttachmentMetadata.setId(record.getAttachmentId()); fileAttachmentMetadata.setId(record.getAttachmentId());
fileAttachmentMetadata.setCreator(fileMetadata.getCreateUser() == null ? StringUtils.EMPTY : fileMetadata.getCreateUser()); fileAttachmentMetadata.setCreator(SessionUtils.getUserId());
fileAttachmentMetadata.setFilePath(fileMetadata.getPath() == null ? StringUtils.EMPTY : fileMetadata.getPath()); fileAttachmentMetadata.setFilePath(fileMetadata.getPath() == null ? StringUtils.EMPTY : fileMetadata.getPath());
fileAttachmentMetadataBatchMapper.insert(fileAttachmentMetadata); fileAttachmentMetadataBatchMapper.insert(fileAttachmentMetadata);
// 缺陷类型的附件, 关联时需单独同步第三方平台 // 缺陷类型的附件, 关联时需单独同步第三方平台

View File

@ -2213,7 +2213,7 @@ public class TestCaseService {
FileAttachmentMetadata fileAttachmentMetadata = new FileAttachmentMetadata(); FileAttachmentMetadata fileAttachmentMetadata = new FileAttachmentMetadata();
BeanUtils.copyBean(fileAttachmentMetadata, fileMetadata); BeanUtils.copyBean(fileAttachmentMetadata, fileMetadata);
fileAttachmentMetadata.setId(record.getAttachmentId()); fileAttachmentMetadata.setId(record.getAttachmentId());
fileAttachmentMetadata.setCreator(fileMetadata.getCreateUser() == null ? StringUtils.EMPTY : fileMetadata.getCreateUser()); fileAttachmentMetadata.setCreator(SessionUtils.getUserId());
fileAttachmentMetadata.setFilePath(fileMetadata.getPath() == null ? StringUtils.EMPTY : fileMetadata.getPath()); fileAttachmentMetadata.setFilePath(fileMetadata.getPath() == null ? StringUtils.EMPTY : fileMetadata.getPath());
fileAttachmentMetadataBatchMapper.insert(fileAttachmentMetadata); fileAttachmentMetadataBatchMapper.insert(fileAttachmentMetadata);
}); });

View File

@ -449,7 +449,7 @@ export default {
updateTime: row.createTime, updateTime: row.createTime,
progress: 100, progress: 100,
status: "toRelate", status: "toRelate",
creator: row.createUser, creator: getCurrentUser().id,
type: row.type, type: row.type,
isLocal: false, isLocal: false,
}); });