Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
c279801d
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
c279801d
编写于
7月 31, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
bind task taskCompleted
上级
3d20322d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
111 deletion
+20
-111
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkContext.java
...com/x/processplatform/service/processing/WorkContext.java
+8
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java
...tform/service/processing/jaxrs/task/ActionProcessing.java
+12
-111
未找到文件。
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkContext.java
浏览文件 @
c279801d
...
...
@@ -38,6 +38,14 @@ public class WorkContext {
private
Task
task
;
private
TaskCompleted
taskCompleted
;
public
void
bindTask
(
Task
task
)
{
this
.
task
=
task
;
}
public
void
bindTaskCompleted
(
TaskCompleted
taskCompleted
)
{
this
.
taskCompleted
=
taskCompleted
;
}
public
WorkContext
(
AeiObjects
aeiObjects
)
throws
Exception
{
this
.
aeiObjects
=
aeiObjects
;
this
.
business
=
aeiObjects
.
business
();
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java
浏览文件 @
c279801d
...
...
@@ -7,6 +7,9 @@ import java.util.concurrent.Callable;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
...
...
@@ -21,6 +24,7 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
...
...
@@ -32,13 +36,11 @@ import com.x.processplatform.core.express.ProcessingAttributes;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapProcessing
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.processplatform.service.processing.MessageFactory
;
import
com.x.processplatform.service.processing.WorkContext
;
import
com.x.processplatform.service.processing.WorkDataHelper
;
import
com.x.processplatform.service.processing.configurator.ProcessingConfigurator
;
import
com.x.processplatform.service.processing.processor.AeiObjects
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
class
ActionProcessing
extends
BaseAction
{
@ActionLogger
...
...
@@ -58,112 +60,6 @@ class ActionProcessing extends BaseAction {
job
=
task
.
getJob
();
}
// Callable<ActionResult<Wo>> callable = new Callable<ActionResult<Wo>>() {
// public ActionResult<Wo> call() throws Exception {
// ActionResult<Wo> result = new ActionResult<>();
// Wo wo = new Wo();
// try (EntityManagerContainer emc =
// EntityManagerContainerFactory.instance().create()) {
// Business business = new Business(emc);
// /** 生成默认的Wi,用于生成默认的processType */
// if (null == wi.getProcessingType()) {
// wi.setProcessingType(TaskCompleted.PROCESSINGTYPE_TASK);
// }
// Task task = emc.find(id, Task.class);
// if (null == task) {
// throw new ExceptionEntityNotExist(id, Task.class);
// }
// Manual manual = null;
// /* 执行办前脚本 */
// if (Objects.equals(task.getActivityType(), ActivityType.manual)) {
// manual = business.element().get(task.getActivity(), Manual.class);
// if (null != manual) {
// if (StringUtils.isNotEmpty(manual.getManualBeforeTaskScript())
// || StringUtils.isNotEmpty(manual.getManualBeforeTaskScriptText())) {
// Work work = emc.find(task.getWork(), Work.class);
// if (null != work) {
// AeiObjects aeiObjects = new AeiObjects(business, work, manual,
// new ProcessingConfigurator(), new ProcessingAttributes());
// ScriptContext scriptContext = aeiObjects.scriptContext();
// WorkDataHelper workDataHelper = new WorkDataHelper(
// business.entityManagerContainer(), work);
// CompiledScript cs = null;
// cs = business.element().getCompiledScript(task.getApplication(), manual,
// Business.EVENT_MANUALBEFORETASK);
// cs.eval(scriptContext);
// workDataHelper.update(aeiObjects.getData());
// emc.commit();
// }
// }
// }
// }
// /* 将待办转为已办 */
// emc.beginTransaction(TaskCompleted.class);
// emc.beginTransaction(Task.class);
// /* 将所有前面的已办lastest标记false */
// emc.listEqualAndEqual(TaskCompleted.class, TaskCompleted.job_FIELDNAME,
// task.getJob(),
// TaskCompleted.person_FIELDNAME, task.getPerson()).forEach(o -> {
// o.setLatest(false);
// });
// Date now = new Date();
// Long duration = Config.workTime().betweenMinutes(task.getStartTime(), now);
// TaskCompleted taskCompleted = new TaskCompleted(task, wi.getProcessingType(),
// now, duration);
// if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
// Process process = business.element().get(task.getProcess(), Process.class);
// if ((null != process) && process.getRouteNameAsOpinion()) {
// /* 先写入路由意见 */
// taskCompleted.setOpinion(StringUtils.trimToEmpty(ListTools.parallel(task.getRouteNameList(),
// task.getRouteName(), task.getRouteOpinionList())));
// /* 如果路由的名称依然没有获取,那么强制设置为路由名称。 */
// if (StringUtils.isEmpty(taskCompleted.getOpinion())) {
// taskCompleted.setOpinion(task.getRouteName());
// }
// }
// }
// taskCompleted.onPersist();
// emc.persist(taskCompleted, CheckPersistType.all);
// emc.remove(task, CheckRemoveType.all);
// emc.commit();
// /* 待办执行后脚本,不能修改数据. */
// if (null != manual) {
// if (StringUtils.isNotEmpty(manual.getManualAfterTaskScript())
// || StringUtils.isNotEmpty(manual.getManualAfterTaskScriptText())) {
// Work work = emc.find(task.getWork(), Work.class);
// if (null != work) {
// AeiObjects aeiObjects = new AeiObjects(business, work, manual,
// new ProcessingConfigurator(), new ProcessingAttributes());
// ScriptContext scriptContext = aeiObjects.scriptContext();
// CompiledScript cs = null;
// cs = business.element().getCompiledScript(task.getApplication(), manual,
// Business.EVENT_MANUALAFTERTASK);
// cs.eval(scriptContext);
// }
// }
// }
// MessageFactory.task_to_taskCompleted(taskCompleted);
// wo.setId(taskCompleted.getId());
// }
// result.setData(wo);
// return result;
// }
// };
return
ProcessPlatformExecutorFactory
.
get
(
job
).
submit
(
new
CallableExecute
(
wi
,
id
)).
get
();
}
...
...
@@ -189,6 +85,8 @@ class ActionProcessing extends BaseAction {
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
new
ProcessingAttributes
());
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
((
WorkContext
)
scriptContext
.
getAttribute
(
ScriptFactory
.
BINDING_NAME_WORKCONTEXT
))
.
bindTask
(
task
);
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
business
.
entityManagerContainer
(),
work
);
CompiledScript
cs
=
null
;
cs
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
manual
,
...
...
@@ -201,7 +99,8 @@ class ActionProcessing extends BaseAction {
}
}
private
void
callManualAfterTaskScript
(
Business
business
,
Task
task
)
throws
Exception
{
private
void
callManualAfterTaskScript
(
Business
business
,
Task
task
,
TaskCompleted
taskCompleted
)
throws
Exception
{
if
(
Objects
.
equals
(
task
.
getActivityType
(),
ActivityType
.
manual
))
{
Manual
manual
=
business
.
element
().
get
(
task
.
getActivity
(),
Manual
.
class
);
if
((
null
!=
manual
)
&&
(
StringUtils
.
isNotEmpty
(
manual
.
getManualAfterTaskScript
())
...
...
@@ -211,6 +110,8 @@ class ActionProcessing extends BaseAction {
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
new
ProcessingAttributes
());
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
((
WorkContext
)
scriptContext
.
getAttribute
(
ScriptFactory
.
BINDING_NAME_WORKCONTEXT
))
.
bindTaskCompleted
(
taskCompleted
);
CompiledScript
cs
=
null
;
cs
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
manual
,
Business
.
EVENT_MANUALAFTERTASK
);
...
...
@@ -263,7 +164,7 @@ class ActionProcessing extends BaseAction {
emc
.
remove
(
task
,
CheckRemoveType
.
all
);
emc
.
commit
();
/* 待办执行后脚本,不能修改数据. */
callManualAfterTaskScript
(
business
,
task
);
callManualAfterTaskScript
(
business
,
task
,
taskCompleted
);
MessageFactory
.
task_to_taskCompleted
(
taskCompleted
);
wo
.
setId
(
taskCompleted
.
getId
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录