Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
ae13cfcf
Commit
ae13cfcf
authored
Apr 01, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车型试验子任务 - 查看
parent
73a8ad0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
38 deletions
+40
-38
StrategyModelTestTaskNew.java
...java/com/ruoyi/service/impl/StrategyModelTestTaskNew.java
+15
-12
TestUseCaseMapper.xml
...ty-review/src/main/resources/mapper/TestUseCaseMapper.xml
+25
-26
No files found.
quality-review/src/main/java/com/ruoyi/service/impl/StrategyModelTestTaskNew.java
View file @
ae13cfcf
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
);
...
...
quality-review/src/main/resources/mapper/TestUseCaseMapper.xml
View file @
ae13cfcf
...
...
@@ -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"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment