Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
o2oa
提交
35dd8e78
o2oa
项目概览
此号慢热型
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
5
Star
0
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,发现更多精彩内容 >>
提交
35dd8e78
编写于
5月 16, 2019
作者:
R
roo00
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加自动删除草稿配置
上级
6e76b7e0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
138 addition
and
0 deletion
+138
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java
...latform/assemble/surface/jaxrs/work/ActionCloseCheck.java
+138
-0
未找到文件。
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionCloseCheck.java
0 → 100644
浏览文件 @
35dd8e78
package
com.x.processplatform.assemble.surface.jaxrs.work
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.x_processplatform_service_processing
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.ThisApplication
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.ActivityType
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.ManualMode
;
import
com.x.processplatform.core.entity.element.Process
;
class
ActionCloseCheck
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
Work
work
=
emc
.
find
(
id
,
Work
.
class
);
Wo
wo
=
new
Wo
();
wo
.
setDraft
(
this
.
draft
(
business
,
effectivePerson
,
work
));
if
(
BooleanUtils
.
isFalse
(
wo
.
getDraft
().
getValue
()))
{
wo
.
setGrabRelease
(
this
.
grabRelease
(
business
,
effectivePerson
,
work
));
}
result
.
setData
(
wo
);
return
result
;
}
}
private
WoDraft
draft
(
Business
business
,
EffectivePerson
effectivePerson
,
Work
work
)
throws
Exception
{
WoDraft
wo
=
new
WoDraft
();
wo
.
setValue
(
false
);
if
((
null
!=
work
)
&&
(
BooleanUtils
.
isFalse
(
work
.
getDataChanged
()))
&&
(
Objects
.
equals
(
ActivityType
.
manual
,
work
.
getActivityType
())))
{
Process
process
=
business
.
process
().
pick
(
work
.
getProcess
());
if
((
null
!=
process
)
&&
(
BooleanUtils
.
isTrue
(
process
.
getCheckDraft
())))
{
if
(
effectivePerson
.
isPerson
(
work
.
getCreatorPerson
()))
{
ThisApplication
.
context
().
applications
().
deleteQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
work
.
getId
())).
getData
(
Wo
.
class
);
wo
.
setValue
(
true
);
}
}
}
return
wo
;
}
private
WoGrabRelease
grabRelease
(
Business
business
,
EffectivePerson
effectivePerson
,
Work
work
)
throws
Exception
{
WoGrabRelease
wo
=
new
WoGrabRelease
();
if
((
null
!=
work
)
&&
(
Objects
.
equals
(
work
.
getActivityType
(),
ActivityType
.
manual
)))
{
Manual
manual
=
business
.
manual
().
pick
(
work
.
getActivity
());
if
((
null
!=
manual
)
&&
Objects
.
equals
(
ManualMode
.
grab
,
manual
.
getManualMode
()))
{
if
(
ListTools
.
isEmpty
(
work
.
getManualTaskIdentityList
())
||
(
work
.
getManualTaskIdentityList
().
size
()
==
1
))
{
business
.
entityManagerContainer
().
beginTransaction
(
Work
.
class
);
work
.
getManualTaskIdentityList
().
clear
();
business
.
entityManagerContainer
().
commit
();
ThisApplication
.
context
().
applications
().
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
work
.
getId
(),
"processing"
),
null
);
List
<
Task
>
tasks
=
business
.
entityManagerContainer
().
fetchEqual
(
Task
.
class
,
ListTools
.
toList
(
Task
.
identity_FIELDNAME
),
Task
.
work_FIELDNAME
,
work
.
getId
());
wo
.
setRelease
(
true
);
wo
.
setTaskList
(
tasks
);
}
}
}
return
wo
;
}
public
static
class
Wo
extends
GsonPropertyObject
{
@FieldDescribe
(
"检查删除草稿结果"
)
private
WoDraft
draft
;
@FieldDescribe
(
"检查抢办释放结果"
)
private
WoGrabRelease
grabRelease
;
public
WoDraft
getDraft
()
{
return
draft
;
}
public
void
setDraft
(
WoDraft
draft
)
{
this
.
draft
=
draft
;
}
public
WoGrabRelease
getGrabRelease
()
{
return
grabRelease
;
}
public
void
setGrabRelease
(
WoGrabRelease
grabRelease
)
{
this
.
grabRelease
=
grabRelease
;
}
}
public
static
class
WoDraft
extends
WrapBoolean
{
}
public
static
class
WoGrabRelease
extends
GsonPropertyObject
{
private
List
<
Task
>
taskList
=
new
ArrayList
<>();
private
Boolean
release
=
false
;
public
List
<
Task
>
getTaskList
()
{
return
taskList
;
}
public
void
setTaskList
(
List
<
Task
>
taskList
)
{
this
.
taskList
=
taskList
;
}
public
Boolean
getRelease
()
{
return
release
;
}
public
void
setRelease
(
Boolean
release
)
{
this
.
release
=
release
;
}
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录