fix(用例管理): 修复用例评审详情页关联的接口和场景用例删除进入回收站数量不对问题
--bug=1040542 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001040542
This commit is contained in:
parent
c9d69335bb
commit
f3e788c649
|
@ -14,6 +14,8 @@ public interface ExtFunctionalCaseTestMapper {
|
||||||
|
|
||||||
List<String> getIds(@Param("request") DisassociateOtherCaseRequest request);
|
List<String> getIds(@Param("request") DisassociateOtherCaseRequest request);
|
||||||
|
|
||||||
|
Integer getOtherCaseCount(@Param("caseId") String caseId);
|
||||||
|
|
||||||
List<FunctionalCaseTestDTO> getList(@Param("request") FunctionalCaseTestRequest request);
|
List<FunctionalCaseTestDTO> getList(@Param("request") FunctionalCaseTestRequest request);
|
||||||
|
|
||||||
List<FunctionalCaseTestPlanDTO> getPlanList(@Param("request") AssociatePlanPageRequest request);
|
List<FunctionalCaseTestPlanDTO> getPlanList(@Param("request") AssociatePlanPageRequest request);
|
||||||
|
|
|
@ -41,7 +41,10 @@
|
||||||
LEFT JOIN api_test_case atc ON fct.source_id = atc.id
|
LEFT JOIN api_test_case atc ON fct.source_id = atc.id
|
||||||
LEFT JOIN api_scenario scenario ON fct.source_id = scenario.id
|
LEFT JOIN api_scenario scenario ON fct.source_id = scenario.id
|
||||||
WHERE fct.case_id = #{request.sourceId}
|
WHERE fct.case_id = #{request.sourceId}
|
||||||
AND atc.deleted = false AND scenario.deleted = false
|
AND (
|
||||||
|
atc.deleted = false
|
||||||
|
OR scenario.deleted = false
|
||||||
|
)
|
||||||
<if test="request.sourceType != null and request.sourceType != ''">
|
<if test="request.sourceType != null and request.sourceType != ''">
|
||||||
AND fct.source_type = #{request.sourceType}
|
AND fct.source_type = #{request.sourceType}
|
||||||
</if>
|
</if>
|
||||||
|
@ -57,6 +60,22 @@
|
||||||
order by fct.create_time desc
|
order by fct.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getOtherCaseCount" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
count(fct.id)
|
||||||
|
FROM
|
||||||
|
functional_case_test fct
|
||||||
|
LEFT JOIN project p ON fct.project_id = p.id
|
||||||
|
LEFT JOIN project_version v ON fct.version_id = v.id
|
||||||
|
LEFT JOIN api_test_case atc ON fct.source_id = atc.id
|
||||||
|
LEFT JOIN api_scenario scenario ON fct.source_id = scenario.id
|
||||||
|
WHERE fct.case_id = #{caseId}
|
||||||
|
AND (
|
||||||
|
atc.deleted = false
|
||||||
|
OR scenario.deleted = false
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getPlanList" parameterType="io.metersphere.functional.request.AssociatePlanPageRequest" resultType="io.metersphere.functional.dto.FunctionalCaseTestPlanDTO">
|
<select id="getPlanList" parameterType="io.metersphere.functional.request.AssociatePlanPageRequest" resultType="io.metersphere.functional.dto.FunctionalCaseTestPlanDTO">
|
||||||
SELECT r.* from (
|
SELECT r.* from (
|
||||||
SELECT distinct tpfc.test_plan_id as testPlanId,
|
SELECT distinct tpfc.test_plan_id as testPlanId,
|
||||||
|
|
|
@ -138,6 +138,8 @@ public class FunctionalCaseService {
|
||||||
@Resource
|
@Resource
|
||||||
private FunctionalCaseTestMapper functionalCaseTestMapper;
|
private FunctionalCaseTestMapper functionalCaseTestMapper;
|
||||||
@Resource
|
@Resource
|
||||||
|
private ExtFunctionalCaseTestMapper extFunctionalCaseTestMapper;
|
||||||
|
@Resource
|
||||||
private BugRelationCaseMapper bugRelationCaseMapper;
|
private BugRelationCaseMapper bugRelationCaseMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private FunctionalCaseRelationshipEdgeMapper functionalCaseRelationshipEdgeMapper;
|
private FunctionalCaseRelationshipEdgeMapper functionalCaseRelationshipEdgeMapper;
|
||||||
|
@ -388,9 +390,8 @@ public class FunctionalCaseService {
|
||||||
functionalCaseDemandExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
functionalCaseDemandExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
||||||
functionalCaseDetailDTO.setDemandCount((int) functionalCaseDemandMapper.countByExample(functionalCaseDemandExample));
|
functionalCaseDetailDTO.setDemandCount((int) functionalCaseDemandMapper.countByExample(functionalCaseDemandExample));
|
||||||
//获取已关联用例数量
|
//获取已关联用例数量
|
||||||
FunctionalCaseTestExample caseTestExample = new FunctionalCaseTestExample();
|
Integer otherCaseCount = extFunctionalCaseTestMapper.getOtherCaseCount(functionalCaseDetailDTO.getId());
|
||||||
caseTestExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
functionalCaseDetailDTO.setCaseCount(otherCaseCount);
|
||||||
functionalCaseDetailDTO.setCaseCount((int) functionalCaseTestMapper.countByExample(caseTestExample));
|
|
||||||
//获取已关联缺陷数量
|
//获取已关联缺陷数量
|
||||||
BugRelationCaseExample bugRelationCaseExample = new BugRelationCaseExample();
|
BugRelationCaseExample bugRelationCaseExample = new BugRelationCaseExample();
|
||||||
bugRelationCaseExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
bugRelationCaseExample.createCriteria().andCaseIdEqualTo(functionalCaseDetailDTO.getId());
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class ProjectController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/list/options/{organizationId}/{module}")
|
@GetMapping("/list/options/{organizationId}/{module}")
|
||||||
@Operation(summary = "根据组织ID获取所有开启某个模块的所有权限的项目")
|
@Operation(summary = "根据组织ID获取所有开启某个模块的所有有权限的项目")
|
||||||
@CheckOwner(resourceId = "#organizationId", resourceType = "organization")
|
@CheckOwner(resourceId = "#organizationId", resourceType = "organization")
|
||||||
public List<Project> getUserProjectWidthModule(@PathVariable String organizationId, @PathVariable String module) {
|
public List<Project> getUserProjectWidthModule(@PathVariable String organizationId, @PathVariable String module) {
|
||||||
return projectService.getUserProjectWidthModule(organizationId, module, SessionUtils.getUserId());
|
return projectService.getUserProjectWidthModule(organizationId, module, SessionUtils.getUserId());
|
||||||
|
|
Loading…
Reference in New Issue