fix(测试跟踪): 修复执行测试计划后可能会出现接口报告创建人显示不正确的问题

--bug=1016726 --user=宋天阳 [测试跟踪]github #17849执行测试计划后报告创建人显示不正确
https://www.tapd.cn/55049933/s/1244293
This commit is contained in:
song-tianyang 2022-09-17 15:26:40 +08:00 committed by 建国
parent c0870f06e5
commit 71305cef47
1 changed files with 2 additions and 2 deletions

View File

@ -98,13 +98,13 @@ public class TestPlanApiCaseService {
public void buildUserInfo(List<? extends TestPlanApiCaseDTO> apiTestCases) {
List<String> userIds = new ArrayList();
userIds.addAll(apiTestCases.stream().map(TestPlanApiCaseDTO::getCreateUser).collect(Collectors.toList()));
userIds.addAll(apiTestCases.stream().map(TestPlanApiCaseDTO::getCreateUserId).collect(Collectors.toList()));
userIds.addAll(apiTestCases.stream().map(TestPlanApiCaseDTO::getUpdateUser).collect(Collectors.toList()));
userIds.addAll(apiTestCases.stream().map(TestPlanApiCaseDTO::getUserId).collect(Collectors.toList()));
if (!org.apache.commons.collections.CollectionUtils.isEmpty(userIds)) {
Map<String, String> userMap = ServiceUtils.getUserNameMap(userIds);
apiTestCases.forEach(caseResult -> {
caseResult.setCreatorName(userMap.get(caseResult.getCreateUser()));
caseResult.setCreatorName(userMap.get(caseResult.getCreateUserId()));
caseResult.setUpdateName(userMap.get(caseResult.getUpdateUser()));
caseResult.setPrincipalName(userMap.get(caseResult.getUserId()));
});