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
0fdd324f
Commit
0fdd324f
authored
Mar 15, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
把车型试验(第三个子任务)融合到总任务的 新增、编辑、详情、暂存
parent
9f66b059
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
79 additions
and
19 deletions
+79
-19
Task.java
quality-review/src/main/java/com/ruoyi/domain/Task.java
+4
-0
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+72
-19
TaskEditRequest.java
.../src/main/java/com/ruoyi/web/request/TaskEditRequest.java
+3
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/Task.java
View file @
0fdd324f
...
...
@@ -195,4 +195,8 @@ public class Task {
public
void
setCarReviewTaskIdNull
()
{
this
.
carReviewTaskId
=
null
;
}
public
void
setModelTestTaskIdNull
()
{
this
.
modelTestTaskId
=
null
;
}
}
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
0fdd324f
package
com
.
ruoyi
.
service
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.DataStatisticsUtils
;
...
...
@@ -152,15 +153,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
taskService
.
save
(
task
);
// 总任务包含车型试验,添加任务-场景关联信息
if
(
CollUtil
.
isNotEmpty
(
request
.
getTestScenarioList
()))
{
for
(
Long
sceneId
:
request
.
getTestScenarioList
())
{
TaskScenarioRelation
taskScenario
=
TaskScenarioRelation
.
builder
()
.
taskId
(
task
.
getId
())
.
testScenarioId
(
sceneId
)
.
build
();
taskScenarioRelationMapper
.
insert
(
taskScenario
);
}
}
saveTaskScenario
(
task
.
getId
(),
request
.
getTestScenarioList
());
// 构建并保存该任务所关联的审核组信息
saveUserRelation
(
auditors
,
task
);
...
...
@@ -287,15 +280,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
BeanUtils
.
copyBeanProp
(
response
,
task
);
// 测试场景
List
<
String
>
taskList
=
Arrays
.
asList
(
task
.
getTaskList
().
split
(
","
));
if
(
taskList
.
contains
(
Task
.
SUB_TASK_TRFIS
)
&&
taskList
.
size
()
==
1
)
{
List
<
Long
>
testkScenarioList
=
taskScenarioRelationMapper
.
selectList
(
new
QueryWrapper
<
TaskScenarioRelation
>().
eq
(
"task_id"
,
request
.
getId
()))
.
stream
()
.
map
(
TaskScenarioRelation:
:
getTestScenarioId
)
.
collect
(
Collectors
.
toList
());
response
.
setTestScenarioList
(
testkScenarioList
);
}
response
.
setTestScenarioList
(
selectTestScenarioList
(
task
));
// 小组成员
response
.
setAuditors
(
setAuditors
(
request
.
getId
()));
...
...
@@ -313,6 +298,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
/**
* 查询测试列表
* @param task
* @return
*/
private
List
<
Long
>
selectTestScenarioList
(
Task
task
)
{
List
<
Long
>
list
=
new
ArrayList
<>();
List
<
String
>
taskList
=
Arrays
.
asList
(
task
.
getTaskList
().
split
(
","
));
if
(
taskList
.
contains
(
Task
.
SUB_TASK_TRFIS
)
&&
taskList
.
size
()
==
1
)
{
list
=
taskScenarioRelationMapper
.
selectList
(
new
QueryWrapper
<
TaskScenarioRelation
>().
eq
(
"task_id"
,
task
.
getId
()))
.
stream
()
.
map
(
TaskScenarioRelation:
:
getTestScenarioId
)
.
collect
(
Collectors
.
toList
());
}
return
list
;
}
@Override
public
List
<
Task
>
findUserFinish
(
TaskFindFinishRequest
request
,
Long
userId
)
{
...
...
@@ -363,6 +366,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 暂存
taskService
.
save
(
task
);
// 测试场景
saveTaskScenario
(
task
.
getId
(),
request
.
getTestScenarioList
());
// 保存任务与小组信息
saveUserRelation
(
auditors
,
task
);
...
...
@@ -396,6 +402,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
task
.
setFile
(
standard
.
getFile
());
}
taskScenarioRelationMapper
.
delete
(
new
QueryWrapper
<
TaskScenarioRelation
>().
lambda
().
eq
(
TaskScenarioRelation:
:
getTaskId
,
task
.
getId
()));
saveTaskScenario
(
task
.
getId
(),
request
.
getTestScenarioList
());
// 找到审查组长
TaskUserRelation
leader
=
null
;
List
<
TaskUserRelation
>
auditors
=
request
.
getAuditors
();
...
...
@@ -435,6 +444,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
BeanUtils
.
copyBeanProp
(
response
,
task
);
// 测试场景
response
.
setTestScenarioList
(
selectTestScenarioList
(
task
));
// 小组成员
response
.
setAuditors
(
setAuditors
(
task
.
getId
()));
...
...
@@ -627,7 +639,31 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
systemReviewTaskMapper
.
deleteById
(
task
.
getSystemReviewTaskId
());
task
.
setSystemReviewTaskIdNull
();
}
// 判断车型试验
if
(
request
.
getTaskList
().
contains
(
Task
.
SUB_TASK_TRFIS
)
&&
ObjectUtil
.
isNull
(
task
.
getModelTestTaskId
()))
{
// 新增
TaskCreateRequest
createRequest
=
new
TaskCreateRequest
();
BeanUtils
.
copyBeanProp
(
createRequest
,
request
);
task
.
setModelTestTaskId
(
saveModelTest
(
createRequest
,
initiator
,
standard
,
leader
));
// 任务-场景
saveTaskScenario
(
task
.
getId
(),
createRequest
.
getTestScenarioList
());
}
if
(!
request
.
getTaskList
().
contains
(
Task
.
SUB_TASK_TRFIS
)
&&
ObjectUtil
.
isNotNull
(
task
.
getModelTestTaskId
()))
{
// 删除
modelTestTaskService
.
removeById
(
task
.
getModelTestTaskId
());
task
.
setModelTestTaskIdNull
();
// 删除 任务-场景
taskScenarioRelationMapper
.
delete
(
new
QueryWrapper
<
TaskScenarioRelation
>().
lambda
().
eq
(
TaskScenarioRelation:
:
getTaskId
,
task
.
getId
()));
}
if
(
request
.
getTaskList
().
contains
(
Task
.
SUB_TASK_TRFIS
)
&&
!
request
.
getTaskList
().
contains
(
Task
.
SUB_TASK_GRFIS
)
&&
!
request
.
getTaskList
().
contains
(
Task
.
SUB_TASK_SRAIF
)
&&
ObjectUtil
.
isNotNull
(
task
.
getModelTestTaskId
()))
{
TaskCreateRequest
createRequest
=
new
TaskCreateRequest
();
BeanUtils
.
copyBeanProp
(
createRequest
,
request
);
taskScenarioRelationMapper
.
delete
(
new
QueryWrapper
<
TaskScenarioRelation
>().
lambda
().
eq
(
TaskScenarioRelation:
:
getTaskId
,
task
.
getId
()));
saveTaskScenario
(
task
.
getId
(),
createRequest
.
getTestScenarioList
());
}
}
}
...
...
@@ -779,4 +815,21 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return
modelTestTask
.
getId
();
}
/**
* 保存任务-测试场景中间表数据
* @param taskId 总任务ID
* @param testScenarioList 测试场景集合
*/
private
void
saveTaskScenario
(
Long
taskId
,
List
<
Long
>
testScenarioList
)
{
if
(
CollUtil
.
isNotEmpty
(
testScenarioList
))
{
for
(
Long
sceneId
:
testScenarioList
)
{
TaskScenarioRelation
taskScenario
=
TaskScenarioRelation
.
builder
()
.
taskId
(
taskId
)
.
testScenarioId
(
sceneId
)
.
build
();
taskScenarioRelationMapper
.
insert
(
taskScenario
);
}
}
}
}
quality-review/src/main/java/com/ruoyi/web/request/TaskEditRequest.java
View file @
0fdd324f
...
...
@@ -66,4 +66,7 @@ public class TaskEditRequest {
@ApiModelProperty
(
"选择的任务"
)
List
<
String
>
taskList
;
@ApiModelProperty
(
"选择的测试场景"
)
private
List
<
Long
>
testScenarioList
;
}
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