diff --git a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java index f2dbfb5a24..b78d0c1b4e 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiScenarioReportService.java @@ -133,7 +133,16 @@ public class ApiScenarioReportService { public List list(QueryAPIReportRequest request) { request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders())); - return extApiScenarioReportMapper.list(request); + List list = extApiScenarioReportMapper.list(request); + List userIds = list.stream().map(APIScenarioReportResult::getUserId) + .collect(Collectors.toList()); + Map userMap = ServiceUtils.getUserMap(userIds); + list.forEach(item -> { + User user = userMap.get(item.getUserId()); + if (user != null) + item.setUserName(user.getName()); + }); + return list; } public List idList(QueryAPIReportRequest request) { diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml index 4c4bc807c3..f0cda17d4d 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiScenarioReportMapper.xml @@ -99,13 +99,10 @@