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
182d832f
Commit
182d832f
authored
Aug 21, 2021
by
龙于生
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
审批人去重
parent
880c8c5c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
2 deletions
+53
-2
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
+53
-2
No files found.
src/main/java/cn/timer/api/controller/spmk/SpmkController.java
View file @
182d832f
package
cn
.
timer
.
api
.
controller
.
spmk
;
package
cn
.
timer
.
api
.
controller
.
spmk
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.HashSet
;
...
@@ -10,6 +11,7 @@ import java.util.Set;
...
@@ -10,6 +11,7 @@ import java.util.Set;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.bean.spmk.*
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dao.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
cn.timer.api.dto.spmk.*
;
import
com.baomidou.mybatisplus.core.toolkit.SerializationUtils
;
import
net.sf.json.JSONArray
;
import
net.sf.json.JSONArray
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -555,8 +557,56 @@ public class SpmkController {
...
@@ -555,8 +557,56 @@ public class SpmkController {
if
(
listFlowChildren
.
isEmpty
()){
if
(
listFlowChildren
.
isEmpty
()){
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
return
ResultUtil
.
error
(
"无法发起,请完善审批流程"
);
}
}
List
<
FlowChildren
>
listFlowChildren1
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren
);
List
<
String
>
uidlist
=
new
ArrayList
<>();
int
i
=
0
;
int
fsize
=
listFlowChildren
.
size
();
int
f
=
0
;
//listFlowChildren删除次数
for
(
FlowChildren
flowChildrenItem:
listFlowChildren
)
{
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
(
relation
.
getUsers
().
size
()
>
1
){
int
j
=
0
;
int
usize
=
relation
.
getUsers
().
size
();
//
int
r
=
0
;
//user list删除次数
for
(
User
user:
relation
.
getUsers
()
)
{
if
(!
uidlist
.
contains
(
user
.
getId
()))
{
uidlist
.
add
(
user
.
getId
());
}
else
{
listFlowChildren1
.
get
(
i
).
getRelation
().
get
(
0
).
getUsers
().
remove
(
j
-
r
);
r
++;
}
j
++;
}
if
(
usize
==
r
){
listFlowChildren1
.
remove
(
i
-
f
);
f
++;
}
}
else
{
if
(!
uidlist
.
contains
(
relation
.
getUsers
().
get
(
0
).
getId
()))
{
uidlist
.
add
(
relation
.
getUsers
().
get
(
0
).
getId
());
}
else
{
listFlowChildren1
.
remove
(
i
-
f
);
f
++;
}
}
}
}
if
(!
hasAudit
)
{
return
ResultUtil
.
error
(
"审批流程设置审批人为空无法发起!"
);
}
}
i
++;
}
listFlowChildren
=
(
ArrayList
<
FlowChildren
>)
SerializationUtils
.
clone
((
Serializable
)
listFlowChildren1
);
/*for (FlowChildren flowChildrenItem: listFlowChildren) {
if("audit".equals(flowChildrenItem.getClassName())){
if("audit".equals(flowChildrenItem.getClassName())){
boolean hasAudit=false;
boolean hasAudit=false;
for (Relation relation:flowChildrenItem.getRelation()) {
for (Relation relation:flowChildrenItem.getRelation()) {
...
@@ -568,7 +618,7 @@ public class SpmkController {
...
@@ -568,7 +618,7 @@ public class SpmkController {
return ResultUtil.error("审批流程设置审批人为空无法发起!");
return ResultUtil.error("审批流程设置审批人为空无法发起!");
}
}
}
}
}
}
*/
Logoutput
(
"listFlowChildren"
);
Logoutput
(
"listFlowChildren"
);
...
@@ -660,6 +710,7 @@ public class SpmkController {
...
@@ -660,6 +710,7 @@ public class SpmkController {
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
public
Result
<
Object
>
selectAd
(
@PathVariable
(
required
=
true
)
Integer
id
)
{
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
);
SpmkApproveDetailDto
adD
=
spmkService
.
selectApproveDetailByAsId
(
id
);
System
.
out
.
println
(
ResultUtil
.
data
(
adD
));
return
ResultUtil
.
data
(
adD
);
return
ResultUtil
.
data
(
adD
);
}
}
...
...
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