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
a4349879
Commit
a4349879
authored
Jul 18, 2022
by
龙于生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改审批转派 转派人生成新节点跟在后面
parent
aad80406
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
9 deletions
+40
-9
src/main/java/cn/timer/api/utils/router/RouterUtils.java
+40
-9
No files found.
src/main/java/cn/timer/api/utils/router/RouterUtils.java
View file @
a4349879
...
...
@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import
cn.hutool.core.lang.UUID
;
import
cn.hutool.core.util.IdUtil
;
import
cn.hutool.json.JSONObject
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.ListUtils
;
...
...
@@ -21,7 +22,6 @@ import cn.hutool.core.collection.ListUtil;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.ConvertException
;
import
cn.hutool.core.lang.Console
;
import
cn.hutool.json.JSONObject
;
import
cn.timer.api.bean.spmk.SpmkApproveExecuteRecord
;
import
cn.timer.api.bean.spmk.SpmkApproveSummary
;
import
cn.timer.api.bean.spmk.SpmkExecutor
;
...
...
@@ -82,6 +82,9 @@ public class RouterUtils {
*/
private
final
static
String
RELATION_TYPE_USERS
=
"users"
;
private
static
com
.
alibaba
.
fastjson
.
JSONObject
jsonObject
=
new
com
.
alibaba
.
fastjson
.
JSONObject
();
public
static
List
<
Router
>
NextNode
(
List
<
Router
>
listRouter
,
JSONObject
obj
,
boolean
isFirse
)
throws
NumberFormatException
,
ConvertException
,
Exception
{
return
NextNode
(
listRouter
,
obj
,
isFirse
,
false
);
}
...
...
@@ -581,6 +584,14 @@ public class RouterUtils {
int
es
=
0
;
//操作人是否在审批名单里
boolean
isExist
=
false
;
List
<
FlowChildren
>
flowChildrenList
=
new
ArrayList
<>();
int
redeployIndex
=
-
1
;
//当前转派人所在节点下标
//初始化转派人数据 用于转派
String
flowChildrenJson
=
"{\"className\":\"audit\",\"execute\":\"0\",\"flow\":true,\"relation\":[{\"approvalOrder\":\"0\",\"departmentId\":\"\",\"down\":0,\"empty\":0,\"name\":\"\",\"signature\":0,\"type\":\"users\",\"upward\":0,\"users\":[{\"execute\":\"0\",\"headUrl\":\"\",\"id\":\"\",\"name\":\"\"}]}]}"
;
FlowChildren
flowChildren
=
jsonObject
.
parseObject
(
flowChildrenJson
,
FlowChildren
.
class
);
for
(
int
i
=
0
,
n
=
listFlowChildren
.
size
();
i
<
n
;
i
++)
{
// 新增 执行人
List
<
User
>
listUser
=
CollUtil
.
toList
();
...
...
@@ -663,8 +674,12 @@ public class RouterUtils {
//新增转派多个人功能
//判断是走派多个人的 否则走旧逻辑
if
(!
CollectionUtils
.
isEmpty
(
redeployUserList
)){
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1);
redeployUserList
.
add
(
users1
.
get
(
users1
.
size
()
-
1
));
//List<User> users1 = CollectionUtil.sub(listUser, 0, i_user+1); 第一次修改
//redeployUserList.add(users1.get(users1.size() - 1)); 第二次修改
flowChildren
.
getRelation
().
get
(
0
).
setName
(
users1
.
get
(
users1
.
size
()
-
1
).
getName
());
flowChildren
.
getRelation
().
get
(
0
).
getUsers
().
get
(
0
).
setName
(
users1
.
get
(
users1
.
size
()
-
1
).
getName
());
flowChildren
.
getRelation
().
get
(
0
).
getUsers
().
get
(
0
).
setId
(
users1
.
get
(
users1
.
size
()
-
1
).
getId
());
redeployIndex
=
i
;
for
(
User
ruser:
redeployUserList
)
{
ruser
.
setExecute
(
UNEXECUTED
);
...
...
@@ -682,14 +697,20 @@ public class RouterUtils {
//新加的 把转派人跟在后面说
User
user
=
users1
.
get
(
users1
.
size
()
-
2
);
User
us
=
new
User
();
us
.
setExecute
(
UNEXECUTED
);
us
.
setName
(
user
.
getName
());
us
.
setId
(
user
.
getId
());
users1
.
add
(
us
);
// User us = new User();
// us.setExecute(UNEXECUTED);
// us.setName(user.getName());
// us.setId(user.getId());
// users1.add(us);
flowChildren
.
getRelation
().
get
(
0
).
setName
(
user
.
getName
());
flowChildren
.
getRelation
().
get
(
0
).
getUsers
().
get
(
0
).
setName
(
user
.
getName
());
flowChildren
.
getRelation
().
get
(
0
).
getUsers
().
get
(
0
).
setId
(
user
.
getId
());
redeployIndex
=
i
;
List
<
User
>
users2
=
CollectionUtil
.
sub
(
listUser
,
i_user
+
1
,
listUser
.
size
());
redeployUserList
=
users2
;
//listUser = ListUtils.union(users1, users2);
n_user
=
listUser
.
size
();
}
...
...
@@ -877,7 +898,17 @@ public class RouterUtils {
}
}
}
for
(
int
i
=
0
;
i
<
listFlowChildren
.
size
();
i
++)
{
flowChildrenList
.
add
(
listFlowChildren
.
get
(
i
));
if
(
i
==
redeployIndex
){
flowChildrenList
.
add
(
flowChildren
);
}
}
if
(
flowChildrenList
.
size
()
>
0
){
listFlowChildren
.
clear
();
listFlowChildren
.
addAll
(
flowChildrenList
);
}
}
public
static
List
<
Router
>
clearRouters
(
List
<
Router
>
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