Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
eea81ea2
Commit
eea81ea2
authored
Oct 19, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
7dd93159
d8234bd3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
WorkflowExcuteServiceImpl.java
...ot/biz/common/service/impl/WorkflowExcuteServiceImpl.java
+20
-6
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/service/impl/WorkflowExcuteServiceImpl.java
View file @
eea81ea2
...
...
@@ -6,7 +6,9 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Random
;
import
java.util.Set
;
import
com.google.common.collect.Sets
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -55,7 +57,13 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
@Override
public
Map
<
String
,
Object
>
checkTaskAuthMap
(
String
processInstanceId
,
ReginParams
userInfo
)
{
// 获取当前登录用户的角色
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
// String currentLoginUserRole = userInfo.getRole().getRoleName();
Set
<
String
>
roleNameSet
=
Sets
.
newHashSet
();
userInfo
.
getUserModel
().
getOrgRoles
().
values
().
forEach
(
i
->
{
i
.
forEach
(
e
->
{
roleNameSet
.
add
(
e
.
getRoleName
());
});
});
String
currentLoginUserName
=
userInfo
.
getUserModel
().
getUserName
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
WorkFlowEnum
.
CHECKFLAG
.
getCode
(),
false
);
...
...
@@ -67,7 +75,7 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
if
(
WorkFlowEnum
.
制定计划内容
.
getCode
().
equals
(
detail
.
getString
(
WorkFlowEnum
.
NAME
.
getCode
()))
||
WorkFlowEnum
.
现场确认
.
getCode
().
equals
(
detail
.
getString
(
WorkFlowEnum
.
NAME
.
getCode
())))
{
String
groupName
=
getFristFlowDetail
(
processInstanceId
);
if
(
StringUtils
.
isNotBlank
(
groupName
)
&&
currentLoginUserRole
.
equal
s
(
groupName
))
{
if
(
StringUtils
.
isNotBlank
(
groupName
)
&&
roleNameSet
.
contain
s
(
groupName
))
{
map
.
put
(
WorkFlowEnum
.
TASKID
.
getCode
(),
detail
.
getString
(
WorkFlowEnum
.
ID
.
getCode
()));
map
.
put
(
WorkFlowEnum
.
CHECKFLAG
.
getCode
(),
true
);
map
.
put
(
WorkFlowEnum
.
NAME
.
getCode
(),
detail
.
getString
(
WorkFlowEnum
.
NAME
.
getCode
()));
...
...
@@ -104,13 +112,13 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
continue
;
}
// 判断当前登录人的角色是不是与流程中设置的当前任务节点权限一致,一致则执行,不一致则退出
if
(!
defaultExecutionRoleProcess
.
equals
(
currentLoginUserRole
))
{
if
(!
roleNameSet
.
contains
(
defaultExecutionRoleProcess
))
{
continue
;
}
map
.
put
(
WorkFlowEnum
.
TASKID
.
getCode
(),
detail
.
getString
(
WorkFlowEnum
.
ID
.
getCode
()));
map
.
put
(
WorkFlowEnum
.
CHECKFLAG
.
getCode
(),
true
);
map
.
put
(
WorkFlowEnum
.
NAME
.
getCode
(),
detail
.
getString
(
WorkFlowEnum
.
NAME
.
getCode
()));
map
.
put
(
WorkFlowEnum
.
GROUPNAME
.
getCode
(),
currentLoginUserRole
);
map
.
put
(
WorkFlowEnum
.
GROUPNAME
.
getCode
(),
defaultExecutionRoleProcess
);
}
}
return
map
;
...
...
@@ -224,7 +232,13 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
* @throws Exception
*/
public
Object
getCurrentUserAllTaskList
(
String
key
,
ReginParams
userInfo
)
throws
Exception
{
String
currentLoginUserRole
=
userInfo
.
getRole
().
getRoleName
();
Set
<
String
>
roleNameSet
=
Sets
.
newHashSet
();
userInfo
.
getUserModel
().
getOrgRoles
().
values
().
forEach
(
i
->
{
i
.
forEach
(
e
->
{
roleNameSet
.
add
(
e
.
getRoleName
());
});
});
// String currentLoginUserRole = userInfo.getRole().getRoleName();
JSONObject
CurrentUserAllTaskResult
=
null
;
try
{
//获取该登录用户已经分配到他名下和他对应的角色权限所能执行的任务组
...
...
@@ -240,7 +254,7 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
SpecifyTaskArray
.
stream
().
forEach
(
i
->
{
JSONObject
json
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
i
));
String
groupName
=
getFristFlowDetail
(
json
.
getString
(
WorkFlowEnum
.
PROCESSINSTANCEID
.
getCode
()));
if
(
StringUtils
.
isNotBlank
(
groupName
)
&&
currentLoginUserRole
.
equal
s
(
groupName
))
{
if
(
StringUtils
.
isNotBlank
(
groupName
)
&&
roleNameSet
.
contain
s
(
groupName
))
{
allTaskResultList
.
add
(
i
);
}
});
...
...
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