fix(测试跟踪): 测试计划功能用例ID排序问题
--bug=1015743 --user=宋昌昌 [测试跟踪]github#16785测试计划-功能用例排序不正确 https://www.tapd.cn/55049933/s/1222841
This commit is contained in:
parent
4777c24842
commit
5f0168f640
|
@ -373,4 +373,14 @@ public class ProjectApplicationService {
|
||||||
return projectApplications.stream()
|
return projectApplications.stream()
|
||||||
.collect(Collectors.toMap(ProjectApplication::getProjectId, ProjectApplication::getType));
|
.collect(Collectors.toMap(ProjectApplication::getProjectId, ProjectApplication::getType));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean checkCustomNumByProjectId(String projectId) {
|
||||||
|
ProjectApplicationExample example = new ProjectApplicationExample();
|
||||||
|
example.createCriteria()
|
||||||
|
.andProjectIdEqualTo(projectId)
|
||||||
|
.andTypeEqualTo(ProjectApplicationType.CASE_CUSTOM_NUM.name())
|
||||||
|
.andTypeValueEqualTo("true");
|
||||||
|
List<ProjectApplication> projectApplications = projectApplicationMapper.selectByExample(example);
|
||||||
|
return projectApplications.size() > 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,9 @@ public class TestPlanTestCaseService {
|
||||||
@Resource
|
@Resource
|
||||||
private FunctionCaseExecutionInfoService functionCaseExecutionInfoService;
|
private FunctionCaseExecutionInfoService functionCaseExecutionInfoService;
|
||||||
|
|
||||||
|
private static final String CUSTOM_NUM = "custom_num";
|
||||||
|
private static final String NUM = "num";
|
||||||
|
|
||||||
public List<TestPlanTestCaseWithBLOBs> listAll() {
|
public List<TestPlanTestCaseWithBLOBs> listAll() {
|
||||||
TestPlanTestCaseExample example = new TestPlanTestCaseExample();
|
TestPlanTestCaseExample example = new TestPlanTestCaseExample();
|
||||||
example.createCriteria();
|
example.createCriteria();
|
||||||
|
@ -92,6 +95,21 @@ public class TestPlanTestCaseService {
|
||||||
|
|
||||||
public List<TestPlanCaseDTO> list(QueryTestPlanCaseRequest request) {
|
public List<TestPlanCaseDTO> list(QueryTestPlanCaseRequest request) {
|
||||||
List<OrderRequest> orders = ServiceUtils.getDefaultSortOrder(request.getOrders());
|
List<OrderRequest> orders = ServiceUtils.getDefaultSortOrder(request.getOrders());
|
||||||
|
// CUSTOM_NUM ORDER
|
||||||
|
boolean customOrderFlag = orders.stream().anyMatch(order -> StringUtils.equals(order.getName(), CUSTOM_NUM));
|
||||||
|
if (customOrderFlag) {
|
||||||
|
// 判断当前项目时候开启自定义字段的配置
|
||||||
|
boolean customNumEnable = projectApplicationService.checkCustomNumByProjectId(request.getProjectId());
|
||||||
|
orders.forEach(order -> {
|
||||||
|
if (StringUtils.equals(order.getName(), CUSTOM_NUM)) {
|
||||||
|
if (customNumEnable) {
|
||||||
|
order.setName(CUSTOM_NUM);
|
||||||
|
} else {
|
||||||
|
order.setName(NUM);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
request.setOrders(orders);
|
request.setOrders(orders);
|
||||||
|
|
||||||
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
|
List<TestPlanCaseDTO> list = extTestPlanTestCaseMapper.list(request);
|
||||||
|
|
Loading…
Reference in New Issue