refactor(功能用例): 后端处理评审关联用例列表过滤已关联ids

This commit is contained in:
WangXu10 2024-01-26 11:05:37 +08:00 committed by Craftsman
parent 8e0ff36aef
commit 486575eb6a
3 changed files with 12 additions and 14 deletions

View File

@ -127,11 +127,10 @@
)
</when>
</choose>
<if test="request.excludeIds != null and request.excludeIds.size() > 0">
AND functional_case.id not in
<foreach collection="request.excludeIds" item="excludeId" separator="," open="(" close=")">
#{excludeId}
</foreach>
<if test="request.reviewId != null and request.reviewId != ''">
AND functional_case.id not in (
select case_id from case_review_functional_case where review_id = #{request.reviewId}
)
</if>
</select>
@ -594,11 +593,10 @@
)
</when>
</choose>
<if test="request.excludeIds != null and request.excludeIds.size() > 0">
AND id not in
<foreach collection="request.excludeIds" item="excludeId" separator="," open="(" close=")">
#{excludeId}
</foreach>
<if test="request.reviewId != null and request.reviewId != ''">
AND functional_case.id not in (
select case_id from case_review_functional_case where review_id = #{request.reviewId}
)
</if>
GROUP BY module_id
</select>

View File

@ -41,8 +41,8 @@ public class FunctionalCasePageRequest extends BasePageRequest implements Serial
@Schema(description = "关联缺陷")
private AssociationDTO associationBug;
@Schema(description = "排除ids")
private List<String> excludeIds;
@Schema(description = "评审id")
private String reviewId;

View File

@ -77,7 +77,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest {
request.setProjectId("100001100001");
request.setCurrent(1);
request.setPageSize(10);
request.setExcludeIds(Arrays.asList("TEST_FUNCTIONAL_CASE_ID_1"));
request.setReviewId("wx_review_id_1");
Map<String, Object> map = new HashMap<>();
map.put("customs", Arrays.asList(new LinkedHashMap() {{
put("id", "TEST_FIELD_ID");
@ -86,7 +86,7 @@ public class CaseReviewFunctionalCaseControllerTests extends BaseTest {
put("type", "List");
}}));
request.setCombine(map);
this.requestPost(FUNCTIONAL_CASE_LIST_URL, request);
this.requestPostWithOkAndReturn(FUNCTIONAL_CASE_LIST_URL, request);
}