Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
abe0a71a
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,发现更多精彩内容 >>
提交
abe0a71a
编写于
9月 25, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
默认去掉云文件和网络会议,增加form的V2版本
上级
7a29173a
变更
19
隐藏空白更改
内联
并排
Showing
19 changed file
with
560 addition
and
128 deletion
+560
-128
o2server/configSample/processPlatform.json
o2server/configSample/processPlatform.json
+2
-2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Components.java
.../main/java/com/x/base/core/project/config/Components.java
+10
-10
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ProcessPlatform.java
.../java/com/x/base/core/project/config/ProcessPlatform.java
+7
-7
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/MappingExecuteQueue.java
...rocessplatform/assemble/designer/MappingExecuteQueue.java
+1
-1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/workcompleted/ActionMergeWithProcess.java
.../designer/jaxrs/workcompleted/ActionMergeWithProcess.java
+1
-2
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java
...ocessplatform/assemble/surface/jaxrs/form/BaseAction.java
+11
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java
...ocessplatform/assemble/surface/jaxrs/form/FormAction.java
+73
-18
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2Get.java
.../x/processplatform/assemble/surface/jaxrs/form/V2Get.java
+90
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2GetMobile.java
...cessplatform/assemble/surface/jaxrs/form/V2GetMobile.java
+99
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java
...emble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java
+13
-30
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java
...surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java
+133
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
.../surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
+0
-12
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompleted.java
.../x/processplatform/core/entity/content/WorkCompleted.java
+10
-11
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java
...platform/core/entity/content/WorkCompletedProperties.java
+33
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ThisApplication.java
...x/processplatform/service/processing/ThisApplication.java
+5
-5
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/data/ActionUpdateWithWorkCompletedPrimitivePath0.java
...xrs/data/ActionUpdateWithWorkCompletedPrimitivePath0.java
+9
-8
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionCombine.java
...platform/service/processing/jaxrs/test/ActionCombine.java
+2
-2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/workcompleted/ActionCombine.java
...service/processing/jaxrs/workcompleted/ActionCombine.java
+54
-13
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/schedule/Merge.java
.../x/processplatform/service/processing/schedule/Merge.java
+7
-7
未找到文件。
o2server/configSample/processPlatform.json
浏览文件 @
abe0a71a
...
...
@@ -26,7 +26,7 @@
"###enable"
:
"是否启用###"
,
"###cron"
:
"定时cron表达式###"
},
"
combin
e"
:
{
"
merg
e"
:
{
"enable"
:
false
,
"cron"
:
"30 30 6 * * ?"
,
"thresholdDays"
:
730.0
,
...
...
@@ -69,7 +69,7 @@
"###urge"
:
"催办任务设置,发现即将过期时发送提醒消息.###"
,
"###expire"
:
"将已经过了截至时间的待办标记过期.###"
,
"###touchDelay"
:
"延时任务设置,定时触发延时任务,当超过延时时间后继续流转.###"
,
"###
combin
e"
:
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并.###"
,
"###
merg
e"
:
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并.###"
,
"###deleteDraft"
:
"清除草稿状态的工作.###"
,
"###passExpired"
:
"超时工作路由设置.###"
,
"###touchDetained"
:
"触发长时间未处理的工作.###"
,
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Components.java
浏览文件 @
abe0a71a
...
...
@@ -29,10 +29,10 @@ public class Components extends ConfigObject {
public
static
final
String
NAME_TASKCENTER
=
"TaskCenter"
;
public
static
final
String
NAME_HOMEPAGE
=
"Homepage"
;
public
static
final
String
NAME_HOTARTICLE
=
"HotArticle"
;
public
static
final
String
NAME_FILE
=
"File"
;
//
public static final String NAME_FILE = "File";
public
static
final
String
NAME_NOTE
=
"Note"
;
public
static
final
String
NAME_MEETING
=
"Meeting"
;
public
static
final
String
NAME_ONLINEMEETING
=
"OnlineMeeting"
;
//
public static final String NAME_ONLINEMEETING = "OnlineMeeting";
public
static
final
String
NAME_ATTENDANCE
=
"Attendance"
;
public
static
final
String
NAME_FORUM
=
"Forum"
;
public
static
final
String
NAME_MINDER
=
"Minder"
;
...
...
@@ -44,7 +44,7 @@ public class Components extends ConfigObject {
public
static
List
<
String
>
SYSTEM_NAME_NAMES
=
ListTools
.
toList
(
NAME_SETTING
,
NAME_ORG
,
NAME_CMSMANAGER
,
NAME_APPLICATIONEXPLORER
,
NAME_PORTALEXPLORER
,
NAME_DATAEXPLORER
,
NAME_SERVICEMANAGER
,
NAME_APPMARKET
,
NAME_APPCENTER
,
NAME_LOGVIEWER
,
NAME_PROFILE
,
NAME_BAM
,
NAME_CMS
,
NAME_TASKCENTER
,
NAME_HOMEPAGE
,
NAME_HOTARTICLE
,
NAME_
FILE
,
NAME_NOTE
,
NAME_MEETING
,
NAME_ONLINE
MEETING
,
NAME_ATTENDANCE
,
NAME_FORUM
,
NAME_HOTARTICLE
,
NAME_
NOTE
,
NAME_
MEETING
,
NAME_ATTENDANCE
,
NAME_FORUM
,
NAME_MINDER
,
NAME_CALENDAR
,
NAME_ANN
,
NAME_SEARCH
,
NAME_IM
);
public
static
final
String
APPICON_PNG
=
"appicon.png"
;
...
...
@@ -87,15 +87,15 @@ public class Components extends ConfigObject {
return
new
Component
(
NAME_HOMEPAGE
,
NAME_HOMEPAGE
,
"首页"
,
APPICON_PNG
,
14
,
Component
.
TYPE_SYSTEM
);
case
NAME_HOTARTICLE:
return
new
Component
(
NAME_HOTARTICLE
,
NAME_HOTARTICLE
,
"热点"
,
APPICON_PNG
,
15
,
Component
.
TYPE_SYSTEM
);
case
NAME_FILE:
return
new
Component
(
NAME_FILE
,
NAME_FILE
,
"云文件"
,
APPICON_PNG
,
16
,
Component
.
TYPE_SYSTEM
);
//
case NAME_FILE:
//
return new Component(NAME_FILE, NAME_FILE, "云文件", APPICON_PNG, 16, Component.TYPE_SYSTEM);
case
NAME_NOTE:
return
new
Component
(
NAME_NOTE
,
NAME_NOTE
,
"便签"
,
APPICON_PNG
,
17
,
Component
.
TYPE_SYSTEM
);
case
NAME_MEETING:
return
new
Component
(
NAME_MEETING
,
NAME_MEETING
,
"会议管理"
,
APPICON_PNG
,
18
,
Component
.
TYPE_SYSTEM
);
case
NAME_ONLINEMEETING:
return
new
Component
(
NAME_ONLINEMEETING
,
NAME_ONLINEMEETING
,
"网络会议"
,
APPICON_PNG
,
19
,
Component
.
TYPE_SYSTEM
);
//
case NAME_ONLINEMEETING:
//
return new Component(NAME_ONLINEMEETING, NAME_ONLINEMEETING, "网络会议", APPICON_PNG, 19,
//
Component.TYPE_SYSTEM);
case
NAME_ATTENDANCE:
return
new
Component
(
NAME_ATTENDANCE
,
NAME_ATTENDANCE
,
"考勤管理"
,
APPICON_PNG
,
20
,
Component
.
TYPE_SYSTEM
);
case
NAME_FORUM:
...
...
@@ -133,10 +133,10 @@ public class Components extends ConfigObject {
o
.
systems
.
add
(
systemComponent
(
NAME_TASKCENTER
));
o
.
systems
.
add
(
systemComponent
(
NAME_HOMEPAGE
));
o
.
systems
.
add
(
systemComponent
(
NAME_HOTARTICLE
));
o
.
systems
.
add
(
systemComponent
(
NAME_FILE
));
//
o.systems.add(systemComponent(NAME_FILE));
o
.
systems
.
add
(
systemComponent
(
NAME_NOTE
));
o
.
systems
.
add
(
systemComponent
(
NAME_MEETING
));
o
.
systems
.
add
(
systemComponent
(
NAME_ONLINEMEETING
));
//
o.systems.add(systemComponent(NAME_ONLINEMEETING));
o
.
systems
.
add
(
systemComponent
(
NAME_ATTENDANCE
));
o
.
systems
.
add
(
systemComponent
(
NAME_FORUM
));
o
.
systems
.
add
(
systemComponent
(
NAME_MINDER
));
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ProcessPlatform.java
浏览文件 @
abe0a71a
...
...
@@ -69,7 +69,7 @@ public class ProcessPlatform extends ConfigObject {
this
.
urge
=
new
Urge
();
this
.
expire
=
new
Expire
();
this
.
touchDelay
=
new
TouchDelay
();
this
.
combine
=
new
Combin
e
();
this
.
merge
=
new
Merg
e
();
this
.
touchDetained
=
new
TouchDetained
();
this
.
deleteDraft
=
new
DeleteDraft
();
this
.
passExpired
=
new
PassExpired
();
...
...
@@ -146,7 +146,7 @@ public class ProcessPlatform extends ConfigObject {
private
TouchDelay
touchDelay
;
@FieldDescribe
(
"合并任务设置,定时触发合并任务,将已完成工作的Data从Item表中提取合并到WorkCompleted的Data字段中,默认工作完成后2年开始进行合并."
)
private
Combine
combin
e
;
private
Merge
merg
e
;
@FieldDescribe
(
"清除草稿状态的工作."
)
private
DeleteDraft
deleteDraft
;
...
...
@@ -211,8 +211,8 @@ public class ProcessPlatform extends ConfigObject {
return
this
.
logLongDetained
==
null
?
new
LogLongDetained
()
:
this
.
logLongDetained
;
}
public
Combine
getCombin
e
()
{
return
this
.
combine
==
null
?
new
Combine
()
:
this
.
combin
e
;
public
Merge
getMerg
e
()
{
return
this
.
merge
==
null
?
new
Merge
()
:
this
.
merg
e
;
}
public
Press
getPress
()
{
...
...
@@ -328,10 +328,10 @@ public class ProcessPlatform extends ConfigObject {
}
public
static
class
Combin
e
extends
ConfigObject
{
public
static
class
Merg
e
extends
ConfigObject
{
public
static
Combin
e
defaultInstance
()
{
Combine
o
=
new
Combin
e
();
public
static
Merg
e
defaultInstance
()
{
Merge
o
=
new
Merg
e
();
return
o
;
}
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/MappingExecuteQueue.java
浏览文件 @
abe0a71a
...
...
@@ -82,7 +82,7 @@ public class MappingExecuteQueue extends AbstractQueue<String> {
}
private
Data
data
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
if
(
BooleanUtils
.
isTrue
(
workCompleted
.
getMerged
())
&&
(
null
!=
workCompleted
.
getProperties
().
getData
()))
{
if
(
BooleanUtils
.
isTrue
(
workCompleted
.
getMerged
())
&&
(
null
!=
workCompleted
.
getProperties
().
getData
()))
{
return
workCompleted
.
getProperties
().
getData
();
}
List
<
Item
>
items
=
business
.
entityManagerContainer
().
listEqualAndEqual
(
Item
.
class
,
Item
.
bundle_FIELDNAME
,
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/workcompleted/ActionMergeWithProcess.java
浏览文件 @
abe0a71a
...
...
@@ -20,15 +20,14 @@ import com.x.base.core.entity.dataitem.DataItemConverter;
import
com.x.base.core.entity.dataitem.ItemCategory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WrapInteger
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.assemble.designer.Business
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.Record
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.WorkCompleted_
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Process
;
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/BaseAction.java
浏览文件 @
abe0a71a
...
...
@@ -188,6 +188,8 @@ abstract class BaseAction extends StandardJaxrsAction {
public
static
class
AbstractWo
extends
GsonPropertyObject
{
private
String
id
;
private
WoForm
form
;
private
Map
<
String
,
WoForm
>
relatedFormMap
=
new
HashMap
<>();
...
...
@@ -218,6 +220,15 @@ abstract class BaseAction extends StandardJaxrsAction {
this
.
relatedScriptMap
=
relatedScriptMap
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/FormAction.java
浏览文件 @
abe0a71a
...
...
@@ -141,23 +141,78 @@ public class FormAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
// @JaxrsMethodDescribe(value = "V2根据工作或完成工作标识获取表单,合并关联表单和关联脚本输出.", action = V2GetWithWorkOrWorkCompleted.class)
// @GET
// @Path("v2/workorworkcompleted/{workOrWorkCompleted}")
// @Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
// @Consumes(MediaType.APPLICATION_JSON)
// public void V2GetWithWorkOrWorkCompleted(@Suspended final AsyncResponse asyncResponse,
// @Context HttpServletRequest request,
// @JaxrsParameterDescribe("工作或完成工作标识") @PathParam("workOrWorkCompleted") String workOrWorkCompleted) {
// ActionResult<V2GetWithWorkOrWorkCompleted.Wo> result = new ActionResult<>();
// EffectivePerson effectivePerson = this.effectivePerson(request);
// try {
// result = new V2GetWithWorkOrWorkCompleted().execute(effectivePerson, workOrWorkCompleted);
// } catch (Exception e) {
// logger.error(e, effectivePerson, request, null);
// result.error(e);
// }
// asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
// }
@JaxrsMethodDescribe
(
value
=
"查询表单,如果有表单那么返回表单id,如果使用的是combine的表单直接返回内容."
,
action
=
V2LookupWorkOrWorkCompleted
.
class
)
@GET
@Path
(
"v2/lookup/workorworkcompleted/{workOrWorkCompleted}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
V2LookupWorkOrWorkCompleted
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作或已完成工作标识"
)
@PathParam
(
"workOrWorkCompleted"
)
String
workOrWorkCompleted
)
{
ActionResult
<
V2LookupWorkOrWorkCompleted
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2LookupWorkOrWorkCompleted
().
execute
(
effectivePerson
,
workOrWorkCompleted
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"查询移动端表单,如果有表单那么返回表单id,如果使用的是combine的表单直接返回内容."
,
action
=
V2LookupWorkOrWorkCompletedMobile
.
class
)
@GET
@Path
(
"v2/lookup/workorworkcompleted/{workOrWorkCompleted}/mobile"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
V2LookupWorkOrWorkCompletedMobile
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作或已完成工作标识"
)
@PathParam
(
"workOrWorkCompleted"
)
String
workOrWorkCompleted
)
{
ActionResult
<
V2LookupWorkOrWorkCompletedMobile
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2LookupWorkOrWorkCompletedMobile
().
execute
(
effectivePerson
,
workOrWorkCompleted
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取表单."
,
action
=
V2Get
.
class
)
@GET
@Path
(
"v2/{id}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
V2Get
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
)
{
ActionResult
<
V2Get
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2Get
().
execute
(
effectivePerson
,
id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取表单Mobile."
,
action
=
V2GetMobile
.
class
)
@GET
@Path
(
"v2/{id}/mobile"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
V2GetMobile
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"标识"
)
@PathParam
(
"id"
)
String
id
)
{
ActionResult
<
V2GetMobile
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
V2GetMobile
().
execute
(
effectivePerson
,
id
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2Get.java
0 → 100644
浏览文件 @
abe0a71a
package
com.x.processplatform.assemble.surface.jaxrs.form
;
import
java.util.Map.Entry
;
import
java.util.Objects
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.content.WorkCompletedProperties
;
import
com.x.processplatform.core.entity.element.Form
;
import
com.x.processplatform.core.entity.element.Script
;
class
V2Get
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2Get
.
class
);
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
);
Form
form
=
emc
.
find
(
id
,
Form
.
class
);
if
(
Objects
.
isNull
(
form
))
{
throw
new
ExceptionEntityNotExist
(
id
,
Form
.
class
);
}
Wo
wo
=
new
Wo
();
wo
.
setForm
(
toWoFormDataOrMobileData
(
form
));
related
(
business
,
wo
,
form
);
result
.
setData
(
wo
);
return
result
;
}
}
private
void
related
(
Business
business
,
Wo
wo
,
Form
form
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
form
.
getData
()))
{
for
(
String
relatedFormId
:
form
.
getProperties
().
getRelatedFormList
())
{
Form
relatedForm
=
business
.
form
().
pick
(
relatedFormId
);
if
(
null
!=
relatedForm
)
{
wo
.
getRelatedFormMap
().
put
(
relatedFormId
,
toWoFormDataOrMobileData
(
relatedForm
));
}
}
}
else
{
for
(
String
mobileRelatedFormId
:
form
.
getProperties
().
getMobileRelatedFormList
())
{
Form
mobileRelatedForm
=
business
.
form
().
pick
(
mobileRelatedFormId
);
if
(
null
!=
mobileRelatedForm
)
{
wo
.
getRelatedFormMap
().
put
(
mobileRelatedFormId
,
toWoFormMobileDataOrData
(
mobileRelatedForm
));
}
}
}
relatedScript
(
business
,
wo
,
form
);
}
protected
void
relatedScript
(
Business
business
,
AbstractWo
wo
,
Form
form
)
throws
Exception
{
for
(
Entry
<
String
,
String
>
entry
:
form
.
getProperties
().
getRelatedScriptMap
().
entrySet
())
{
switch
(
entry
.
getValue
())
{
case
WorkCompletedProperties
.
Script
.
TYPE_PROCESSPLATFORM
:
Script
relatedScript
=
business
.
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedScript
));
}
break
;
case
WorkCompletedProperties
.
Script
.
TYPE_CMS
:
com
.
x
.
cms
.
core
.
entity
.
element
.
Script
relatedCmsScript
=
business
.
cms
().
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedCmsScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedCmsScript
));
}
break
;
case
WorkCompletedProperties
.
Script
.
TYPE_PORTAL
:
com
.
x
.
portal
.
core
.
entity
.
Script
relatedPortalScript
=
business
.
portal
().
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedPortalScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedPortalScript
));
}
break
;
default
:
break
;
}
}
}
public
static
class
Wo
extends
AbstractWo
{
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2GetMobile.java
0 → 100644
浏览文件 @
abe0a71a
package
com.x.processplatform.assemble.surface.jaxrs.form
;
import
java.util.Objects
;
import
java.util.Map.Entry
;
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
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Audit
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.PropertyTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.jaxrs.form.ActionGetWithWorkOrWorkCompletedMobile.Wo
;
import
com.x.processplatform.assemble.surface.jaxrs.form.BaseAction.AbstractWo
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkCompletedProperties
;
import
com.x.processplatform.core.entity.element.Activity
;
import
com.x.processplatform.core.entity.element.Form
;
import
com.x.processplatform.core.entity.element.Script
;
class
V2GetMobile
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2GetMobile
.
class
);
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
);
Form
form
=
emc
.
find
(
id
,
Form
.
class
);
if
(
Objects
.
isNull
(
form
))
{
throw
new
ExceptionEntityNotExist
(
id
,
Form
.
class
);
}
Wo
wo
=
new
Wo
();
wo
.
setForm
(
toWoFormMobileDataOrData
(
form
));
related
(
business
,
wo
,
form
);
result
.
setData
(
wo
);
return
result
;
}
}
private
void
related
(
Business
business
,
Wo
wo
,
Form
form
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
form
.
getMobileData
()))
{
for
(
String
mobileRelatedFormId
:
form
.
getProperties
().
getMobileRelatedFormList
())
{
Form
relatedForm
=
business
.
form
().
pick
(
mobileRelatedFormId
);
if
(
null
!=
relatedForm
)
{
wo
.
getRelatedFormMap
().
put
(
mobileRelatedFormId
,
toWoFormMobileDataOrData
(
relatedForm
));
}
}
}
else
{
for
(
String
relatedFormId
:
form
.
getProperties
().
getRelatedFormList
())
{
Form
relatedForm
=
business
.
form
().
pick
(
relatedFormId
);
if
(
null
!=
relatedForm
)
{
wo
.
getRelatedFormMap
().
put
(
relatedFormId
,
toWoFormDataOrMobileData
(
relatedForm
));
}
}
}
relatedScript
(
business
,
wo
,
form
);
}
protected
void
relatedScript
(
Business
business
,
AbstractWo
wo
,
Form
form
)
throws
Exception
{
for
(
Entry
<
String
,
String
>
entry
:
form
.
getProperties
().
getMobileRelatedScriptMap
().
entrySet
())
{
switch
(
entry
.
getValue
())
{
case
WorkCompletedProperties
.
Script
.
TYPE_PROCESSPLATFORM
:
Script
relatedScript
=
business
.
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedScript
));
}
break
;
case
WorkCompletedProperties
.
Script
.
TYPE_CMS
:
com
.
x
.
cms
.
core
.
entity
.
element
.
Script
relatedCmsScript
=
business
.
cms
().
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedCmsScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedCmsScript
));
}
break
;
case
WorkCompletedProperties
.
Script
.
TYPE_PORTAL
:
com
.
x
.
portal
.
core
.
entity
.
Script
relatedPortalScript
=
business
.
portal
().
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedPortalScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedPortalScript
));
}
break
;
default
:
break
;
}
}
}
public
static
class
Wo
extends
AbstractWo
{
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2
FindWithWorkOrWorkCompleted2
.java
→
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2
LookupWorkOrWorkCompleted
.java
浏览文件 @
abe0a71a
...
...
@@ -4,14 +4,12 @@ import java.util.Map.Entry;
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
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Audit
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.PropertyTools
;
...
...
@@ -23,56 +21,42 @@ import com.x.processplatform.core.entity.element.Activity;
import
com.x.processplatform.core.entity.element.Form
;
import
com.x.processplatform.core.entity.element.Script
;
class
V2
FindWithWorkOrWorkCompleted2
extends
BaseAction
{
class
V2
LookupWorkOrWorkCompleted
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2
FindWithWorkOrWorkCompleted2
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2
LookupWorkOrWorkCompleted
.
class
);
ActionResult
<
JsonElement
>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Audit
audit
=
logger
.
audit
(
effectivePerson
);
ActionResult
<
JsonElement
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
if
(!
business
.
readableWithWorkOrWorkCompleted
(
effectivePerson
,
workOrWorkCompleted
,
new
ExceptionEntityNotExist
(
workOrWorkCompleted
)))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
JsonElement
wo
=
null
;
Wo
wo
=
new
Wo
();
Work
work
=
emc
.
find
(
workOrWorkCompleted
,
Work
.
class
);
if
(
null
!=
work
)
{
wo
=
gson
.
toJsonTree
(
this
.
work
(
business
,
work
)
);
this
.
work
(
business
,
work
,
wo
);
}
else
{
wo
=
gson
.
toJsonTree
(
this
.
workCompleted
(
business
,
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
))
);
this
.
workCompleted
(
business
,
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
),
wo
);
}
audit
.
log
(
null
,
"查看"
);
result
.
setData
(
wo
);
return
result
;
}
}
private
Wo
work
(
Business
business
,
Work
work
)
throws
Exception
{
Wo
wo
=
new
Wo
();
private
void
work
(
Business
business
,
Work
work
,
Wo
wo
)
throws
Exception
{
String
id
=
work
.
getForm
();
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(!
StringUtils
.
isEmpty
(
id
))
{
wo
.
setId
(
id
);
}
else
{
Activity
activity
=
business
.
getActivity
(
work
);
id
=
PropertyTools
.
getOrElse
(
activity
,
Activity
.
form_FIELDNAME
,
String
.
class
,
""
);
}
if
(
StringUtils
.
isNotEmpty
(
id
))
{
Form
form
=
business
.
form
().
pick
(
id
);
if
(
null
!=
form
)
{
wo
.
setForm
(
toWoFormDataOrMobileData
(
form
));
related
(
business
,
wo
,
form
);
}
}
return
wo
;
wo
.
setId
(
id
);
}
private
Wo
workCompleted
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
Wo
wo
=
new
Wo
();
private
void
workCompleted
(
Business
business
,
WorkCompleted
workCompleted
,
Wo
wo
)
throws
Exception
{
// 先使用当前库的表单,如果不存在使用储存的表单.
if
(
StringUtils
.
isNotEmpty
(
workCompleted
.
getForm
()))
{
Form
form
=
business
.
form
().
pick
(
workCompleted
.
getForm
());
...
...
@@ -92,7 +76,6 @@ class V2FindWithWorkOrWorkCompleted2 extends BaseAction {
}
workCompleted
.
getProperties
().
getRelatedScriptList
().
stream
()
.
forEach
(
o
->
wo
.
getRelatedScriptMap
().
put
(
o
.
getId
(),
toWoScript
(
o
)));
return
wo
;
}
private
void
related
(
Business
business
,
Wo
wo
,
Form
form
)
throws
Exception
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java
0 → 100644
浏览文件 @
abe0a71a
package
com.x.processplatform.assemble.surface.jaxrs.form
;
import
java.util.Map.Entry
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.PropertyTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.jaxrs.form.ActionGetWithWorkOrWorkCompletedMobile.Wo
;
import
com.x.processplatform.assemble.surface.jaxrs.form.BaseAction.AbstractWo
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkCompletedProperties
;
import
com.x.processplatform.core.entity.element.Activity
;
import
com.x.processplatform.core.entity.element.Form
;
import
com.x.processplatform.core.entity.element.Script
;
class
V2LookupWorkOrWorkCompletedMobile
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
V2LookupWorkOrWorkCompletedMobile
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
if
(!
business
.
readableWithWorkOrWorkCompleted
(
effectivePerson
,
workOrWorkCompleted
,
new
ExceptionEntityNotExist
(
workOrWorkCompleted
)))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wo
wo
=
new
Wo
();
Work
work
=
emc
.
find
(
workOrWorkCompleted
,
Work
.
class
);
if
(
null
!=
work
)
{
this
.
work
(
business
,
work
,
wo
);
}
else
{
this
.
workCompleted
(
business
,
emc
.
flag
(
workOrWorkCompleted
,
WorkCompleted
.
class
),
wo
);
}
result
.
setData
(
wo
);
return
result
;
}
}
private
void
work
(
Business
business
,
Work
work
,
Wo
wo
)
throws
Exception
{
String
id
=
work
.
getForm
();
if
(!
StringUtils
.
isEmpty
(
id
))
{
wo
.
setId
(
id
);
}
else
{
Activity
activity
=
business
.
getActivity
(
work
);
id
=
PropertyTools
.
getOrElse
(
activity
,
Activity
.
form_FIELDNAME
,
String
.
class
,
""
);
}
wo
.
setId
(
id
);
}
private
void
workCompleted
(
Business
business
,
WorkCompleted
workCompleted
,
Wo
wo
)
throws
Exception
{
// 先使用当前库的表单,如果不存在使用储存的表单.
if
(
StringUtils
.
isNotEmpty
(
workCompleted
.
getForm
()))
{
Form
form
=
business
.
form
().
pick
(
workCompleted
.
getForm
());
if
(
null
!=
form
)
{
wo
.
setForm
(
toWoFormDataOrMobileData
(
form
));
related
(
business
,
wo
,
form
);
}
}
else
if
(
null
!=
workCompleted
.
getProperties
().
getForm
())
{
wo
.
setForm
(
toWoFormDataOrMobileData
(
workCompleted
.
getProperties
().
getForm
()));
if
(
StringUtils
.
isNotBlank
(
workCompleted
.
getProperties
().
getForm
().
getData
()))
{
workCompleted
.
getProperties
().
getRelatedFormList
()
.
forEach
(
o
->
wo
.
getRelatedFormMap
().
put
(
o
.
getId
(),
toWoFormDataOrMobileData
(
o
)));
}
else
{
workCompleted
.
getProperties
().
getMobileRelatedFormList
()
.
forEach
(
o
->
wo
.
getRelatedFormMap
().
put
(
o
.
getId
(),
toWoFormMobileDataOrData
(
o
)));
}
}
workCompleted
.
getProperties
().
getRelatedScriptList
().
stream
()
.
forEach
(
o
->
wo
.
getRelatedScriptMap
().
put
(
o
.
getId
(),
toWoScript
(
o
)));
}
private
void
related
(
Business
business
,
Wo
wo
,
Form
form
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
form
.
getMobileData
()))
{
for
(
String
mobileRelatedFormId
:
form
.
getProperties
().
getMobileRelatedFormList
())
{
Form
relatedForm
=
business
.
form
().
pick
(
mobileRelatedFormId
);
if
(
null
!=
relatedForm
)
{
wo
.
getRelatedFormMap
().
put
(
mobileRelatedFormId
,
toWoFormMobileDataOrData
(
relatedForm
));
}
}
}
else
{
for
(
String
relatedFormId
:
form
.
getProperties
().
getRelatedFormList
())
{
Form
relatedForm
=
business
.
form
().
pick
(
relatedFormId
);
if
(
null
!=
relatedForm
)
{
wo
.
getRelatedFormMap
().
put
(
relatedFormId
,
toWoFormDataOrMobileData
(
relatedForm
));
}
}
}
relatedScript
(
business
,
wo
,
form
);
}
protected
void
relatedScript
(
Business
business
,
AbstractWo
wo
,
Form
form
)
throws
Exception
{
for
(
Entry
<
String
,
String
>
entry
:
form
.
getProperties
().
getMobileRelatedScriptMap
().
entrySet
())
{
switch
(
entry
.
getValue
())
{
case
WorkCompletedProperties
.
Script
.
TYPE_PROCESSPLATFORM
:
Script
relatedScript
=
business
.
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedScript
));
}
break
;
case
WorkCompletedProperties
.
Script
.
TYPE_CMS
:
com
.
x
.
cms
.
core
.
entity
.
element
.
Script
relatedCmsScript
=
business
.
cms
().
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedCmsScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedCmsScript
));
}
break
;
case
WorkCompletedProperties
.
Script
.
TYPE_PORTAL
:
com
.
x
.
portal
.
core
.
entity
.
Script
relatedPortalScript
=
business
.
portal
().
script
().
pick
(
entry
.
getKey
());
if
(
null
!=
relatedPortalScript
)
{
wo
.
getRelatedScriptMap
().
put
(
entry
.
getKey
(),
toWoScript
(
relatedPortalScript
));
}
break
;
default
:
break
;
}
}
}
public
static
class
Wo
extends
AbstractWo
{
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/work/ActionGetWithWorkOrWorkCompleted.java
浏览文件 @
abe0a71a
...
...
@@ -166,18 +166,6 @@ class ActionGetWithWorkOrWorkCompleted extends BaseAction {
for
(
WoTask
task
:
wo
.
getTaskList
())
{
if
(
effectivePerson
.
isPerson
(
task
.
getPerson
()))
{
wo
.
setCurrentTaskIndex
(
loop
);
// /* 发送抢办信号 */
// if (Objects.equals(ManualMode.grab, wo.getActivity().getManualMode())) {
// CompletableFuture.runAsync(() -> {
// try {
// ThisApplication.context().applications().getQuery(
// x_processplatform_service_processing.class,
// Applications.joinQueryUri("task", task.getId(), "grab"));
// } catch (Exception e) {
// logger.error(e);
// }
// });
// }
break
;
}
loop
++;
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompleted.java
浏览文件 @
abe0a71a
...
...
@@ -16,6 +16,11 @@ import javax.persistence.Temporal;
import
javax.persistence.TemporalType
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.openjpa.persistence.Persistent
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
org.apache.openjpa.persistence.jdbc.Strategy
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
...
...
@@ -26,12 +31,6 @@ import com.x.base.core.project.tools.DateTools;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.core.entity.PersistenceProperties
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.openjpa.persistence.Persistent
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
org.apache.openjpa.persistence.jdbc.Strategy
;
@Entity
@ContainerEntity
(
dumpSize
=
100
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@Table
(
name
=
PersistenceProperties
.
Content
.
WorkCompleted
.
table
,
uniqueConstraints
=
{
...
...
@@ -155,10 +154,6 @@ public class WorkCompleted extends SliceJpaObject implements ProjectionInterface
}
}
public
Boolean
getMerged
()
{
return
BooleanUtils
.
isTrue
(
merged
);
}
public
static
final
String
job_FIELDNAME
=
"job"
;
@FieldDescribe
(
"工作"
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
job_FIELDNAME
)
...
...
@@ -375,7 +370,7 @@ public class WorkCompleted extends SliceJpaObject implements ProjectionInterface
private
WorkCompletedProperties
properties
;
public
static
final
String
merged_FIELDNAME
=
"merged"
;
@FieldDescribe
(
"
业务数据是否从item表中合并至data字段
"
)
@FieldDescribe
(
"
合并数据
"
)
@Column
(
name
=
ColumnNamePrefix
+
merged_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
merged_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -1047,6 +1042,10 @@ public class WorkCompleted extends SliceJpaObject implements ProjectionInterface
this
.
timeValue02
=
timeValue02
;
}
public
Boolean
getMerged
()
{
return
merged
;
}
public
void
setMerged
(
Boolean
merged
)
{
this
.
merged
=
merged
;
}
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkCompletedProperties.java
浏览文件 @
abe0a71a
...
...
@@ -9,6 +9,15 @@ import com.x.processplatform.core.entity.element.Form;
public
class
WorkCompletedProperties
extends
JsonProperties
{
@FieldDescribe
(
"合并已办对象"
)
private
List
<
TaskCompleted
>
taskCompletedList
=
new
ArrayList
<>();
@FieldDescribe
(
"合并已阅对象"
)
private
List
<
ReadCompleted
>
readCompletedList
=
new
ArrayList
<>();
@FieldDescribe
(
"合并参阅对象"
)
private
List
<
Review
>
reviewList
=
new
ArrayList
<>();
@FieldDescribe
(
"合并记录对象"
)
private
List
<
Record
>
recordList
=
new
ArrayList
<>();
...
...
@@ -108,6 +117,30 @@ public class WorkCompletedProperties extends JsonProperties {
this
.
mobileRelatedScriptList
=
mobileRelatedScriptList
;
}
public
List
<
TaskCompleted
>
getTaskCompletedList
()
{
return
taskCompletedList
;
}
public
void
setTaskCompletedList
(
List
<
TaskCompleted
>
taskCompletedList
)
{
this
.
taskCompletedList
=
taskCompletedList
;
}
public
List
<
ReadCompleted
>
getReadCompletedList
()
{
return
readCompletedList
;
}
public
void
setReadCompletedList
(
List
<
ReadCompleted
>
readCompletedList
)
{
this
.
readCompletedList
=
readCompletedList
;
}
public
List
<
Review
>
getReviewList
()
{
return
reviewList
;
}
public
void
setReviewList
(
List
<
Review
>
reviewList
)
{
this
.
reviewList
=
reviewList
;
}
public
static
class
Script
{
public
static
final
String
TYPE_PROCESSPLATFORM
=
"processPlatform"
;
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ThisApplication.java
浏览文件 @
abe0a71a
package
com.x.processplatform.service.processing
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.project.Context
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.config.Config
;
...
...
@@ -8,17 +10,15 @@ import com.x.base.core.project.message.MessageConnector;
import
com.x.processplatform.service.processing.processor.embed.SyncEmbedQueue
;
import
com.x.processplatform.service.processing.processor.invoke.SyncJaxrsInvokeQueue
;
import
com.x.processplatform.service.processing.processor.invoke.SyncJaxwsInvokeQueue
;
import
com.x.processplatform.service.processing.schedule.Combine
;
import
com.x.processplatform.service.processing.schedule.DeleteDraft
;
import
com.x.processplatform.service.processing.schedule.Expire
;
import
com.x.processplatform.service.processing.schedule.LogLongDetained
;
import
com.x.processplatform.service.processing.schedule.Merge
;
import
com.x.processplatform.service.processing.schedule.PassExpired
;
import
com.x.processplatform.service.processing.schedule.TouchDelay
;
import
com.x.processplatform.service.processing.schedule.TouchDetained
;
import
com.x.processplatform.service.processing.schedule.Urge
;
import
org.apache.commons.lang3.BooleanUtils
;
public
class
ThisApplication
{
private
ThisApplication
()
{
...
...
@@ -51,8 +51,8 @@ public class ThisApplication {
context
().
startQueue
(
syncJaxrsInvokeQueue
);
context
().
startQueue
(
syncJaxwsInvokeQueue
);
context
().
startQueue
(
syncEmbedQueue
);
if
(
BooleanUtils
.
isTrue
(
Config
.
processPlatform
().
get
Combin
e
().
getEnable
()))
{
context
.
schedule
(
Combine
.
class
,
Config
.
processPlatform
().
getCombin
e
().
getCron
());
if
(
BooleanUtils
.
isTrue
(
Config
.
processPlatform
().
get
Merg
e
().
getEnable
()))
{
context
.
schedule
(
Merge
.
class
,
Config
.
processPlatform
().
getMerg
e
().
getCron
());
}
if
(
BooleanUtils
.
isTrue
(
Config
.
processPlatform
().
getDeleteDraft
().
getEnable
()))
{
context
.
schedule
(
DeleteDraft
.
class
,
Config
.
processPlatform
().
getDeleteDraft
().
getCron
());
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/data/ActionUpdateWithWorkCompletedPrimitivePath0.java
浏览文件 @
abe0a71a
...
...
@@ -5,7 +5,6 @@ import java.util.concurrent.Callable;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.google.gson.Gson
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.dataitem.ItemPrimitiveType
;
...
...
@@ -26,7 +25,7 @@ import com.x.query.core.entity.Item;
class
ActionUpdateWithWorkCompletedPrimitivePath0
extends
BaseAction
{
/*
* 更新workCompletedPath0 基本类型数据
*
*
/
*/
@ActionLogger
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionUpdateWithWorkCompletedPrimitivePath0
.
class
);
...
...
@@ -38,7 +37,8 @@ class ActionUpdateWithWorkCompletedPrimitivePath0 extends BaseAction {
String
executorSeed
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
WorkCompleted
workCompleted
=
emc
.
fetch
(
id
,
WorkCompleted
.
class
,
ListTools
.
toList
(
WorkCompleted
.
job_FIELDNAME
));
WorkCompleted
workCompleted
=
emc
.
fetch
(
id
,
WorkCompleted
.
class
,
ListTools
.
toList
(
WorkCompleted
.
job_FIELDNAME
));
if
(
null
==
workCompleted
)
{
throw
new
ExceptionEntityNotExist
(
id
,
WorkCompleted
.
class
);
}
...
...
@@ -63,25 +63,26 @@ class ActionUpdateWithWorkCompletedPrimitivePath0 extends BaseAction {
if
(
1
==
exists
.
size
())
{
Item
existsItem
=
exists
.
get
(
0
);
if
(
existsItem
.
getItemType
().
equals
(
ItemType
.
p
)
||
existsItem
.
getItemType
().
equals
(
ItemType
.
n
))
{
if
(
existsItem
.
getItemType
().
equals
(
ItemType
.
p
)
||
existsItem
.
getItemType
().
equals
(
ItemType
.
n
))
{
if
(
existsItem
.
getItemPrimitiveType
().
equals
(
ItemPrimitiveType
.
s
))
{
//字符
//
字符
existsItem
.
setStringShortValue
(
val
);
}
if
(
existsItem
.
getItemPrimitiveType
().
equals
(
ItemPrimitiveType
.
b
))
{
//Boolean
//
Boolean
existsItem
.
setBooleanValue
(
Boolean
.
parseBoolean
(
val
));
}
if
(
existsItem
.
getItemPrimitiveType
().
equals
(
ItemPrimitiveType
.
n
))
{
//number
//
number
existsItem
.
setNumberValue
(
Double
.
parseDouble
(
val
));
}
if
(
existsItem
.
getItemPrimitiveType
().
equals
(
ItemPrimitiveType
.
u
))
{
//这是啥?问狗哥去吧。
//
这是啥?问狗哥去吧。
existsItem
.
setStringShortValue
(
val
);
}
business
.
entityManagerContainer
().
beginTransaction
(
Item
.
class
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionCombine.java
浏览文件 @
abe0a71a
...
...
@@ -6,14 +6,14 @@ 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.processplatform.service.processing.ThisApplication
;
import
com.x.processplatform.service.processing.schedule.
Combin
e
;
import
com.x.processplatform.service.processing.schedule.
Merg
e
;
class
ActionCombine
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ThisApplication
.
context
().
scheduleLocal
(
Combin
e
.
class
,
1
);
ThisApplication
.
context
().
scheduleLocal
(
Merg
e
.
class
,
1
);
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/workcompleted/ActionCombine.java
浏览文件 @
abe0a71a
...
...
@@ -5,6 +5,7 @@ import java.util.Comparator;
import
java.util.Date
;
import
java.util.List
;
import
java.util.concurrent.Callable
;
import
java.util.stream.Collectors
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -22,7 +23,10 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.DocumentVersion
;
import
com.x.processplatform.core.entity.content.ReadCompleted
;
import
com.x.processplatform.core.entity.content.Record
;
import
com.x.processplatform.core.entity.content.Review
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkLog
;
import
com.x.processplatform.service.processing.Business
;
...
...
@@ -66,14 +70,17 @@ class ActionCombine extends BaseAction {
workCompleted
=
emc
.
find
(
id
,
WorkCompleted
.
class
);
Business
business
=
new
Business
(
emc
);
if
(
null
!=
workCompleted
)
{
emc
.
beginTransaction
(
WorkCompleted
.
class
);
List
<
Item
>
items
=
mergeItem
(
business
,
workCompleted
);
List
<
WorkLog
>
workLogs
=
mergeWorkLog
(
business
,
workCompleted
);
List
<
Record
>
records
=
mergeRecord
(
business
,
workCompleted
);
List
<
DocumentVersion
>
documentVersions
=
listDocumentVersion
(
business
,
workCompleted
);
List
<
Item
>
items
=
combineItem
(
business
,
workCompleted
);
List
<
TaskCompleted
>
taskCompleteds
=
combineTaskCompleted
(
business
,
workCompleted
);
List
<
ReadCompleted
>
readCompleteds
=
combineReadCompleted
(
business
,
workCompleted
);
List
<
Review
>
reviews
=
combineReview
(
business
,
workCompleted
);
List
<
WorkLog
>
workLogs
=
combineWorkLog
(
business
,
workCompleted
);
List
<
Record
>
records
=
combineRecord
(
business
,
workCompleted
);
emc
.
beginTransaction
(
WorkCompleted
.
class
);
workCompleted
.
setMerged
(
true
);
emc
.
commit
();
this
.
remove
(
business
,
items
,
workLogs
,
records
,
documentVersions
);
this
.
remove
(
business
,
items
,
workLogs
,
records
,
documentVersions
);
logger
.
print
(
"已完成工作合并, id: {}, title:{}, sequence:{}."
,
workCompleted
.
getId
(),
workCompleted
.
getTitle
(),
workCompleted
.
getSequence
());
}
...
...
@@ -87,8 +94,8 @@ class ActionCombine extends BaseAction {
return
result
;
}
private
void
remove
(
Business
business
,
List
<
Item
>
items
,
List
<
WorkLog
>
workLogs
,
List
<
Record
>
records
,
List
<
DocumentVersion
>
documentVersions
)
throws
Exception
{
private
void
remove
(
Business
business
,
List
<
Item
>
items
,
List
<
WorkLog
>
workLogs
,
List
<
Record
>
records
,
List
<
DocumentVersion
>
documentVersions
)
throws
Exception
{
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
if
(!
items
.
isEmpty
())
{
emc
.
beginTransaction
(
Item
.
class
);
...
...
@@ -108,7 +115,7 @@ class ActionCombine extends BaseAction {
emc
.
remove
(
o
,
CheckRemoveType
.
all
);
}
}
if
(!
documentVersions
.
isEmpty
())
{
emc
.
beginTransaction
(
DocumentVersion
.
class
);
for
(
DocumentVersion
o
:
documentVersions
)
{
...
...
@@ -118,12 +125,45 @@ class ActionCombine extends BaseAction {
emc
.
commit
();
}
private
List
<
DocumentVersion
>
listDocumentVersion
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
return
business
.
entityManagerContainer
().
listEqual
(
DocumentVersion
.
class
,
DocumentVersion
.
job_FIELDNAME
,
private
List
<
TaskCompleted
>
combineTaskCompleted
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
List
<
TaskCompleted
>
list
=
business
.
entityManagerContainer
().
listEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
job_FIELDNAME
,
workCompleted
.
getJob
());
list
=
list
.
stream
()
.
sorted
(
Comparator
.
comparing
(
TaskCompleted:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)))
.
collect
(
Collectors
.
toList
());
workCompleted
.
getProperties
().
setTaskCompletedList
(
list
);
return
list
;
}
private
List
<
ReadCompleted
>
combineReadCompleted
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
List
<
ReadCompleted
>
list
=
business
.
entityManagerContainer
().
listEqual
(
ReadCompleted
.
class
,
ReadCompleted
.
job_FIELDNAME
,
workCompleted
.
getJob
());
list
=
list
.
stream
()
.
sorted
(
Comparator
.
comparing
(
ReadCompleted:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)))
.
collect
(
Collectors
.
toList
());
workCompleted
.
getProperties
().
setReadCompletedList
(
list
);
return
list
;
}
private
List
<
Review
>
combineReview
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
List
<
Review
>
list
=
business
.
entityManagerContainer
().
listEqual
(
Review
.
class
,
Review
.
job_FIELDNAME
,
workCompleted
.
getJob
());
list
=
list
.
stream
()
.
sorted
(
Comparator
.
comparing
(
Review:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)))
.
collect
(
Collectors
.
toList
());
workCompleted
.
getProperties
().
setReviewList
(
list
);
return
list
;
}
private
List
<
Item
>
mergeItem
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
private
List
<
DocumentVersion
>
listDocumentVersion
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
return
business
.
entityManagerContainer
().
listEqual
(
DocumentVersion
.
class
,
DocumentVersion
.
job_FIELDNAME
,
workCompleted
.
getJob
());
}
private
List
<
Item
>
combineItem
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
List
<
Item
>
list
=
business
.
entityManagerContainer
().
listEqualAndEqual
(
Item
.
class
,
Item
.
bundle_FIELDNAME
,
workCompleted
.
getJob
(),
Item
.
itemCategory_FIELDNAME
,
ItemCategory
.
pp
);
DataItemConverter
<
Item
>
converter
=
new
DataItemConverter
<
Item
>(
Item
.
class
);
...
...
@@ -132,7 +172,7 @@ class ActionCombine extends BaseAction {
return
list
;
}
private
List
<
Record
>
merg
eRecord
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
private
List
<
Record
>
combin
eRecord
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
List
<
Record
>
list
=
business
.
entityManagerContainer
().
listEqual
(
Record
.
class
,
Record
.
job_FIELDNAME
,
workCompleted
.
getJob
());
Collections
.
sort
(
list
,
Comparator
.
comparing
(
Record:
:
getOrder
,
Comparator
.
nullsLast
(
Long:
:
compareTo
)));
...
...
@@ -140,13 +180,14 @@ class ActionCombine extends BaseAction {
return
list
;
}
private
List
<
WorkLog
>
merg
eWorkLog
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
private
List
<
WorkLog
>
combin
eWorkLog
(
Business
business
,
WorkCompleted
workCompleted
)
throws
Exception
{
List
<
WorkLog
>
list
=
business
.
entityManagerContainer
().
listEqual
(
WorkLog
.
class
,
WorkCompleted
.
job_FIELDNAME
,
workCompleted
.
getJob
());
Collections
.
sort
(
list
,
Comparator
.
comparing
(
WorkLog:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)));
workCompleted
.
getProperties
().
setWorkLogList
(
list
);
return
list
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/schedule/
Combin
e.java
→
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/schedule/
Merg
e.java
浏览文件 @
abe0a71a
...
...
@@ -13,6 +13,10 @@ import javax.persistence.criteria.Path;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject_
;
...
...
@@ -28,15 +32,11 @@ import com.x.processplatform.core.entity.content.WorkCompleted;
import
com.x.processplatform.core.entity.content.WorkCompleted_
;
import
com.x.processplatform.service.processing.ThisApplication
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
import
fr.opensagres.poi.xwpf.converter.core.utils.StringUtils
;
public
class
Combin
e
extends
AbstractJob
{
public
class
Merg
e
extends
AbstractJob
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
Combin
e
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
Merg
e
.
class
);
@Override
public
void
schedule
(
JobExecutionContext
jobExecutionContext
)
throws
Exception
{
...
...
@@ -78,7 +78,7 @@ public class Combine extends AbstractJob {
private
List
<
WorkCompleted
>
list
(
EntityManagerContainer
emc
,
String
sequence
)
throws
Exception
{
Date
date
=
new
Date
();
date
=
DateUtils
.
addDays
(
date
,
0
-
Config
.
processPlatform
().
get
Combin
e
().
getThresholdDays
());
date
=
DateUtils
.
addDays
(
date
,
0
-
Config
.
processPlatform
().
get
Merg
e
().
getThresholdDays
());
EntityManager
em
=
emc
.
get
(
WorkCompleted
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Tuple
>
cq
=
cb
.
createQuery
(
Tuple
.
class
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录