Commit c0e9feae authored by 盖献康's avatar 盖献康

根据车型试验子任务ID获取用例集合

parent 699e7852
...@@ -18,6 +18,9 @@ import lombok.NoArgsConstructor; ...@@ -18,6 +18,9 @@ import lombok.NoArgsConstructor;
@ApiModel("测试用例VO(t_test_usecase)") @ApiModel("测试用例VO(t_test_usecase)")
public class TestUsecaseVO { public class TestUsecaseVO {
@ApiModelProperty("测试用例ID")
private Long id;
@ApiModelProperty("测试场景") @ApiModelProperty("测试场景")
private String testScenario; private String testScenario;
......
...@@ -2,6 +2,7 @@ package com.ruoyi.service; ...@@ -2,6 +2,7 @@ package com.ruoyi.service;
import com.ruoyi.domain.TestUseCase; import com.ruoyi.domain.TestUseCase;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
import java.util.List; import java.util.List;
...@@ -19,4 +20,11 @@ public interface TestUseCaseService extends IService<TestUseCase> { ...@@ -19,4 +20,11 @@ public interface TestUseCaseService extends IService<TestUseCase> {
* @return 测试用例集合 * @return 测试用例集合
*/ */
public List<TestUseCase> selectseCaseList(TestUserCaseRequest testUserCaseRequest); public List<TestUseCase> selectseCaseList(TestUserCaseRequest testUserCaseRequest);
/**
* 通过车型试验ID获取所绑定的测试用例
* @param request
* @return
*/
List<Long> selectCaseIdList(TestUseCaseIdListRequest request);
} }
...@@ -2,14 +2,17 @@ package com.ruoyi.service.impl; ...@@ -2,14 +2,17 @@ package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.TestUseCase; import com.ruoyi.domain.TestUseCase;
import com.ruoyi.domain.vo.TestUsecaseVO;
import com.ruoyi.service.TestUseCaseService; import com.ruoyi.service.TestUseCaseService;
import com.ruoyi.mapper.TestUseCaseMapper; import com.ruoyi.mapper.TestUseCaseMapper;
import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author wangfei * @author wangfei
...@@ -37,6 +40,12 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -37,6 +40,12 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
return testUseCaseMapper.selectseCaseList(testUserCaseRequest); return testUseCaseMapper.selectseCaseList(testUserCaseRequest);
} }
@Override
public List<Long> selectCaseIdList(TestUseCaseIdListRequest request) {
List<TestUsecaseVO> list = testUseCaseMapper.selectListByTaskId(request.getModelTestId());
return list.stream().map(TestUsecaseVO::getId).collect(Collectors.toList());
}
} }
......
package com.ruoyi.web; package com.ruoyi.web;
import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.TestUseCase; import com.ruoyi.domain.TestUseCase;
import com.ruoyi.service.TestUseCaseService; import com.ruoyi.service.TestUseCaseService;
import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -11,10 +14,7 @@ import org.apache.skywalking.apm.toolkit.trace.Tags; ...@@ -11,10 +14,7 @@ import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace; import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
...@@ -35,4 +35,16 @@ public class TestUserCaseController extends BaseController{ ...@@ -35,4 +35,16 @@ public class TestUserCaseController extends BaseController{
List<TestUseCase> list = testUseCaseService.selectseCaseList(testUserCaseRequest); List<TestUseCase> list = testUseCaseService.selectseCaseList(testUserCaseRequest);
return getDataTable(list); return getDataTable(list);
} }
/**
* 通过车型试验ID获取所绑定的测试用例
* @param request
* @return
*/
@Anonymous
@ApiOperation("根据场景查询用例ID集合")
@PostMapping("/getCaseIdList")
public R<List<Long>> getCaseIdList(@Validated @RequestBody TestUseCaseIdListRequest request) {
return R.ok(testUseCaseService.selectCaseIdList(request));
}
} }
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
/**
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("测试用例id列表")
public class TestUseCaseIdListRequest {
@NotNull(message = "车型试验ID不为空")
@ApiModelProperty("车型试验ID")
private Long modelTestId;
}
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<select id="selectListByTaskId" resultType="com.ruoyi.domain.vo.TestUsecaseVO"> <select id="selectListByTaskId" resultType="com.ruoyi.domain.vo.TestUsecaseVO">
select select
tu.id,
ts.test_scenario testScenario, ts.test_scenario testScenario,
tt.test_type testType, tt.test_type testType,
tu.usecase_no usecaseNo, tu.usecase_no usecaseNo,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment