refactor(用例管理): 用例评审相关调整
This commit is contained in:
parent
1b3712492c
commit
c3a605e99f
|
@ -71,7 +71,7 @@
|
||||||
#{moduleId}
|
#{moduleId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="request.keyword != null">
|
<if test="request.keyword != null and request.keyword != ''">
|
||||||
and (
|
and (
|
||||||
functional_case.name like concat('%', #{request.keyword},'%')
|
functional_case.name like concat('%', #{request.keyword},'%')
|
||||||
or functional_case.num like concat('%', #{request.keyword},'%')
|
or functional_case.num like concat('%', #{request.keyword},'%')
|
||||||
|
@ -306,16 +306,7 @@
|
||||||
<if test="userId != null and userId != ''">
|
<if test="userId != null and userId != ''">
|
||||||
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
|
||||||
<when test='request.condition.searchMode == "AND"'>
|
|
||||||
AND <include refid="queryWhereConditionByBaseQueryRequest"/>
|
|
||||||
</when>
|
|
||||||
<when test='request.condition.searchMode == "OR"'>
|
|
||||||
and (
|
|
||||||
<include refid="queryWhereConditionByBaseQueryRequest"/>
|
<include refid="queryWhereConditionByBaseQueryRequest"/>
|
||||||
)
|
|
||||||
</when>
|
|
||||||
</choose>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getListByRequest" resultType="io.metersphere.functional.domain.CaseReviewFunctionalCase">
|
<select id="getListByRequest" resultType="io.metersphere.functional.domain.CaseReviewFunctionalCase">
|
||||||
|
@ -330,16 +321,7 @@
|
||||||
<if test="userId != null and userId != ''">
|
<if test="userId != null and userId != ''">
|
||||||
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
AND crfc.case_id in (select case_id from case_review_functional_case_user crfcu where crfcu.review_id = #{request.reviewId} and crfcu.user_id = #{userId})
|
||||||
</if>
|
</if>
|
||||||
<choose>
|
|
||||||
<when test='request.condition.searchMode == "AND"'>
|
|
||||||
AND <include refid="queryWhereConditionByBaseQueryRequest"/>
|
|
||||||
</when>
|
|
||||||
<when test='request.condition.searchMode == "OR"'>
|
|
||||||
and (
|
|
||||||
<include refid="queryWhereConditionByBaseQueryRequest"/>
|
<include refid="queryWhereConditionByBaseQueryRequest"/>
|
||||||
)
|
|
||||||
</when>
|
|
||||||
</choose>
|
|
||||||
<if test="request.excludeIds != null and request.excludeIds.size() > 0" >
|
<if test="request.excludeIds != null and request.excludeIds.size() > 0" >
|
||||||
and crfc.id not in
|
and crfc.id not in
|
||||||
<foreach collection="request.excludeIds" item="excludeId" open="(" separator="," close=")">
|
<foreach collection="request.excludeIds" item="excludeId" open="(" separator="," close=")">
|
||||||
|
@ -350,20 +332,35 @@
|
||||||
|
|
||||||
|
|
||||||
<sql id="queryWhereConditionByBaseQueryRequest">
|
<sql id="queryWhereConditionByBaseQueryRequest">
|
||||||
|
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
|
||||||
|
and functional_case.module_id in
|
||||||
|
<foreach collection="request.moduleIds" item="moduleId" separator="," open="(" close=")">
|
||||||
|
#{moduleId}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="request.condition.keyword != null">
|
<if test="request.condition.keyword != null">
|
||||||
(
|
and (
|
||||||
functional_case.name like concat('%', #{request.keyword},'%')
|
functional_case.name like concat('%', #{request.keyword},'%')
|
||||||
or functional_case.num like concat('%', #{request.keyword},'%')
|
or functional_case.num like concat('%', #{request.keyword},'%')
|
||||||
or JSON_CONTAINS(tags, concat('["',#{request.keyword},'"]'))
|
or JSON_CONTAINS(tags, concat('["',#{request.keyword},'"]'))
|
||||||
)
|
)
|
||||||
<include refid="queryType">
|
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
|
||||||
</if>
|
</if>
|
||||||
<include refid="filters">
|
<include refid="filters">
|
||||||
<property name="filter" value="request.condition.filter"/>
|
<property name="filter" value="request.condition.filter"/>
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
</include>
|
||||||
|
<choose>
|
||||||
|
<when test='request.condition.searchMode == "AND"'>
|
||||||
|
AND <include refid="baseQueryCombine"/>
|
||||||
|
</when>
|
||||||
|
<when test='request.condition.searchMode == "OR"'>
|
||||||
|
and (
|
||||||
|
<include refid="baseQueryCombine"/>
|
||||||
|
)
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="baseQueryCombine">
|
||||||
<if test="request.condition.combine != null">
|
<if test="request.condition.combine != null">
|
||||||
<include refid="combine">
|
<include refid="combine">
|
||||||
<property name="condition" value="request.condition.combine"/>
|
<property name="condition" value="request.condition.combine"/>
|
||||||
|
@ -373,6 +370,7 @@
|
||||||
1=1
|
1=1
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
<select id="getPos" resultType="java.lang.Long">
|
<select id="getPos" resultType="java.lang.Long">
|
||||||
SELECT
|
SELECT
|
||||||
pos
|
pos
|
||||||
|
|
|
@ -356,28 +356,6 @@
|
||||||
</if>
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="queryVersionConditionByBaseQueryRequest">
|
|
||||||
<if test="request.versionId != null">
|
|
||||||
${versionTable}.version_id = #{request.versionId}
|
|
||||||
<include refid="queryType">
|
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
|
||||||
</if>
|
|
||||||
<if test="request.refId != null">
|
|
||||||
${versionTable}.ref_id = #{request.refId}
|
|
||||||
<include refid="queryType">
|
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
|
||||||
</if>
|
|
||||||
<if test="request.versionId == null and request.refId == null">
|
|
||||||
${versionTable}.latest = 1
|
|
||||||
<include refid="queryType">
|
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
|
||||||
</if>
|
|
||||||
1 = 1
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<sql id="queryVersionCondition">
|
<sql id="queryVersionCondition">
|
||||||
<if test="request.versionId != null">
|
<if test="request.versionId != null">
|
||||||
and ${versionTable}.version_id = #{request.versionId}
|
and ${versionTable}.version_id = #{request.versionId}
|
||||||
|
@ -513,51 +491,49 @@
|
||||||
WHERE
|
WHERE
|
||||||
functional_case.project_id = #{projectId}
|
functional_case.project_id = #{projectId}
|
||||||
and functional_case.deleted = #{deleted}
|
and functional_case.deleted = #{deleted}
|
||||||
<choose>
|
|
||||||
<when test='request.condition.searchMode == "AND"'>
|
|
||||||
AND <include refid="queryWhereConditionByBaseQueryRequest"/>
|
|
||||||
</when>
|
|
||||||
<when test='request.condition.searchMode == "OR"'>
|
|
||||||
and (
|
|
||||||
<include refid="queryWhereConditionByBaseQueryRequest"/>
|
<include refid="queryWhereConditionByBaseQueryRequest"/>
|
||||||
)
|
|
||||||
</when>
|
|
||||||
</choose>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<sql id="queryWhereConditionByBaseQueryRequest">
|
<sql id="queryWhereConditionByBaseQueryRequest">
|
||||||
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
|
<if test="request.moduleIds != null and request.moduleIds.size() > 0">
|
||||||
functional_case.module_id in
|
and functional_case.module_id in
|
||||||
<foreach collection="request.moduleIds" item="moduleId" separator="," open="(" close=")">
|
<foreach collection="request.moduleIds" item="moduleId" separator="," open="(" close=")">
|
||||||
#{moduleId}
|
#{moduleId}
|
||||||
</foreach>
|
</foreach>
|
||||||
<include refid="queryType">
|
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
|
||||||
</if>
|
</if>
|
||||||
<if test="request.condition.keyword != null">
|
<if test="request.condition.keyword != null and request.condition.keyword != ''">
|
||||||
(
|
and (
|
||||||
functional_case.name like concat('%', #{request.keyword},'%')
|
functional_case.name like concat('%', #{request.keyword},'%')
|
||||||
or functional_case.num like concat('%', #{request.keyword},'%')
|
or functional_case.num like concat('%', #{request.keyword},'%')
|
||||||
or JSON_CONTAINS(tags, concat('["',#{request.keyword},'"]'))
|
or JSON_CONTAINS(tags, concat('["',#{request.keyword},'"]'))
|
||||||
)
|
)
|
||||||
<include refid="queryType">
|
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
|
||||||
</if>
|
</if>
|
||||||
<include refid="filters">
|
<include refid="filters">
|
||||||
<property name="filter" value="request.condition.filter"/>
|
<property name="filter" value="request.condition.filter"/>
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
|
||||||
</include>
|
</include>
|
||||||
|
<choose>
|
||||||
|
<when test='request.condition.searchMode == "AND"'>
|
||||||
|
AND <include refid="baseQueryCombine"/>
|
||||||
|
</when>
|
||||||
|
<when test='request.condition.searchMode == "OR"'>
|
||||||
|
and (
|
||||||
|
<include refid="baseQueryCombine"/>
|
||||||
|
)
|
||||||
|
</when>
|
||||||
|
</choose>
|
||||||
|
<include refid="queryVersionCondition">
|
||||||
|
<property name="versionTable" value="functional_case"/>
|
||||||
|
</include>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="baseQueryCombine">
|
||||||
<if test="request.condition.combine != null">
|
<if test="request.condition.combine != null">
|
||||||
<include refid="combine">
|
<include refid="combine">
|
||||||
<property name="condition" value="request.condition.combine"/>
|
<property name="condition" value="request.condition.combine"/>
|
||||||
<property name="searchMode" value="request.condition.searchMode"/>
|
<property name="searchMode" value="request.condition.searchMode"/>
|
||||||
</include>
|
</include>
|
||||||
</if>
|
</if>
|
||||||
<include refid="queryVersionConditionByBaseQueryRequest">
|
1=1
|
||||||
<property name="versionTable" value="functional_case"/>
|
|
||||||
</include>
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="getRefIds" resultType="java.lang.String">
|
<select id="getRefIds" resultType="java.lang.String">
|
||||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serial;
|
import java.io.Serial;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wx
|
* @author wx
|
||||||
|
@ -24,4 +25,7 @@ public class BaseReviewCaseBatchRequest extends TableBatchProcessDTO implements
|
||||||
|
|
||||||
@Schema(description = "userId用来判断是否只看我的")
|
@Schema(description = "userId用来判断是否只看我的")
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(description = "模块id")
|
||||||
|
private List<String> moduleIds;
|
||||||
}
|
}
|
||||||
|
|
|
@ -405,4 +405,8 @@ public class FunctionalCaseModuleService extends ModuleTreeService {
|
||||||
return this.add(request, userId);
|
return this.add(request, userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public FunctionalCaseModule getModule(String id) {
|
||||||
|
return functionalCaseModuleMapper.selectByPrimaryKey(id);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -276,6 +276,10 @@ public class FunctionalCaseService {
|
||||||
functionalCaseDetailDTO.setVersionName(versions.get(0).getName());
|
functionalCaseDetailDTO.setVersionName(versions.get(0).getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//模块名称
|
||||||
|
FunctionalCaseModule module = functionalCaseModuleService.getModule(functionalCaseDetailDTO.getModuleId());
|
||||||
|
functionalCaseDetailDTO.setModuleName(module.getName());
|
||||||
|
|
||||||
//处理已关联需求数量/缺陷数量/用例数量
|
//处理已关联需求数量/缺陷数量/用例数量
|
||||||
handleCount(functionalCaseDetailDTO);
|
handleCount(functionalCaseDetailDTO);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue