fix(工作台): 人员显示去重以及项目默认值全部增加属性

This commit is contained in:
guoyuqi 2024-11-20 18:29:16 +08:00 committed by Craftsman
parent 8c7940b2a6
commit 9735eb9f1c
2 changed files with 8 additions and 5 deletions

View File

@ -918,8 +918,7 @@
count(distinct fct.case_id) count(distinct fct.case_id)
from functional_case_test fct from functional_case_test fct
LEFT JOIN functional_case fc ON fc.id = fct.case_id LEFT JOIN functional_case fc ON fc.id = fct.case_id
where fct.project_id = #{projectId} where fc.project_id = #{projectId}
and fc.project_id = #{projectId}
and fc.deleted = false and fc.deleted = false
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
AND fc.create_time BETWEEN #{startTime} AND #{endTime} AND fc.create_time BETWEEN #{startTime} AND #{endTime}

View File

@ -411,12 +411,13 @@ public class DashboardService {
if (CollectionUtils.isNotEmpty(list)) { if (CollectionUtils.isNotEmpty(list)) {
layoutDTO.setProjectIds(list.stream().map(Project::getId).toList()); layoutDTO.setProjectIds(list.stream().map(Project::getId).toList());
} else { } else {
layoutDTO.setProjectIds(allPermissionProjects.stream().map(Project::getId).toList()); layoutDTO.setProjectIds(new ArrayList<>());
layoutDTO.setSelectAll(true);
} }
} }
} else if (StringUtils.equalsIgnoreCase(layoutDTO.getKey(), DashboardUserLayoutKeys.PROJECT_MEMBER_VIEW.toString())) { } else if (StringUtils.equalsIgnoreCase(layoutDTO.getKey(), DashboardUserLayoutKeys.PROJECT_MEMBER_VIEW.toString())) {
List<ProjectUserMemberDTO> list = orgProjectMemberList.stream().filter(t -> layoutDTO.getHandleUsers().contains(t.getId())).toList(); List<ProjectUserMemberDTO> list = orgProjectMemberList.stream().filter(t -> layoutDTO.getHandleUsers().contains(t.getId())).toList();
layoutDTO.setHandleUsers(list.stream().map(ProjectUserMemberDTO::getId).toList()); layoutDTO.setHandleUsers(list.stream().map(ProjectUserMemberDTO::getId).distinct().toList());
List<Project> projectList = allPermissionProjects.stream().filter(t -> layoutDTO.getProjectIds().contains(t.getId())).toList(); List<Project> projectList = allPermissionProjects.stream().filter(t -> layoutDTO.getProjectIds().contains(t.getId())).toList();
if (CollectionUtils.isEmpty(projectList)) { if (CollectionUtils.isEmpty(projectList)) {
layoutDTO.setProjectIds(List.of(allPermissionProjects.getFirst().getId())); layoutDTO.setProjectIds(List.of(allPermissionProjects.getFirst().getId()));
@ -1248,7 +1249,10 @@ public class DashboardService {
if (CollectionUtils.isNotEmpty(simpleAllApiScenarioList)) { if (CollectionUtils.isNotEmpty(simpleAllApiScenarioList)) {
simpleAllApiScenarioSize = simpleAllApiScenarioList.size(); simpleAllApiScenarioSize = simpleAllApiScenarioList.size();
} }
List<ApiScenario> unExecList = simpleAllApiScenarioList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ExecStatus.PENDING.toString())).toList(); List<String> lastReportStatuList = new ArrayList<>();
lastReportStatuList.add(StringUtils.EMPTY);
lastReportStatuList.add(ExecStatus.PENDING.toString());
List<ApiScenario> unExecList = simpleAllApiScenarioList.stream().filter(t -> lastReportStatuList.contains(t.getLastReportStatus())).toList();
int unExecSize = CollectionUtils.isNotEmpty(unExecList) ? unExecList.size() : 0; int unExecSize = CollectionUtils.isNotEmpty(unExecList) ? unExecList.size() : 0;
List<ApiScenario> successList = simpleAllApiScenarioList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ResultStatus.SUCCESS.name())).toList(); List<ApiScenario> successList = simpleAllApiScenarioList.stream().filter(t -> StringUtils.equalsIgnoreCase(t.getLastReportStatus(), ResultStatus.SUCCESS.name())).toList();