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
7d791f85
Commit
7d791f85
authored
Mar 19, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'gaixiankang' into 'dev'
总任务下第三个子任务的开始执行,以及返回详情 See merge request
!201
parents
b453d995
74395058
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
37 additions
and
11 deletions
+37
-11
ModelTestTask.java
...-review/src/main/java/com/ruoyi/domain/ModelTestTask.java
+3
-0
TaskState.java
...ity-review/src/main/java/com/ruoyi/service/TaskState.java
+2
-1
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+1
-1
TaskStateAdapter.java
...rc/main/java/com/ruoyi/service/impl/TaskStateAdapter.java
+17
-5
TaskStateFacade.java
...src/main/java/com/ruoyi/service/impl/TaskStateFacade.java
+3
-2
TaskStateFinish.java
...src/main/java/com/ruoyi/service/impl/TaskStateFinish.java
+2
-1
TaskStartRequest.java
...src/main/java/com/ruoyi/web/request/TaskStartRequest.java
+4
-0
TaskFindResponse.java
...rc/main/java/com/ruoyi/web/response/TaskFindResponse.java
+3
-0
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+2
-1
No files found.
quality-review/src/main/java/com/ruoyi/domain/ModelTestTask.java
View file @
7d791f85
...
...
@@ -115,4 +115,7 @@ public class ModelTestTask {
@ApiModelProperty
(
"车型试验标准条款数"
)
private
Integer
standards
;
@ApiModelProperty
(
"试验方案ID"
)
private
String
testSchemeId
;
}
quality-review/src/main/java/com/ruoyi/service/TaskState.java
View file @
7d791f85
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.web.request.TaskStartRequest
;
import
java.util.List
;
public
interface
TaskState
{
void
doCreate
(
Task
task
,
List
<
String
>
taskList
);
void
doStart
(
Task
task
);
void
doStart
(
Task
task
,
TaskStartRequest
request
);
void
doSubmit
(
Task
task
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
7d791f85
...
...
@@ -267,7 +267,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
@Override
public
void
startTask
(
TaskStartRequest
request
)
{
Task
task
=
taskMapper
.
selectById
(
request
.
getId
());
taskStateFacade
.
doStart
(
task
);
taskStateFacade
.
doStart
(
task
,
request
);
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskStateAdapter.java
View file @
7d791f85
package
com
.
ruoyi
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.ModelTestTask
;
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
com.ruoyi.service.*
;
import
com.ruoyi.web.request.TaskStartRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -24,8 +24,12 @@ public abstract class TaskStateAdapter implements TaskState {
@Autowired
private
TaskService
taskService
;
@Autowired
private
ModelTestTaskService
modelTestTaskService
;
@Override
public
void
doStart
(
Task
task
)
{
public
void
doStart
(
Task
task
,
TaskStartRequest
request
)
{
task
.
setTaskStatus
(
Task
.
TASK_STATUS_PENDING
);
task
.
setRunStatus
(
Task
.
RUN_STATUS_STATUS_RUNNING
);
...
...
@@ -36,6 +40,14 @@ public abstract class TaskStateAdapter implements TaskState {
}
else
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_GRFIS
))
{
carReviewTaskService
.
startReviewTask
(
task
.
getCarReviewTaskId
());
taskService
.
updateById
(
task
);
}
else
if
(
Objects
.
equals
(
task
.
getNextNode
(),
Task
.
SUB_TASK_TRFIS
))
{
modelTestTaskService
.
startModelTestTask
(
task
.
getModelTestTaskId
());
// 更新车型试验的试验方案ID
modelTestTaskService
.
update
(
new
ModelTestTask
(),
new
LambdaUpdateWrapper
<
ModelTestTask
>()
.
set
(
ModelTestTask:
:
getTestSchemeId
,
request
.
getTestSchemeId
())
.
eq
(
ModelTestTask:
:
getId
,
task
.
getModelTestTaskId
()));
taskService
.
updateById
(
task
);
}
else
{
throw
new
ServiceException
(
"已没有可执行的子任务节点"
,
HttpStatus
.
ERROR
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskStateFacade.java
View file @
7d791f85
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.service.impl;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.service.TaskState
;
import
com.ruoyi.web.request.TaskStartRequest
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -21,8 +22,8 @@ public class TaskStateFacade implements TaskState {
}
@Override
public
void
doStart
(
Task
task
)
{
taskStateContext
.
getResource
(
task
.
getTaskStatus
()).
doStart
(
task
);
public
void
doStart
(
Task
task
,
TaskStartRequest
request
)
{
taskStateContext
.
getResource
(
task
.
getTaskStatus
()).
doStart
(
task
,
request
);
}
@Override
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskStateFinish.java
View file @
7d791f85
...
...
@@ -4,6 +4,7 @@ import com.ruoyi.common.constant.HttpStatus;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.service.TaskState
;
import
com.ruoyi.web.request.TaskStartRequest
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
...
...
@@ -28,7 +29,7 @@ public class TaskStateFinish extends TaskStateAdapter implements TaskState, Init
}
@Override
public
void
doStart
(
Task
task
)
{
public
void
doStart
(
Task
task
,
TaskStartRequest
request
)
{
throw
new
ServiceException
(
"不能开始一个已经结束的任务"
,
HttpStatus
.
ERROR
);
}
...
...
quality-review/src/main/java/com/ruoyi/web/request/TaskStartRequest.java
View file @
7d791f85
...
...
@@ -10,4 +10,8 @@ public class TaskStartRequest {
@ApiModelProperty
(
"ID"
)
private
Long
id
;
@ApiModelProperty
(
"试验方案ID"
)
private
String
testSchemeId
;
}
quality-review/src/main/java/com/ruoyi/web/response/TaskFindResponse.java
View file @
7d791f85
...
...
@@ -118,4 +118,7 @@ public class TaskFindResponse {
@ApiModelProperty
(
"指向待执行节点的指针[0、1、2]"
)
private
int
pointer
;
@ApiModelProperty
(
"试验方案ID"
)
private
String
testSchemeId
;
}
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
7d791f85
...
...
@@ -106,7 +106,8 @@
crt.task_status car_review_status,
mtt.task_begin_time test_begin_time,
mtt.task_end_time test_end_time,
mtt.task_status test_status
mtt.task_status test_status,
mtt.test_scheme_id testSchemeId
FROM t_task t
left join t_system_review_task srt on t.system_review_task_id = srt.id
left join t_car_review_task crt on t.car_review_task_id = crt.id
...
...
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