Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
a7b7b29e
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
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,发现更多精彩内容 >>
提交
a7b7b29e
编写于
7月 19, 2022
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
流程数据发布设计3
上级
7d77c29e
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
541 addition
and
229 deletion
+541
-229
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicBaseEntity.java
...ava/com/x/base/core/entity/dynamic/DynamicBaseEntity.java
+12
-9
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntity.java
...in/java/com/x/base/core/entity/dynamic/DynamicEntity.java
+1
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
.../com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
+14
-1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java
...ain/java/com/x/base/core/project/tools/PropertyTools.java
+13
-4
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_service_processing.java
...se/core/project/x_processplatform_service_processing.java
+1
-1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionEdit.java
...splatform/assemble/designer/jaxrs/process/ActionEdit.java
+4
-0
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGet.java
...ssplatform/assemble/designer/jaxrs/process/ActionGet.java
+5
-31
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGetEnabled.java
...orm/assemble/designer/jaxrs/process/ActionGetEnabled.java
+6
-32
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java
...java/com/x/processplatform/assemble/surface/Business.java
+10
-21
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/PublishFactory.java
...form/assemble/surface/factory/element/PublishFactory.java
+31
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetAllowRerouteTo.java
...semble/surface/jaxrs/process/ActionGetAllowRerouteTo.java
+29
-14
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetComplex.java
...form/assemble/surface/jaxrs/process/ActionGetComplex.java
+19
-16
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Publish.java
...va/com/x/processplatform/core/entity/element/Publish.java
+10
-15
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/PublishProperties.java
...rocessplatform/core/entity/element/PublishProperties.java
+12
-0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/PublishTable.java
...m/x/processplatform/core/entity/element/PublishTable.java
+70
-0
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/log/Signal.java
...in/java/com/x/processplatform/core/entity/log/Signal.java
+49
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java
...atform/service/processing/processor/end/EndProcessor.java
+3
-3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/publish/AbstractPublishProcessor.java
...rocessing/processor/publish/AbstractPublishProcessor.java
+65
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/publish/PublishProcessor.java
...ervice/processing/processor/publish/PublishProcessor.java
+80
-0
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionCreate.java
...m/x/query/assemble/designer/jaxrs/table/ActionCreate.java
+2
-2
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionEdit.java
...com/x/query/assemble/designer/jaxrs/table/ActionEdit.java
+1
-1
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionInsert.java
.../x/query/service/processing/jaxrs/table/ActionInsert.java
+8
-4
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionUpdateWithBundle.java
...ervice/processing/jaxrs/table/ActionUpdateWithBundle.java
+20
-15
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/BaseAction.java
...om/x/query/service/processing/jaxrs/table/BaseAction.java
+76
-60
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicBaseEntity.java
浏览文件 @
a7b7b29e
...
...
@@ -3,23 +3,26 @@ package com.x.base.core.entity.dynamic;
import
com.x.base.core.entity.SliceJpaObject
;
/**
* @author sword
*/
public
class
DynamicBaseEntity
extends
SliceJpaObject
{
private
static
final
long
serialVersionUID
=
-
4334572608549855123L
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
@Override
public
void
onPersist
()
throws
Exception
{
}
private
String
id
=
createId
();
@Override
public
String
getId
()
{
return
null
;
}
/* 以上为 JpaObject 默认字段 */
@Override
public
void
setId
(
String
id
)
{
public
void
onPersist
()
throws
Exception
{
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntity.java
浏览文件 @
a7b7b29e
...
...
@@ -16,6 +16,7 @@ public class DynamicEntity extends GsonPropertyObject {
public
static
final
String
FIELDNAME_SUFFIX
=
"_FIELDNAME"
;
public
static
final
String
JAR_NAME
=
"x_query_dynamic_entity"
;
public
static
final
String
JAR_PREFIX
=
"dynamic_"
;
public
static
final
String
BUNDLE_FIELD
=
"bundle"
;
// public static final String TYPE_string = "string";
// public static final String TYPE_integer = "integer";
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/dynamic/DynamicEntityBuilder.java
浏览文件 @
a7b7b29e
...
...
@@ -90,6 +90,7 @@ public class DynamicEntityBuilder {
.
addAnnotation
(
annotationSpec_table
).
addField
(
fieldSpec_serialVersionUID
).
addField
(
fieldSpec_TABLE
);
this
.
createIdField
(
builder
);
this
.
createBundleField
(
builder
);
this
.
createOnPersistMethod
(
builder
);
this
.
createStringFields
(
builder
);
this
.
createIntegerFields
(
builder
);
...
...
@@ -146,6 +147,18 @@ public class DynamicEntityBuilder {
builder
.
addField
(
fieldSpec
).
addMethod
(
set
).
addMethod
(
get
);
}
/**
* 自建表默认创建bundle属性用于存储流程实例的job
* @param builder
*/
private
void
createBundleField
(
Builder
builder
)
{
Field
bundleField
=
new
Field
();
bundleField
.
setName
(
"bundle"
);
bundleField
.
setDescription
(
"流程实例的JOB"
);
bundleField
.
setType
(
"string"
);
this
.
createField
(
builder
,
bundleField
,
String
.
class
);
}
private
void
createStringFields
(
Builder
builder
)
{
for
(
Field
field
:
ListTools
.
trim
(
dynamicEntity
.
stringFields
(),
true
,
true
))
{
this
.
createField
(
builder
,
field
,
String
.
class
);
...
...
@@ -500,4 +513,4 @@ public class DynamicEntityBuilder {
return
spec
;
}
}
\ No newline at end of file
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/tools/PropertyTools.java
浏览文件 @
a7b7b29e
package
com.x.base.core.project.tools
;
import
java.lang.reflect.Field
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
org.apache.commons.beanutils.PropertyUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -60,4 +57,16 @@ public class PropertyTools {
return
map
;
}
public
static
boolean
hasField
(
Class
<?>
cls
,
String
fieldName
)
{
if
(
StringUtils
.
isBlank
(
fieldName
)){
return
false
;
}
for
(
Field
field
:
FieldUtils
.
getAllFields
(
cls
))
{
if
(
field
.
getName
().
equals
(
fieldName
)){
return
true
;
}
}
return
false
;
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_service_processing.java
浏览文件 @
a7b7b29e
...
...
@@ -45,7 +45,7 @@ import com.x.base.core.project.annotation.ModuleType;
"com.x.processplatform.core.entity.content.Read"
,
"com.x.processplatform.core.entity.content.DocumentVersion"
,
"com.x.processplatform.core.entity.content.SerialNumber"
,
"com.x.processplatform.core.entity.element.End"
,
"com.x.processplatform.core.entity.content.DocSign"
,
"com.x.processplatform.core.entity.content.DocSignScrawl"
,
"com.x.processplatform.core.entity.element.Application"
,
"com.x.processplatform.core.entity.element.Application"
,
"com.x.processplatform.core.entity.element.Publish"
,
"com.x.processplatform.core.entity.element.ApplicationDict"
,
"com.x.processplatform.core.entity.element.ApplicationDictItem"
,
"com.x.processplatform.core.entity.element.Script"
,
"com.x.processplatform.core.entity.element.Cancel"
,
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionEdit.java
浏览文件 @
a7b7b29e
...
...
@@ -2,6 +2,8 @@ package com.x.processplatform.assemble.designer.jaxrs.process;
import
java.util.Date
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.core.entity.element.*
;
import
com.x.processplatform.core.entity.element.Process
;
import
org.apache.commons.beanutils.BeanUtils
;
...
...
@@ -21,6 +23,8 @@ import com.x.processplatform.core.entity.element.wrap.WrapProcess;
class
ActionEdit
extends
BaseAction
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionEdit
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
WrapProcess
wrap
=
this
.
convertToWrapIn
(
jsonElement
,
WrapProcess
.
class
);
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGet.java
浏览文件 @
a7b7b29e
...
...
@@ -5,37 +5,9 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.processplatform.assemble.designer.Business
;
import
com.x.processplatform.core.entity.element.Agent
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Begin
;
import
com.x.processplatform.core.entity.element.Cancel
;
import
com.x.processplatform.core.entity.element.Choice
;
import
com.x.processplatform.core.entity.element.Delay
;
import
com.x.processplatform.core.entity.element.Embed
;
import
com.x.processplatform.core.entity.element.End
;
import
com.x.processplatform.core.entity.element.Invoke
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.Merge
;
import
com.x.processplatform.core.entity.element.Parallel
;
import
com.x.processplatform.core.entity.element.*
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Service
;
import
com.x.processplatform.core.entity.element.Split
;
import
com.x.processplatform.core.entity.element.wrap.WrapAgent
;
import
com.x.processplatform.core.entity.element.wrap.WrapBegin
;
import
com.x.processplatform.core.entity.element.wrap.WrapCancel
;
import
com.x.processplatform.core.entity.element.wrap.WrapChoice
;
import
com.x.processplatform.core.entity.element.wrap.WrapDelay
;
import
com.x.processplatform.core.entity.element.wrap.WrapEmbed
;
import
com.x.processplatform.core.entity.element.wrap.WrapEnd
;
import
com.x.processplatform.core.entity.element.wrap.WrapInvoke
;
import
com.x.processplatform.core.entity.element.wrap.WrapManual
;
import
com.x.processplatform.core.entity.element.wrap.WrapMerge
;
import
com.x.processplatform.core.entity.element.wrap.WrapParallel
;
import
com.x.processplatform.core.entity.element.wrap.WrapProcess
;
import
com.x.processplatform.core.entity.element.wrap.WrapRoute
;
import
com.x.processplatform.core.entity.element.wrap.WrapService
;
import
com.x.processplatform.core.entity.element.wrap.WrapSplit
;
import
com.x.processplatform.core.entity.element.wrap.*
;
class
ActionGet
extends
BaseAction
{
...
...
@@ -89,6 +61,8 @@ class ActionGet extends BaseAction {
business
.
merge
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setParallelList
(
WrapParallel
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Parallel
.
class
,
business
.
parallel
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setPublishList
(
WrapPublish
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Publish
.
class
,
business
.
publish
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setServiceList
(
WrapService
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Service
.
class
,
business
.
service
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setSplitList
(
WrapSplit
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Split
.
class
,
...
...
@@ -99,4 +73,4 @@ class ActionGet extends BaseAction {
return
wo
;
}
}
\ No newline at end of file
}
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/process/ActionGetEnabled.java
浏览文件 @
a7b7b29e
package
com.x.processplatform.assemble.designer.jaxrs.process
;
import
com.x.processplatform.core.entity.element.*
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.wrap.*
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -7,37 +10,6 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.processplatform.assemble.designer.Business
;
import
com.x.processplatform.core.entity.element.Agent
;
import
com.x.processplatform.core.entity.element.Application
;
import
com.x.processplatform.core.entity.element.Begin
;
import
com.x.processplatform.core.entity.element.Cancel
;
import
com.x.processplatform.core.entity.element.Choice
;
import
com.x.processplatform.core.entity.element.Delay
;
import
com.x.processplatform.core.entity.element.Embed
;
import
com.x.processplatform.core.entity.element.End
;
import
com.x.processplatform.core.entity.element.Invoke
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.Merge
;
import
com.x.processplatform.core.entity.element.Parallel
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Service
;
import
com.x.processplatform.core.entity.element.Split
;
import
com.x.processplatform.core.entity.element.wrap.WrapAgent
;
import
com.x.processplatform.core.entity.element.wrap.WrapBegin
;
import
com.x.processplatform.core.entity.element.wrap.WrapCancel
;
import
com.x.processplatform.core.entity.element.wrap.WrapChoice
;
import
com.x.processplatform.core.entity.element.wrap.WrapDelay
;
import
com.x.processplatform.core.entity.element.wrap.WrapEmbed
;
import
com.x.processplatform.core.entity.element.wrap.WrapEnd
;
import
com.x.processplatform.core.entity.element.wrap.WrapInvoke
;
import
com.x.processplatform.core.entity.element.wrap.WrapManual
;
import
com.x.processplatform.core.entity.element.wrap.WrapMerge
;
import
com.x.processplatform.core.entity.element.wrap.WrapParallel
;
import
com.x.processplatform.core.entity.element.wrap.WrapProcess
;
import
com.x.processplatform.core.entity.element.wrap.WrapRoute
;
import
com.x.processplatform.core.entity.element.wrap.WrapService
;
import
com.x.processplatform.core.entity.element.wrap.WrapSplit
;
class
ActionGetEnabled
extends
BaseAction
{
...
...
@@ -97,6 +69,8 @@ class ActionGetEnabled extends BaseAction {
business
.
merge
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setParallelList
(
WrapParallel
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Parallel
.
class
,
business
.
parallel
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setPublishList
(
WrapPublish
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Publish
.
class
,
business
.
publish
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setServiceList
(
WrapService
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Service
.
class
,
business
.
service
().
listWithProcess
(
process
.
getId
()))));
wrap
.
setSplitList
(
WrapSplit
.
outCopier
.
copy
(
business
.
entityManagerContainer
().
list
(
Split
.
class
,
...
...
@@ -106,4 +80,4 @@ class ActionGetEnabled extends BaseAction {
Wo
wo
=
gson
.
fromJson
(
gson
.
toJson
(
wrap
),
Wo
.
class
);
return
wo
;
}
}
\ No newline at end of file
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/Business.java
浏览文件 @
a7b7b29e
...
...
@@ -10,6 +10,7 @@ import java.util.Objects;
import
java.util.zip.ZipEntry
;
import
java.util.zip.ZipOutputStream
;
import
com.x.processplatform.assemble.surface.factory.element.*
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -33,27 +34,6 @@ import com.x.processplatform.assemble.surface.factory.content.TaskFactory;
import
com.x.processplatform.assemble.surface.factory.content.WorkCompletedFactory
;
import
com.x.processplatform.assemble.surface.factory.content.WorkFactory
;
import
com.x.processplatform.assemble.surface.factory.content.WorkLogFactory
;
import
com.x.processplatform.assemble.surface.factory.element.AgentFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ApplicationDictFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ApplicationDictItemFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ApplicationFactory
;
import
com.x.processplatform.assemble.surface.factory.element.BeginFactory
;
import
com.x.processplatform.assemble.surface.factory.element.CancelFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ChoiceFactory
;
import
com.x.processplatform.assemble.surface.factory.element.DelayFactory
;
import
com.x.processplatform.assemble.surface.factory.element.EmbedFactory
;
import
com.x.processplatform.assemble.surface.factory.element.EndFactory
;
import
com.x.processplatform.assemble.surface.factory.element.FileFactory
;
import
com.x.processplatform.assemble.surface.factory.element.FormFactory
;
import
com.x.processplatform.assemble.surface.factory.element.InvokeFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ManualFactory
;
import
com.x.processplatform.assemble.surface.factory.element.MergeFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ParallelFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ProcessFactory
;
import
com.x.processplatform.assemble.surface.factory.element.RouteFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ScriptFactory
;
import
com.x.processplatform.assemble.surface.factory.element.ServiceFactory
;
import
com.x.processplatform.assemble.surface.factory.element.SplitFactory
;
import
com.x.processplatform.assemble.surface.factory.portal.PortalFactory
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Read
;
...
...
@@ -336,6 +316,15 @@ public class Business {
return
parallel
;
}
private
PublishFactory
publish
;
public
PublishFactory
publish
()
throws
Exception
{
if
(
null
==
this
.
publish
)
{
this
.
publish
=
new
PublishFactory
(
this
);
}
return
publish
;
}
private
ServiceFactory
service
;
public
ServiceFactory
service
()
throws
Exception
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/factory/element/PublishFactory.java
0 → 100644
浏览文件 @
a7b7b29e
package
com.x.processplatform.assemble.surface.factory.element
;
import
com.x.base.core.project.exception.ExceptionWhen
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Publish
;
import
java.util.List
;
/**
* @author sword
*/
public
class
PublishFactory
extends
ElementFactory
{
public
PublishFactory
(
Business
abstractBusiness
)
throws
Exception
{
super
(
abstractBusiness
);
}
public
Publish
pick
(
String
flag
)
throws
Exception
{
return
this
.
pick
(
flag
,
ExceptionWhen
.
none
);
}
@Deprecated
public
Publish
pick
(
String
flag
,
ExceptionWhen
exceptionWhen
)
throws
Exception
{
return
this
.
pick
(
flag
,
Publish
.
class
);
}
public
List
<
Publish
>
listWithProcess
(
Process
process
)
throws
Exception
{
return
this
.
listWithProcess
(
Publish
.
class
,
process
);
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetAllowRerouteTo.java
浏览文件 @
a7b7b29e
...
...
@@ -3,6 +3,8 @@ package com.x.processplatform.assemble.surface.jaxrs.process;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.x.processplatform.core.entity.element.*
;
import
com.x.processplatform.core.entity.element.Process
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -15,20 +17,6 @@ import com.x.base.core.project.http.ActionResult;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Agent
;
import
com.x.processplatform.core.entity.element.Begin
;
import
com.x.processplatform.core.entity.element.Cancel
;
import
com.x.processplatform.core.entity.element.Choice
;
import
com.x.processplatform.core.entity.element.Delay
;
import
com.x.processplatform.core.entity.element.Embed
;
import
com.x.processplatform.core.entity.element.End
;
import
com.x.processplatform.core.entity.element.Invoke
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.Merge
;
import
com.x.processplatform.core.entity.element.Parallel
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Service
;
import
com.x.processplatform.core.entity.element.Split
;
class
ActionGetAllowRerouteTo
extends
BaseAction
{
...
...
@@ -52,6 +40,7 @@ class ActionGetAllowRerouteTo extends BaseAction {
wo
.
setManualList
(
this
.
filterManuals
(
business
,
process
));
wo
.
setMergeList
(
this
.
filterMerges
(
business
,
process
));
wo
.
setParallelList
(
this
.
filterParallels
(
business
,
process
));
wo
.
setPublishList
(
this
.
filterPublishes
(
business
,
process
));
wo
.
setServiceList
(
this
.
filterServices
(
business
,
process
));
wo
.
setSplitList
(
this
.
filterSplits
(
business
,
process
));
result
.
setData
(
wo
);
...
...
@@ -77,6 +66,7 @@ class ActionGetAllowRerouteTo extends BaseAction {
private
List
<
WoManual
>
manualList
;
private
List
<
WoMerge
>
mergeList
;
private
List
<
WoParallel
>
parallelList
;
private
List
<
WoPublish
>
publishList
;
private
List
<
WoService
>
serviceList
;
private
List
<
WoSplit
>
splitList
;
...
...
@@ -184,6 +174,13 @@ class ActionGetAllowRerouteTo extends BaseAction {
this
.
splitList
=
splitList
;
}
public
List
<
WoPublish
>
getPublishList
()
{
return
publishList
;
}
public
void
setPublishList
(
List
<
WoPublish
>
publishList
)
{
this
.
publishList
=
publishList
;
}
}
public
static
class
WoAgent
extends
Agent
{
...
...
@@ -263,6 +260,13 @@ class ActionGetAllowRerouteTo extends BaseAction {
ListTools
.
toList
(
Parallel
.
name_FIELDNAME
,
Parallel
.
id_FIELDNAME
),
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoPublish
extends
Publish
{
private
static
final
long
serialVersionUID
=
7325540706018402262L
;
static
WrapCopier
<
Publish
,
WoPublish
>
copier
=
WrapCopierFactory
.
wo
(
Publish
.
class
,
WoPublish
.
class
,
ListTools
.
toList
(
Publish
.
name_FIELDNAME
,
Publish
.
id_FIELDNAME
),
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoService
extends
Service
{
private
static
final
long
serialVersionUID
=
6466513124630937459L
;
...
...
@@ -395,6 +399,17 @@ class ActionGetAllowRerouteTo extends BaseAction {
return
WoParallel
.
copier
.
copy
(
list
);
}
private
List
<
WoPublish
>
filterPublishes
(
Business
business
,
Process
process
)
throws
Exception
{
List
<
Publish
>
os
=
business
.
publish
().
listWithProcess
(
process
);
List
<
Publish
>
list
=
new
ArrayList
<>();
for
(
Publish
o
:
os
)
{
if
(
BooleanUtils
.
isTrue
(
o
.
getAllowRerouteTo
()))
{
list
.
add
(
o
);
}
}
return
WoPublish
.
copier
.
copy
(
list
);
}
private
List
<
WoService
>
filterServices
(
Business
business
,
Process
process
)
throws
Exception
{
List
<
Service
>
os
=
business
.
service
().
listWithProcess
(
process
);
List
<
Service
>
list
=
new
ArrayList
<>();
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/process/ActionGetComplex.java
浏览文件 @
a7b7b29e
...
...
@@ -11,21 +11,8 @@ 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.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.element.Agent
;
import
com.x.processplatform.core.entity.element.Begin
;
import
com.x.processplatform.core.entity.element.Cancel
;
import
com.x.processplatform.core.entity.element.Choice
;
import
com.x.processplatform.core.entity.element.Delay
;
import
com.x.processplatform.core.entity.element.Embed
;
import
com.x.processplatform.core.entity.element.End
;
import
com.x.processplatform.core.entity.element.Invoke
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.Merge
;
import
com.x.processplatform.core.entity.element.Parallel
;
import
com.x.processplatform.core.entity.element.*
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Service
;
import
com.x.processplatform.core.entity.element.Split
;
class
ActionGetComplex
extends
BaseAction
{
...
...
@@ -62,6 +49,7 @@ class ActionGetComplex extends BaseAction {
private
List
<
WoMerge
>
mergeList
;
private
List
<
WoRoute
>
routeList
;
private
List
<
WoParallel
>
parallelList
;
private
List
<
WoPublish
>
publishList
;
private
List
<
WoService
>
serviceList
;
private
List
<
WoSplit
>
splitList
;
...
...
@@ -145,7 +133,7 @@ class ActionGetComplex extends BaseAction {
this
.
mergeList
=
mergeList
;
}
public
List
<
WoParallel
>
getParallelList
()
{
return
parallelList
;
...
...
@@ -179,6 +167,13 @@ class ActionGetComplex extends BaseAction {
this
.
routeList
=
routeList
;
}
public
List
<
WoPublish
>
getPublishList
()
{
return
publishList
;
}
public
void
setPublishList
(
List
<
WoPublish
>
publishList
)
{
this
.
publishList
=
publishList
;
}
}
public
static
class
WoAgent
extends
Agent
{
...
...
@@ -251,7 +246,7 @@ class ActionGetComplex extends BaseAction {
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoParallel
extends
Parallel
{
...
...
@@ -260,6 +255,13 @@ class ActionGetComplex extends BaseAction {
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoPublish
extends
Publish
{
private
static
final
long
serialVersionUID
=
-
4503137257516929365L
;
static
WrapCopier
<
Publish
,
WoPublish
>
copier
=
WrapCopierFactory
.
wo
(
Publish
.
class
,
WoPublish
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoService
extends
Service
{
private
static
final
long
serialVersionUID
=
6466513124630937459L
;
...
...
@@ -296,6 +298,7 @@ class ActionGetComplex extends BaseAction {
wo
.
setManualList
(
WoManual
.
copier
.
copy
(
business
.
manual
().
listWithProcess
(
process
)));
wo
.
setMergeList
(
WoMerge
.
copier
.
copy
(
business
.
merge
().
listWithProcess
(
process
)));
wo
.
setParallelList
(
WoParallel
.
copier
.
copy
(
business
.
parallel
().
listWithProcess
(
process
)));
wo
.
setPublishList
(
WoPublish
.
copier
.
copy
(
business
.
publish
().
listWithProcess
(
process
)));
wo
.
setServiceList
(
WoService
.
copier
.
copy
(
business
.
service
().
listWithProcess
(
process
)));
wo
.
setSplitList
(
WoSplit
.
copier
.
copy
(
business
.
split
().
listWithProcess
(
process
)));
wo
.
setRouteList
(
WoRoute
.
copier
.
copy
(
business
.
route
().
listWithProcess
(
process
)));
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Publish.java
浏览文件 @
a7b7b29e
...
...
@@ -59,6 +59,7 @@ public class Publish extends Activity {
public
void
postLoad
()
{
if
(
null
!=
this
.
properties
)
{
this
.
customData
=
this
.
getProperties
().
getCustomData
();
this
.
publishTableList
=
this
.
getProperties
().
getPublishTableList
();
}
}
...
...
@@ -467,17 +468,9 @@ public class Publish extends Activity {
@CheckPersist
(
allowEmpty
=
true
)
private
String
targetAssignDataScriptText
;
public
static
final
String
updateTableList_FIELDNAME
=
"updateTableList"
;
@FieldDescribe
(
"发布目标数据表."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
updateTableList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
updateTableList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
updateTableList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
updateTableList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
private
List
<
String
>
updateTableList
;
@FieldDescribe
(
"发布的数据表"
)
@Transient
private
List
<
PublishTable
>
publishTableList
;
@IdReference
(
Script
.
class
)
@FieldDescribe
(
"生成displayLog脚本."
)
...
...
@@ -998,11 +991,13 @@ public class Publish extends Activity {
this
.
targetAssignDataScriptText
=
targetAssignDataScriptText
;
}
public
List
<
String
>
getUpdate
TableList
()
{
return
update
TableList
;
public
List
<
PublishTable
>
getPublish
TableList
()
{
return
publish
TableList
;
}
public
void
setUpdateTableList
(
List
<
String
>
updateTableList
)
{
this
.
updateTableList
=
updateTableList
;
public
void
setPublishTableList
(
List
<
PublishTable
>
publishTableList
)
{
this
.
publishTableList
=
publishTableList
;
this
.
getProperties
().
setPublishTableList
(
publishTableList
);
}
}
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/PublishProperties.java
浏览文件 @
a7b7b29e
...
...
@@ -4,6 +4,8 @@ import com.google.gson.JsonElement;
import
com.x.base.core.entity.JsonProperties
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
java.util.List
;
/**
* @author sword
*/
...
...
@@ -14,6 +16,9 @@ public class PublishProperties extends JsonProperties {
@FieldDescribe
(
"活动自定义数据"
)
private
JsonElement
customData
;
@FieldDescribe
(
"发布的数据表"
)
private
List
<
PublishTable
>
publishTableList
;
public
JsonElement
getCustomData
()
{
return
customData
;
}
...
...
@@ -22,4 +27,11 @@ public class PublishProperties extends JsonProperties {
this
.
customData
=
customData
;
}
public
List
<
PublishTable
>
getPublishTableList
()
{
return
publishTableList
;
}
public
void
setPublishTableList
(
List
<
PublishTable
>
publishTableList
)
{
this
.
publishTableList
=
publishTableList
;
}
}
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/PublishTable.java
0 → 100644
浏览文件 @
a7b7b29e
package
com.x.processplatform.core.entity.element
;
import
com.x.base.core.entity.JsonProperties
;
import
com.x.base.core.project.annotation.FieldDescribe
;
/**
* @author sword
*/
public
class
PublishTable
extends
JsonProperties
{
private
static
final
long
serialVersionUID
=
6232849915945948766L
;
public
static
final
String
TABLE_DATA_BY_SCRIPT
=
"script"
;
public
static
final
String
TABLE_DATA_BY_PATH
=
"dataPath"
;
@FieldDescribe
(
"数据表名称"
)
private
String
tableName
;
@FieldDescribe
(
"获取数据方式"
)
private
String
queryTableDataBy
;
@FieldDescribe
(
"数据路径"
)
private
String
queryTableDataPath
;
@FieldDescribe
(
"数据脚本."
)
private
String
targetAssignDataScript
;
@FieldDescribe
(
"数据脚本文本."
)
private
String
targetAssignDataScriptText
;
public
String
getTableName
()
{
return
tableName
;
}
public
void
setTableName
(
String
tableName
)
{
this
.
tableName
=
tableName
;
}
public
String
getQueryTableDataBy
()
{
return
queryTableDataBy
;
}
public
void
setQueryTableDataBy
(
String
queryTableDataBy
)
{
this
.
queryTableDataBy
=
queryTableDataBy
;
}
public
String
getQueryTableDataPath
()
{
return
queryTableDataPath
;
}
public
void
setQueryTableDataPath
(
String
queryTableDataPath
)
{
this
.
queryTableDataPath
=
queryTableDataPath
;
}
public
String
getTargetAssignDataScript
()
{
return
targetAssignDataScript
;
}
public
void
setTargetAssignDataScript
(
String
targetAssignDataScript
)
{
this
.
targetAssignDataScript
=
targetAssignDataScript
;
}
public
String
getTargetAssignDataScriptText
()
{
return
targetAssignDataScriptText
;
}
public
void
setTargetAssignDataScriptText
(
String
targetAssignDataScriptText
)
{
this
.
targetAssignDataScriptText
=
targetAssignDataScriptText
;
}
}
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/log/Signal.java
浏览文件 @
a7b7b29e
...
...
@@ -729,6 +729,55 @@ public class Signal extends GsonPropertyObject {
return
p
;
}
private
PublishArrive
publishArrive
;
private
PublishExecute
publishExecute
;
private
PublishInquire
publishInquire
;
public
PublishArrive
getPublishArrive
()
{
return
publishArrive
;
}
public
PublishExecute
getPublishExecute
()
{
return
publishExecute
;
}
public
PublishInquire
getPublishInquire
()
{
return
publishInquire
;
}
public
static
class
PublishArrive
extends
Base
{
}
public
static
Signal
publishArrive
(
String
activityToken
,
Activity
activity
)
{
Signal
p
=
new
Signal
(
activityToken
,
activity
);
PublishArrive
s
=
new
PublishArrive
();
p
.
publishArrive
=
s
;
return
p
;
}
public
static
class
PublishExecute
extends
Base
{
}
public
static
Signal
publishExecute
(
String
activityToken
,
Activity
activity
)
{
Signal
p
=
new
Signal
(
activityToken
,
activity
);
PublishExecute
s
=
new
PublishExecute
();
p
.
publishExecute
=
s
;
return
p
;
}
public
static
class
PublishInquire
extends
Base
{
}
public
static
Signal
publishInquire
(
String
activityToken
,
Activity
activity
)
{
Signal
p
=
new
Signal
(
activityToken
,
activity
);
PublishInquire
s
=
new
PublishInquire
();
p
.
publishInquire
=
s
;
return
p
;
}
private
String
name
;
private
String
alias
;
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java
浏览文件 @
a7b7b29e
...
...
@@ -265,8 +265,8 @@ public class EndProcessor extends AbstractEndProcessor {
/**
* 触发在等待状态的父文档
*
* @param
parentW
orkId
*
* @param
w
orkId
*/
private
void
touchWork
(
String
workId
)
{
new
Thread
(
EndProcessor
.
class
.
getName
()
+
"_touchWork"
)
{
...
...
@@ -304,4 +304,4 @@ public class EndProcessor extends AbstractEndProcessor {
workCompleted
.
setActivityName
(
end
.
getName
());
return
workCompleted
;
}
}
\ No newline at end of file
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/publish/AbstractPublishProcessor.java
0 → 100644
浏览文件 @
a7b7b29e
package
com.x.processplatform.service.processing.processor.publish
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.Publish
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.service.processing.processor.AbstractProcessor
;
import
com.x.processplatform.service.processing.processor.AeiObjects
;
import
java.util.List
;
abstract
class
AbstractPublishProcessor
extends
AbstractProcessor
{
protected
AbstractPublishProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
super
(
entityManagerContainer
);
}
@Override
protected
Work
arriveProcessing
(
AeiObjects
aeiObjects
)
throws
Exception
{
Publish
publish
=
(
Publish
)
aeiObjects
.
getActivity
();
return
arriving
(
aeiObjects
,
publish
);
}
@Override
protected
List
<
Work
>
executeProcessing
(
AeiObjects
aeiObjects
)
throws
Exception
{
Publish
publish
=
(
Publish
)
aeiObjects
.
getActivity
();
return
executing
(
aeiObjects
,
publish
);
}
@Override
protected
List
<
Route
>
inquireProcessing
(
AeiObjects
aeiObjects
)
throws
Exception
{
Publish
publish
=
(
Publish
)
aeiObjects
.
getActivity
();
return
inquiring
(
aeiObjects
,
publish
);
}
protected
abstract
Work
arriving
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
;
protected
abstract
List
<
Work
>
executing
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
;
protected
abstract
List
<
Route
>
inquiring
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
;
@Override
protected
void
arriveCommitted
(
AeiObjects
aeiObjects
)
throws
Exception
{
Publish
publish
=
(
Publish
)
aeiObjects
.
getActivity
();
this
.
arrivingCommitted
(
aeiObjects
,
publish
);
}
@Override
protected
void
executeCommitted
(
AeiObjects
aeiObjects
,
List
<
Work
>
works
)
throws
Exception
{
Publish
publish
=
(
Publish
)
aeiObjects
.
getActivity
();
this
.
executingCommitted
(
aeiObjects
,
publish
,
works
);
}
@Override
protected
void
inquireCommitted
(
AeiObjects
aeiObjects
)
throws
Exception
{
Publish
publish
=
(
Publish
)
aeiObjects
.
getActivity
();
this
.
inquiringCommitted
(
aeiObjects
,
publish
);
}
protected
abstract
void
arrivingCommitted
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
;
protected
abstract
void
executingCommitted
(
AeiObjects
aeiObjects
,
Publish
publish
,
List
<
Work
>
works
)
throws
Exception
;
protected
abstract
void
inquiringCommitted
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
;
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/publish/PublishProcessor.java
0 → 100644
浏览文件 @
a7b7b29e
package
com.x.processplatform.service.processing.processor.publish
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.Embed
;
import
com.x.processplatform.core.entity.element.Publish
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.log.Signal
;
import
com.x.processplatform.service.processing.processor.AeiObjects
;
import
org.apache.commons.lang3.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 数据发布节点处理器
* @author sword
*/
public
class
PublishProcessor
extends
AbstractPublishProcessor
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
PublishProcessor
.
class
);
public
PublishProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
super
(
entityManagerContainer
);
}
@Override
protected
Work
arriving
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
{
// 发送ProcessingSignal
aeiObjects
.
getProcessingAttributes
()
.
push
(
Signal
.
publishArrive
(
aeiObjects
.
getWork
().
getActivityToken
(),
publish
));
return
aeiObjects
.
getWork
();
}
@Override
protected
void
arrivingCommitted
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
{
// Do nothing
}
@Override
protected
List
<
Work
>
executing
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
{
// 发送ProcessingSignal
aeiObjects
.
getProcessingAttributes
()
.
push
(
Signal
.
publishExecute
(
aeiObjects
.
getWork
().
getActivityToken
(),
publish
));
List
<
Work
>
results
=
new
ArrayList
<>();
boolean
passThrough
=
false
;
if
(
passThrough
)
{
results
.
add
(
aeiObjects
.
getWork
());
}
return
results
;
}
@Override
protected
void
executingCommitted
(
AeiObjects
aeiObjects
,
Publish
publish
,
List
<
Work
>
works
)
throws
Exception
{
// Do nothing
}
@Override
protected
List
<
Route
>
inquiring
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
{
// 发送ProcessingSignal
aeiObjects
.
getProcessingAttributes
()
.
push
(
Signal
.
publishInquire
(
aeiObjects
.
getWork
().
getActivityToken
(),
publish
));
List
<
Route
>
results
=
new
ArrayList
<>();
results
.
add
(
aeiObjects
.
getRoutes
().
get
(
0
));
return
results
;
}
@Override
protected
void
inquiringCommitted
(
AeiObjects
aeiObjects
,
Publish
publish
)
throws
Exception
{
// Do nothing
}
private
boolean
hasCmsAssignDataScript
(
Publish
publish
)
{
return
StringUtils
.
isNotEmpty
(
publish
.
getTargetAssignDataScript
())
||
StringUtils
.
isNotEmpty
(
publish
.
getTargetAssignDataScriptText
());
}
}
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionCreate.java
浏览文件 @
a7b7b29e
...
...
@@ -61,7 +61,7 @@ class ActionCreate extends BaseAction {
}
for
(
Field
field
:
dynamicEntity
.
getFieldList
())
{
if
(
JpaObject
.
FieldsDefault
.
stream
().
filter
(
o
->
StringUtils
.
equalsIgnoreCase
(
o
,
field
.
getName
()))
if
(
ListTools
.
toList
(
JpaObject
.
FieldsDefault
,
DynamicEntity
.
BUNDLE_FIELD
)
.
stream
().
filter
(
o
->
StringUtils
.
equalsIgnoreCase
(
o
,
field
.
getName
()))
.
count
()
>
0
)
{
throw
new
ExceptionFieldName
(
field
.
getName
());
}
...
...
@@ -99,4 +99,4 @@ class ActionCreate extends BaseAction {
Table
.
status_FIELDNAME
));
}
}
\ No newline at end of file
}
o2server/x_query_assemble_designer/src/main/java/com/x/query/assemble/designer/jaxrs/table/ActionEdit.java
浏览文件 @
a7b7b29e
...
...
@@ -52,7 +52,7 @@ class ActionEdit extends BaseAction {
}
for
(
Field
field
:
dynamicEntity
.
getFieldList
())
{
if
(
JpaObject
.
FieldsDefault
.
stream
().
filter
(
o
->
StringUtils
.
equalsIgnoreCase
(
o
,
field
.
getName
()))
if
(
ListTools
.
toList
(
JpaObject
.
FieldsDefault
,
DynamicEntity
.
BUNDLE_FIELD
)
.
stream
().
filter
(
o
->
StringUtils
.
equalsIgnoreCase
(
o
,
field
.
getName
()))
.
count
()
>
0
)
{
throw
new
ExceptionFieldName
(
field
.
getName
());
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionInsert.java
浏览文件 @
a7b7b29e
package
com.x.query.service.processing.jaxrs.table
;
import
com.x.base.core.project.tools.StringTools
;
import
org.apache.commons.beanutils.PropertyUtilsBean
;
import
com.google.gson.JsonElement
;
...
...
@@ -17,6 +18,8 @@ import com.x.base.core.project.logger.LoggerFactory;
import
com.x.query.core.entity.schema.Table
;
import
com.x.query.service.processing.Business
;
import
java.util.List
;
class
ActionInsert
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionInsert
.
class
);
...
...
@@ -39,10 +42,11 @@ class ActionInsert extends BaseAction {
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<?
extends
JpaObject
>)
classLoader
.
loadClass
(
dynamicEntity
.
className
());
JpaObject
o
=
update
(
jsonElement
,
cls
);
List
<?
extends
JpaObject
>
list
=
update
(
jsonElement
,
cls
,
null
);
emc
.
beginTransaction
(
cls
);
emc
.
persist
(
o
);
emc
.
check
(
o
,
CheckPersistType
.
all
);
for
(
JpaObject
o
:
list
){
emc
.
persist
(
o
,
CheckPersistType
.
all
);
}
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
...
...
@@ -57,4 +61,4 @@ class ActionInsert extends BaseAction {
}
}
\ No newline at end of file
}
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionUpdateWithBundle.java
浏览文件 @
a7b7b29e
package
com.x.query.service.processing.jaxrs.table
;
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
;
...
...
@@ -14,9 +12,14 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.PropertyTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.query.core.entity.schema.Table
;
import
com.x.query.service.processing.Business
;
import
java.util.List
;
class
ActionUpdateWithBundle
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionUpdateWithBundle
.
class
);
...
...
@@ -31,10 +34,6 @@ class ActionUpdateWithBundle extends BaseAction {
Thread
.
currentThread
().
setContextClassLoader
(
classLoader
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
if
(
StringUtils
.
isEmpty
(
bundle
))
{
throw
new
ExceptionBundleEmpty
();
}
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
LOGGER
.
debug
(
"execute:{}, flag:{}."
,
effectivePerson:
:
getDistinguishedName
,
()
->
flag
);
Table
table
=
emc
.
flag
(
flag
,
Table
.
class
);
...
...
@@ -45,15 +44,21 @@ class ActionUpdateWithBundle extends BaseAction {
@SuppressWarnings
(
"unchecked"
)
Class
<?
extends
JpaObject
>
cls
=
(
Class
<?
extends
JpaObject
>)
classLoader
.
loadClass
(
dynamicEntity
.
className
());
JpaObject
o
=
update
(
jsonElement
,
cls
);
JpaObject
obj
=
emc
.
find
(
bundle
,
cls
);
List
<?
extends
JpaObject
>
list
=
update
(
jsonElement
,
cls
,
bundle
);
List
<?
extends
JpaObject
>
bundleList
=
null
;
if
(
PropertyTools
.
hasField
(
cls
,
DynamicEntity
.
BUNDLE_FIELD
))
{
bundleList
=
emc
.
listEqual
(
cls
,
DynamicEntity
.
BUNDLE_FIELD
,
bundle
);
}
emc
.
beginTransaction
(
cls
);
if
(
null
!=
obj
)
{
o
.
copyTo
(
obj
,
JpaObject
.
FieldsUnmodify
);
emc
.
check
(
obj
,
CheckPersistType
.
all
);
}
else
{
emc
.
persist
(
o
);
emc
.
check
(
o
,
CheckPersistType
.
all
);
if
(
ListTools
.
isNotEmpty
(
bundleList
)){
for
(
JpaObject
o
:
bundleList
){
emc
.
remove
(
o
);
}
for
(
JpaObject
o
:
list
){
o
.
setId
(
StringTools
.
uniqueToken
());
emc
.
persist
(
o
,
CheckPersistType
.
all
);
}
}
emc
.
commit
();
Wo
wo
=
new
Wo
();
...
...
@@ -69,4 +74,4 @@ class ActionUpdateWithBundle extends BaseAction {
}
}
\ No newline at end of file
}
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/BaseAction.java
浏览文件 @
a7b7b29e
...
...
@@ -8,7 +8,9 @@ import java.util.List;
import
javax.persistence.Column
;
import
com.x.base.core.entity.dynamic.DynamicEntity
;
import
org.apache.commons.beanutils.PropertyUtilsBean
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.reflect.FieldUtils
;
import
org.apache.openjpa.persistence.jdbc.ElementColumn
;
...
...
@@ -30,72 +32,86 @@ abstract class BaseAction extends StandardJaxrsAction {
private
PropertyUtilsBean
propertyUtilsBean
=
new
PropertyUtilsBean
();
protected
<
T
extends
JpaObject
>
T
update
(
JsonElement
jsonElement
,
Class
<
T
>
cls
)
protected
<
T
extends
JpaObject
>
List
<
T
>
update
(
JsonElement
jsonElement
,
Class
<
T
>
cls
,
String
bundle
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
,
InstantiationException
,
IllegalArgumentException
,
SecurityException
{
List
<
T
>
list
=
new
ArrayList
<>();
List
<
Field
>
fields
=
FieldUtils
.
getFieldsListWithAnnotation
(
cls
,
Column
.
class
);
T
t
=
cls
.
getConstructor
().
newInstance
();
JsonObject
jsonObject
=
null
;
if
((
jsonElement
!=
null
)
&&
jsonElement
.
isJsonObject
())
{
jsonObject
=
jsonElement
.
getAsJsonObject
();
final
List
<
JsonObject
>
jsonObjectList
=
new
ArrayList
<>();
if
(
jsonElement
.
isJsonObject
())
{
jsonObjectList
.
add
(
jsonElement
.
getAsJsonObject
());
}
else
if
(
jsonElement
.
isJsonArray
()){
JsonArray
jsonArray
=
jsonElement
.
getAsJsonArray
();
jsonArray
.
forEach
(
je
->
{
if
(
je
.
isJsonObject
())
{
jsonObjectList
.
add
(
je
.
getAsJsonObject
());
}
});
}
for
(
Field
field
:
fields
)
{
switch
(
JpaObjectTools
.
type
(
field
))
{
case
JpaObject
.
TYPE_STRING
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractStringOrDistinguishedName
(
getJsonElement
(
jsonObject
,
field
),
getColumnDefinedStringLength
(
field
)));
break
;
case
JpaObject
.
TYPE_INTEGER
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractInteger
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_LONG
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractLong
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_FLOAT
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractFloat
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DOUBLE
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDouble
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DATETIME
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDateTime
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DATE
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDate
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_BOOLEAN
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractBoolean
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_STRINGLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractStringOrDistinguishedNameList
(
getJsonElement
(
jsonObject
,
field
),
getElementColumnDefinedStringLength
(
field
)));
break
;
case
JpaObject
.
TYPE_INTEGERLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractIntegerList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_LONGLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractLongList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_FLOATLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractFloatList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DOUBLELIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDoubleList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DATETIMELIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDateTimeList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_BOOLEANLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractBooleanList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
default
:
break
;
for
(
JsonObject
jsonObject
:
jsonObjectList
)
{
T
t
=
cls
.
getConstructor
().
newInstance
();
for
(
Field
field
:
fields
)
{
switch
(
JpaObjectTools
.
type
(
field
))
{
case
JpaObject
.
TYPE_STRING
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractStringOrDistinguishedName
(
getJsonElement
(
jsonObject
,
field
),
getColumnDefinedStringLength
(
field
)));
break
;
case
JpaObject
.
TYPE_INTEGER
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractInteger
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_LONG
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractLong
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_FLOAT
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractFloat
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DOUBLE
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDouble
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DATETIME
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDateTime
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DATE
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDate
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_BOOLEAN
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractBoolean
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_STRINGLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractStringOrDistinguishedNameList
(
getJsonElement
(
jsonObject
,
field
),
getElementColumnDefinedStringLength
(
field
)));
break
;
case
JpaObject
.
TYPE_INTEGERLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractIntegerList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_LONGLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractLongList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_FLOATLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractFloatList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DOUBLELIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDoubleList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_DATETIMELIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractDateTimeList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
case
JpaObject
.
TYPE_BOOLEANLIST
:
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
extractBooleanList
(
getJsonElement
(
jsonObject
,
field
)));
break
;
default
:
break
;
}
if
(
StringUtils
.
isNotBlank
(
bundle
)
&&
field
.
getName
().
equals
(
DynamicEntity
.
BUNDLE_FIELD
)){
propertyUtilsBean
.
setProperty
(
t
,
field
.
getName
(),
bundle
);
}
}
list
.
add
(
t
);
}
return
t
;
return
lis
t
;
}
private
JsonElement
getJsonElement
(
JsonObject
jsonObject
,
Field
field
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录