feat(测试计划): 修复条件搜索测试集数量不正确问题
--bug=1042669 --user=王旭 【测试计划】计划详情-功能/接口/场景用例列表-搜索用例-搜索后左侧测试集数量未更新 https://www.tapd.cn/55049933/s/1532646
This commit is contained in:
parent
969e7716ab
commit
9db8404d1c
|
@ -9,6 +9,7 @@ import io.metersphere.plan.dto.ApiCaseModuleDTO;
|
||||||
import io.metersphere.plan.dto.ResourceSelectParam;
|
import io.metersphere.plan.dto.ResourceSelectParam;
|
||||||
import io.metersphere.plan.dto.TestPlanCaseRunResultCount;
|
import io.metersphere.plan.dto.TestPlanCaseRunResultCount;
|
||||||
import io.metersphere.plan.dto.request.TestPlanApiCaseBatchRequest;
|
import io.metersphere.plan.dto.request.TestPlanApiCaseBatchRequest;
|
||||||
|
import io.metersphere.plan.dto.request.TestPlanApiCaseModuleRequest;
|
||||||
import io.metersphere.plan.dto.request.TestPlanApiCaseRequest;
|
import io.metersphere.plan.dto.request.TestPlanApiCaseRequest;
|
||||||
import io.metersphere.plan.dto.request.TestPlanApiRequest;
|
import io.metersphere.plan.dto.request.TestPlanApiRequest;
|
||||||
import io.metersphere.plan.dto.response.TestPlanApiCasePageResponse;
|
import io.metersphere.plan.dto.response.TestPlanApiCasePageResponse;
|
||||||
|
@ -55,7 +56,7 @@ public interface ExtTestPlanApiCaseMapper {
|
||||||
|
|
||||||
void batchUpdateExecutor(@Param("ids") List<String> ids, @Param("userId") String userId);
|
void batchUpdateExecutor(@Param("ids") List<String> ids, @Param("userId") String userId);
|
||||||
|
|
||||||
List<ModuleCountDTO> collectionCountByRequest(@Param("testPlanId") String testPlanId);
|
List<ModuleCountDTO> collectionCountByRequest(@Param("request") TestPlanApiCaseModuleRequest request);
|
||||||
|
|
||||||
Long getMaxPosByCollectionId(String collectionId);
|
Long getMaxPosByCollectionId(String collectionId);
|
||||||
|
|
||||||
|
|
|
@ -641,18 +641,20 @@
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="collectionCountByRequest" parameterType="java.lang.String" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
<select id="collectionCountByRequest" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
||||||
SELECT
|
SELECT
|
||||||
test_plan_api_case.test_plan_collection_id AS moduleId,
|
t.test_plan_collection_id AS moduleId,
|
||||||
count( test_plan_api_case.id ) AS dataCount
|
count( t.id ) AS dataCount
|
||||||
FROM
|
FROM
|
||||||
api_test_case
|
api_test_case atc
|
||||||
INNER JOIN test_plan_api_case ON api_test_case.id = test_plan_api_case.api_case_id
|
INNER JOIN test_plan_api_case t ON atc.id = t.api_case_id
|
||||||
|
INNER JOIN api_definition a on atc.api_definition_id = a.id
|
||||||
WHERE
|
WHERE
|
||||||
api_test_case.deleted = FALSE
|
atc.deleted = FALSE
|
||||||
AND test_plan_api_case.test_plan_id = #{testPlanId}
|
AND t.test_plan_id = #{request.testPlanId}
|
||||||
|
<include refid="queryApiCaseWhereCondition"/>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
test_plan_api_case.test_plan_collection_id
|
t.test_plan_collection_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getMaxPosByCollectionId" resultType="java.lang.Long">
|
<select id="getMaxPosByCollectionId" resultType="java.lang.Long">
|
||||||
|
|
|
@ -44,7 +44,7 @@ public interface ExtTestPlanApiScenarioMapper {
|
||||||
|
|
||||||
List<String> selectIdByProjectIdAndTestPlanId(@Param("projectId") String projectId, @Param("testPlanId") String testPlanId);
|
List<String> selectIdByProjectIdAndTestPlanId(@Param("projectId") String projectId, @Param("testPlanId") String testPlanId);
|
||||||
|
|
||||||
List<ModuleCountDTO> collectionCountByRequest(@Param("testPlanId") String testPlanId);
|
List<ModuleCountDTO> collectionCountByRequest(@Param("request") TestPlanApiScenarioModuleRequest request);
|
||||||
|
|
||||||
List<ProjectOptionDTO> selectRootIdByTestPlanId(@Param("testPlanId") String testPlanId);
|
List<ProjectOptionDTO> selectRootIdByTestPlanId(@Param("testPlanId") String testPlanId);
|
||||||
|
|
||||||
|
|
|
@ -351,7 +351,7 @@
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="collectionCountByRequest" parameterType="java.lang.String" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
<select id="collectionCountByRequest" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
||||||
SELECT
|
SELECT
|
||||||
test_plan_api_scenario.test_plan_collection_id AS moduleId,
|
test_plan_api_scenario.test_plan_collection_id AS moduleId,
|
||||||
count( test_plan_api_scenario.id ) AS dataCount
|
count( test_plan_api_scenario.id ) AS dataCount
|
||||||
|
@ -360,7 +360,8 @@
|
||||||
INNER JOIN test_plan_api_scenario on api_scenario.id = test_plan_api_scenario.api_scenario_id
|
INNER JOIN test_plan_api_scenario on api_scenario.id = test_plan_api_scenario.api_scenario_id
|
||||||
WHERE
|
WHERE
|
||||||
api_scenario.deleted = FALSE
|
api_scenario.deleted = FALSE
|
||||||
AND test_plan_api_scenario.test_plan_id = #{testPlanId}
|
AND test_plan_api_scenario.test_plan_id = #{request.testPlanId}
|
||||||
|
<include refid="queryApiScenarioWhereCondition"/>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
test_plan_api_scenario.test_plan_collection_id
|
test_plan_api_scenario.test_plan_collection_id
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -7,6 +7,7 @@ import io.metersphere.plan.domain.TestPlanFunctionalCase;
|
||||||
import io.metersphere.plan.dto.ResourceSelectParam;
|
import io.metersphere.plan.dto.ResourceSelectParam;
|
||||||
import io.metersphere.plan.dto.TestPlanCaseRunResultCount;
|
import io.metersphere.plan.dto.TestPlanCaseRunResultCount;
|
||||||
import io.metersphere.plan.dto.request.BasePlanCaseBatchRequest;
|
import io.metersphere.plan.dto.request.BasePlanCaseBatchRequest;
|
||||||
|
import io.metersphere.plan.dto.request.TestPlanCaseModuleRequest;
|
||||||
import io.metersphere.plan.dto.request.TestPlanCaseRequest;
|
import io.metersphere.plan.dto.request.TestPlanCaseRequest;
|
||||||
import io.metersphere.plan.dto.response.TestPlanCasePageResponse;
|
import io.metersphere.plan.dto.response.TestPlanCasePageResponse;
|
||||||
import io.metersphere.project.dto.DropNode;
|
import io.metersphere.project.dto.DropNode;
|
||||||
|
@ -62,5 +63,5 @@ public interface ExtTestPlanFunctionalCaseMapper {
|
||||||
|
|
||||||
Long getMaxPosByCollectionId(String collectionId);
|
Long getMaxPosByCollectionId(String collectionId);
|
||||||
|
|
||||||
List<ModuleCountDTO> collectionCountByRequest(@Param("testPlanId") String testPlanId);
|
List<ModuleCountDTO> collectionCountByRequest(@Param("request") TestPlanCaseModuleRequest request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -541,7 +541,7 @@
|
||||||
WHERE test_plan_collection_id = #{0}
|
WHERE test_plan_collection_id = #{0}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="collectionCountByRequest" parameterType="java.lang.String" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
<select id="collectionCountByRequest" resultType="io.metersphere.project.dto.ModuleCountDTO">
|
||||||
SELECT
|
SELECT
|
||||||
test_plan_functional_case.test_plan_collection_id AS moduleId,
|
test_plan_functional_case.test_plan_collection_id AS moduleId,
|
||||||
count( test_plan_functional_case.id ) AS dataCount
|
count( test_plan_functional_case.id ) AS dataCount
|
||||||
|
@ -550,7 +550,8 @@
|
||||||
INNER JOIN test_plan_functional_case ON functional_case.id = test_plan_functional_case.functional_case_id
|
INNER JOIN test_plan_functional_case ON functional_case.id = test_plan_functional_case.functional_case_id
|
||||||
WHERE
|
WHERE
|
||||||
functional_case.deleted = FALSE
|
functional_case.deleted = FALSE
|
||||||
AND test_plan_functional_case.test_plan_id = #{testPlanId}
|
AND test_plan_functional_case.test_plan_id = #{request.testPlanId}
|
||||||
|
<include refid="queryWhereCondition"/>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
test_plan_functional_case.test_plan_collection_id
|
test_plan_functional_case.test_plan_collection_id
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -344,7 +344,7 @@ public class TestPlanApiCaseService extends TestPlanResourceService {
|
||||||
private Map<String, Long> getCollectionCount(TestPlanApiCaseModuleRequest request) {
|
private Map<String, Long> getCollectionCount(TestPlanApiCaseModuleRequest request) {
|
||||||
request.setCollectionId(null);
|
request.setCollectionId(null);
|
||||||
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
||||||
List<ModuleCountDTO> list = extTestPlanApiCaseMapper.collectionCountByRequest(request.getTestPlanId());
|
List<ModuleCountDTO> list = extTestPlanApiCaseMapper.collectionCountByRequest(request);
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
projectModuleCountMap.put(item.getModuleId(), (long) item.getDataCount());
|
projectModuleCountMap.put(item.getModuleId(), (long) item.getDataCount());
|
||||||
});
|
});
|
||||||
|
|
|
@ -478,7 +478,7 @@ public class TestPlanApiScenarioService extends TestPlanResourceService {
|
||||||
private Map<String, Long> getCollectionCount(TestPlanApiScenarioModuleRequest request) {
|
private Map<String, Long> getCollectionCount(TestPlanApiScenarioModuleRequest request) {
|
||||||
request.setCollectionId(null);
|
request.setCollectionId(null);
|
||||||
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
||||||
List<ModuleCountDTO> list = extTestPlanApiScenarioMapper.collectionCountByRequest(request.getTestPlanId());
|
List<ModuleCountDTO> list = extTestPlanApiScenarioMapper.collectionCountByRequest(request);
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
projectModuleCountMap.put(item.getModuleId(), (long) item.getDataCount());
|
projectModuleCountMap.put(item.getModuleId(), (long) item.getDataCount());
|
||||||
});
|
});
|
||||||
|
|
|
@ -371,7 +371,7 @@ public class TestPlanFunctionalCaseService extends TestPlanResourceService {
|
||||||
private Map<String, Long> getCollectionCount(TestPlanCaseModuleRequest request) {
|
private Map<String, Long> getCollectionCount(TestPlanCaseModuleRequest request) {
|
||||||
request.setCollectionId(null);
|
request.setCollectionId(null);
|
||||||
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
Map<String, Long> projectModuleCountMap = new HashMap<>();
|
||||||
List<ModuleCountDTO> list = extTestPlanFunctionalCaseMapper.collectionCountByRequest(request.getTestPlanId());
|
List<ModuleCountDTO> list = extTestPlanFunctionalCaseMapper.collectionCountByRequest(request);
|
||||||
list.forEach(item -> {
|
list.forEach(item -> {
|
||||||
projectModuleCountMap.put(item.getModuleId(), (long) item.getDataCount());
|
projectModuleCountMap.put(item.getModuleId(), (long) item.getDataCount());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue