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
7342db08
Commit
7342db08
authored
Feb 04, 2024
by
王飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、将启动子任务抽象到外部处理。
parent
3e7b5c16
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
23 deletions
+43
-23
CarReviewTaskService.java
...src/main/java/com/ruoyi/service/CarReviewTaskService.java
+5
-0
SystemReviewTaskService.java
.../main/java/com/ruoyi/service/SystemReviewTaskService.java
+6
-0
CarReviewTaskServiceImpl.java
...java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
+6
-1
SystemReviewTaskServiceImpl.java
...a/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
+6
-1
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+0
-17
TaskStateNew.java
...ew/src/main/java/com/ruoyi/service/impl/TaskStateNew.java
+10
-2
TaskStatePending.java
...rc/main/java/com/ruoyi/service/impl/TaskStatePending.java
+10
-2
No files found.
quality-review/src/main/java/com/ruoyi/service/CarReviewTaskService.java
View file @
7342db08
...
...
@@ -41,6 +41,11 @@ public interface CarReviewTaskService extends IService<CarReviewTask> {
*/
void
startReviewTask
(
CarReviewTaskStartRequest
request
);
/**
* 开始一个车辆审查任务中的问卷任务
*/
void
startReviewTask
(
Long
id
);
/**
* 确认一个车辆审查任务中的问卷任务
* @param request
...
...
quality-review/src/main/java/com/ruoyi/service/SystemReviewTaskService.java
View file @
7342db08
...
...
@@ -36,6 +36,12 @@ public interface SystemReviewTaskService extends IService<SystemReviewTask> {
*/
void
start
(
SystemReviewTaskStartRequest
request
);
/**
* 开始一个任务
* @param id
*/
void
start
(
Long
id
);
/**
* 根据状态查找体系审查任务
* @return
...
...
quality-review/src/main/java/com/ruoyi/service/impl/CarReviewTaskServiceImpl.java
View file @
7342db08
...
...
@@ -113,7 +113,12 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public
void
startReviewTask
(
CarReviewTaskStartRequest
request
)
{
CarReviewTask
carReviewTask
=
carReviewTaskService
.
getById
(
request
.
getTaskId
());
startReviewTask
(
request
.
getTaskId
());
}
@Override
public
void
startReviewTask
(
Long
id
)
{
CarReviewTask
carReviewTask
=
carReviewTaskService
.
getById
(
id
);
strategyCarReviewTaskContext
.
getResource
(
carReviewTask
.
getTaskStatus
()).
doStartReview
(
carReviewTask
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/SystemReviewTaskServiceImpl.java
View file @
7342db08
...
...
@@ -102,7 +102,12 @@ public class SystemReviewTaskServiceImpl extends ServiceImpl<SystemReviewTaskMap
@Override
public
void
start
(
SystemReviewTaskStartRequest
request
)
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
request
.
getTaskId
());
start
(
request
.
getTaskId
());
}
@Override
public
void
start
(
Long
id
)
{
SystemReviewTask
systemReviewTask
=
systemReviewTaskService
.
getById
(
id
);
strategySystemReviewTaskContext
.
getResource
(
systemReviewTask
.
getTaskStatus
()).
doStart
(
systemReviewTask
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
7342db08
...
...
@@ -182,23 +182,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Override
public
void
startTask
(
TaskStartRequest
request
)
{
Task
task
=
taskMapper
.
selectById
(
request
.
getId
());
SystemReviewTaskStartRequest
systemRequest
=
new
SystemReviewTaskStartRequest
();
systemRequest
.
setTaskId
(
task
.
getSystemReviewTaskId
());
CarReviewTaskStartRequest
carRequest
=
new
CarReviewTaskStartRequest
();
carRequest
.
setTaskId
(
task
.
getCarReviewTaskId
());
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_SRAIF
))
{
systemReviewTaskService
.
start
(
systemRequest
);
}
else
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_GRFIS
))
{
carReviewTaskService
.
startReviewTask
(
carRequest
);
}
taskStateFacade
.
doStart
(
task
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskStateNew.java
View file @
7342db08
...
...
@@ -3,6 +3,8 @@ package com.ruoyi.service.impl;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.service.CarReviewTaskService
;
import
com.ruoyi.service.SystemReviewTaskService
;
import
com.ruoyi.service.TaskService
;
import
com.ruoyi.service.TaskState
;
import
org.springframework.beans.factory.InitializingBean
;
...
...
@@ -27,6 +29,12 @@ public class TaskStateNew implements TaskState, InitializingBean {
@Autowired
private
TaskService
taskService
;
@Autowired
private
SystemReviewTaskService
systemReviewTaskService
;
@Autowired
private
CarReviewTaskService
carReviewTaskService
;
@Override
public
void
doCreate
(
Task
task
,
List
<
String
>
taskList
)
{
...
...
@@ -54,12 +62,12 @@ public class TaskStateNew implements TaskState, InitializingBean {
task
.
setRunStatus
(
Task
.
RUN_STATUS_STATUS_RUNNING
);
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_SRAIF
))
{
systemReviewTaskService
.
start
(
task
.
getSystemReviewTaskId
());
task
.
setNextNode
(
Task
.
SUB_TASK_GRFIS
);
taskService
.
updateById
(
task
);
}
else
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_GRFIS
))
{
carReviewTaskService
.
startReviewTask
(
task
.
getCarReviewTaskId
());
task
.
setNextNode
(
Task
.
SUB_TASK_TRFIS
);
taskService
.
updateById
(
task
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskStatePending.java
View file @
7342db08
...
...
@@ -6,6 +6,8 @@ import com.ruoyi.domain.CarReviewTask;
import
com.ruoyi.domain.SystemReviewTask
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.mapper.ReviewDetailsMapper
;
import
com.ruoyi.service.CarReviewTaskService
;
import
com.ruoyi.service.SystemReviewTaskService
;
import
com.ruoyi.service.TaskService
;
import
com.ruoyi.service.TaskState
;
import
org.springframework.beans.factory.InitializingBean
;
...
...
@@ -32,6 +34,12 @@ public class TaskStatePending implements TaskState, InitializingBean {
@Autowired
private
ApplicationContext
applicationContext
;
@Autowired
private
SystemReviewTaskService
systemReviewTaskService
;
@Autowired
private
CarReviewTaskService
carReviewTaskService
;
@Override
public
void
doCreate
(
Task
task
,
List
<
String
>
taskList
)
{
throw
new
ServiceException
(
"不能创建一个已经开始的任务"
,
HttpStatus
.
ERROR
);
...
...
@@ -44,12 +52,12 @@ public class TaskStatePending implements TaskState, InitializingBean {
task
.
setRunStatus
(
Task
.
RUN_STATUS_STATUS_RUNNING
);
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_SRAIF
))
{
systemReviewTaskService
.
start
(
task
.
getSystemReviewTaskId
());
task
.
setNextNode
(
Task
.
SUB_TASK_GRFIS
);
taskService
.
updateById
(
task
);
}
else
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_GRFIS
))
{
carReviewTaskService
.
startReviewTask
(
task
.
getCarReviewTaskId
());
task
.
setNextNode
(
Task
.
SUB_TASK_TRFIS
);
taskService
.
updateById
(
task
);
...
...
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