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

车型试验子任务 - 查看

parent 73a8ad0c
package com.ruoyi.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
......@@ -64,21 +65,23 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
// 创建一个HashMap, 用于存放数据。用例条款ID作为key
HashMap<Long, List<TestCaseVO>> map = new HashMap<>();
for (TestUsecaseVO testUsecaseVO : testCaseList) {
// map不存在此key,添加; 则,存数据
if (!map.containsKey(testUsecaseVO.getReviewStandardId())) {
TestCaseVO caseVO = new TestCaseVO();
BeanUtils.copyProperties(testUsecaseVO, caseVO);
List<TestCaseVO> caseList = new ArrayList<>();
caseList.add(caseVO);
map.put(testUsecaseVO.getReviewStandardId(), caseList);
} else {
TestCaseVO caseVO = new TestCaseVO();
BeanUtils.copyProperties(testUsecaseVO, caseVO);
map.get(testUsecaseVO.getReviewStandardId()).add(caseVO);
if (ObjectUtil.isNotEmpty(testUsecaseVO.getReviewStandardId())) {
// map不存在此key,添加; 则,存数据
if (!map.containsKey(testUsecaseVO.getReviewStandardId())) {
TestCaseVO caseVO = new TestCaseVO();
BeanUtils.copyProperties(testUsecaseVO, caseVO);
List<TestCaseVO> caseList = new ArrayList<>();
caseList.add(caseVO);
map.put(testUsecaseVO.getReviewStandardId(), caseList);
} else {
TestCaseVO caseVO = new TestCaseVO();
BeanUtils.copyProperties(testUsecaseVO, caseVO);
map.get(testUsecaseVO.getReviewStandardId()).add(caseVO);
}
}
}
// 循环map, 给list赋值
for (Map.Entry<Long, List<TestCaseVO>> entry : map.entrySet()) {
for (Map.Entry<Long, List<TestCaseVO>> entry : map.entrySet()) {
List<TestUsecaseVO> collect = testCaseList.stream().filter(testCaseVO -> entry.getKey().equals(testCaseVO.getReviewStandardId())).collect(Collectors.toList());
if (collect.size() > 0){
TestUsecaseVO testUsecaseVO = collect.get(0);
......
......@@ -49,32 +49,31 @@
</select>
<select id="selectListByTaskId" resultType="com.ruoyi.domain.vo.TestUsecaseVO">
select
tu.id,
tu.case_id caseId,
ts.test_scenario testScenario,
tt.test_type testType,
tu.usecase_no usecaseNo,
tu.name,
tu.tools,
tu.input,
tu.description,
tu.review_standard_id,
rs.chapter,
rs.text,
rs.test_method testMethod,
tr.test_result testResult
from
t_test_usecase tu
left join t_test_scenario ts on tu.test_scenario_id = ts.id
left join t_test_type tt on tu.test_type_id = tt.id
left join t_review_standard rs on tu.review_standard_id = rs.id
left join t_task_scenario_relation tsr on tsr.test_scenario_id = ts.id
left join t_task t on tsr.task_id = t.id
left join t_model_test_task mtt on mtt.id = t.model_test_task_id
left join t_test_records tr on tu.case_id = tr.usecase_id
where
mtt.id = #{id}
select tu.id,
tu.case_id caseId,
ts.test_scenario testScenario,
tt.test_type testType,
tu.usecase_no usecaseNo,
tu.name,
tu.tools,
tu.input,
tu.description,
tu.review_standard_id,
rs.chapter,
rs.text,
rs.test_method testMethod,
tr.test_result testResult
from t_test_usecase tu
left join t_test_scenario ts on tu.test_scenario_id = ts.id
left join t_test_type tt on tu.test_type_id = tt.id
left join t_review_standard rs on tu.review_standard_id = rs.id
left join t_task_scenario_relation tsr on tsr.test_scenario_id = ts.id
left join t_task t on tsr.task_id = t.id
left join t_model_test_task mtt on mtt.id = t.model_test_task_id
left join t_test_records tr on tu.case_id = tr.usecase_id
where mtt.id = #{id}
group by tu.id, tu.case_id, ts.test_scenario, tt.test_type, tu.usecase_no, tu.name, tu.tools, tu.input,
tu.description, tu.review_standard_id, rs.chapter, rs.text, rs.test_method, tr.test_result
</select>
<select id="selectOptionalUsecase" resultType="com.ruoyi.domain.vo.OptionalUseCasesVO">
......
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