fix(工作台): 修复我处理的缺陷卡片问题

This commit is contained in:
guoyuqi 2024-11-26 11:39:11 +08:00 committed by 刘瑞斌
parent c9e588ae5e
commit c7bfb50fb0
3 changed files with 36 additions and 1 deletions

View File

@ -137,4 +137,6 @@ public interface ExtBugMapper {
List<ProjectUserStatusCountDTO> projectUserBugStatusCount(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("userIds") List<String> userIds, @Param("platforms") Set<String> platforms); List<ProjectUserStatusCountDTO> projectUserBugStatusCount(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime, @Param("userIds") List<String> userIds, @Param("platforms") Set<String> platforms);
List<Bug>getSimpleList(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("handleUsers") Set<String> handleUsers,@Param("createUser") String createUser, @Param("platforms") Set<String> platforms); List<Bug>getSimpleList(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("handleUsers") Set<String> handleUsers,@Param("createUser") String createUser, @Param("platforms") Set<String> platforms);
List<Bug>getByHandleUser(@Param("projectId") String projectId, @Param("startTime") Long startTime, @Param("endTime") Long endTime,@Param("localHandleUser") String localHandleUser,@Param("createUser") String createUser,@Param("thirdHandleUser") String thirdHandleUser, @Param("thirdPlatform") String thirdPlatform);
} }

View File

@ -474,5 +474,33 @@
</if> </if>
</select> </select>
<select id="getByHandleUser" resultType="io.metersphere.bug.domain.Bug">
SELECT bug.id, bug.status, bug.platform, bug.platform_bug_id
FROM bug
WHERE bug.deleted = false
AND bug.project_id = #{projectId}
<if test="startTime != null and endTime != null">
AND bug.create_time BETWEEN #{startTime} AND #{endTime}
</if>
<if test="createUser != null and createUser != ''">
AND bug.create_user = #{createUser}
</if>
and (
( bug.platform = 'Local'
<if test="localHandleUser != null and localHandleUser != ''">
AND bug.handle_user = #{localHandleUser}
</if>
)
<if test="thirdPlatform != null and thirdPlatform != ''">
or (
( bug.platform = #{thirdPlatform}
<if test="thirdHandleUser != null and thirdHandleUser != ''">
AND bug.handle_user = #{thirdHandleUser}
</if>)
)
</if>
)
</select>
</mapper> </mapper>

View File

@ -1315,7 +1315,12 @@ public class DashboardService {
String createUser = hasCreateUser ? userId : null; String createUser = hasCreateUser ? userId : null;
String platformName = projectApplicationService.getPlatformName(projectId); String platformName = projectApplicationService.getPlatformName(projectId);
Set<String> platforms = getPlatforms(platformName); Set<String> platforms = getPlatforms(platformName);
List<Bug> allSimpleList = extBugMapper.getSimpleList(projectId, null, null, handleUsers, createUser, platforms); List<Bug> allSimpleList;
if (hasHandleUser) {
allSimpleList = extBugMapper.getByHandleUser(projectId, null, null, localHandleUser, createUser, handleUser, platformName);
} else {
allSimpleList= extBugMapper.getSimpleList(projectId, null, null, handleUsers, createUser, platforms);
}
List<String> localLastStepStatus = getBugEndStatus(projectId, platformName); 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();