Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
2e275642
Commit
2e275642
authored
Aug 26, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop_zyq' into 'develop'
Develop zyq See merge request 8timerv2/8timerapiv200!455
parents
2878dc0b
ba76959a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
23 deletions
+65
-23
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+40
-17
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+25
-6
No files found.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
2e275642
...
@@ -525,26 +525,30 @@ public class SpmkController {
...
@@ -525,26 +525,30 @@ public class SpmkController {
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
Router
router
=
spmkApproveSummaryDto
.
getRouter
();
List
<
Router
>
routers
=
router
.
getChildren
();
List
<
Router
>
routers
=
router
.
getChildren
();
// routers = RouterUtils.clearRouters(routers);
if
(
routers
==
null
){
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
if
(
CollectionUtil
.
isNotEmpty
(
routers
))
{
if
(
CollectionUtil
.
isNotEmpty
(
routers
))
{
boolean
hasAudit
=
false
;
// boolean hasAudit=false;
if
(
routers
.
size
()>
0
){
// if(routers.size()>0){
for
(
Relation
relation:
routers
.
get
(
0
).
getRelation
())
{
// for (Relation relation:routers.get(0).getRelation()) {
if
(
relation
.
getUsers
().
size
()>
0
){
// if(relation.getUsers().size()>0){
hasAudit
=
true
;
// hasAudit=true;
}
// }
}
// }
}
// List<Relation> relations = routers.get(0).getRelation();
// if (relations == null || relations.size() < 1) {
// return ResultUtil.error("无法发起,请完善审批流程");
// }
// }
// List<User> users = relations.get(0).getUsers();
//// List<Relation> relations = routers.get(0).getRelation();
// if (CollectionUtil.isEmpty(users)) {
//// if (relations == null || relations.size() < 1) {
// return ResultUtil.error("无法发起,请完善审批流程");
//// return ResultUtil.error("无法发起,请完善审批流程");
//// }
//// List<User> users = relations.get(0).getUsers();
//// if (CollectionUtil.isEmpty(users)) {
//// return ResultUtil.error("无法发起,请完善审批流程");
//// }
// if(!hasAudit){
// return ResultUtil.error("请选择审批人!");
// }
// }
if
(!
hasAudit
){
return
ResultUtil
.
error
(
"请选择审批人!"
);
}
}
else
{
}
else
{
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
}
...
@@ -560,6 +564,25 @@ public class SpmkController {
...
@@ -560,6 +564,25 @@ public class SpmkController {
RouterUtils
.
NextNode
(
listRouter
,
jSONObject
,
ISFIRST
);
RouterUtils
.
NextNode
(
listRouter
,
jSONObject
,
ISFIRST
);
List
<
FlowChildren
>
listFlowChildren
=
new
ArrayList
<
FlowChildren
>();
List
<
FlowChildren
>
listFlowChildren
=
new
ArrayList
<
FlowChildren
>();
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
RouterUtils
.
getIsFlowChildren
(
listRouter
,
listFlowChildren
);
if
(
listFlowChildren
.
isEmpty
()){
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
for
(
FlowChildren
flowChildrenItem:
listFlowChildren
)
{
if
(
"audit"
.
equals
(
flowChildrenItem
.
getClassName
())){
boolean
hasAudit
=
false
;
for
(
Relation
relation:
flowChildrenItem
.
getRelation
())
{
if
(
relation
.
getUsers
().
size
()>
0
){
hasAudit
=
true
;
}
}
if
(!
hasAudit
){
return
ResultUtil
.
error
(
"审批流程设置审批人为空无法发起!"
);
}
}
}
Logoutput
(
"listFlowChildren"
);
Logoutput
(
"listFlowChildren"
);
// 当前审批人
// 当前审批人
...
...
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
2e275642
...
@@ -389,12 +389,26 @@ public class RouterUtils {
...
@@ -389,12 +389,26 @@ public class RouterUtils {
if
(
router
.
getRelation
()
!=
null
)
{
if
(
router
.
getRelation
()
!=
null
)
{
for
(
Relation
relation
:
router
.
getRelation
())
{
for
(
Relation
relation
:
router
.
getRelation
())
{
if
(
relation
!=
null
&&
CollectionUtil
.
isNotEmpty
(
relation
.
getUsers
()))
{
if
(
relation
!=
null
)
{
if
(
router
.
getFlow
())
{
if
(
CollectionUtil
.
isNotEmpty
(
relation
.
getUsers
())){
FlowChildren
fc
=
FlowChildren
.
builder
().
build
();
if
(
router
.
getFlow
())
{
BeanUtil
.
copyProperties
(
router
,
fc
,
"condition"
,
"children"
);
FlowChildren
fc
=
FlowChildren
.
builder
().
build
();
listFlowChildren
.
add
(
fc
);
BeanUtil
.
copyProperties
(
router
,
fc
,
"condition"
,
"children"
);
getIsFlowChildren
(
router
.
getChildren
(),
listFlowChildren
);
listFlowChildren
.
add
(
fc
);
getIsFlowChildren
(
router
.
getChildren
(),
listFlowChildren
);
}
}
else
{
//无审批人,查询是否跳过或者失败! 0不处理 1指定成员 2自动通过
if
(
"executive"
.
equals
(
relation
.
getType
())
&&
relation
.
getEmpty
()
==
2
){
getIsFlowChildren
(
router
.
getChildren
(),
listFlowChildren
);
}
else
if
(
"executive"
.
equals
(
relation
.
getType
())
&&
relation
.
getEmpty
()
==
0
){
FlowChildren
fc
=
FlowChildren
.
builder
().
build
();
BeanUtil
.
copyProperties
(
router
,
fc
,
"condition"
,
"children"
);
listFlowChildren
.
add
(
fc
);
getIsFlowChildren
(
router
.
getChildren
(),
listFlowChildren
);
}
else
{
//未开发
}
}
}
}
}
}
}
...
@@ -714,4 +728,9 @@ public class RouterUtils {
...
@@ -714,4 +728,9 @@ public class RouterUtils {
}
}
public
static
List
<
Router
>
clearRouters
(
List
<
Router
>
routers
){
return
routers
;
}
}
}
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