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
3a4fcd80
Commit
3a4fcd80
authored
Jul 12, 2022
by
龙于生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化审批流程
parent
dcff51c4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+23
-24
No files found.
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
3a4fcd80
...
@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
...
@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.core.util.IdUtil
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
@@ -578,7 +579,8 @@ public class RouterUtils {
...
@@ -578,7 +579,8 @@ public class RouterUtils {
boolean
hasNextApprover
=
false
;
boolean
hasNextApprover
=
false
;
//统计并序审批 还有几个执行中的
//统计并序审批 还有几个执行中的
int
es
=
0
;
int
es
=
0
;
//操作人是否在审批名单里
boolean
isExist
=
false
;
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
// 新增 执行人
// 新增 执行人
List
<
User
>
listUser
=
CollUtil
.
toList
();
List
<
User
>
listUser
=
CollUtil
.
toList
();
...
@@ -586,10 +588,15 @@ public class RouterUtils {
...
@@ -586,10 +588,15 @@ public class RouterUtils {
List
<
Relation
>
listR
=
listFlowChildren
.
get
(
i
).
getRelation
();
List
<
Relation
>
listR
=
listFlowChildren
.
get
(
i
).
getRelation
();
if
(
CollectionUtil
.
isNotEmpty
(
listR
))
{
if
(
CollectionUtil
.
isNotEmpty
(
listR
))
{
listUser
=
listR
.
get
(
0
).
getUsers
();
listUser
=
listR
.
get
(
0
).
getUsers
();
if
(
"1"
.
equals
(
listR
.
get
(
0
).
getApprovalOrder
())){
aobl
=
true
;
for
(
User
user:
listR
.
get
(
0
).
getUsers
()
for
(
User
user:
listR
.
get
(
0
).
getUsers
()
)
{
)
{
if
(
Integer
.
parseInt
(
user
.
getId
())
==
empNum
&&
listFlowChildren
.
get
(
i
).
getClassName
().
equals
(
AUDIT
)){
isExist
=
true
;
}
//判断是顺序还是并序 0顺序 1并序
if
(
"1"
.
equals
(
listR
.
get
(
0
).
getApprovalOrder
())){
aobl
=
true
;
if
(
"1"
.
equals
(
user
.
getExecute
())){
if
(
"1"
.
equals
(
user
.
getExecute
())){
es
++;
es
++;
}
}
...
@@ -602,6 +609,7 @@ public class RouterUtils {
...
@@ -602,6 +609,7 @@ public class RouterUtils {
//执行中
//执行中
if
(
EXECUTING
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
if
(
EXECUTING
.
equals
(
listFlowChildren
.
get
(
i
).
getExecute
()))
{
String
currentApprover
=
""
;
//存放当前审批人名称
String
currentApprover
=
""
;
//存放当前审批人名称
int
num
=
0
;
//遍历当前节点审批人
//遍历当前节点审批人
outloop:
// 标识 (若内层满足条件直接跳到该层循环)
outloop:
// 标识 (若内层满足条件直接跳到该层循环)
for
(
int
i_user
=
0
,
n_user
=
listUser
.
size
();
i_user
<
n_user
;
i_user
++)
{
for
(
int
i_user
=
0
,
n_user
=
listUser
.
size
();
i_user
<
n_user
;
i_user
++)
{
...
@@ -612,13 +620,14 @@ public class RouterUtils {
...
@@ -612,13 +620,14 @@ public class RouterUtils {
//执行中
//执行中
}
else
if
(
EXECUTING
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
}
else
if
(
EXECUTING
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
//判断当前节点审批人id 等于 操作用户id 则更新执行人信息:审批意见、状态(0未执行 1执行中 2同意 3拒接 4转派)
if
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
())
==
empNum
){
if
((
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
())
==
empNum
&&
num
==
0
)
||
(!
isExist
&&
num
==
0
)){
num
++;
SpmkExecutor
.
builder
()
SpmkExecutor
.
builder
()
.
id
(
executorId
)
.
id
(
executorId
)
.
opinion
(
opinion
)
.
opinion
(
opinion
)
//
.empNum(Integer.parseInt(listUser.get(i_user).getId()))
.
empNum
(
Integer
.
parseInt
(
listUser
.
get
(
i_user
).
getId
()))
//
.executorName(listUser.get(i_user).getName())
.
executorName
(
listUser
.
get
(
i_user
).
getName
())
//
.operatorHeaderUrl(listUser.get(i_user).getHeadUrl())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user
).
getHeadUrl
())
.
sts
(
sts
)
.
sts
(
sts
)
.
signatureImg
(
signatureImg
)
.
signatureImg
(
signatureImg
)
.
build
()
.
build
()
...
@@ -652,7 +661,7 @@ public class RouterUtils {
...
@@ -652,7 +661,7 @@ public class RouterUtils {
}
else
if
(
sts
==
ExecutorSts
.
REDEPLOY
.
ordinal
())
{
}
else
if
(
sts
==
ExecutorSts
.
REDEPLOY
.
ordinal
())
{
//新增转派多个人功能
//新增转派多个人功能
//判断是走派多个人的 否则走旧逻辑
//判断是走派多个人的 否则走旧逻辑
if
(
redeployUserList
.
size
()
>
0
){
if
(
!
CollectionUtils
.
isEmpty
(
redeployUserList
)
){
List
<
User
>
users1
=
CollectionUtil
.
sub
(
listUser
,
0
,
i_user
+
1
);
List
<
User
>
users1
=
CollectionUtil
.
sub
(
listUser
,
0
,
i_user
+
1
);
for
(
User
ruser:
redeployUserList
for
(
User
ruser:
redeployUserList
)
{
)
{
...
@@ -678,6 +687,7 @@ public class RouterUtils {
...
@@ -678,6 +687,7 @@ public class RouterUtils {
//
//
// System.out.println(listUser);
// System.out.println(listUser);
}
}
//break outloop;
}
}
//未执行
//未执行
}
else
if
(
UNEXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
}
else
if
(
UNEXECUTED
.
equals
(
listUser
.
get
(
i_user
).
getExecute
()))
{
...
@@ -698,9 +708,10 @@ public class RouterUtils {
...
@@ -698,9 +708,10 @@ public class RouterUtils {
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listUser
.
get
(
i_user
).
getName
()).
build
().
updateById
();
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listUser
.
get
(
i_user
).
getName
()).
build
().
updateById
();
// 处理了 下一个审批人 则跳出循环
// 处理了 下一个审批人 则跳出循环
if
(
redeployUserList
.
size
()
==
0
){
if
(
CollectionUtils
.
isEmpty
(
redeployUserList
)
){
break
;
break
outloop
;
}
}
}
}
}
}
...
@@ -794,9 +805,7 @@ public class RouterUtils {
...
@@ -794,9 +805,7 @@ public class RouterUtils {
.
build
();
.
build
();
// 新增 审批执行记录
// 新增 审批执行记录
aer2
.
insert
();
aer2
.
insert
();
String
currentApprover
=
""
;
//遍历当前节点审批人
//遍历当前节点审批人
outloop:
for
(
int
i_user2
=
0
,
n_user2
=
listUser
.
size
();
i_user2
<
n_user2
;
i_user2
++)
{
for
(
int
i_user2
=
0
,
n_user2
=
listUser
.
size
();
i_user2
<
n_user2
;
i_user2
++)
{
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
SpmkExecutor
executor
=
SpmkExecutor
.
builder
()
.
approveExecuteRecordId
(
aer2
.
getId
())
.
approveExecuteRecordId
(
aer2
.
getId
())
...
@@ -805,24 +814,14 @@ public class RouterUtils {
...
@@ -805,24 +814,14 @@ public class RouterUtils {
.
operatorHeaderUrl
(
listUser
.
get
(
i_user2
).
getHeadUrl
())
.
operatorHeaderUrl
(
listUser
.
get
(
i_user2
).
getHeadUrl
())
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
())
.
sts
(
ExecutorSts
.
IN_EXECUTION
.
ordinal
())
.
build
();
.
build
();
//新增执行人
executor
.
insert
();
executor
.
insert
();
listUser
.
get
(
i_user2
).
setExecute
(
EXECUTING
);
listUser
.
get
(
i_user2
).
setExecute
(
EXECUTING
);
hasNextApprover
=
true
;
hasNextApprover
=
true
;
// 当前审批人
// 当前审批人
currentApprover
=
currentApprover
!=
""
?
currentApprover
+
","
+
listUser
.
get
(
i_user2
).
getName
():
listUser
.
get
(
i_user2
).
getName
();
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
listUser
.
get
(
i_user2
).
getName
()).
build
().
updateById
();
SpmkApproveSummary
.
builder
().
id
(
asId
).
currentApprover
(
currentApprover
).
build
().
updateById
();
// 处理了 下一个审批人 则跳出循环
// 处理了 下一个审批人 则跳出循环
for
(
int
j
=
0
;
j
<
redeployUserList
.
size
();
j
++)
{
break
;
User
u
=
redeployUserList
.
get
(
j
);
if
(
u
.
getId
()
==
listUser
.
get
(
i_user2
).
getId
()){
if
(
j
==
redeployUserList
.
size
()
-
1
){
break
outloop
;
}
}
}
//break;
}
}
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTING
);
listFlowChildren
.
get
(
i
).
setExecute
(
EXECUTING
);
...
...
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