Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
5b77e227
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
339
Star
10
Fork
6
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b77e227
编写于
9月 29, 2022
作者:
Z
zhourui
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix/processTaskIdentity
上级
afd4edda
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
81 addition
and
28 deletion
+81
-28
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java
...cessplatform/service/processing/processor/AeiObjects.java
+9
-1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java
.../service/processing/processor/manual/ManualProcessor.java
+72
-27
未找到文件。
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java
浏览文件 @
5b77e227
...
...
@@ -321,10 +321,18 @@ public class AeiObjects extends GsonPropertyObject {
}
public
List
<
TaskCompleted
>
getJoinInquireTaskCompletedsWithActivityToken
(
String
activityToken
)
throws
Exception
{
List
<
String
>
routeNames
=
this
.
getRoutes
().
stream
().
map
(
Route:
:
getName
).
collect
(
Collectors
.
toList
());
return
this
.
getTaskCompleteds
().
stream
()
.
filter
(
o
->
StringUtils
.
equalsIgnoreCase
(
activityToken
,
o
.
getActivityToken
())
&&
BooleanUtils
.
isNotFalse
(
o
.
getJoinInquire
()))
.
collect
(
Collectors
.
toList
());
.
filter
(
t
->
routeNames
.
contains
(
t
.
getRouteName
())).
collect
(
Collectors
.
toList
());
}
public
List
<
TaskCompleted
>
getJoinInquireTaskCompletedsRouteNameAvailableWithActivityToken
(
String
activityToken
)
throws
Exception
{
List
<
String
>
routeNames
=
this
.
getRoutes
().
stream
().
map
(
Route:
:
getName
).
collect
(
Collectors
.
toList
());
return
this
.
getJoinInquireTaskCompletedsWithActivityToken
(
activityToken
).
stream
()
.
filter
(
t
->
routeNames
.
contains
(
t
.
getRouteName
())).
collect
(
Collectors
.
toList
());
}
public
List
<
Read
>
getReads
()
throws
Exception
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java
浏览文件 @
5b77e227
...
...
@@ -197,7 +197,7 @@ public class ManualProcessor extends AbstractManualProcessor {
}
if
(
taskIdentities
.
isEmpty
())
{
taskIdentities
=
TranslateTaskIdentityTools
.
translate
(
aeiObjects
,
manual
);
this
.
ifTaskIdentitiesEmptyForceToCreatorOrMaintenance
(
aeiObjects
,
taskIdentities
);
this
.
ifTaskIdentitiesEmptyForceToCreatorOrMaintenance
(
aeiObjects
,
manual
,
taskIdentities
);
// 处理授权
this
.
writeToEmpowerMap
(
aeiObjects
,
taskIdentities
);
}
...
...
@@ -238,18 +238,23 @@ public class ManualProcessor extends AbstractManualProcessor {
}
/**
* 如果没能计算到活动处理人,
那么
按照流程维护人,应用维护人,工作创建者,平台维护人顺序查找处理人
* 如果没能计算到活动处理人,
先判断人员活动是否有设置人员,如果有那么先返回工作创建者,再
按照流程维护人,应用维护人,工作创建者,平台维护人顺序查找处理人
*
* @param aeiObjects
* @param manual
* @param taskIdentities
* @throws Exception
*/
private
void
ifTaskIdentitiesEmptyForceToCreatorOrMaintenance
(
AeiObjects
aeiObjects
,
TaskIdentities
taskIdentities
)
throws
Exception
{
private
void
ifTaskIdentitiesEmptyForceToCreatorOrMaintenance
(
AeiObjects
aeiObjects
,
Manual
manual
,
TaskIdentities
taskIdentities
)
throws
Exception
{
if
(
taskIdentities
.
isEmpty
())
{
String
identity
=
null
;
if
(
StringUtils
.
isNotBlank
(
aeiObjects
.
getProcess
().
getMaintenanceIdentity
()))
{
if
(!
ifManualAssignTaskIdentity
(
manual
))
{
identity
=
aeiObjects
.
business
().
organization
().
identity
()
.
get
(
aeiObjects
.
getWork
().
getCreatorIdentity
());
}
if
(
StringUtils
.
isEmpty
(
identity
)
&&
StringUtils
.
isNotBlank
(
aeiObjects
.
getProcess
().
getMaintenanceIdentity
()))
{
identity
=
aeiObjects
.
business
().
organization
().
identity
()
.
get
(
aeiObjects
.
getProcess
().
getMaintenanceIdentity
());
}
...
...
@@ -275,6 +280,45 @@ public class ManualProcessor extends AbstractManualProcessor {
}
}
/**
* 判读是否在活动中制定了处理人,这里没有对脚本的注解和空行进行判断
*
* @param manual
* @return
*/
private
boolean
ifManualAssignTaskIdentity
(
Manual
manual
)
{
/* 指定了的身份 */
if
(
ListTools
.
isNotEmpty
(
manual
.
getTaskIdentityList
()))
{
return
true
;
}
/* 选择了职务 */
if
(
StringUtils
.
isNotBlank
(
manual
.
getTaskDuty
()))
{
return
true
;
}
/* 指定data数据路径值 */
if
(
ListTools
.
isNotEmpty
(
manual
.
getTaskDataPathList
()))
{
return
true
;
}
/* 使用脚本计算 */
if
(
StringUtils
.
isNotEmpty
(
manual
.
getTaskScriptText
()))
{
return
true
;
}
else
{
if
(
StringUtils
.
isNotEmpty
(
manual
.
getTaskScript
()))
{
String
clean
=
manual
.
getTaskScript
().
replaceAll
(
"/\\*[^*]*(?:\\*(?!/)[^*]*)*\\*/|//.*"
,
""
);
clean
=
StringUtils
.
trimToEmpty
(
clean
);
if
(
StringUtils
.
isNotBlank
(
clean
))
{
return
true
;
}
}
}
/* 指定处理组织 */
if
(
ListTools
.
isNotEmpty
(
manual
.
getTaskUnitList
()))
{
return
true
;
}
/* 指定处理群组 */
return
(
ListTools
.
isNotEmpty
(
manual
.
getTaskGroupList
()));
}
// 更新授权,通过surface创建且workThroughManual=false 代表是草稿,那么不需要授权.
private
void
writeToEmpowerMap
(
AeiObjects
aeiObjects
,
TaskIdentities
taskIdentities
)
throws
Exception
{
...
...
@@ -331,13 +375,14 @@ public class ManualProcessor extends AbstractManualProcessor {
protected
List
<
Work
>
executing
(
AeiObjects
aeiObjects
,
Manual
manual
)
throws
Exception
{
List
<
Work
>
results
=
new
ArrayList
<>();
ManualTaskIdentityMatrix
matrix
=
executingManualTaskIdentityMatrix
(
aeiObjects
,
manual
);
List
<
TaskCompleted
>
taskCompleteds
=
executingJoinInquireCheckRouteNameTaskCompleteds
(
aeiObjects
);
List
<
TaskCompleted
>
taskCompleteds
=
aeiObjects
.
getJoinInquireTaskCompletedsRouteNameAvailableWithActivityToken
(
aeiObjects
.
getWork
().
getActivityToken
());
executingCompletedIdentityInTaskCompleteds
(
aeiObjects
,
matrix
,
taskCompleteds
);
// 发送ProcessingSignal
aeiObjects
.
getProcessingAttributes
().
push
(
Signal
.
manualExecute
(
aeiObjects
.
getWork
().
getActivityToken
(),
manual
,
Objects
.
toString
(
manual
.
getManualMode
(),
""
),
matrix
.
flat
()));
if
(
matrix
.
isEmpty
())
{
if
(
matrix
.
isEmpty
()
&&
(!
taskCompleteds
.
isEmpty
())
)
{
results
.
add
(
aeiObjects
.
getWork
());
aeiObjects
.
getTasks
().
stream
().
filter
(
t
->
StringUtils
.
equalsIgnoreCase
(
t
.
getActivityToken
(),
aeiObjects
.
getWork
().
getActivityToken
()))
...
...
@@ -364,22 +409,22 @@ public class ManualProcessor extends AbstractManualProcessor {
return
results
;
}
/**
* 获取当前参与流转的已办,同时过滤路由决策在路由中的已办.
*
* @param aeiObjects
* @return
* @throws Exception
*/
private
List
<
TaskCompleted
>
executingJoinInquireCheckRouteNameTaskCompleteds
(
AeiObjects
aeiObjects
)
throws
Exception
{
List
<
TaskCompleted
>
taskCompleteds
=
aeiObjects
.
getJoinInquireTaskCompletedsWithActivityToken
(
aeiObjects
.
getWork
().
getActivityToken
());
List
<
String
>
routeNames
=
aeiObjects
.
getRoutes
().
stream
().
map
(
Route:
:
getName
).
collect
(
Collectors
.
toList
());
taskCompleteds
=
taskCompleteds
.
stream
().
filter
(
t
->
routeNames
.
contains
(
t
.
getRouteName
()))
.
collect
(
Collectors
.
toList
());
return
taskCompleteds
;
}
//
/**
//
* 获取当前参与流转的已办,同时过滤路由决策在路由中的已办.
//
*
//
* @param aeiObjects
//
* @return
//
* @throws Exception
//
*/
//
private List<TaskCompleted> executingJoinInquireCheckRouteNameTaskCompleteds(AeiObjects aeiObjects)
//
throws Exception {
//
List<TaskCompleted> taskCompleteds = aeiObjects
//
.getJoinInquireTaskCompletedsWithActivityToken(aeiObjects.getWork().getActivityToken());
//
List<String> routeNames = aeiObjects.getRoutes().stream().map(Route::getName).collect(Collectors.toList());
//
taskCompleteds = taskCompleteds.stream().filter(t -> routeNames.contains(t.getRouteName()))
//
.collect(Collectors.toList());
//
return taskCompleteds;
//
}
@SuppressWarnings
(
"unchecked"
)
@Deprecated
(
forRemoval
=
true
,
since
=
"8.0"
)
...
...
@@ -396,15 +441,15 @@ public class ManualProcessor extends AbstractManualProcessor {
DEPRECATED_WORK_FIELD_MANUALTASKIDENTITYLIST
));
identities
=
aeiObjects
.
business
().
organization
().
identity
().
list
(
identities
);
}
if
(
identities
.
isEmpty
()
&&
aeiObjects
.
getJoinInquireTaskCompletedsWithActivityToken
(
aeiObjects
.
getWork
().
getActivityToken
()).
isEmpty
())
{
if
(
identities
.
isEmpty
()
&&
aeiObjects
.
getJoinInquireTaskCompletedsRouteNameAvailableWithActivityToken
(
aeiObjects
.
getWork
().
getActivityToken
()).
isEmpty
())
{
identities
=
calculateTaskIdentities
(
aeiObjects
,
manual
);
LOGGER
.
info
(
"工作设置的处理人已经全部无效,且没有已办,重新计算当前环节所有处理人进行处理,标题:{}, id:{}, 设置的处理人:{}."
,
aeiObjects
.
getWork
()::
getTitle
,
aeiObjects
.
getWork
()::
getId
,
identities:
:
toString
);
matrix
=
manual
.
identitiesToManualTaskIdentityMatrix
(
identities
);
// 重新绑定到对象上.
}
matrix
=
manual
.
identitiesToManualTaskIdentityMatrix
(
identities
);
}
// 重新绑定到对象上.
aeiObjects
.
getWork
().
setManualTaskIdentityMatrix
(
matrix
);
return
matrix
;
}
...
...
liyi_hz2008
@liyi_hz2008
mentioned in commit
1fc3a70b
·
9月 29, 2022
mentioned in commit
1fc3a70b
mentioned in commit 1fc3a70bde4d9572f6a2881f2807c2cff93ef0f2
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录