Commit 939702a4 authored by 盖献康's avatar 盖献康

Merge branch 'gaixiankang' into 'dev'

车型试验子任务 - 查看

See merge request !247
parents 55249169 1190431a
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
...@@ -64,6 +65,7 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali ...@@ -64,6 +65,7 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
// 创建一个HashMap, 用于存放数据。用例条款ID作为key // 创建一个HashMap, 用于存放数据。用例条款ID作为key
HashMap<Long, List<TestCaseVO>> map = new HashMap<>(); HashMap<Long, List<TestCaseVO>> map = new HashMap<>();
for (TestUsecaseVO testUsecaseVO : testCaseList) { for (TestUsecaseVO testUsecaseVO : testCaseList) {
if (ObjectUtil.isNotEmpty(testUsecaseVO.getReviewStandardId())) {
// map不存在此key,添加; 则,存数据 // map不存在此key,添加; 则,存数据
if (!map.containsKey(testUsecaseVO.getReviewStandardId())) { if (!map.containsKey(testUsecaseVO.getReviewStandardId())) {
TestCaseVO caseVO = new TestCaseVO(); TestCaseVO caseVO = new TestCaseVO();
...@@ -77,6 +79,7 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali ...@@ -77,6 +79,7 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
map.get(testUsecaseVO.getReviewStandardId()).add(caseVO); map.get(testUsecaseVO.getReviewStandardId()).add(caseVO);
} }
} }
}
// 循环map, 给list赋值 // 循环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()); List<TestUsecaseVO> collect = testCaseList.stream().filter(testCaseVO -> entry.getKey().equals(testCaseVO.getReviewStandardId())).collect(Collectors.toList());
......
...@@ -49,8 +49,7 @@ ...@@ -49,8 +49,7 @@
</select> </select>
<select id="selectListByTaskId" resultType="com.ruoyi.domain.vo.TestUsecaseVO"> <select id="selectListByTaskId" resultType="com.ruoyi.domain.vo.TestUsecaseVO">
select select tu.id,
tu.id,
tu.case_id caseId, tu.case_id caseId,
ts.test_scenario testScenario, ts.test_scenario testScenario,
tt.test_type testType, tt.test_type testType,
...@@ -64,8 +63,7 @@ ...@@ -64,8 +63,7 @@
rs.text, rs.text,
rs.test_method testMethod, rs.test_method testMethod,
tr.test_result testResult tr.test_result testResult
from from t_test_usecase tu
t_test_usecase tu
left join t_test_scenario ts on tu.test_scenario_id = ts.id 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_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_review_standard rs on tu.review_standard_id = rs.id
...@@ -73,8 +71,9 @@ ...@@ -73,8 +71,9 @@
left join t_task t on tsr.task_id = t.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_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 left join t_test_records tr on tu.case_id = tr.usecase_id
where where mtt.id = #{id}
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>
<select id="selectOptionalUsecase" resultType="com.ruoyi.domain.vo.OptionalUseCasesVO"> <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