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
8e91fdbb
Commit
8e91fdbb
authored
Mar 05, 2024
by
王飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、修改nextNode属性的计算方式。
parent
7c5131da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
13 deletions
+35
-13
Task.java
quality-review/src/main/java/com/ruoyi/domain/Task.java
+16
-0
TaskStateNew.java
...ew/src/main/java/com/ruoyi/service/impl/TaskStateNew.java
+19
-13
No files found.
quality-review/src/main/java/com/ruoyi/domain/Task.java
View file @
8e91fdbb
...
...
@@ -157,4 +157,20 @@ public class Task {
@ApiModelProperty
(
"选择的项目"
)
private
String
taskList
;
@ApiModelProperty
(
"指向待执行节点的指针[0、1、2]"
)
private
int
pointer
;
@ApiModelProperty
(
"子任务指针最大值"
)
private
int
maxPointer
;
// 返回当前节点的下一个节点
public
String
getNextNode
()
{
String
[]
split
=
taskList
.
split
(
","
);
if
(
pointer
+
1
>
maxPointer
)
{
return
null
;
}
else
{
return
split
[
pointer
+
1
];
}
}
}
quality-review/src/main/java/com/ruoyi/service/impl/TaskStateNew.java
View file @
8e91fdbb
...
...
@@ -13,8 +13,10 @@ import org.springframework.context.ApplicationContext;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
@Transactional
@Service
...
...
@@ -38,21 +40,25 @@ public class TaskStateNew implements TaskState, InitializingBean {
@Override
public
void
doCreate
(
Task
task
,
List
<
String
>
taskList
)
{
String
nextNode
=
null
;
List
<
String
>
subTasks
=
new
ArrayList
<>()
;
if
(
taskList
.
contains
(
Task
.
SUB_TASK_TRFIS
))
{
nextNode
=
Task
.
SUB_TASK_TRFIS
;
// 保存体系审查任务
if
(
taskList
.
contains
(
Task
.
SUB_TASK_SRAIF
))
{
subTasks
.
add
(
Task
.
SUB_TASK_SRAIF
);
}
// 保存车型审查问卷任务
if
(
taskList
.
contains
(
Task
.
SUB_TASK_GRFIS
))
{
// 保存车型审查问卷任务
nextNode
=
Task
.
SUB_TASK_GRFIS
;;
subTasks
.
add
(
Task
.
SUB_TASK_GRFIS
);
}
if
(
taskList
.
contains
(
Task
.
SUB_TASK_SRAIF
))
{
// 保存体系审查任务
nextNode
=
Task
.
SUB_TASK_SRAIF
;
// 车型试验任务
if
(
taskList
.
contains
(
Task
.
SUB_TASK_TRFIS
))
{
subTasks
.
add
(
Task
.
SUB_TASK_TRFIS
);
}
task
.
setNextNode
(
nextNode
);
task
.
setPointer
(
0
);
task
.
setMaxPointer
(
subTasks
.
size
());
taskService
.
updateById
(
task
);
}
...
...
@@ -65,16 +71,15 @@ public class TaskStateNew implements TaskState, InitializingBean {
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
);
}
else
{
throw
new
ServiceException
(
"已没有可执行的子任务节点"
,
HttpStatus
.
ERROR
);
}
task
.
setPointer
(
task
.
getPointer
()
+
1
);
taskService
.
updateById
(
task
);
}
...
...
@@ -87,4 +92,5 @@ public class TaskStateNew implements TaskState, InitializingBean {
public
void
afterPropertiesSet
()
throws
Exception
{
taskStateContext
.
putResource
(
Task
.
TASK_STATUS_NEW
,
applicationContext
.
getBean
(
this
.
getClass
()));
}
}
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