|
|
@ -776,8 +776,14 @@ public class DashboardService {
|
|
|
|
Long toEndTime = request.getToEndTime();
|
|
|
|
Long toEndTime = request.getToEndTime();
|
|
|
|
List<SelectOption> headerHandlerOption = getHandlerOption(request.getHandleUsers(), projectId);
|
|
|
|
List<SelectOption> headerHandlerOption = getHandlerOption(request.getHandleUsers(), projectId);
|
|
|
|
//获取每个人每个状态有多少数据(已按照用户id排序)
|
|
|
|
//获取每个人每个状态有多少数据(已按照用户id排序)
|
|
|
|
List<SelectOption> headerStatusOption = bugStatusService.getHeaderStatusOption(projectId);
|
|
|
|
String platformName = projectApplicationService.getPlatformName(projectId);
|
|
|
|
Set<String> platforms = getPlatforms(projectId);
|
|
|
|
List<SelectOption> headerStatusOption = bugStatusService.getAllLocalStatusOptions(projectId);
|
|
|
|
|
|
|
|
if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
|
|
|
|
List<SelectOption> thirdStatusOptions = bugStatusService.getHeaderStatusOption(projectId);
|
|
|
|
|
|
|
|
headerStatusOption.addAll(thirdStatusOptions);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
headerStatusOption = headerStatusOption.stream().distinct().toList();
|
|
|
|
|
|
|
|
Set<String> platforms = getPlatforms(platformName);
|
|
|
|
List<String> handleUserIds = headerHandlerOption.stream().sorted(Comparator.comparing(SelectOption::getValue)).map(SelectOption::getValue).collect(Collectors.toList());
|
|
|
|
List<String> handleUserIds = headerHandlerOption.stream().sorted(Comparator.comparing(SelectOption::getValue)).map(SelectOption::getValue).collect(Collectors.toList());
|
|
|
|
List<ProjectUserStatusCountDTO> projectUserStatusCountDTOS = extBugMapper.projectUserBugStatusCount(projectId, toStartTime, toEndTime, handleUserIds, platforms);
|
|
|
|
List<ProjectUserStatusCountDTO> projectUserStatusCountDTOS = extBugMapper.projectUserBugStatusCount(projectId, toStartTime, toEndTime, handleUserIds, platforms);
|
|
|
|
Map<String, SelectOption> statusMap = headerStatusOption.stream().collect(Collectors.toMap(SelectOption::getValue, t -> t));
|
|
|
|
Map<String, SelectOption> statusMap = headerStatusOption.stream().collect(Collectors.toMap(SelectOption::getValue, t -> t));
|
|
|
@ -882,24 +888,32 @@ public class DashboardService {
|
|
|
|
* @return 处理人id 与 名称的集合
|
|
|
|
* @return 处理人id 与 名称的集合
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<SelectOption> getHandlerOption(List<String> handleUsers, String projectId) {
|
|
|
|
private List<SelectOption> getHandlerOption(List<String> handleUsers, String projectId) {
|
|
|
|
List<SelectOption> headerHandlerOption;
|
|
|
|
String platformName = projectApplicationService.getPlatformName(projectId);
|
|
|
|
|
|
|
|
List<SelectOption> headerHandlerOption = bugCommonService.getLocalHandlerOption(projectId);
|
|
|
|
|
|
|
|
List<SelectOption> thirdHandlerOption;
|
|
|
|
if (CollectionUtils.isEmpty(handleUsers)) {
|
|
|
|
if (CollectionUtils.isEmpty(handleUsers)) {
|
|
|
|
headerHandlerOption = bugCommonService.getHeaderHandlerOption(projectId);
|
|
|
|
if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
} else {
|
|
|
|
thirdHandlerOption = bugCommonService.getHeaderHandlerOption(projectId);
|
|
|
|
List<SelectOption> headerHandlerOptionList = bugCommonService.getHeaderHandlerOption(projectId);
|
|
|
|
if (CollectionUtils.isNotEmpty(thirdHandlerOption)) {
|
|
|
|
headerHandlerOption = headerHandlerOptionList.stream().filter(t -> handleUsers.contains(t.getValue())).toList();
|
|
|
|
headerHandlerOption.addAll(thirdHandlerOption);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return headerHandlerOption;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
|
|
|
|
List<SelectOption> headerHandlerOptionList = bugCommonService.getHeaderHandlerOption(projectId);
|
|
|
|
|
|
|
|
headerHandlerOption.addAll(headerHandlerOptionList);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
headerHandlerOption = headerHandlerOption.stream().filter(t -> handleUsers.contains(t.getValue())).toList();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return headerHandlerOption.stream().distinct().toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 根据项目id获取当前对接平台,与本地进行组装
|
|
|
|
* 根据项目id获取当前对接平台,与本地进行组装
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param projectId 项目ID
|
|
|
|
|
|
|
|
* @return 本地与对接平台集合
|
|
|
|
* @return 本地与对接平台集合
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private Set<String> getPlatforms(String projectId) {
|
|
|
|
private Set<String> getPlatforms(String platformName) {
|
|
|
|
String platformName = projectApplicationService.getPlatformName(projectId);
|
|
|
|
|
|
|
|
Set<String> platforms = new HashSet<>();
|
|
|
|
Set<String> platforms = new HashSet<>();
|
|
|
|
platforms.add(BugPlatform.LOCAL.getName());
|
|
|
|
platforms.add(BugPlatform.LOCAL.getName());
|
|
|
|
if (!StringUtils.equalsIgnoreCase(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
if (!StringUtils.equalsIgnoreCase(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
@ -1152,7 +1166,7 @@ public class DashboardService {
|
|
|
|
if (CollectionUtils.isNotEmpty(simpleAllApiCaseList)) {
|
|
|
|
if (CollectionUtils.isNotEmpty(simpleAllApiCaseList)) {
|
|
|
|
simpleAllApiCaseSize = simpleAllApiCaseList.size();
|
|
|
|
simpleAllApiCaseSize = simpleAllApiCaseList.size();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<ApiTestCase> unExecList = simpleAllApiCaseList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ExecStatus.PENDING.toString())).toList();
|
|
|
|
List<ApiTestCase> unExecList = simpleAllApiCaseList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), StringUtils.EMPTY)).toList();
|
|
|
|
int unExecSize = CollectionUtils.isNotEmpty(unExecList) ? unExecList.size() : 0;
|
|
|
|
int unExecSize = CollectionUtils.isNotEmpty(unExecList) ? unExecList.size() : 0;
|
|
|
|
|
|
|
|
|
|
|
|
List<ApiTestCase> successList = simpleAllApiCaseList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ResultStatus.SUCCESS.name())).toList();
|
|
|
|
List<ApiTestCase> successList = simpleAllApiCaseList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ResultStatus.SUCCESS.name())).toList();
|
|
|
@ -1282,19 +1296,30 @@ public class DashboardService {
|
|
|
|
statisticsDTO.setErrorCode(NO_PROJECT_PERMISSION.getCode());
|
|
|
|
statisticsDTO.setErrorCode(NO_PROJECT_PERMISSION.getCode());
|
|
|
|
return statisticsDTO;
|
|
|
|
return statisticsDTO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Set<String>handleUsers = new HashSet<>();
|
|
|
|
String localHandleUser = hasHandleUser ? userId : null;
|
|
|
|
String localHandleUser = hasHandleUser ? userId : null;
|
|
|
|
|
|
|
|
handleUsers.add(localHandleUser);
|
|
|
|
String handleUser = hasHandleUser ? handleUserId : null;
|
|
|
|
String handleUser = hasHandleUser ? handleUserId : null;
|
|
|
|
|
|
|
|
handleUsers.add(handleUser);
|
|
|
|
String createUser = hasCreateUser ? userId : null;
|
|
|
|
String createUser = hasCreateUser ? userId : null;
|
|
|
|
Set<String> platforms = getPlatforms(projectId);
|
|
|
|
String platformName = projectApplicationService.getPlatformName(projectId);
|
|
|
|
List<Bug> allSimpleList = extBugMapper.getSimpleList(projectId, null, null, handleUser, createUser, platforms, localHandleUser);
|
|
|
|
Set<String> platforms = getPlatforms(platformName);
|
|
|
|
List<String> localLastStepStatus = getBugEndStatus(projectId);
|
|
|
|
List<Bug> allSimpleList = extBugMapper.getSimpleList(projectId, null, null, handleUsers, createUser, platforms);
|
|
|
|
|
|
|
|
List<String> localLastStepStatus = getBugEndStatus(projectId, platformName);
|
|
|
|
List<Bug> statusList = allSimpleList.stream().filter(t -> !localLastStepStatus.contains(t.getStatus())).toList();
|
|
|
|
List<Bug> statusList = allSimpleList.stream().filter(t -> !localLastStepStatus.contains(t.getStatus())).toList();
|
|
|
|
int statusSize = CollectionUtils.isEmpty(statusList) ? 0 : statusList.size();
|
|
|
|
int statusSize = CollectionUtils.isEmpty(statusList) ? 0 : statusList.size();
|
|
|
|
int totalSize = CollectionUtils.isEmpty(allSimpleList) ? 0 : allSimpleList.size();
|
|
|
|
int totalSize = CollectionUtils.isEmpty(allSimpleList) ? 0 : allSimpleList.size();
|
|
|
|
List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize);
|
|
|
|
List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize);
|
|
|
|
Map<String, List<NameCountDTO>> statusStatisticsMap = new HashMap<>();
|
|
|
|
Map<String, List<NameCountDTO>> statusStatisticsMap = new HashMap<>();
|
|
|
|
statusStatisticsMap.put("retentionRate", nameCountDTOS);
|
|
|
|
statusStatisticsMap.put("retentionRate", nameCountDTOS);
|
|
|
|
List<SelectOption> headerStatusOption = bugStatusService.getHeaderStatusOption(projectId);
|
|
|
|
List<SelectOption> headerStatusOption = bugStatusService.getAllLocalStatusOptions(projectId);
|
|
|
|
|
|
|
|
if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
|
|
|
|
List<SelectOption> thirdStatusOptions = bugStatusService.getHeaderStatusOption(projectId);
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(thirdStatusOptions)) {
|
|
|
|
|
|
|
|
headerStatusOption.addAll(thirdStatusOptions);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
headerStatusOption = headerStatusOption.stream().distinct().toList();
|
|
|
|
Map<String, List<Bug>> bugMap = allSimpleList.stream().collect(Collectors.groupingBy(Bug::getStatus));
|
|
|
|
Map<String, List<Bug>> bugMap = allSimpleList.stream().collect(Collectors.groupingBy(Bug::getStatus));
|
|
|
|
List<StatusPercentDTO> bugPercentList = bulidBugPercentList(headerStatusOption, bugMap, totalSize);
|
|
|
|
List<StatusPercentDTO> bugPercentList = bulidBugPercentList(headerStatusOption, bugMap, totalSize);
|
|
|
|
statisticsDTO.setStatusStatisticsMap(statusStatisticsMap);
|
|
|
|
statisticsDTO.setStatusStatisticsMap(statusStatisticsMap);
|
|
|
@ -1303,9 +1328,8 @@ public class DashboardService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@NotNull
|
|
|
|
@NotNull
|
|
|
|
private List<String> getBugEndStatus(String projectId) {
|
|
|
|
private List<String> getBugEndStatus(String projectId, String platformName) {
|
|
|
|
List<String> localLastStepStatus = bugCommonService.getLocalLastStepStatus(projectId);
|
|
|
|
List<String> localLastStepStatus = bugCommonService.getLocalLastStepStatus(projectId);
|
|
|
|
String platformName = projectApplicationService.getPlatformName(projectId);
|
|
|
|
|
|
|
|
if (StringUtils.equalsIgnoreCase(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
if (StringUtils.equalsIgnoreCase(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
return localLastStepStatus;
|
|
|
|
return localLastStepStatus;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1379,11 +1403,19 @@ public class DashboardService {
|
|
|
|
statisticsDTO.setErrorCode(NO_PROJECT_PERMISSION.getCode());
|
|
|
|
statisticsDTO.setErrorCode(NO_PROJECT_PERMISSION.getCode());
|
|
|
|
return statisticsDTO;
|
|
|
|
return statisticsDTO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Set<String> platforms = getPlatforms(projectId);
|
|
|
|
String platformName = projectApplicationService.getPlatformName(projectId);
|
|
|
|
|
|
|
|
Set<String> platforms = getPlatforms(platformName);
|
|
|
|
List<SelectOption> planBugList = extTestPlanMapper.getPlanBugList(projectId, TestPlanConstants.TEST_PLAN_TYPE_PLAN, new ArrayList<>(platforms), null);
|
|
|
|
List<SelectOption> planBugList = extTestPlanMapper.getPlanBugList(projectId, TestPlanConstants.TEST_PLAN_TYPE_PLAN, new ArrayList<>(platforms), null);
|
|
|
|
List<String> localLastStepStatus = getBugEndStatus(projectId);
|
|
|
|
List<String> localLastStepStatus = getBugEndStatus(projectId, platformName);
|
|
|
|
List<SelectOption> legacyBugList = planBugList.stream().filter(t -> !localLastStepStatus.contains(t.getText())).toList();
|
|
|
|
List<SelectOption> legacyBugList = planBugList.stream().filter(t -> !localLastStepStatus.contains(t.getText())).toList();
|
|
|
|
List<SelectOption> headerStatusOption = bugStatusService.getHeaderStatusOption(projectId);
|
|
|
|
List<SelectOption> headerStatusOption = bugStatusService.getAllLocalStatusOptions(projectId);
|
|
|
|
|
|
|
|
if (!StringUtils.equals(platformName, BugPlatform.LOCAL.getName())) {
|
|
|
|
|
|
|
|
List<SelectOption> thirdStatusOptions = bugStatusService.getHeaderStatusOption(projectId);
|
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(thirdStatusOptions)) {
|
|
|
|
|
|
|
|
headerStatusOption.addAll(thirdStatusOptions);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
headerStatusOption = headerStatusOption.stream().distinct().toList();
|
|
|
|
int statusSize = CollectionUtils.isEmpty(legacyBugList) ? 0 : legacyBugList.size();
|
|
|
|
int statusSize = CollectionUtils.isEmpty(legacyBugList) ? 0 : legacyBugList.size();
|
|
|
|
int totalSize = CollectionUtils.isEmpty(planBugList) ? 0 : planBugList.size();
|
|
|
|
int totalSize = CollectionUtils.isEmpty(planBugList) ? 0 : planBugList.size();
|
|
|
|
List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize);
|
|
|
|
List<NameCountDTO> nameCountDTOS = buildBugRetentionRateList(totalSize, statusSize);
|
|
|
|