fix(用例管理): 修复用例评审详情页关联的接口和场景用例未规划显示不对问题

--bug=1040529 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view?bug_id=1155049933001040529
This commit is contained in:
guoyuqi 2024-05-22 15:32:57 +08:00 committed by Craftsman
parent 1384dabbea
commit da98861217
1 changed files with 10 additions and 5 deletions

View File

@ -68,8 +68,6 @@ public class FunctionalTestCaseService {
@Resource
private ExtFunctionalCaseModuleMapper extFunctionalCaseModuleMapper;
private static final String UNPLANNED_API = "api_unplanned_request";
@Resource
private BaseAssociateBugProvider baseAssociateBugProvider;
@ -202,12 +200,19 @@ public class FunctionalTestCaseService {
public List<BaseTreeNode> getTree(AssociateCaseModuleRequest request) {
List<BaseTreeNode> fileModuleList = new ArrayList<>();
String unplanned = "api_unplanned_request";
switch (request.getSourceType()) {
case AssociateCaseType.API -> fileModuleList = extFunctionalCaseModuleMapper.selectApiCaseModuleByRequest(request);
case AssociateCaseType.SCENARIO -> fileModuleList = extFunctionalCaseModuleMapper.selectApiScenarioModuleByRequest(request);
case AssociateCaseType.API -> {
fileModuleList = extFunctionalCaseModuleMapper.selectApiCaseModuleByRequest(request);
unplanned = "api_unplanned_request";
}
case AssociateCaseType.SCENARIO ->{
fileModuleList = extFunctionalCaseModuleMapper.selectApiScenarioModuleByRequest(request);
unplanned = "api_unplanned_scenario";
}
default -> new ArrayList<>();
}
return functionalCaseModuleService.buildTreeAndCountResource(fileModuleList, true, Translator.get(UNPLANNED_API));
return functionalCaseModuleService.buildTreeAndCountResource(fileModuleList, true, Translator.get(unplanned));
}
public List<FunctionalCaseTestDTO> hasAssociatePage(FunctionalCaseTestRequest request) {