Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
5abbcb48
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,发现更多精彩内容 >>
提交
5abbcb48
编写于
12月 20, 2021
作者:
R
Ray
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成脚本替换
上级
88f78ede
变更
48
展开全部
隐藏空白更改
内联
并排
Showing
48 changed file
with
2186 addition
and
1960 deletion
+2186
-1960
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/StorageObject.java
...t/src/main/java/com/x/base/core/entity/StorageObject.java
+6
-7
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
...a/com/x/base/core/project/scripting/ScriptingFactory.java
+20
-15
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSForumInfo.java
...e_entity/src/main/java/com/x/bbs/entity/BBSForumInfo.java
+21
-9
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSSectionInfo.java
...entity/src/main/java/com/x/bbs/entity/BBSSectionInfo.java
+21
-8
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSSubjectAttachment.java
.../src/main/java/com/x/bbs/entity/BBSSubjectAttachment.java
+3
-3
o2server/x_cms_core_entity/src/main/java/com/x/cms/core/entity/FileInfo.java
..._entity/src/main/java/com/x/cms/core/entity/FileInfo.java
+11
-9
o2server/x_file_core_entity/src/main/java/com/x/file/core/entity/open/File.java
...ntity/src/main/java/com/x/file/core/entity/open/File.java
+6
-6
o2server/x_file_core_entity/src/main/java/com/x/file/core/entity/open/OriginFile.java
...src/main/java/com/x/file/core/entity/open/OriginFile.java
+2
-2
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/jaxrs/connector/ActionCreate.java
...ge/assemble/communicate/jaxrs/connector/ActionCreate.java
+16
-15
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/oauth/ActionInfo.java
...ation/assemble/authentication/jaxrs/oauth/ActionInfo.java
+11
-8
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/ActionInput.java
...ation/assemble/control/jaxrs/inputperson/ActionInput.java
+10
-20
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/ActionInputAll.java
...on/assemble/control/jaxrs/inputperson/ActionInputAll.java
+562
-545
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/BaseAction.java
...rganization/assemble/control/jaxrs/person/BaseAction.java
+8
-7
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionListWithWorkOrWorkCompleted.java
...surface/jaxrs/read/ActionListWithWorkOrWorkCompleted.java
+62
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java
...ocessplatform/assemble/surface/jaxrs/read/ReadAction.java
+20
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionListWithWorkOrWorkCompleted.java
...axrs/readcompleted/ActionListWithWorkOrWorkCompleted.java
+2
-3
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Attachment.java
...com/x/processplatform/core/entity/content/Attachment.java
+19
-17
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkProperties.java
...x/processplatform/core/entity/content/WorkProperties.java
+0
-6
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
...va/com/x/processplatform/core/entity/element/Process.java
+14
-14
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/SerialBuilder.java
...m/x/processplatform/service/processing/SerialBuilder.java
+3
-3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkContext.java
...com/x/processplatform/service/processing/WorkContext.java
+37
-15
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkDataHelper.java
.../x/processplatform/service/processing/WorkDataHelper.java
+3
-3
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WrapScriptObject.java
.../processplatform/service/processing/WrapScriptObject.java
+10
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java
...ssplatform/service/processing/factory/ElementFactory.java
+59
-49
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java
...splatform/service/processing/jaxrs/task/ActionAppend.java
+158
-106
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java
...tform/service/processing/jaxrs/task/ActionProcessing.java
+9
-12
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionWill.java
...essplatform/service/processing/jaxrs/task/ActionWill.java
+1
-1
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionAddSplit.java
...latform/service/processing/jaxrs/work/ActionAddSplit.java
+3
-2
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractBaseProcessor.java
...m/service/processing/processor/AbstractBaseProcessor.java
+60
-49
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractProcessor.java
...tform/service/processing/processor/AbstractProcessor.java
+51
-56
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java
...cessplatform/service/processing/processor/AeiObjects.java
+76
-63
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/TranslateReadIdentityTools.java
...vice/processing/processor/TranslateReadIdentityTools.java
+20
-18
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/TranslateReviewPersonTools.java
...vice/processing/processor/TranslateReviewPersonTools.java
+21
-20
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/choice/ChoiceProcessor.java
.../service/processing/processor/choice/ChoiceProcessor.java
+6
-9
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/embed/EmbedProcessor.java
...rm/service/processing/processor/embed/EmbedProcessor.java
+17
-15
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/invoke/InvokeProcessor.java
.../service/processing/processor/invoke/InvokeProcessor.java
+32
-19
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java
.../service/processing/processor/manual/ManualProcessor.java
+10
-10
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/TranslateTaskIdentityTools.java
...ocessing/processor/manual/TranslateTaskIdentityTools.java
+39
-88
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/parallel/ParallelProcessor.java
...vice/processing/processor/parallel/ParallelProcessor.java
+7
-6
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/service/ServiceProcessor.java
...ervice/processing/processor/service/ServiceProcessor.java
+5
-4
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/split/SplitProcessor.java
...rm/service/processing/processor/split/SplitProcessor.java
+7
-8
o2server/x_program_center/src/main/java/com/x/program/center/dingding/SyncOrganization.java
.../java/com/x/program/center/dingding/SyncOrganization.java
+19
-18
o2server/x_program_center/src/main/java/com/x/program/center/qiyeweixin/SyncOrganization.java
...ava/com/x/program/center/qiyeweixin/SyncOrganization.java
+41
-25
o2server/x_program_center/src/main/java/com/x/program/center/welink/SyncOrganization.java
...in/java/com/x/program/center/welink/SyncOrganization.java
+637
-633
o2server/x_program_center/src/main/java/com/x/program/center/zhengwudingding/SyncOrganization.java
...om/x/program/center/zhengwudingding/SyncOrganization.java
+10
-9
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
...ess/src/main/java/com/x/query/core/express/plan/Plan.java
+15
-5
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/ActionListCalculateWithWork.java
.../processing/jaxrs/neural/ActionListCalculateWithWork.java
+7
-7
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Generate.java
...com/x/query/service/processing/jaxrs/neural/Generate.java
+9
-12
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/entity/StorageObject.java
浏览文件 @
5abbcb48
...
@@ -3,7 +3,6 @@ package com.x.base.core.entity;
...
@@ -3,7 +3,6 @@ package com.x.base.core.entity;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
...
@@ -56,7 +55,7 @@ public abstract class StorageObject extends SliceJpaObject {
...
@@ -56,7 +55,7 @@ public abstract class StorageObject extends SliceJpaObject {
public
static
final
String
DELETE_OPERATE
=
"delete"
;
public
static
final
String
DELETE_OPERATE
=
"delete"
;
public
abstract
String
path
();
public
abstract
String
path
()
throws
Exception
;
public
abstract
String
getStorage
();
public
abstract
String
getStorage
();
...
@@ -82,7 +81,7 @@ public abstract class StorageObject extends SliceJpaObject {
...
@@ -82,7 +81,7 @@ public abstract class StorageObject extends SliceJpaObject {
public
abstract
void
setDeepPath
(
Boolean
deepPath
);
public
abstract
void
setDeepPath
(
Boolean
deepPath
);
public
String
path
(
String
operate
)
{
public
String
path
(
String
operate
)
throws
Exception
{
return
this
.
path
();
return
this
.
path
();
}
}
...
@@ -407,7 +406,7 @@ public abstract class StorageObject extends SliceJpaObject {
...
@@ -407,7 +406,7 @@ public abstract class StorageObject extends SliceJpaObject {
}
}
}
}
private
long
hdfsUpdateContent
(
StorageMapping
mapping
,
byte
[]
bytes
)
throws
IO
Exception
{
private
long
hdfsUpdateContent
(
StorageMapping
mapping
,
byte
[]
bytes
)
throws
Exception
{
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
.
get
(
hdfsConfiguration
(
mapping
)))
{
.
get
(
hdfsConfiguration
(
mapping
)))
{
org
.
apache
.
hadoop
.
fs
.
Path
path
=
new
org
.
apache
.
hadoop
.
fs
.
Path
(
getPrefix
(
mapping
),
this
.
path
());
org
.
apache
.
hadoop
.
fs
.
Path
path
=
new
org
.
apache
.
hadoop
.
fs
.
Path
(
getPrefix
(
mapping
),
this
.
path
());
...
@@ -424,7 +423,7 @@ public abstract class StorageObject extends SliceJpaObject {
...
@@ -424,7 +423,7 @@ public abstract class StorageObject extends SliceJpaObject {
return
bytes
.
length
;
return
bytes
.
length
;
}
}
private
Long
hdfsReadContent
(
StorageMapping
mapping
,
OutputStream
output
)
throws
IO
Exception
{
private
Long
hdfsReadContent
(
StorageMapping
mapping
,
OutputStream
output
)
throws
Exception
{
long
length
=
-
1L
;
long
length
=
-
1L
;
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
.
get
(
hdfsConfiguration
(
mapping
)))
{
.
get
(
hdfsConfiguration
(
mapping
)))
{
...
@@ -440,7 +439,7 @@ public abstract class StorageObject extends SliceJpaObject {
...
@@ -440,7 +439,7 @@ public abstract class StorageObject extends SliceJpaObject {
return
length
;
return
length
;
}
}
private
boolean
hdfsExistContent
(
StorageMapping
mapping
)
throws
IO
Exception
{
private
boolean
hdfsExistContent
(
StorageMapping
mapping
)
throws
Exception
{
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
.
get
(
hdfsConfiguration
(
mapping
)))
{
.
get
(
hdfsConfiguration
(
mapping
)))
{
org
.
apache
.
hadoop
.
fs
.
Path
path
=
new
org
.
apache
.
hadoop
.
fs
.
Path
(
getPrefix
(
mapping
),
this
.
path
());
org
.
apache
.
hadoop
.
fs
.
Path
path
=
new
org
.
apache
.
hadoop
.
fs
.
Path
(
getPrefix
(
mapping
),
this
.
path
());
...
@@ -448,7 +447,7 @@ public abstract class StorageObject extends SliceJpaObject {
...
@@ -448,7 +447,7 @@ public abstract class StorageObject extends SliceJpaObject {
}
}
}
}
private
void
hdfsDeleteContent
(
StorageMapping
mapping
)
throws
IO
Exception
{
private
void
hdfsDeleteContent
(
StorageMapping
mapping
)
throws
Exception
{
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
try
(
org
.
apache
.
hadoop
.
fs
.
FileSystem
fileSystem
=
org
.
apache
.
hadoop
.
fs
.
FileSystem
.
get
(
hdfsConfiguration
(
mapping
)))
{
.
get
(
hdfsConfiguration
(
mapping
)))
{
org
.
apache
.
hadoop
.
fs
.
Path
path
=
new
org
.
apache
.
hadoop
.
fs
.
Path
(
getPrefix
(
mapping
),
this
.
path
());
org
.
apache
.
hadoop
.
fs
.
Path
path
=
new
org
.
apache
.
hadoop
.
fs
.
Path
(
getPrefix
(
mapping
),
this
.
path
());
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/scripting/ScriptingFactory.java
浏览文件 @
5abbcb48
...
@@ -31,28 +31,31 @@ public class ScriptingFactory {
...
@@ -31,28 +31,31 @@ public class ScriptingFactory {
private
static
CompiledScript
compiledScriptInitialScriptText
;
private
static
CompiledScript
compiledScriptInitialScriptText
;
public
static
final
String
BINDING_NAME_RESOURCES
=
"java_resources"
;
public
static
final
String
BINDING_NAME_RESOURCES
=
"java_resources"
;
// public static final String BINDING_NAME_ORGANIZATION = "organization";
// public static final String BINDING_NAME_WEBSERVICESCLIENT = "webservicesClient";
public
static
final
String
BINDING_NAME_WORKCONTEXT
=
"java_workContext"
;
public
static
final
String
BINDING_NAME_WORKCONTEXT
=
"java_workContext"
;
public
static
final
String
BINDING_NAME_DATA
=
"java_data"
;
public
static
final
String
BINDING_NAME_ASSIGNDATA
=
"java_assignData"
;
public
static
final
String
BINDING_NAME_ASSIGNDATA
=
"assignData"
;
// public static final String BINDING_NAME_JAXWSPARAMETERS = "java_jaxwsParameters";
public
static
final
String
BINDING_NAME_JAXWSRESPONSE
=
"java_jaxwsResponse"
;
public
static
final
String
BINDING_NAME_JAXRSPARAMETERS
=
"java_jaxrsParameters"
;
public
static
final
String
BINDING_NAME_JAXRSRESPONSE
=
"java_jaxrsResponse"
;
public
static
final
String
BINDING_NAME_JAXRSHEADERS
=
"java_jaxrsHeaders"
;
public
static
final
String
BINDING_NAME_JAXRSBODY
=
"java_jaxrsBody"
;
public
static
final
String
BINDING_NAME_REQUESTTEXT
=
"java_requestText"
;
public
static
final
String
BINDING_NAME_EXPIRE
=
"java_expire"
;
public
static
final
String
BINDING_NAME_EFFECTIVEPERSON
=
"java_effectivePerson"
;
// public static final String BINDING_NAME_PARAMETERS = "java_parameters";
// public static final String BINDING_NAME_ROUTES = "routes";
// public static final String BINDING_NAME_ROUTES = "routes";
// public static final String BINDING_NAME_ROUTE = "routes";
// public static final String BINDING_NAME_ROUTE = "routes";
// public static final String BINDING_NAME_ROUTE = "java_route";
public
static
final
String
BINDING_NAME_IDENTITY
=
"identity"
;
//
public static final String BINDING_NAME_IDENTITY = "identity";
public
static
final
String
BINDING_NAME_JAXRSRESPONSE
=
"jaxrsResponse"
;
// public static final String BINDING_NAME_SERVICEVALUE = "serviceValue";
public
static
final
String
BINDING_NAME_JAXWSRESPONSE
=
"jaxwsResponse"
;
// public static final String BINDING_NAME_TASK = "task";
// public static final String BINDING_NAME_SERIAL = "serial";
// public static final String BINDING_NAME_PROCESS = "process";
public
static
final
String
BINDING_NAME_JAXRSBODY
=
"jaxrsBody"
;
public
static
final
String
BINDING_NAME_DATA
=
"data"
;
public
static
final
String
BINDING_NAME_JAXRSHEAD
=
"jaxrsHead"
;
public
static
final
String
BINDING_NAME_SERVICEVALUE
=
"serviceValue"
;
public
static
final
String
BINDING_NAME_TASK
=
"task"
;
public
static
final
String
BINDING_NAME_EXPIRE
=
"expire"
;
public
static
final
String
BINDING_NAME_SERIAL
=
"serial"
;
public
static
final
String
BINDING_NAME_PROCESS
=
"process"
;
public
static
final
String
BINDING_NAME_SERVICE_RESOURCES
=
"java_resources"
;
public
static
final
String
BINDING_NAME_SERVICE_RESOURCES
=
"java_resources"
;
public
static
final
String
BINDING_NAME_SERVICE_EFFECTIVEPERSON
=
"java_effectivePerson"
;
public
static
final
String
BINDING_NAME_SERVICE_EFFECTIVEPERSON
=
"java_effectivePerson"
;
...
@@ -61,6 +64,8 @@ public class ScriptingFactory {
...
@@ -61,6 +64,8 @@ public class ScriptingFactory {
public
static
final
String
BINDING_NAME_SERVICE_REQUEST
=
"java_request"
;
public
static
final
String
BINDING_NAME_SERVICE_REQUEST
=
"java_request"
;
public
static
final
String
BINDING_NAME_SERVICE_PARAMETERS
=
"java_parameters"
;
public
static
final
String
BINDING_NAME_SERVICE_PARAMETERS
=
"java_parameters"
;
public
static
final
String
BINDING_NAME_SERVICE_PERSON
=
"person"
;
public
static
ScriptEngine
newScriptEngine
()
{
public
static
ScriptEngine
newScriptEngine
()
{
return
(
new
ScriptEngineManager
()).
getEngineByName
(
Config
.
SCRIPTING_ENGINE_NAME
);
return
(
new
ScriptEngineManager
()).
getEngineByName
(
Config
.
SCRIPTING_ENGINE_NAME
);
}
}
...
...
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSForumInfo.java
浏览文件 @
5abbcb48
package
com.x.bbs.entity
;
package
com.x.bbs.entity
;
import
com.x.base.core.entity.AbstractPersistenceProperties
;
import
java.util.ArrayList
;
import
com.x.base.core.entity.JpaObject
;
import
java.util.List
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
javax.persistence.Basic
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
javax.persistence.Column
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.Id
;
import
javax.persistence.Inheritance
;
import
javax.persistence.InheritanceType
;
import
javax.persistence.Lob
;
import
javax.persistence.OrderColumn
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.openjpa.persistence.PersistentCollection
;
import
org.apache.openjpa.persistence.PersistentCollection
;
import
org.apache.openjpa.persistence.jdbc.ContainerTable
;
import
org.apache.openjpa.persistence.jdbc.ContainerTable
;
import
org.apache.openjpa.persistence.jdbc.ElementColumn
;
import
org.apache.openjpa.persistence.jdbc.ElementColumn
;
import
org.apache.openjpa.persistence.jdbc.ElementIndex
;
import
org.apache.openjpa.persistence.jdbc.ElementIndex
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
javax.persistence.*
;
import
com.x.base.core.entity.AbstractPersistenceProperties
;
import
java.util.ArrayList
;
import
com.x.base.core.entity.JpaObject
;
import
java.util.List
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.project.annotation.FieldDescribe
;
/**
/**
* 论坛信息表
* 论坛信息表
...
...
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSSectionInfo.java
浏览文件 @
5abbcb48
package
com.x.bbs.entity
;
package
com.x.bbs.entity
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.persistence.Basic
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.Id
;
import
javax.persistence.Inheritance
;
import
javax.persistence.InheritanceType
;
import
javax.persistence.Lob
;
import
javax.persistence.Table
;
import
javax.persistence.UniqueConstraint
;
import
org.apache.openjpa.persistence.PersistentCollection
;
import
org.apache.openjpa.persistence.jdbc.ContainerTable
;
import
org.apache.openjpa.persistence.jdbc.ElementColumn
;
import
org.apache.openjpa.persistence.jdbc.ElementIndex
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
org.apache.openjpa.persistence.jdbc.OrderColumn
;
import
com.x.base.core.entity.AbstractPersistenceProperties
;
import
com.x.base.core.entity.AbstractPersistenceProperties
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
org.apache.openjpa.persistence.PersistentCollection
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
org.apache.openjpa.persistence.jdbc.OrderColumn
;
import
org.apache.openjpa.persistence.jdbc.*
;
import
javax.persistence.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* 版块信息表
* 版块信息表
...
...
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSSubjectAttachment.java
浏览文件 @
5abbcb48
...
@@ -92,12 +92,12 @@ public class BBSSubjectAttachment extends StorageObject {
...
@@ -92,12 +92,12 @@ public class BBSSubjectAttachment extends StorageObject {
}
}
@Override
@Override
public
String
path
()
throws
Exception
{
public
String
path
()
{
if
(
null
==
this
.
sectionId
)
{
if
(
null
==
this
.
sectionId
)
{
throw
new
Exception
(
"sectionId can not be null."
);
throw
new
IllegalState
Exception
(
"sectionId can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
throw
new
Exception
(
"id can not be empty."
);
throw
new
IllegalState
Exception
(
"id can not be empty."
);
}
}
String
str
=
DateTools
.
format
(
this
.
getCreateTime
(),
DateTools
.
formatCompact_yyyyMMdd
);
String
str
=
DateTools
.
format
(
this
.
getCreateTime
(),
DateTools
.
formatCompact_yyyyMMdd
);
str
+=
PATHSEPARATOR
;
str
+=
PATHSEPARATOR
;
...
...
o2server/x_cms_core_entity/src/main/java/com/x/cms/core/entity/FileInfo.java
浏览文件 @
5abbcb48
...
@@ -120,18 +120,18 @@ public class FileInfo extends StorageObject {
...
@@ -120,18 +120,18 @@ public class FileInfo extends StorageObject {
}
}
@Override
@Override
public
String
path
()
throws
Exception
{
public
String
path
()
{
if
(
StringUtils
.
isEmpty
(
this
.
appId
))
{
if
(
StringUtils
.
isEmpty
(
this
.
appId
))
{
throw
new
Exception
(
"appId can not be null."
);
throw
new
IllegalState
Exception
(
"appId can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
this
.
categoryId
))
{
if
(
StringUtils
.
isEmpty
(
this
.
categoryId
))
{
throw
new
Exception
(
"categoryId can not be null."
);
throw
new
IllegalState
Exception
(
"categoryId can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
documentId
))
{
if
(
StringUtils
.
isEmpty
(
documentId
))
{
throw
new
Exception
(
"documentId can not be null."
);
throw
new
IllegalState
Exception
(
"documentId can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
throw
new
Exception
(
"id can not be empty."
);
throw
new
IllegalState
Exception
(
"id can not be empty."
);
}
}
String
str
=
DateTools
.
format
(
this
.
getCreateTime
(),
DateTools
.
formatCompact_yyyyMMdd
);
String
str
=
DateTools
.
format
(
this
.
getCreateTime
(),
DateTools
.
formatCompact_yyyyMMdd
);
str
+=
PATHSEPARATOR
;
str
+=
PATHSEPARATOR
;
...
@@ -281,8 +281,9 @@ public class FileInfo extends StorageObject {
...
@@ -281,8 +281,9 @@ public class FileInfo extends StorageObject {
public
static
final
String
readUnitList_FIELDNAME
=
"readUnitList"
;
public
static
final
String
readUnitList_FIELDNAME
=
"readUnitList"
;
@FieldDescribe
(
"可以访问的组织."
)
@FieldDescribe
(
"可以访问的组织."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
readUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
+
readUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
readUnitList_FIELDNAME
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
readUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
...
@@ -304,8 +305,9 @@ public class FileInfo extends StorageObject {
...
@@ -304,8 +305,9 @@ public class FileInfo extends StorageObject {
public
static
final
String
editUnitList_FIELDNAME
=
"editUnitList"
;
public
static
final
String
editUnitList_FIELDNAME
=
"editUnitList"
;
@FieldDescribe
(
"可以修改的组织."
)
@FieldDescribe
(
"可以修改的组织."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
editUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
+
editUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editUnitList_FIELDNAME
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
...
...
o2server/x_file_core_entity/src/main/java/com/x/file/core/entity/open/File.java
浏览文件 @
5abbcb48
...
@@ -226,21 +226,21 @@ public class File extends StorageObject {
...
@@ -226,21 +226,21 @@ public class File extends StorageObject {
}
}
@Override
@Override
public
String
path
()
throws
Exception
{
public
String
path
()
{
if
(
null
==
this
.
person
)
{
if
(
null
==
this
.
person
)
{
throw
new
Exception
(
"person can not be null."
);
throw
new
IllegalState
Exception
(
"person can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
throw
new
Exception
(
"id can not be empty."
);
throw
new
IllegalState
Exception
(
"id can not be empty."
);
}
}
if
(
StringUtils
.
isEmpty
(
reference
))
{
if
(
StringUtils
.
isEmpty
(
reference
))
{
throw
new
Exception
(
"reference can not be empty."
);
throw
new
IllegalState
Exception
(
"reference can not be empty."
);
}
}
if
(
Objects
.
isNull
(
this
.
getCreateTime
()))
{
if
(
Objects
.
isNull
(
this
.
getCreateTime
()))
{
throw
new
Exception
(
"createTime can not be empty."
);
throw
new
IllegalState
Exception
(
"createTime can not be empty."
);
}
}
if
(
Objects
.
isNull
(
this
.
referenceType
))
{
if
(
Objects
.
isNull
(
this
.
referenceType
))
{
throw
new
Exception
(
"referenceType can not be empty."
);
throw
new
IllegalState
Exception
(
"referenceType can not be empty."
);
}
}
String
str
=
this
.
person
;
String
str
=
this
.
person
;
...
...
o2server/x_file_core_entity/src/main/java/com/x/file/core/entity/open/OriginFile.java
浏览文件 @
5abbcb48
...
@@ -87,10 +87,10 @@ public class OriginFile extends StorageObject {
...
@@ -87,10 +87,10 @@ public class OriginFile extends StorageObject {
@Override
@Override
public
String
path
()
throws
Exception
{
public
String
path
()
throws
Exception
{
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
throw
new
Exception
(
"id can not be empty."
);
throw
new
IllegalState
Exception
(
"id can not be empty."
);
}
}
if
(
StringUtils
.
isEmpty
(
type
))
{
if
(
StringUtils
.
isEmpty
(
type
))
{
throw
new
Exception
(
"type can not be empty."
);
throw
new
IllegalState
Exception
(
"type can not be empty."
);
}
}
String
str
=
this
.
type
;
String
str
=
this
.
type
;
str
+=
PATHSEPARATOR
;
str
+=
PATHSEPARATOR
;
...
...
o2server/x_message_assemble_communicate/src/main/java/com/x/message/assemble/communicate/jaxrs/connector/ActionCreate.java
浏览文件 @
5abbcb48
...
@@ -28,7 +28,7 @@ import com.x.base.core.project.jaxrs.WrapBoolean;
...
@@ -28,7 +28,7 @@ import com.x.base.core.project.jaxrs.WrapBoolean;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.message.MessageConnector
;
import
com.x.base.core.project.message.MessageConnector
;
import
com.x.base.core.project.script
.Script
Factory
;
import
com.x.base.core.project.script
ing.Scripting
Factory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.message.assemble.communicate.Business
;
import
com.x.message.assemble.communicate.Business
;
import
com.x.message.assemble.communicate.ThisApplication
;
import
com.x.message.assemble.communicate.ThisApplication
;
...
@@ -38,7 +38,7 @@ import com.x.message.core.entity.Message;
...
@@ -38,7 +38,7 @@ import com.x.message.core.entity.Message;
class
ActionCreate
extends
BaseAction
{
class
ActionCreate
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCreate
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionCreate
.
class
);
private
static
ConcurrentMap
<
String
,
CompiledScript
>
scriptMap
=
new
ConcurrentHashMap
<>();
private
static
ConcurrentMap
<
String
,
CompiledScript
>
scriptMap
=
new
ConcurrentHashMap
<>();
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
List
<
Message
>
messages
=
new
ArrayList
<>();
List
<
Message
>
messages
=
new
ArrayList
<>();
...
@@ -47,10 +47,10 @@ class ActionCreate extends BaseAction {
...
@@ -47,10 +47,10 @@ class ActionCreate extends BaseAction {
Business
business
=
new
Business
(
emc
);
Business
business
=
new
Business
(
emc
);
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
List
<
String
>
consumers
=
Config
.
messages
().
getConsumers
(
wi
.
getType
());
List
<
String
>
consumers
=
Config
.
messages
().
getConsumers
(
wi
.
getType
());
Map
<
String
,
String
>
consumersV2
=
Config
.
messages
().
getConsumersV2
(
wi
.
getType
());
Map
<
String
,
String
>
consumersV2
=
Config
.
messages
().
getConsumersV2
(
wi
.
getType
());
for
(
String
consumer:
consumers
)
{
for
(
String
consumer
:
consumers
)
{
if
(!
consumersV2
.
containsKey
(
consumer
))
{
if
(!
consumersV2
.
containsKey
(
consumer
))
{
consumersV2
.
put
(
consumer
,
""
);
consumersV2
.
put
(
consumer
,
""
);
}
}
}
}
Instant
instant
=
this
.
instant
(
effectivePerson
,
business
,
wi
,
new
ArrayList
<>(
consumersV2
.
keySet
()));
Instant
instant
=
this
.
instant
(
effectivePerson
,
business
,
wi
,
new
ArrayList
<>(
consumersV2
.
keySet
()));
...
@@ -59,19 +59,18 @@ class ActionCreate extends BaseAction {
...
@@ -59,19 +59,18 @@ class ActionCreate extends BaseAction {
Wi
cpwi
=
wi
;
Wi
cpwi
=
wi
;
String
func
=
consumersV2
.
get
(
consumer
);
String
func
=
consumersV2
.
get
(
consumer
);
try
{
try
{
if
(
StringUtils
.
isNoneBlank
(
func
))
{
if
(
StringUtils
.
isNoneBlank
(
func
))
{
cpwi
=
(
Wi
)
BeanUtils
.
cloneBean
(
wi
);
cpwi
=
(
Wi
)
BeanUtils
.
cloneBean
(
wi
);
JsonObject
body
=
cpwi
.
getBody
().
deepCopy
().
getAsJsonObject
();
JsonObject
body
=
cpwi
.
getBody
().
deepCopy
().
getAsJsonObject
();
CompiledScript
compiledScript
=
scriptMap
.
get
(
func
);
CompiledScript
compiledScript
=
scriptMap
.
get
(
func
);
if
(
compiledScript
==
null
)
{
if
(
compiledScript
==
null
)
{
String
eval
=
Config
.
messageSendRuleScript
();
String
eval
=
Config
.
messageSendRuleScript
();
if
(
StringUtils
.
isNotEmpty
(
eval
))
{
if
(
StringUtils
.
isNotEmpty
(
eval
))
{
eval
=
"function"
+
StringUtils
.
substringAfter
(
eval
,
"function"
)
+
" "
+
func
+
"();"
;
compiledScript
=
ScriptingFactory
.
functionalizationCompile
(
eval
);
compiledScript
=
ScriptFactory
.
compile
(
eval
);
scriptMap
.
put
(
func
,
compiledScript
);
scriptMap
.
put
(
func
,
compiledScript
);
}
}
}
}
if
(
compiledScript
!=
null
)
{
if
(
compiledScript
!=
null
)
{
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
"body"
,
body
);
bindings
.
put
(
"body"
,
body
);
...
@@ -81,7 +80,8 @@ class ActionCreate extends BaseAction {
...
@@ -81,7 +80,8 @@ class ActionCreate extends BaseAction {
if
(
o
!=
null
)
{
if
(
o
!=
null
)
{
if
(
o
instanceof
Boolean
)
{
if
(
o
instanceof
Boolean
)
{
if
(!((
Boolean
)
o
).
booleanValue
())
{
if
(!((
Boolean
)
o
).
booleanValue
())
{
logger
.
info
(
"消息类型{}.{}的消息[{}]不满足发送条件,跳过..."
,
wi
.
getType
(),
consumer
,
wi
.
getTitle
());
logger
.
info
(
"消息类型{}.{}的消息[{}]不满足发送条件,跳过..."
,
wi
.
getType
(),
consumer
,
wi
.
getTitle
());
continue
;
continue
;
}
}
}
}
...
@@ -190,7 +190,8 @@ class ActionCreate extends BaseAction {
...
@@ -190,7 +190,8 @@ class ActionCreate extends BaseAction {
}
}
break
;
break
;
case
MessageConnector
.
CONSUME_MPWEIXIN
:
case
MessageConnector
.
CONSUME_MPWEIXIN
:
if
(
BooleanUtils
.
isTrue
(
Config
.
mPweixin
().
getEnable
())
&&
BooleanUtils
.
isTrue
(
Config
.
mPweixin
().
getMessageEnable
()))
{
if
(
BooleanUtils
.
isTrue
(
Config
.
mPweixin
().
getEnable
())
&&
BooleanUtils
.
isTrue
(
Config
.
mPweixin
().
getMessageEnable
()))
{
ThisApplication
.
mpWeixinConsumeQueue
.
send
(
message
);
ThisApplication
.
mpWeixinConsumeQueue
.
send
(
message
);
}
}
break
;
break
;
...
...
o2server/x_organization_assemble_authentication/src/main/java/com/x/organization/assemble/authentication/jaxrs/oauth/ActionInfo.java
浏览文件 @
5abbcb48
...
@@ -30,14 +30,15 @@ import com.x.base.core.project.http.HttpToken;
...
@@ -30,14 +30,15 @@ import com.x.base.core.project.http.HttpToken;
import
com.x.base.core.project.jaxrs.WoText
;
import
com.x.base.core.project.jaxrs.WoText
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.organization.assemble.authentication.Business
;
import
com.x.organization.assemble.authentication.Business
;
import
com.x.organization.core.entity.OauthCode
;
import
com.x.organization.core.entity.OauthCode
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.Person
;
class
ActionInfo
extends
BaseAction
{
class
ActionInfo
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionInfo
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionInfo
.
class
);
public
static
final
Pattern
SCRIPT_PATTERN
=
Pattern
.
compile
(
"^\\((.+?)\\)$"
);
public
static
final
Pattern
SCRIPT_PATTERN
=
Pattern
.
compile
(
"^\\((.+?)\\)$"
);
...
@@ -94,7 +95,7 @@ class ActionInfo extends BaseAction {
...
@@ -94,7 +95,7 @@ class ActionInfo extends BaseAction {
if
(
optional
.
isPresent
())
{
if
(
optional
.
isPresent
())
{
return
(
CompiledScript
)
optional
.
get
();
return
(
CompiledScript
)
optional
.
get
();
}
else
{
}
else
{
CompiledScript
compiledScript
=
Script
Factory
.
compile
(
ScriptFactory
.
functionalization
(
text
)
);
CompiledScript
compiledScript
=
Script
ingFactory
.
functionalizationCompile
(
text
);
CacheManager
.
put
(
cache
,
cacheKey
,
compiledScript
);
CacheManager
.
put
(
cache
,
cacheKey
,
compiledScript
);
return
compiledScript
;
return
compiledScript
;
}
}
...
@@ -105,8 +106,9 @@ class ActionInfo extends BaseAction {
...
@@ -105,8 +106,9 @@ class ActionInfo extends BaseAction {
if
(
Config
.
token
().
isInitialManager
(
oauthCode
.
getPerson
()))
{
if
(
Config
.
token
().
isInitialManager
(
oauthCode
.
getPerson
()))
{
InitialManager
initialManager
=
Config
.
token
().
initialManagerInstance
();
InitialManager
initialManager
=
Config
.
token
().
initialManagerInstance
();
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
"person"
,
initialManager
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
initialManager
);
for
(
String
str
:
StringUtils
.
split
(
oauthCode
.
getScope
(),
","
))
{
for
(
String
str
:
StringUtils
.
split
(
oauthCode
.
getScope
(),
","
))
{
String
property
=
StringEscapeUtils
.
unescapeJson
(
oauth
.
getMapping
().
get
(
str
));
String
property
=
StringEscapeUtils
.
unescapeJson
(
oauth
.
getMapping
().
get
(
str
));
...
@@ -115,7 +117,7 @@ class ActionInfo extends BaseAction {
...
@@ -115,7 +117,7 @@ class ActionInfo extends BaseAction {
String
value
=
""
;
String
value
=
""
;
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
CompiledScript
compiledScript
=
this
.
compliedScript
(
oauthCode
.
getClientId
(),
str
,
matcher
.
group
(
1
));
CompiledScript
compiledScript
=
this
.
compliedScript
(
oauthCode
.
getClientId
(),
str
,
matcher
.
group
(
1
));
value
=
ScriptFactory
.
asString
(
compiledScript
.
eval
(
scriptContext
)
);
value
=
JsonScriptingExecutor
.
evalString
(
compiledScript
,
scriptContext
);
}
else
{
}
else
{
value
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
initialManager
,
property
));
value
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
initialManager
,
property
));
}
}
...
@@ -124,7 +126,8 @@ class ActionInfo extends BaseAction {
...
@@ -124,7 +126,8 @@ class ActionInfo extends BaseAction {
}
else
{
}
else
{
Person
person
=
business
.
entityManagerContainer
().
find
(
oauthCode
.
getPerson
(),
Person
.
class
);
Person
person
=
business
.
entityManagerContainer
().
find
(
oauthCode
.
getPerson
(),
Person
.
class
);
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
"person"
,
person
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
person
);
for
(
String
str
:
StringUtils
.
split
(
oauthCode
.
getScope
(),
","
))
{
for
(
String
str
:
StringUtils
.
split
(
oauthCode
.
getScope
(),
","
))
{
String
property
=
oauth
.
getMapping
().
get
(
str
);
String
property
=
oauth
.
getMapping
().
get
(
str
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
...
@@ -133,7 +136,7 @@ class ActionInfo extends BaseAction {
...
@@ -133,7 +136,7 @@ class ActionInfo extends BaseAction {
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
CompiledScript
compiledScript
=
this
.
compliedScript
(
oauthCode
.
getClientId
(),
str
,
CompiledScript
compiledScript
=
this
.
compliedScript
(
oauthCode
.
getClientId
(),
str
,
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
value
=
ScriptFactory
.
asString
(
compiledScript
.
eval
(
scriptContext
)
);
value
=
JsonScriptingExecutor
.
evalString
(
compiledScript
,
scriptContext
);
}
else
{
}
else
{
value
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
person
,
property
));
value
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
person
,
property
));
}
}
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/ActionInput.java
浏览文件 @
5abbcb48
...
@@ -11,10 +11,9 @@ import java.util.regex.Matcher;
...
@@ -11,10 +11,9 @@ import java.util.regex.Matcher;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
import
javax.script.Bindings
;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.text.StringEscapeUtils
;
import
org.apache.commons.text.StringEscapeUtils
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.Cell
;
...
@@ -29,13 +28,16 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
...
@@ -29,13 +28,16 @@ import com.x.base.core.container.factory.EntityManagerContainerFactory;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.Crypto
;
import
com.x.base.core.project.tools.Crypto
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
...
@@ -46,7 +48,6 @@ import com.x.organization.core.entity.Identity;
...
@@ -46,7 +48,6 @@ import com.x.organization.core.entity.Identity;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.PersonAttribute
;
import
com.x.organization.core.entity.PersonAttribute
;
import
com.x.organization.core.entity.Role
;
import
com.x.organization.core.entity.Role
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
class
ActionInput
extends
BaseAction
{
class
ActionInput
extends
BaseAction
{
...
@@ -93,12 +94,13 @@ class ActionInput extends BaseAction {
...
@@ -93,12 +94,13 @@ class ActionInput extends BaseAction {
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Matcher
matcher
=
pattern
.
matcher
(
Config
.
person
().
getPassword
());
Matcher
matcher
=
pattern
.
matcher
(
Config
.
person
().
getPassword
());
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
String
eval
=
ScriptFactory
.
functionalization
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
CompiledScript
cs
=
ScriptingFactory
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
.
functionalizationCompile
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
for
(
PersonItem
o
:
people
)
{
for
(
PersonItem
o
:
people
)
{
bindings
.
put
(
"person"
,
o
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
o
);
String
pass
=
ScriptFactory
.
scriptEngine
.
eval
(
eval
,
scriptContext
).
toString
(
);
String
pass
=
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
o
.
setPassword
(
pass
);
o
.
setPassword
(
pass
);
}
}
}
else
{
}
else
{
...
@@ -204,11 +206,6 @@ class ActionInput extends BaseAction {
...
@@ -204,11 +206,6 @@ class ActionInput extends BaseAction {
for
(
PersonItem
o
:
people
)
{
for
(
PersonItem
o
:
people
)
{
for
(
PersonItem
item
:
people
)
{
for
(
PersonItem
item
:
people
)
{
if
(
o
!=
item
)
{
if
(
o
!=
item
)
{
// if (StringUtils.equals(o.getName(), item.getName())) {
// this.setMemo(workbook, configurator, o, "姓名冲突.");
// validate = false;
// continue;
// }
if
(
StringUtils
.
equals
(
o
.
getMobile
(),
item
.
getMobile
()))
{
if
(
StringUtils
.
equals
(
o
.
getMobile
(),
item
.
getMobile
()))
{
this
.
setMemo
(
workbook
,
configurator
,
o
,
"手机号冲突,本次导入中不唯一."
);
this
.
setMemo
(
workbook
,
configurator
,
o
,
"手机号冲突,本次导入中不唯一."
);
validate
=
false
;
validate
=
false
;
...
@@ -236,13 +233,6 @@ class ActionInput extends BaseAction {
...
@@ -236,13 +233,6 @@ class ActionInput extends BaseAction {
}
}
if
(
validate
)
{
if
(
validate
)
{
for
(
PersonItem
o
:
people
)
{
for
(
PersonItem
o
:
people
)
{
// p = emc.flag(o.getName(), Person.class);
// if (null != p) {
// this.setMemo(workbook, configurator, o,
// "姓名: " + o.getName() + " 与已经存在用户: " + p.getName() + " 冲突.");
// validate = false;
// continue;
// }
p
=
emc
.
flag
(
o
.
getMobile
(),
Person
.
class
);
p
=
emc
.
flag
(
o
.
getMobile
(),
Person
.
class
);
if
(
null
!=
p
)
{
if
(
null
!=
p
)
{
this
.
setMemo
(
workbook
,
configurator
,
o
,
this
.
setMemo
(
workbook
,
configurator
,
o
,
...
...
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/inputperson/ActionInputAll.java
浏览文件 @
5abbcb48
此差异已折叠。
点击以展开。
o2server/x_organization_assemble_control/src/main/java/com/x/organization/assemble/control/jaxrs/person/BaseAction.java
浏览文件 @
5abbcb48
...
@@ -11,8 +11,8 @@ import javax.persistence.criteria.CriteriaQuery;
...
@@ -11,8 +11,8 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.persistence.criteria.Root
;
import
javax.script.Bindings
;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -25,7 +25,8 @@ import com.x.base.core.project.gson.GsonPropertyObject;
...
@@ -25,7 +25,8 @@ import com.x.base.core.project.gson.GsonPropertyObject;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.organization.assemble.control.Business
;
import
com.x.organization.assemble.control.Business
;
...
@@ -252,12 +253,12 @@ abstract class BaseAction extends StandardJaxrsAction {
...
@@ -252,12 +253,12 @@ abstract class BaseAction extends StandardJaxrsAction {
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
String
eval
=
ScriptFactory
.
functionalization
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
CompiledScript
cs
=
ScriptingFactory
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
.
functionalizationCompile
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
"person"
,
person
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
person
);
Object
o
=
ScriptFactory
.
scriptEngine
.
eval
(
eval
,
scriptContext
);
return
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
return
o
.
toString
();
}
else
{
}
else
{
return
str
;
return
str
;
}
}
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ActionListWithWorkOrWorkCompleted.java
0 → 100644
浏览文件 @
5abbcb48
package
com.x.processplatform.assemble.surface.jaxrs.read
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
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.processplatform.assemble.surface.Business
;
import
com.x.processplatform.core.entity.content.Read
;
import
com.x.processplatform.core.entity.content.ReadCompleted
;
class
ActionListWithWorkOrWorkCompleted
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListWithWorkOrWorkCompleted
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Business
business
=
new
Business
(
emc
);
if
(!
business
.
readableWithWorkOrWorkCompleted
(
effectivePerson
,
workOrWorkCompleted
,
new
ExceptionEntityNotExist
(
workOrWorkCompleted
)))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
final
String
job
=
business
.
job
().
findWithWorkOrWorkCompleted
(
workOrWorkCompleted
);
List
<
Wo
>
wos
=
this
.
list
(
business
,
job
);
wos
=
wos
.
stream
().
sorted
(
Comparator
.
comparing
(
Wo:
:
getCreateTime
)).
collect
(
Collectors
.
toList
());
result
.
setData
(
wos
);
return
result
;
}
}
private
List
<
Wo
>
list
(
Business
business
,
String
job
)
throws
Exception
{
List
<
Read
>
os
=
business
.
entityManagerContainer
().
listEqual
(
Read
.
class
,
ReadCompleted
.
job_FIELDNAME
,
job
);
return
Wo
.
copier
.
copy
(
os
);
}
public
static
class
Wo
extends
Read
{
static
final
long
serialVersionUID
=
5610132069178497370L
;
static
WrapCopier
<
Read
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Read
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java
浏览文件 @
5abbcb48
...
@@ -207,7 +207,7 @@ public class ReadAction extends StandardJaxrsAction {
...
@@ -207,7 +207,7 @@ public class ReadAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
@JaxrsMethodDescribe
(
value
=
"统计当前用户在指定应用下的待
办
,按流程分类."
,
action
=
ActionListCountWithProcess
.
class
)
@JaxrsMethodDescribe
(
value
=
"统计当前用户在指定应用下的待
阅
,按流程分类."
,
action
=
ActionListCountWithProcess
.
class
)
@GET
@GET
@Path
(
"list/count/application/{applicationFlag}/process"
)
@Path
(
"list/count/application/{applicationFlag}/process"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
@@ -225,6 +225,25 @@ public class ReadAction extends StandardJaxrsAction {
...
@@ -225,6 +225,25 @@ public class ReadAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
@JaxrsMethodDescribe
(
value
=
"根据工作或完成工作获取待阅."
,
action
=
ActionListWithWorkOrWorkCompleted
.
class
)
@GET
@Path
(
"list/workorworkcompleted/{workOrWorkCompleted}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listWithWorkOrWorkCompleted
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"工作或完成工作标识"
)
@PathParam
(
"workOrWorkCompleted"
)
String
workOrWorkCompleted
)
{
ActionResult
<
List
<
ActionListWithWorkOrWorkCompleted
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListWithWorkOrWorkCompleted
().
execute
(
effectivePerson
,
workOrWorkCompleted
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"获取待阅内容,"
,
action
=
ActionGet
.
class
)
@JaxrsMethodDescribe
(
value
=
"获取待阅内容,"
,
action
=
ActionGet
.
class
)
@GET
@GET
@Path
(
"{id}"
)
@Path
(
"{id}"
)
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/readcompleted/ActionListWithWorkOrWorkCompleted.java
浏览文件 @
5abbcb48
...
@@ -20,7 +20,7 @@ import com.x.processplatform.core.entity.content.ReadCompleted;
...
@@ -20,7 +20,7 @@ import com.x.processplatform.core.entity.content.ReadCompleted;
class
ActionListWithWorkOrWorkCompleted
extends
BaseAction
{
class
ActionListWithWorkOrWorkCompleted
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionListWithWorkOrWorkCompleted
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListWithWorkOrWorkCompleted
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
String
workOrWorkCompleted
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
@@ -47,8 +47,7 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
...
@@ -47,8 +47,7 @@ class ActionListWithWorkOrWorkCompleted extends BaseAction {
private
List
<
Wo
>
list
(
Business
business
,
String
job
)
throws
Exception
{
private
List
<
Wo
>
list
(
Business
business
,
String
job
)
throws
Exception
{
List
<
ReadCompleted
>
os
=
business
.
entityManagerContainer
().
listEqual
(
ReadCompleted
.
class
,
List
<
ReadCompleted
>
os
=
business
.
entityManagerContainer
().
listEqual
(
ReadCompleted
.
class
,
ReadCompleted
.
job_FIELDNAME
,
job
);
ReadCompleted
.
job_FIELDNAME
,
job
);
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
os
);
return
Wo
.
copier
.
copy
(
os
);
return
wos
;
}
}
public
static
class
Wo
extends
ReadCompleted
{
public
static
class
Wo
extends
ReadCompleted
{
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Attachment.java
浏览文件 @
5abbcb48
...
@@ -108,22 +108,21 @@ public class Attachment extends StorageObject {
...
@@ -108,22 +108,21 @@ public class Attachment extends StorageObject {
this
.
setActivityName
(
work
.
getActivityName
());
this
.
setActivityName
(
work
.
getActivityName
());
}
}
/** 更新运行方法 */
/** 更新运行方法 */
@Override
@Override
public
String
path
()
throws
Exception
{
public
String
path
()
{
if
(
StringUtils
.
isNotEmpty
(
fromPath
))
{
if
(
StringUtils
.
isNotEmpty
(
fromPath
))
{
return
fromPath
;
return
fromPath
;
}
}
if
(
null
==
this
.
workCreateTime
)
{
if
(
null
==
this
.
workCreateTime
)
{
throw
new
Exception
(
"workCreateTime can not be null."
);
throw
new
IllegalState
Exception
(
"workCreateTime can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
job
))
{
if
(
StringUtils
.
isEmpty
(
job
))
{
throw
new
Exception
(
"job can not be empty."
);
throw
new
IllegalState
Exception
(
"job can not be empty."
);
}
}
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
throw
new
Exception
(
"id can not be empty."
);
throw
new
IllegalState
Exception
(
"id can not be empty."
);
}
}
String
str
=
DateTools
.
format
(
workCreateTime
,
DateTools
.
formatCompact_yyyyMMdd
);
String
str
=
DateTools
.
format
(
workCreateTime
,
DateTools
.
formatCompact_yyyyMMdd
);
if
(
BooleanUtils
.
isTrue
(
this
.
getDeepPath
()))
{
if
(
BooleanUtils
.
isTrue
(
this
.
getDeepPath
()))
{
...
@@ -141,18 +140,18 @@ public class Attachment extends StorageObject {
...
@@ -141,18 +140,18 @@ public class Attachment extends StorageObject {
}
}
@Override
@Override
public
String
path
(
String
operate
)
throws
Exception
{
public
String
path
(
String
operate
)
{
if
(
StringUtils
.
isNotEmpty
(
fromPath
)
&&
!
DELETE_OPERATE
.
equals
(
operate
))
{
if
(
StringUtils
.
isNotEmpty
(
fromPath
)
&&
!
DELETE_OPERATE
.
equals
(
operate
))
{
return
fromPath
;
return
fromPath
;
}
}
if
(
null
==
this
.
workCreateTime
)
{
if
(
null
==
this
.
workCreateTime
)
{
throw
new
Exception
(
"workCreateTime can not be null."
);
throw
new
IllegalState
Exception
(
"workCreateTime can not be null."
);
}
}
if
(
StringUtils
.
isEmpty
(
job
))
{
if
(
StringUtils
.
isEmpty
(
job
))
{
throw
new
Exception
(
"job can not be empty."
);
throw
new
IllegalState
Exception
(
"job can not be empty."
);
}
}
if
(
StringUtils
.
isEmpty
(
id
))
{
if
(
StringUtils
.
isEmpty
(
id
))
{
throw
new
Exception
(
"id can not be empty."
);
throw
new
IllegalState
Exception
(
"id can not be empty."
);
}
}
String
str
=
DateTools
.
format
(
workCreateTime
,
DateTools
.
formatCompact_yyyyMMdd
);
String
str
=
DateTools
.
format
(
workCreateTime
,
DateTools
.
formatCompact_yyyyMMdd
);
if
(
BooleanUtils
.
isTrue
(
this
.
getDeepPath
()))
{
if
(
BooleanUtils
.
isTrue
(
this
.
getDeepPath
()))
{
...
@@ -393,8 +392,9 @@ public class Attachment extends StorageObject {
...
@@ -393,8 +392,9 @@ public class Attachment extends StorageObject {
public
static
final
String
readUnitList_FIELDNAME
=
"readUnitList"
;
public
static
final
String
readUnitList_FIELDNAME
=
"readUnitList"
;
@FieldDescribe
(
"可以访问的组织."
)
@FieldDescribe
(
"可以访问的组织."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
readUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
+
readUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
readUnitList_FIELDNAME
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
readUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
readUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
...
@@ -416,8 +416,9 @@ public class Attachment extends StorageObject {
...
@@ -416,8 +416,9 @@ public class Attachment extends StorageObject {
public
static
final
String
editUnitList_FIELDNAME
=
"editUnitList"
;
public
static
final
String
editUnitList_FIELDNAME
=
"editUnitList"
;
@FieldDescribe
(
"可以修改的组织."
)
@FieldDescribe
(
"可以修改的组织."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
editUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
+
editUnitList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editUnitList_FIELDNAME
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
editUnitList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editUnitList_FIELDNAME
+
ElementIndexNameSuffix
)
...
@@ -464,8 +465,9 @@ public class Attachment extends StorageObject {
...
@@ -464,8 +465,9 @@ public class Attachment extends StorageObject {
public
static
final
String
divisionList_FIELDNAME
=
"divisionList"
;
public
static
final
String
divisionList_FIELDNAME
=
"divisionList"
;
@FieldDescribe
(
"分组."
)
@FieldDescribe
(
"分组."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
divisionList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
IndexNameMiddle
+
divisionList_FIELDNAME
+
JoinIndexNameSuffix
))
+
divisionList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
divisionList_FIELDNAME
+
JoinIndexNameSuffix
))
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
divisionList_FIELDNAME
)
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
divisionList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
divisionList_FIELDNAME
+
ElementIndexNameSuffix
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
divisionList_FIELDNAME
+
ElementIndexNameSuffix
)
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/WorkProperties.java
浏览文件 @
5abbcb48
...
@@ -13,15 +13,9 @@ public class WorkProperties extends JsonProperties {
...
@@ -13,15 +13,9 @@ public class WorkProperties extends JsonProperties {
private
static
final
long
serialVersionUID
=
-
62236689373222398L
;
private
static
final
long
serialVersionUID
=
-
62236689373222398L
;
@FieldDescribe
(
"强制待办处理人"
)
@FieldDescribe
(
"强制待办处理人"
)
// properties的泛型在前后都必须申明类型!!!!LinkedHashMap<String, String>()这样的写法是对的.
// properties的泛型在前后都必须申明类型!!!!LinkedHashMap<String, String>()这样的写法是对的.
// properties的泛型在前后都必须申明类型!!!!LinkedHashMap<String, String>()这样的写法是对的.
private
List
<
String
>
manualForceTaskIdentityList
=
new
ArrayList
<
String
>();
private
List
<
String
>
manualForceTaskIdentityList
=
new
ArrayList
<
String
>();
@FieldDescribe
(
"授权对象"
)
@FieldDescribe
(
"授权对象"
)
// properties的泛型在前后都必须申明类型!!!!LinkedHashMap<String, String>()这样的写法是对的.
// properties的泛型在前后都必须申明类型!!!!LinkedHashMap<String, String>()这样的写法是对的.
// properties的泛型在前后都必须申明类型!!!!LinkedHashMap<String, String>()这样的写法是对的.
private
Map
<
String
,
String
>
manualEmpowerMap
=
new
LinkedHashMap
<
String
,
String
>();
private
Map
<
String
,
String
>
manualEmpowerMap
=
new
LinkedHashMap
<
String
,
String
>();
@FieldDescribe
(
"服务回调值"
)
@FieldDescribe
(
"服务回调值"
)
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
浏览文件 @
5abbcb48
...
@@ -341,13 +341,13 @@ public class Process extends SliceJpaObject {
...
@@ -341,13 +341,13 @@ public class Process extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
true
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
expireScript
;
private
String
expireScript
;
public
static
final
String
expireScriptText_FIELDNAME
=
"expireScriptText"
;
//
public static final String expireScriptText_FIELDNAME = "expireScriptText";
@FieldDescribe
(
"过期时间设定脚本文本."
)
//
@FieldDescribe("过期时间设定脚本文本.")
@Lob
//
@Lob
@Basic
(
fetch
=
FetchType
.
EAGER
)
//
@Basic(fetch = FetchType.EAGER)
@Column
(
length
=
JpaObject
.
length_1M
,
name
=
ColumnNamePrefix
+
expireScriptText_FIELDNAME
)
//
@Column(length = JpaObject.length_1M, name = ColumnNamePrefix + expireScriptText_FIELDNAME)
@CheckPersist
(
allowEmpty
=
true
)
//
@CheckPersist(allowEmpty = true)
private
String
expireScriptText
;
//
private String expireScriptText;
public
static
final
String
checkDraft_FIELDNAME
=
"checkDraft"
;
public
static
final
String
checkDraft_FIELDNAME
=
"checkDraft"
;
@FieldDescribe
(
"是否进行无内容的草稿删除校验."
)
@FieldDescribe
(
"是否进行无内容的草稿删除校验."
)
...
@@ -708,13 +708,13 @@ public class Process extends SliceJpaObject {
...
@@ -708,13 +708,13 @@ public class Process extends SliceJpaObject {
this
.
expireScript
=
expireScript
;
this
.
expireScript
=
expireScript
;
}
}
public
String
getExpireScriptText
()
{
//
public String getExpireScriptText() {
return
expireScriptText
;
//
return expireScriptText;
}
//
}
//
public
void
setExpireScriptText
(
String
expireScriptText
)
{
//
public void setExpireScriptText(String expireScriptText) {
this
.
expireScriptText
=
expireScriptText
;
//
this.expireScriptText = expireScriptText;
}
//
}
public
List
<
String
>
getControllerList
()
{
public
List
<
String
>
getControllerList
()
{
return
controllerList
;
return
controllerList
;
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/SerialBuilder.java
浏览文件 @
5abbcb48
...
@@ -81,9 +81,9 @@ public class SerialBuilder {
...
@@ -81,9 +81,9 @@ public class SerialBuilder {
List
<
SerialTextureItem
>
list
=
XGsonBuilder
.
instance
().
fromJson
(
data
,
collectionType
);
List
<
SerialTextureItem
>
list
=
XGsonBuilder
.
instance
().
fromJson
(
data
,
collectionType
);
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
//
Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERIAL
,
this
.
serial
);
//
bindings.put(ScriptingFactory.BINDING_NAME_SERIAL, this.serial);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_PROCESS
,
this
.
process
);
//
bindings.put(ScriptingFactory.BINDING_NAME_PROCESS, this.process);
for
(
SerialTextureItem
o
:
list
)
{
for
(
SerialTextureItem
o
:
list
)
{
if
((!
StringUtils
.
equalsIgnoreCase
(
o
.
getKey
(),
"number"
))
if
((!
StringUtils
.
equalsIgnoreCase
(
o
.
getKey
(),
"number"
))
&&
StringUtils
.
isNotEmpty
(
o
.
getScript
()))
{
&&
StringUtils
.
isNotEmpty
(
o
.
getScript
()))
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkContext.java
浏览文件 @
5abbcb48
...
@@ -14,6 +14,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
...
@@ -14,6 +14,7 @@ import com.x.base.core.project.gson.XGsonBuilder;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Read
;
import
com.x.processplatform.core.entity.content.Read
;
import
com.x.processplatform.core.entity.content.ReadCompleted
;
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.Review
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
...
@@ -32,6 +33,7 @@ public class WorkContext {
...
@@ -32,6 +33,7 @@ public class WorkContext {
private
AeiObjects
aeiObjects
=
null
;
private
AeiObjects
aeiObjects
=
null
;
private
Task
task
;
private
Task
task
;
private
TaskCompleted
taskCompleted
;
private
TaskCompleted
taskCompleted
;
private
Route
route
;
public
void
bindTask
(
Task
task
)
{
public
void
bindTask
(
Task
task
)
{
this
.
task
=
task
;
this
.
task
=
task
;
...
@@ -41,6 +43,10 @@ public class WorkContext {
...
@@ -41,6 +43,10 @@ public class WorkContext {
this
.
taskCompleted
=
taskCompleted
;
this
.
taskCompleted
=
taskCompleted
;
}
}
public
void
bindRoute
(
Route
route
)
{
this
.
route
=
route
;
}
public
WorkContext
(
AeiObjects
aeiObjects
)
throws
Exception
{
public
WorkContext
(
AeiObjects
aeiObjects
)
throws
Exception
{
this
.
aeiObjects
=
aeiObjects
;
this
.
aeiObjects
=
aeiObjects
;
this
.
business
=
aeiObjects
.
business
();
this
.
business
=
aeiObjects
.
business
();
...
@@ -53,21 +59,10 @@ public class WorkContext {
...
@@ -53,21 +59,10 @@ public class WorkContext {
this
.
task
=
task
;
this
.
task
=
task
;
}
}
// public WorkContext(Business business, Work work, Activity activity, Task task) {
public
WorkContext
(
AeiObjects
aeiObjects
,
TaskCompleted
taskCompleted
)
throws
Exception
{
// this.business = business;
this
(
aeiObjects
);
// this.work = work;
this
.
taskCompleted
=
taskCompleted
;
// this.activity = activity;
}
// this.gson = XGsonBuilder.instance();
// this.task = task;
// }
//
// public WorkContext(Business business, Work work, Activity activity, TaskCompleted taskCompleted) {
// this.business = business;
// this.work = work;
// this.activity = activity;
// this.gson = XGsonBuilder.instance();
// this.taskCompleted = taskCompleted;
// }
public
String
getWork
()
{
public
String
getWork
()
{
return
gson
.
toJson
(
work
);
return
gson
.
toJson
(
work
);
...
@@ -92,6 +87,21 @@ public class WorkContext {
...
@@ -92,6 +87,21 @@ public class WorkContext {
}
}
}
}
public
String
getRecordList
()
throws
Exception
{
try
{
List
<
Record
>
list
=
new
ArrayList
<>();
if
(
null
!=
this
.
aeiObjects
)
{
list
.
addAll
(
aeiObjects
.
getRecords
());
list
.
addAll
(
aeiObjects
.
getCreateRecords
());
}
return
gson
.
toJson
(
list
.
stream
().
filter
(
o
->
StringUtils
.
equals
(
o
.
getWork
(),
this
.
aeiObjects
.
getWork
().
getId
()))
.
collect
(
Collectors
.
toList
()));
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"getRecordList error."
,
e
);
}
}
public
String
getRouteList
()
{
public
String
getRouteList
()
{
try
{
try
{
List
<
Route
>
list
=
new
ArrayList
<>();
List
<
Route
>
list
=
new
ArrayList
<>();
...
@@ -104,6 +114,18 @@ public class WorkContext {
...
@@ -104,6 +114,18 @@ public class WorkContext {
}
}
}
}
/**
*
* @return 当前注入的路由
* @throws Exception
*/
public
String
getRoute
()
{
if
(
null
!=
route
)
{
return
gson
.
toJson
(
route
);
}
return
""
;
}
public
void
setTitle
(
String
title
)
throws
Exception
{
public
void
setTitle
(
String
title
)
throws
Exception
{
business
.
entityManagerContainer
().
beginTransaction
(
Work
.
class
);
business
.
entityManagerContainer
().
beginTransaction
(
Work
.
class
);
work
.
setTitle
(
title
);
work
.
setTitle
(
title
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WorkDataHelper.java
浏览文件 @
5abbcb48
...
@@ -37,12 +37,12 @@ public class WorkDataHelper {
...
@@ -37,12 +37,12 @@ public class WorkDataHelper {
public
WorkDataHelper
(
EntityManagerContainer
emc
,
Work
work
)
throws
Exception
{
public
WorkDataHelper
(
EntityManagerContainer
emc
,
Work
work
)
throws
Exception
{
if
((
null
==
emc
)
||
(
null
==
work
))
{
if
((
null
==
emc
)
||
(
null
==
work
))
{
throw
new
Exception
(
"create instance error."
);
throw
new
IllegalState
Exception
(
"create instance error."
);
}
}
this
.
job
=
work
.
getJob
();
this
.
job
=
work
.
getJob
();
this
.
distributeFactor
=
work
.
getDistributeFactor
();
this
.
distributeFactor
=
work
.
getDistributeFactor
();
if
(
StringUtils
.
isEmpty
(
this
.
job
))
{
if
(
StringUtils
.
isEmpty
(
this
.
job
))
{
throw
new
Exception
(
"can not create DataHelper job is empty."
);
throw
new
IllegalState
Exception
(
"can not create DataHelper job is empty."
);
}
}
this
.
emc
=
emc
;
this
.
emc
=
emc
;
this
.
converter
=
new
DataItemConverter
<>(
Item
.
class
);
this
.
converter
=
new
DataItemConverter
<>(
Item
.
class
);
...
@@ -65,7 +65,7 @@ public class WorkDataHelper {
...
@@ -65,7 +65,7 @@ public class WorkDataHelper {
this
.
items
=
this
.
load
();
this
.
items
=
this
.
load
();
}
}
private
List
<
Item
>
load
()
throws
Exception
{
private
List
<
Item
>
load
()
throws
Exception
{
EntityManager
em
=
emc
.
get
(
Item
.
class
);
EntityManager
em
=
emc
.
get
(
Item
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Item
>
cq
=
cb
.
createQuery
(
Item
.
class
);
CriteriaQuery
<
Item
>
cq
=
cb
.
createQuery
(
Item
.
class
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/WrapScriptObject.java
浏览文件 @
5abbcb48
...
@@ -4,6 +4,16 @@ public class WrapScriptObject {
...
@@ -4,6 +4,16 @@ public class WrapScriptObject {
private
String
value
;
private
String
value
;
private
String
type
;
public
void
type
(
String
type
)
{
this
.
type
=
type
;
}
public
String
type
()
{
return
this
.
type
;
}
public
String
get
()
{
public
String
get
()
{
return
this
.
value
;
return
this
.
value
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/factory/ElementFactory.java
浏览文件 @
5abbcb48
...
@@ -98,47 +98,58 @@ public class ElementFactory extends AbstractFactory {
...
@@ -98,47 +98,58 @@ public class ElementFactory extends AbstractFactory {
return
t
;
return
t
;
}
}
// public Activity getActivity(String id) throws Exception {
public
Activity
getActivity
(
String
id
)
throws
Exception
{
// Activity activity = null;
Activity
activity
=
null
;
// activity = this.get(id, ActivityType.manual);
activity
=
this
.
get
(
id
,
ActivityType
.
manual
);
// if (null == activity) {
if
(
null
!=
activity
)
{
// activity = this.get(id, ActivityType.begin);
return
activity
;
// if (null == activity) {
}
// activity = this.get(id, ActivityType.cancel);
activity
=
this
.
get
(
id
,
ActivityType
.
begin
);
// if (null == activity) {
if
(
null
!=
activity
)
{
// activity = this.get(id, ActivityType.choice);
return
activity
;
// if (null == activity) {
}
// activity = this.get(id, ActivityType.delay);
activity
=
this
.
get
(
id
,
ActivityType
.
cancel
);
// if (null == activity) {
if
(
null
!=
activity
)
{
// activity = this.get(id, ActivityType.embed);
return
activity
;
// if (null == activity) {
}
// activity = this.get(id, ActivityType.split);
activity
=
this
.
get
(
id
,
ActivityType
.
choice
);
// if (null == activity) {
if
(
null
!=
activity
)
{
// activity = this.get(id, ActivityType.invoke);
return
activity
;
// if (null == activity) {
}
// activity = this.get(id, ActivityType.agent);
activity
=
this
.
get
(
id
,
ActivityType
.
delay
);
// if (null == activity) {
if
(
null
!=
activity
)
{
// activity = this.get(id, ActivityType.merge);
return
activity
;
// if (null == activity) {
}
// activity = this.get(id, ActivityType.parallel);
activity
=
this
.
get
(
id
,
ActivityType
.
embed
);
// if (null == activity) {
if
(
null
!=
activity
)
{
// activity = this.get(id, ActivityType.service);
return
activity
;
// if (null == activity) {
}
// activity = this.get(id, ActivityType.end);
activity
=
this
.
get
(
id
,
ActivityType
.
split
);
// }
if
(
null
!=
activity
)
{
// }
return
activity
;
// }
}
// }
activity
=
this
.
get
(
id
,
ActivityType
.
invoke
);
// }
if
(
null
!=
activity
)
{
// }
return
activity
;
// }
}
// }
activity
=
this
.
get
(
id
,
ActivityType
.
agent
);
// }
if
(
null
!=
activity
)
{
// }
return
activity
;
// }
}
// }
activity
=
this
.
get
(
id
,
ActivityType
.
merge
);
// return activity;
if
(
null
!=
activity
)
{
// }
return
activity
;
}
activity
=
this
.
get
(
id
,
ActivityType
.
parallel
);
if
(
null
!=
activity
)
{
return
activity
;
}
activity
=
this
.
get
(
id
,
ActivityType
.
service
);
if
(
null
!=
activity
)
{
return
activity
;
}
return
this
.
get
(
id
,
ActivityType
.
end
);
}
public
Activity
get
(
String
id
,
ActivityType
activityType
)
throws
Exception
{
public
Activity
get
(
String
id
,
ActivityType
activityType
)
throws
Exception
{
switch
(
activityType
)
{
switch
(
activityType
)
{
...
@@ -407,10 +418,9 @@ public class ElementFactory extends AbstractFactory {
...
@@ -407,10 +418,9 @@ public class ElementFactory extends AbstractFactory {
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
Mapping_
.
process
),
process
),
cb
.
equal
(
root
.
get
(
Mapping_
.
process
),
""
),
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
equal
(
root
.
get
(
Mapping_
.
process
),
process
),
cb
.
equal
(
root
.
get
(
Mapping_
.
process
),
""
),
cb
.
isNull
(
root
.
get
(
Mapping_
.
process
))));
cb
.
isNull
(
root
.
get
(
Mapping_
.
process
))));
List
<
Mapping
>
os
=
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
List
<
Mapping
>
os
=
em
.
createQuery
(
cq
.
where
(
p
)).
getResultList
();
os
.
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
{
os
.
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
o
.
getApplication
()
+
o
.
getTableName
()))
return
o
.
getApplication
()
+
o
.
getTableName
();
.
forEach
((
k
,
v
)
->
list
.
add
(
v
.
stream
().
filter
(
i
->
StringUtils
.
isNotEmpty
(
i
.
getProcess
()))
})).
forEach
((
k
,
v
)
->
list
.
findFirst
().
orElse
(
v
.
get
(
0
))));
.
add
(
v
.
stream
().
filter
(
i
->
StringUtils
.
isNotEmpty
(
i
.
getProcess
())).
findFirst
().
orElse
(
v
.
get
(
0
))));
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
list
);
CacheManager
.
put
(
cacheCategory
,
cacheKey
,
list
);
}
}
return
list
;
return
list
;
...
@@ -651,10 +661,10 @@ public class ElementFactory extends AbstractFactory {
...
@@ -651,10 +661,10 @@ public class ElementFactory extends AbstractFactory {
scriptName
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
o
,
Process
.
afterEndScript_FIELDNAME
));
scriptName
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
o
,
Process
.
afterEndScript_FIELDNAME
));
scriptText
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
o
,
Process
.
afterEndScriptText_FIELDNAME
));
scriptText
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
o
,
Process
.
afterEndScriptText_FIELDNAME
));
break
;
break
;
case
Business
.
EVENT_PROCESSEXPIRE
:
//
case Business.EVENT_PROCESSEXPIRE:
scriptName
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
o
,
Process
.
expireScript_FIELDNAME
));
//
scriptName = Objects.toString(PropertyUtils.getProperty(o, Process.expireScript_FIELDNAME));
scriptText
=
Objects
.
toString
(
PropertyUtils
.
getProperty
(
o
,
Process
.
expireScriptText_FIELDNAME
));
//
scriptText = Objects.toString(PropertyUtils.getProperty(o, Process.expireScriptText_FIELDNAME));
break
;
//
break;
default
:
default
:
break
;
break
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionAppend.java
浏览文件 @
5abbcb48
...
@@ -7,10 +7,7 @@ import java.util.Map;
...
@@ -7,10 +7,7 @@ import java.util.Map;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
...
@@ -26,52 +23,36 @@ import com.x.base.core.project.http.EffectivePerson;
...
@@ -26,52 +23,36 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.base.core.project.jaxrs.WrapStringList
;
import
com.x.base.core.project.jaxrs.WrapStringList
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script
.ScriptFactory
;
import
com.x.base.core.project.script
ing.JsonScriptingExecutor
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.webservices.WebservicesClient
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.Activity
;
import
com.x.processplatform.core.entity.element.ActivityType
;
import
com.x.processplatform.core.entity.element.ActivityType
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.Manual
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Process
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapAppend
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapAppend
;
import
com.x.processplatform.service.processing.ApplicationDictHelper
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.processplatform.service.processing.ThisApplication
;
import
com.x.processplatform.service.processing.configurator.ProcessingConfigurator
;
import
com.x.processplatform.service.processing.WorkContext
;
import
com.x.processplatform.service.processing.processor.AeiObjects
;
import
com.x.processplatform.service.processing.WorkDataHelper
;
import
com.x.processplatform.service.processing.processor.manual.TaskIdentities
;
import
com.x.processplatform.service.processing.processor.manual.TaskIdentities
;
import
com.x.processplatform.service.processing.processor.manual.TaskIdentity
;
import
com.x.processplatform.service.processing.processor.manual.TaskIdentity
;
class
ActionAppend
extends
BaseAction
{
class
ActionAppend
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionAppend
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionAppend
.
class
);
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
final
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
final
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
String
executorSeed
=
null
;
String
executorSeed
=
initJob
(
id
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Task
task
=
emc
.
fetch
(
id
,
Task
.
class
,
ListTools
.
toList
(
Task
.
job_FIELDNAME
));
if
(
null
==
task
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
}
executorSeed
=
task
.
getJob
();
}
Callable
<
ActionResult
<
Wo
>>
callable
=
new
Callable
<
ActionResult
<
Wo
>>()
{
Callable
<
ActionResult
<
Wo
>>
callable
=
new
Callable
<
ActionResult
<
Wo
>>()
{
public
ActionResult
<
Wo
>
call
()
throws
Exception
{
public
ActionResult
<
Wo
>
call
()
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wo
=
new
Wo
();
String
workId
=
""
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
Business
business
=
new
Business
(
emc
);
Task
task
=
emc
.
find
(
id
,
Task
.
class
);
Task
task
=
emc
.
find
(
id
,
Task
.
class
);
...
@@ -82,109 +63,128 @@ class ActionAppend extends BaseAction {
...
@@ -82,109 +63,128 @@ class ActionAppend extends BaseAction {
if
(
null
==
work
)
{
if
(
null
==
work
)
{
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
throw
new
ExceptionEntityNotExist
(
task
.
getWork
(),
Work
.
class
);
}
}
workId
=
work
.
getId
();
Manual
manual
=
(
Manual
)
business
.
element
().
get
(
task
.
getActivity
(),
ActivityType
.
manual
);
Manual
manual
=
(
Manual
)
business
.
element
().
get
(
task
.
getActivity
(),
ActivityType
.
manual
);
Route
route
=
getRoute
(
business
,
task
,
manual
);
Route
route
=
getRoute
(
business
,
task
,
manual
);
List
<
String
>
identities
=
new
ArrayList
<>();
List
<
String
>
identities
=
new
ArrayList
<>();
if
(
ListTools
.
isNotEmpty
(
wi
.
getIdentityList
()))
{
if
(
ListTools
.
isNotEmpty
(
wi
.
getIdentityList
()))
{
identities
.
addAll
(
wi
.
getIdentityList
());
identities
.
addAll
(
wi
.
getIdentityList
());
}
}
if
(
route
!=
null
)
{
if
(
ifEvalScript
(
manual
,
route
))
{
if
(
StringUtils
.
equals
(
route
.
getType
(),
Route
.
TYPE_APPENDTASK
)
evalScript
(
business
,
identities
,
manual
,
route
,
work
,
task
);
&&
StringUtils
.
equals
(
manual
.
getId
(),
route
.
getActivity
()))
{
if
(
StringUtils
.
equals
(
route
.
getAppendTaskIdentityType
(),
Route
.
APPENDTASKIDENTITYTYPE_SCRIPT
))
{
Data
data
=
new
Data
();
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
business
.
entityManagerContainer
(),
work
);
data
=
workDataHelper
.
get
();
ScriptContext
scriptContext
=
scriptContext
(
business
,
work
,
data
,
manual
,
task
);
CompiledScript
compiledScript
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
route
,
Business
.
EVENT_ROUTEAPPENDTASKIDENTITY
);
Object
objectValue
=
compiledScript
.
eval
(
scriptContext
);
List
<
String
>
os
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
identities
.
addAll
(
os
);
}
}
}
}
}
Process
process
=
business
.
element
().
get
(
task
.
getProcess
(),
Process
.
class
);
Process
process
=
business
.
element
().
get
(
task
.
getProcess
(),
Process
.
class
);
identities
=
business
.
organization
().
identity
().
list
(
ListTools
.
trim
(
identities
,
true
,
true
));
identities
=
business
.
organization
().
identity
().
list
(
ListTools
.
trim
(
identities
,
true
,
true
));
TaskIdentities
taskIdentities
=
empower
(
business
,
process
,
task
,
identities
);
TaskIdentities
taskIdentities
=
empower
(
business
,
process
,
task
,
identities
);
identities
=
taskIdentities
.
identities
();
identities
=
taskIdentities
.
identities
();
if
(
ListTools
.
isNotEmpty
(
identities
))
{
Wo
wo
=
new
Wo
();
// List<TaskCompleted> os = emc.listEqualAndInAndNotEqual(TaskCompleted.class,
clean
(
wo
,
emc
,
business
,
task
,
work
,
identities
,
taskIdentities
);
// TaskCompleted.activityToken_FIELDNAME, work.getActivityToken(),
// TaskCompleted.identity_FIELDNAME, identities, TaskCompleted.joinInquire_FIELDNAME,
// true);
// 同一环节办理后再转交给已经有已办的人员,需要将已办置为joinInquire=false
List
<
TaskCompleted
>
os
=
emc
.
listEqualAndInAndNotEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
activityToken_FIELDNAME
,
work
.
getActivityToken
(),
TaskCompleted
.
identity_FIELDNAME
,
identities
,
TaskCompleted
.
joinInquire_FIELDNAME
,
false
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
emc
.
beginTransaction
(
TaskCompleted
.
class
);
for
(
TaskCompleted
o
:
os
)
{
o
.
setJoinInquire
(
false
);
o
.
setProcessingType
(
TaskCompleted
.
PROCESSINGTYPE_BEAPPENDEDTASK
);
}
}
// 后面还要合并,clone一个新实例
wo
.
getValueList
().
addAll
(
new
ArrayList
<>(
identities
));
identities
=
ListUtils
.
sum
(
ListUtils
.
subtract
(
work
.
getManualTaskIdentityList
(),
ListTools
.
toList
(
task
.
getIdentity
())),
identities
);
identities
=
business
.
organization
().
identity
().
list
(
ListTools
.
trim
(
identities
,
true
,
true
));
emc
.
beginTransaction
(
Work
.
class
);
work
.
setManualTaskIdentityList
(
identities
);
for
(
TaskIdentity
taskIdentity
:
taskIdentities
)
{
if
(
BooleanUtils
.
isNotTrue
(
taskIdentity
.
getIgnoreEmpower
())
&&
StringUtils
.
isNotEmpty
(
taskIdentity
.
getFromIdentity
()))
{
work
.
getProperties
().
getManualEmpowerMap
().
put
(
taskIdentity
.
getIdentity
(),
taskIdentity
.
getFromIdentity
());
}
}
//properties中的集合对象需要重新new对象set进去,这样jpa才会更新数据
Map
<
String
,
String
>
manualEmpowerMap
=
new
LinkedHashMap
<
String
,
String
>();
manualEmpowerMap
.
putAll
(
work
.
getProperties
().
getManualEmpowerMap
());
work
.
getProperties
().
setManualEmpowerMap
(
manualEmpowerMap
);
// 转派后设置过期为空
// emc.beginTransaction(Task.class);
// task.setExpired(false);
// task.setExpireTime(null);
emc
.
commit
();
}
result
.
setData
(
wo
);
result
.
setData
(
wo
);
}
}
return
result
;
return
result
;
}
}
};
};
return
ProcessPlatformExecutorFactory
.
get
(
executorSeed
).
submit
(
callable
).
get
(
300
,
TimeUnit
.
SECONDS
);
return
ProcessPlatformExecutorFactory
.
get
(
executorSeed
).
submit
(
callable
).
get
(
300
,
TimeUnit
.
SECONDS
);
}
}
public
static
ScriptContext
scriptContext
(
Business
business
,
Work
work
,
Data
data
,
Activity
activity
,
Task
task
)
private
String
initJob
(
String
id
)
throws
Exception
{
throws
Exception
{
String
executorSeed
;
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
WorkContext
workContext
=
new
WorkContext
(
business
,
work
,
activity
,
task
);
Task
task
=
emc
.
fetch
(
id
,
Task
.
class
,
ListTools
.
toList
(
Task
.
job_FIELDNAME
));
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_WORKCONTEXT
,
workContext
);
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_DATA
,
data
);
if
(
null
==
task
)
{
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_ORGANIZATION
,
business
.
organization
());
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_WEBSERVICESCLIENT
,
new
WebservicesClient
());
}
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_DICTIONARY
,
executorSeed
=
task
.
getJob
();
new
ApplicationDictHelper
(
business
.
entityManagerContainer
(),
work
.
getApplication
()));
}
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_APPLICATIONS
,
ThisApplication
.
context
().
applications
());
return
executorSeed
;
// 重新创建的ScriptContext是需要初始化的
ScriptFactory
.
initialScriptText
().
eval
(
scriptContext
);
return
scriptContext
;
}
}
// public class CallableExecute implements Callable<ActionResult<Wo>> {
//
// public ActionResult<Wo> call() throws Exception {
// ActionResult<Wo> result = new ActionResult<>();
// Wo wo = new Wo();
// try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {
// Business business = new Business(emc);
// Task task = emc.find(id, Task.class);
// if (null == task) {
// throw new ExceptionEntityNotExist(id, Task.class);
// }
// Work work = emc.find(task.getWork(), Work.class);
// if (null == work) {
// throw new ExceptionEntityNotExist(task.getWork(), Work.class);
// }
// Manual manual = (Manual) business.element().get(task.getActivity(), ActivityType.manual);
// Route route = getRoute(business, task, manual);
// List<String> identities = new ArrayList<>();
// if (ListTools.isNotEmpty(wi.getIdentityList())) {
// identities.addAll(wi.getIdentityList());
// }
// if (ifEvalScript(manual, route)) {
// evalScript(business, identities, manual, route, work, task);
// }
// Process process = business.element().get(task.getProcess(), Process.class);
// identities = business.organization().identity().list(ListTools.trim(identities, true, true));
// TaskIdentities taskIdentities = empower(business, process, task, identities);
// identities = taskIdentities.identities();
// if (ListTools.isNotEmpty(identities)) {
// List<TaskCompleted> os = emc.listEqualAndInAndNotEqual(TaskCompleted.class,
// TaskCompleted.activityToken_FIELDNAME, work.getActivityToken(),
// TaskCompleted.identity_FIELDNAME, identities, TaskCompleted.joinInquire_FIELDNAME, false);
// if (ListTools.isNotEmpty(os)) {
// emc.beginTransaction(TaskCompleted.class);
// for (TaskCompleted o : os) {
// o.setJoinInquire(false);
// o.setProcessingType(TaskCompleted.PROCESSINGTYPE_BEAPPENDEDTASK);
// }
// }
// wo.getValueList().addAll(new ArrayList<>(identities));
// identities = ListUtils.sum(
// ListUtils.subtract(work.getManualTaskIdentityList(), ListTools.toList(task.getIdentity())),
// identities);
// identities = business.organization().identity().list(ListTools.trim(identities, true, true));
// emc.beginTransaction(Work.class);
// work.setManualTaskIdentityList(identities);
// for (TaskIdentity taskIdentity : taskIdentities) {
// if (BooleanUtils.isNotTrue(taskIdentity.getIgnoreEmpower())
// && StringUtils.isNotEmpty(taskIdentity.getFromIdentity())) {
// work.getProperties().getManualEmpowerMap().put(taskIdentity.getIdentity(),
// taskIdentity.getFromIdentity());
// }
// }
// // properties中的集合对象需要重新new对象set进去,这样jpa才会更新数据
// Map<String, String> manualEmpowerMap = new LinkedHashMap<>();
// manualEmpowerMap.putAll(work.getProperties().getManualEmpowerMap());
// work.getProperties().setManualEmpowerMap(manualEmpowerMap);
// emc.commit();
// }
// result.setData(wo);
// }
// return result;
// }
// }
// public static ScriptContext scriptContext(Business business, Work work, Data data, Activity activity, Task task)
// throws Exception {
// ScriptContext scriptContext = new SimpleScriptContext();
// Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
// WorkContext workContext = new WorkContext(business, work, activity, task);
// bindings.put(ScriptingFactory.BINDING_NAME_WORKCONTEXT, workContext);
// bindings.put(ScriptingFactory.BINDING_NAME_DATA, data);
// bindings.put(ScriptFactory.BINDING_NAME_ORGANIZATION, business.organization());
// bindings.put(ScriptFactory.BINDING_NAME_WEBSERVICESCLIENT, new WebservicesClient());
// bindings.put(ScriptFactory.BINDING_NAME_DICTIONARY,
// new ApplicationDictHelper(business.entityManagerContainer(), work.getApplication()));
// bindings.put(ScriptFactory.BINDING_NAME_APPLICATIONS, ThisApplication.context().applications());
// // 重新创建的ScriptContext是需要初始化的
// ScriptFactory.initialScriptText().eval(scriptContext);
// return scriptContext;
// }
private
TaskIdentities
empower
(
Business
business
,
Process
process
,
Task
task
,
List
<
String
>
identities
)
private
TaskIdentities
empower
(
Business
business
,
Process
process
,
Task
task
,
List
<
String
>
identities
)
throws
Exception
{
throws
Exception
{
TaskIdentities
taskIdentities
=
new
TaskIdentities
();
TaskIdentities
taskIdentities
=
new
TaskIdentities
();
...
@@ -203,11 +203,63 @@ class ActionAppend extends BaseAction {
...
@@ -203,11 +203,63 @@ class ActionAppend extends BaseAction {
return
null
;
return
null
;
}
}
private
void
evalScript
(
Business
business
,
List
<
String
>
identities
,
Manual
manual
,
Route
route
,
Work
work
,
Task
task
)
throws
Exception
{
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
new
ProcessingAttributes
());
CompiledScript
compiledScript
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
route
,
Business
.
EVENT_ROUTEAPPENDTASKIDENTITY
);
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
aeiObjects
.
scriptContext
(),
identities:
:
addAll
);
}
private
boolean
ifEvalScript
(
Manual
manual
,
Route
route
)
{
return
(
route
!=
null
)
&&
StringUtils
.
equals
(
route
.
getType
(),
Route
.
TYPE_APPENDTASK
)
&&
StringUtils
.
equals
(
manual
.
getId
(),
route
.
getActivity
())
&&
StringUtils
.
equals
(
route
.
getAppendTaskIdentityType
(),
Route
.
APPENDTASKIDENTITYTYPE_SCRIPT
);
}
private
void
clean
(
Wo
wo
,
EntityManagerContainer
emc
,
Business
business
,
Task
task
,
Work
work
,
List
<
String
>
identities
,
TaskIdentities
taskIdentities
)
throws
Exception
{
List
<
TaskCompleted
>
os
=
emc
.
listEqualAndInAndNotEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
activityToken_FIELDNAME
,
work
.
getActivityToken
(),
TaskCompleted
.
identity_FIELDNAME
,
identities
,
TaskCompleted
.
joinInquire_FIELDNAME
,
false
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
emc
.
beginTransaction
(
TaskCompleted
.
class
);
for
(
TaskCompleted
o
:
os
)
{
o
.
setJoinInquire
(
false
);
o
.
setProcessingType
(
TaskCompleted
.
PROCESSINGTYPE_BEAPPENDEDTASK
);
}
}
wo
.
getValueList
().
addAll
(
new
ArrayList
<>(
identities
));
identities
=
ListUtils
.
sum
(
ListUtils
.
subtract
(
work
.
getManualTaskIdentityList
(),
ListTools
.
toList
(
task
.
getIdentity
())),
identities
);
identities
=
business
.
organization
().
identity
().
list
(
ListTools
.
trim
(
identities
,
true
,
true
));
emc
.
beginTransaction
(
Work
.
class
);
work
.
setManualTaskIdentityList
(
identities
);
for
(
TaskIdentity
taskIdentity
:
taskIdentities
)
{
if
(
BooleanUtils
.
isNotTrue
(
taskIdentity
.
getIgnoreEmpower
())
&&
StringUtils
.
isNotEmpty
(
taskIdentity
.
getFromIdentity
()))
{
work
.
getProperties
().
getManualEmpowerMap
().
put
(
taskIdentity
.
getIdentity
(),
taskIdentity
.
getFromIdentity
());
}
}
// properties中的集合对象需要重新new对象set进去,这样jpa才会更新数据
Map
<
String
,
String
>
manualEmpowerMap
=
new
LinkedHashMap
<>();
manualEmpowerMap
.
putAll
(
work
.
getProperties
().
getManualEmpowerMap
());
work
.
getProperties
().
setManualEmpowerMap
(
manualEmpowerMap
);
emc
.
commit
();
}
public
static
class
Wi
extends
WrapAppend
{
public
static
class
Wi
extends
WrapAppend
{
private
static
final
long
serialVersionUID
=
-
3293122515327864483L
;
}
}
public
static
class
Wo
extends
WrapStringList
{
public
static
class
Wo
extends
WrapStringList
{
private
static
final
long
serialVersionUID
=
6457473592503074552L
;
}
}
}
}
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionProcessing.java
浏览文件 @
5abbcb48
...
@@ -25,7 +25,8 @@ import com.x.base.core.project.http.EffectivePerson;
...
@@ -25,7 +25,8 @@ import com.x.base.core.project.http.EffectivePerson;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
...
@@ -86,13 +87,12 @@ class ActionProcessing extends BaseAction {
...
@@ -86,13 +87,12 @@ class ActionProcessing extends BaseAction {
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
new
ProcessingAttributes
());
new
ProcessingAttributes
());
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
((
WorkContext
)
scriptContext
.
getAttribute
(
ScriptFactory
.
BINDING_NAME_WORKCONTEXT
))
((
WorkContext
)
scriptContext
.
getAttribute
(
Script
ing
Factory
.
BINDING_NAME_WORKCONTEXT
))
.
bindTask
(
task
);
.
bindTask
(
task
);
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
business
.
entityManagerContainer
(),
work
);
WorkDataHelper
workDataHelper
=
new
WorkDataHelper
(
business
.
entityManagerContainer
(),
work
);
CompiledScript
cs
=
null
;
CompiledScript
cs
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
manual
,
cs
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
manual
,
Business
.
EVENT_MANUALBEFORETASK
);
Business
.
EVENT_MANUALBEFORETASK
);
cs
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
workDataHelper
.
update
(
aeiObjects
.
getData
());
workDataHelper
.
update
(
aeiObjects
.
getData
());
business
.
entityManagerContainer
().
commit
();
business
.
entityManagerContainer
().
commit
();
}
}
...
@@ -111,12 +111,11 @@ class ActionProcessing extends BaseAction {
...
@@ -111,12 +111,11 @@ class ActionProcessing extends BaseAction {
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
AeiObjects
aeiObjects
=
new
AeiObjects
(
business
,
work
,
manual
,
new
ProcessingConfigurator
(),
new
ProcessingAttributes
());
new
ProcessingAttributes
());
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
((
WorkContext
)
scriptContext
.
getAttribute
(
ScriptFactory
.
BINDING_NAME_WORKCONTEXT
))
((
WorkContext
)
scriptContext
.
getAttribute
(
Script
ing
Factory
.
BINDING_NAME_WORKCONTEXT
))
.
bindTaskCompleted
(
taskCompleted
);
.
bindTaskCompleted
(
taskCompleted
);
CompiledScript
cs
=
null
;
CompiledScript
cs
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
manual
,
cs
=
business
.
element
().
getCompiledScript
(
task
.
getApplication
(),
manual
,
Business
.
EVENT_MANUALAFTERTASK
);
Business
.
EVENT_MANUALAFTERTASK
);
cs
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
}
}
}
}
...
@@ -142,9 +141,7 @@ class ActionProcessing extends BaseAction {
...
@@ -142,9 +141,7 @@ class ActionProcessing extends BaseAction {
emc
.
beginTransaction
(
Task
.
class
);
emc
.
beginTransaction
(
Task
.
class
);
// 将所有前面的已办lastest标记false
// 将所有前面的已办lastest标记false
emc
.
listEqualAndEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
job_FIELDNAME
,
task
.
getJob
(),
emc
.
listEqualAndEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
job_FIELDNAME
,
task
.
getJob
(),
TaskCompleted
.
person_FIELDNAME
,
task
.
getPerson
()).
forEach
(
o
->
{
TaskCompleted
.
person_FIELDNAME
,
task
.
getPerson
()).
forEach
(
o
->
o
.
setLatest
(
false
));
o
.
setLatest
(
false
);
});
Date
now
=
new
Date
();
Date
now
=
new
Date
();
Long
duration
=
Config
.
workTime
().
betweenMinutes
(
task
.
getStartTime
(),
now
);
Long
duration
=
Config
.
workTime
().
betweenMinutes
(
task
.
getStartTime
(),
now
);
TaskCompleted
taskCompleted
=
new
TaskCompleted
(
task
,
wi
.
getProcessingType
(),
now
,
duration
);
TaskCompleted
taskCompleted
=
new
TaskCompleted
(
task
,
wi
.
getProcessingType
(),
now
,
duration
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/task/ActionWill.java
浏览文件 @
5abbcb48
...
@@ -87,7 +87,7 @@ class ActionWill extends BaseAction {
...
@@ -87,7 +87,7 @@ class ActionWill extends BaseAction {
if
(
null
!=
route
)
{
if
(
null
!=
route
)
{
wo
.
setDefaultRouteName
(
route
.
getName
());
wo
.
setDefaultRouteName
(
route
.
getName
());
wo
.
setNextActivityType
(
route
.
getActivityType
());
wo
.
setNextActivityType
(
route
.
getActivityType
());
Activity
nextActivity
=
business
.
element
().
get
Activity
(
route
.
getActivity
());
Activity
nextActivity
=
business
.
element
().
get
(
route
.
getActivity
(),
route
.
getActivityType
());
if
(
null
!=
nextActivity
)
{
if
(
null
!=
nextActivity
)
{
wo
.
setNextActivityName
(
nextActivity
.
getName
());
wo
.
setNextActivityName
(
nextActivity
.
getName
());
wo
.
setNextActivityAlias
(
nextActivity
.
getAlias
());
wo
.
setNextActivityAlias
(
nextActivity
.
getAlias
());
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/work/ActionAddSplit.java
浏览文件 @
5abbcb48
...
@@ -6,6 +6,7 @@ import java.util.List;
...
@@ -6,6 +6,7 @@ import java.util.List;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.Callable
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonElement
;
...
@@ -62,7 +63,7 @@ class ActionAddSplit extends BaseAction {
...
@@ -62,7 +63,7 @@ class ActionAddSplit extends BaseAction {
throw
new
ExceptionEntityNotExist
(
id
,
Work
.
class
);
throw
new
ExceptionEntityNotExist
(
id
,
Work
.
class
);
}
}
if
(
!
work
.
getSplitting
(
))
{
if
(
BooleanUtils
.
isFalse
(
work
.
getSplitting
()
))
{
throw
new
ExceptionNotSplit
(
work
.
getId
());
throw
new
ExceptionNotSplit
(
work
.
getId
());
}
}
if
(
ListTools
.
isEmpty
(
wi
.
getSplitValueList
()))
{
if
(
ListTools
.
isEmpty
(
wi
.
getSplitValueList
()))
{
...
@@ -89,7 +90,7 @@ class ActionAddSplit extends BaseAction {
...
@@ -89,7 +90,7 @@ class ActionAddSplit extends BaseAction {
throw
new
ExceptionInvalidFromWorkLog
(
wi
.
getWorkLog
());
throw
new
ExceptionInvalidFromWorkLog
(
wi
.
getWorkLog
());
}
}
Activity
activity
=
business
.
element
().
get
Activity
(
from
.
getFromActivity
());
Activity
activity
=
business
.
element
().
get
(
from
.
getFromActivity
(),
from
.
getArrivedActivityType
());
for
(
String
splitValue
:
wi
.
getSplitValueList
())
{
for
(
String
splitValue
:
wi
.
getSplitValueList
())
{
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractBaseProcessor.java
浏览文件 @
5abbcb48
package
com.x.processplatform.service.processing.processor
;
package
com.x.processplatform.service.processing.processor
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -28,7 +29,7 @@ import com.x.processplatform.service.processing.Business;
...
@@ -28,7 +29,7 @@ import com.x.processplatform.service.processing.Business;
*/
*/
public
abstract
class
AbstractBaseProcessor
{
public
abstract
class
AbstractBaseProcessor
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AbstractBaseProcessor
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AbstractBaseProcessor
.
class
);
private
EntityManagerContainer
entityManagerContainer
;
private
EntityManagerContainer
entityManagerContainer
;
...
@@ -49,35 +50,33 @@ public abstract class AbstractBaseProcessor {
...
@@ -49,35 +50,33 @@ public abstract class AbstractBaseProcessor {
return
this
.
business
;
return
this
.
business
;
}
}
protected
static
Integer
MAX_ERROR_RETRY
=
5
;
protected
static
final
Integer
MAX_ERROR_RETRY
=
5
;
protected
static
String
BAS
=
"beforeArriveScript"
;
protected
static
final
String
BAS
=
"beforeArriveScript"
;
protected
static
String
BAST
=
"beforeArriveScriptText"
;
protected
static
final
String
BAST
=
"beforeArriveScriptText"
;
protected
static
String
AAS
=
"afterArriveScript"
;
protected
static
final
String
AAS
=
"afterArriveScript"
;
protected
static
String
AAST
=
"afterArriveScriptText"
;
protected
static
final
String
AAST
=
"afterArriveScriptText"
;
protected
static
String
BES
=
"beforeExecuteScript"
;
protected
static
final
String
BES
=
"beforeExecuteScript"
;
protected
static
String
BEST
=
"beforeExecuteScriptText"
;
protected
static
final
String
BEST
=
"beforeExecuteScriptText"
;
protected
static
String
AES
=
"afterExecuteScript"
;
protected
static
final
String
AES
=
"afterExecuteScript"
;
protected
static
String
AEST
=
"afterExecuteScriptText"
;
protected
static
final
String
AEST
=
"afterExecuteScriptText"
;
protected
static
String
BIS
=
"beforeInquireScript"
;
protected
static
final
String
BIS
=
"beforeInquireScript"
;
protected
static
String
BIST
=
"beforeInquireScriptText"
;
protected
static
final
String
BIST
=
"beforeInquireScriptText"
;
protected
static
String
AIS
=
"afterInquireScript"
;
protected
static
final
String
AIS
=
"afterInquireScript"
;
protected
static
String
AIST
=
"afterInquireScriptText"
;
protected
static
final
String
AIST
=
"afterInquireScriptText"
;
protected
void
arriveActivity
(
AeiObjects
aeiObjects
)
throws
Exception
{
protected
void
arriveActivity
(
AeiObjects
aeiObjects
)
throws
Exception
{
String
token
=
aeiObjects
.
getWork
().
getActivityToken
();
String
token
=
aeiObjects
.
getWork
().
getActivityToken
();
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getChangeActivityToken
(
))
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getChangeActivityToken
()
))
{
token
=
StringTools
.
uniqueToken
();
token
=
StringTools
.
uniqueToken
();
}
}
Date
date
=
new
Date
();
Date
date
=
new
Date
();
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getStampArrivedWorkLog
())
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getStampArrivedWorkLog
())
/* 需要创建到达的工作日志 */
&&
ListTools
.
isNotEmpty
(
aeiObjects
.
getWorkLogs
()))
{
if
(
ListTools
.
isNotEmpty
(
aeiObjects
.
getWorkLogs
()))
{
/* 如果为空的话那么就是新建的工作,不需要连接到达日志 */
/* 如果为空的话那么就是新建的工作,不需要连接到达日志 */
this
.
stampArriveWorkLog
(
aeiObjects
,
token
,
date
);
this
.
stampArriveWorkLog
(
aeiObjects
,
token
,
date
);
}
}
}
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCreateFromWorkLog
(
))
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCreateFromWorkLog
()
))
{
this
.
createFromWorkLog
(
aeiObjects
,
token
,
date
);
this
.
createFromWorkLog
(
aeiObjects
,
token
,
date
);
}
}
aeiObjects
.
getWork
().
setActivityToken
(
token
);
aeiObjects
.
getWork
().
setActivityToken
(
token
);
...
@@ -88,11 +87,6 @@ public abstract class AbstractBaseProcessor {
...
@@ -88,11 +87,6 @@ public abstract class AbstractBaseProcessor {
aeiObjects
.
getWork
().
setActivityDescription
(
aeiObjects
.
getActivity
().
getDescription
());
aeiObjects
.
getWork
().
setActivityDescription
(
aeiObjects
.
getActivity
().
getDescription
());
aeiObjects
.
getWork
().
setActivityType
(
aeiObjects
.
getActivity
().
getActivityType
());
aeiObjects
.
getWork
().
setActivityType
(
aeiObjects
.
getActivity
().
getActivityType
());
aeiObjects
.
getWork
().
setWorkStatus
(
WorkStatus
.
processing
);
aeiObjects
.
getWork
().
setWorkStatus
(
WorkStatus
.
processing
);
// aeiObjects.getWork().setDestinationActivity(null);
// aeiObjects.getWork().setDestinationActivityType(null);
// aeiObjects.getWork().setDestinationRoute(null);
// aeiObjects.getWork().setDestinationRouteName(null);
// aeiObjects.getWork().setErrorRetry(0);
if
(
StringUtils
.
isNotEmpty
(
aeiObjects
.
getActivity
().
getForm
()))
{
if
(
StringUtils
.
isNotEmpty
(
aeiObjects
.
getActivity
().
getForm
()))
{
/** 检查表单存在 */
/** 检查表单存在 */
Form
form
=
this
.
business
().
element
().
get
(
aeiObjects
.
getActivity
().
getForm
(),
Form
.
class
);
Form
form
=
this
.
business
().
element
().
get
(
aeiObjects
.
getActivity
().
getForm
(),
Form
.
class
);
...
@@ -130,7 +124,6 @@ public abstract class AbstractBaseProcessor {
...
@@ -130,7 +124,6 @@ public abstract class AbstractBaseProcessor {
.
sorted
(
Comparator
.
comparing
(
WorkLog:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)))
.
sorted
(
Comparator
.
comparing
(
WorkLog:
:
getCreateTime
,
Comparator
.
nullsLast
(
Date:
:
compareTo
)))
.
findFirst
().
orElse
(
null
);
.
findFirst
().
orElse
(
null
);
if
(
null
!=
oldest
)
{
if
(
null
!=
oldest
)
{
// @Todo
workLog
=
new
WorkLog
();
workLog
=
new
WorkLog
();
oldest
.
copyTo
(
workLog
,
JpaObject
.
ID_DISTRIBUTEFACTOR
);
oldest
.
copyTo
(
workLog
,
JpaObject
.
ID_DISTRIBUTEFACTOR
);
workLog
.
setArrivedActivity
(
aeiObjects
.
getActivity
().
getId
());
workLog
.
setArrivedActivity
(
aeiObjects
.
getActivity
().
getId
());
...
@@ -148,98 +141,116 @@ public abstract class AbstractBaseProcessor {
...
@@ -148,98 +141,116 @@ public abstract class AbstractBaseProcessor {
aeiObjects
.
getCreateWorkLogs
().
add
(
workLog
);
aeiObjects
.
getCreateWorkLogs
().
add
(
workLog
);
}
else
{
}
else
{
/* 这样的情况应该是不可能的 */
/* 这样的情况应该是不可能的 */
throw
new
Exception
(
"不能发生的情况,没有找到任何WorkLog"
);
throw
new
IllegalState
Exception
(
"不能发生的情况,没有找到任何WorkLog"
);
}
}
}
}
return
workLog
;
return
workLog
;
}
}
protected
Work
copyWork
(
Work
work
)
throws
Exception
{
protected
Work
copyWork
(
Work
work
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethod
Exception
{
Work
copy
=
new
Work
();
Work
copy
=
new
Work
();
work
.
copyTo
(
copy
,
JpaObject
.
ID_DISTRIBUTEFACTOR
);
work
.
copyTo
(
copy
,
JpaObject
.
ID_DISTRIBUTEFACTOR
);
return
copy
;
return
copy
;
}
}
protected
boolean
hasBeforeArriveScript
(
Process
process
,
Activity
activity
)
throws
Exception
{
protected
boolean
hasBeforeArriveScript
(
Process
process
,
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
this
.
hasBeforeArriveScript
(
process
)
||
this
.
hasBeforeArriveScript
(
activity
);
return
this
.
hasBeforeArriveScript
(
process
)
||
this
.
hasBeforeArriveScript
(
activity
);
}
}
protected
boolean
hasBeforeArriveScript
(
Process
process
)
throws
Exception
{
protected
boolean
hasBeforeArriveScript
(
Process
process
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
process
.
get
(
BAS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
process
.
get
(
BAS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
process
.
get
(
BAST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
process
.
get
(
BAST
,
String
.
class
));
}
}
protected
boolean
hasBeforeArriveScript
(
Activity
activity
)
throws
Exception
{
protected
boolean
hasBeforeArriveScript
(
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
BAS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
BAS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
BAST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
BAST
,
String
.
class
));
}
}
protected
boolean
hasAfterArriveScript
(
Process
process
,
Activity
activity
)
throws
Exception
{
protected
boolean
hasAfterArriveScript
(
Process
process
,
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
this
.
hasAfterArriveScript
(
process
)
||
this
.
hasAfterArriveScript
(
activity
);
return
this
.
hasAfterArriveScript
(
process
)
||
this
.
hasAfterArriveScript
(
activity
);
}
}
protected
boolean
hasAfterArriveScript
(
Process
process
)
throws
Exception
{
protected
boolean
hasAfterArriveScript
(
Process
process
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
process
.
get
(
AAS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
process
.
get
(
AAS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
process
.
get
(
AAST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
process
.
get
(
AAST
,
String
.
class
));
}
}
protected
boolean
hasAfterArriveScript
(
Activity
activity
)
throws
Exception
{
protected
boolean
hasAfterArriveScript
(
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
AAS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
AAS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
AAST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
AAST
,
String
.
class
));
}
}
protected
boolean
hasBeforeExecuteScript
(
Process
process
,
Activity
activity
)
throws
Exception
{
protected
boolean
hasBeforeExecuteScript
(
Process
process
,
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
this
.
hasBeforeExecuteScript
(
process
)
||
this
.
hasBeforeExecuteScript
(
activity
);
return
this
.
hasBeforeExecuteScript
(
process
)
||
this
.
hasBeforeExecuteScript
(
activity
);
}
}
protected
boolean
hasBeforeExecuteScript
(
Process
process
)
throws
Exception
{
protected
boolean
hasBeforeExecuteScript
(
Process
process
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
process
.
get
(
BES
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
process
.
get
(
BES
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
process
.
get
(
BEST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
process
.
get
(
BEST
,
String
.
class
));
}
}
protected
boolean
hasBeforeExecuteScript
(
Activity
activity
)
throws
Exception
{
protected
boolean
hasBeforeExecuteScript
(
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
BES
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
BES
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
BEST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
BEST
,
String
.
class
));
}
}
protected
boolean
hasAfterExecuteScript
(
Process
process
,
Activity
activity
)
throws
Exception
{
protected
boolean
hasAfterExecuteScript
(
Process
process
,
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
this
.
hasAfterExecuteScript
(
process
)
||
this
.
hasAfterExecuteScript
(
activity
);
return
this
.
hasAfterExecuteScript
(
process
)
||
this
.
hasAfterExecuteScript
(
activity
);
}
}
protected
boolean
hasAfterExecuteScript
(
Process
process
)
throws
Exception
{
protected
boolean
hasAfterExecuteScript
(
Process
process
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
process
.
get
(
AES
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
process
.
get
(
AES
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
process
.
get
(
AEST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
process
.
get
(
AEST
,
String
.
class
));
}
}
protected
boolean
hasAfterExecuteScript
(
Activity
activity
)
throws
Exception
{
protected
boolean
hasAfterExecuteScript
(
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
AES
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
AES
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
AEST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
AEST
,
String
.
class
));
}
}
protected
boolean
hasBeforeInquireScript
(
Process
process
,
Activity
activity
)
throws
Exception
{
protected
boolean
hasBeforeInquireScript
(
Process
process
,
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
this
.
hasBeforeInquireScript
(
process
)
||
this
.
hasBeforeInquireScript
(
activity
);
return
this
.
hasBeforeInquireScript
(
process
)
||
this
.
hasBeforeInquireScript
(
activity
);
}
}
protected
boolean
hasBeforeInquireScript
(
Process
process
)
throws
Exception
{
protected
boolean
hasBeforeInquireScript
(
Process
process
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
process
.
get
(
BIS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
process
.
get
(
BIS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
process
.
get
(
BIST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
process
.
get
(
BIST
,
String
.
class
));
}
}
protected
boolean
hasBeforeInquireScript
(
Activity
activity
)
throws
Exception
{
protected
boolean
hasBeforeInquireScript
(
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
BIS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
BIS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
BIST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
BIST
,
String
.
class
));
}
}
protected
boolean
hasAfterInquireScript
(
Process
process
,
Activity
activity
)
throws
Exception
{
protected
boolean
hasAfterInquireScript
(
Process
process
,
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
this
.
hasAfterInquireScript
(
process
)
||
this
.
hasAfterInquireScript
(
activity
);
return
this
.
hasAfterInquireScript
(
process
)
||
this
.
hasAfterInquireScript
(
activity
);
}
}
protected
boolean
hasAfterInquireScript
(
Process
process
)
throws
Exception
{
protected
boolean
hasAfterInquireScript
(
Process
process
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
process
.
get
(
AIS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
process
.
get
(
AIS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
process
.
get
(
AIST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
process
.
get
(
AIST
,
String
.
class
));
}
}
protected
boolean
hasAfterInquireScript
(
Activity
activity
)
throws
Exception
{
protected
boolean
hasAfterInquireScript
(
Activity
activity
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
AIS
,
String
.
class
))
return
StringUtils
.
isNotEmpty
(
activity
.
get
(
AIS
,
String
.
class
))
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
AIST
,
String
.
class
));
||
StringUtils
.
isNotEmpty
(
activity
.
get
(
AIST
,
String
.
class
));
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AbstractProcessor.java
浏览文件 @
5abbcb48
...
@@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -14,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Read
;
import
com.x.processplatform.core.entity.content.Read
;
import
com.x.processplatform.core.entity.content.Review
;
import
com.x.processplatform.core.entity.content.Review
;
...
@@ -245,39 +246,36 @@ public abstract class AbstractProcessor extends AbstractBaseProcessor {
...
@@ -245,39 +246,36 @@ public abstract class AbstractProcessor extends AbstractBaseProcessor {
}
}
private
void
callBeforeExecuteScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
private
void
callBeforeExecuteScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallBeforeExecuteScript
())
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallBeforeExecuteScript
())
if
(
this
.
hasBeforeExecuteScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
&&
this
.
hasBeforeExecuteScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
null
;
CompiledScript
cs
=
null
;
if
(
this
.
hasBeforeExecuteScript
(
aeiObjects
.
getProcess
()))
{
if
(
this
.
hasBeforeExecuteScript
(
aeiObjects
.
getProcess
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getProcess
(),
Business
.
EVENT_BEFOREEXECUTE
);
aeiObjects
.
getProcess
(),
Business
.
EVENT_BEFOREEXECUTE
);
cs
.
eval
(
scriptContext
);
}
}
if
(
this
.
hasBeforeExecuteScript
(
aeiObjects
.
getActivity
()))
{
if
(
this
.
hasBeforeExecuteScript
(
aeiObjects
.
getActivity
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_BEFOREEXECUTE
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_BEFOREEXECUTE
);
cs
.
eval
(
scriptContext
);
}
}
}
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
}
}
private
void
callAfterExecuteScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
private
void
callAfterExecuteScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallAfterExecuteScript
())
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallAfterExecuteScript
())
if
(
this
.
hasAfterExecuteScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
&&
this
.
hasAfterExecuteScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
null
;
CompiledScript
cs
=
null
;
if
(
this
.
hasAfterExecuteScript
(
aeiObjects
.
getProcess
()))
{
if
(
this
.
hasAfterExecuteScript
(
aeiObjects
.
getProcess
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getProcess
(),
Business
.
EVENT_AFTEREXECUTE
);
aeiObjects
.
getProcess
(),
Business
.
EVENT_AFTEREXECUTE
);
cs
.
eval
(
scriptContext
);
cs
.
eval
(
scriptContext
);
}
}
if
(
this
.
hasAfterExecuteScript
(
aeiObjects
.
getActivity
()))
{
if
(
this
.
hasAfterExecuteScript
(
aeiObjects
.
getActivity
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_AFTEREXECUTE
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_AFTEREXECUTE
);
cs
.
eval
(
scriptContext
);
cs
.
eval
(
scriptContext
);
}
}
}
}
}
}
}
...
@@ -356,39 +354,36 @@ public abstract class AbstractProcessor extends AbstractBaseProcessor {
...
@@ -356,39 +354,36 @@ public abstract class AbstractProcessor extends AbstractBaseProcessor {
}
}
private
void
callBeforeInquireScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
private
void
callBeforeInquireScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallBeforeInquireScript
())
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallBeforeInquireScript
())
if
(
this
.
hasBeforeInquireScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
&&
this
.
hasBeforeInquireScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
null
;
CompiledScript
cs
=
null
;
if
(
this
.
hasBeforeInquireScript
(
aeiObjects
.
getProcess
()))
{
if
(
this
.
hasBeforeInquireScript
(
aeiObjects
.
getProcess
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getProcess
(),
Business
.
EVENT_BEFOREINQUIRE
);
aeiObjects
.
getProcess
(),
Business
.
EVENT_BEFOREINQUIRE
);
cs
.
eval
(
scriptContext
);
}
}
if
(
this
.
hasBeforeInquireScript
(
aeiObjects
.
getActivity
()))
{
if
(
this
.
hasBeforeInquireScript
(
aeiObjects
.
getActivity
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_BEFOREINQUIRE
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_BEFOREINQUIRE
);
cs
.
eval
(
scriptContext
);
}
}
}
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
}
}
private
void
callAfterInquireScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
private
void
callAfterInquireScript
(
AeiObjects
aeiObjects
)
throws
Exception
{
if
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallAfterInquireScript
())
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getActivityProcessingConfigurator
().
getCallAfterInquireScript
())
if
(
this
.
hasAfterInquireScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
&&
this
.
hasAfterInquireScript
(
aeiObjects
.
getProcess
(),
aeiObjects
.
getActivity
()))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
null
;
CompiledScript
cs
=
null
;
if
(
this
.
hasAfterInquireScript
(
aeiObjects
.
getProcess
()))
{
if
(
this
.
hasAfterInquireScript
(
aeiObjects
.
getProcess
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getProcess
(),
Business
.
EVENT_AFTERINQUIRE
);
aeiObjects
.
getProcess
(),
Business
.
EVENT_AFTERINQUIRE
);
cs
.
eval
(
scriptContext
);
cs
.
eval
(
scriptContext
);
}
}
if
(
this
.
hasAfterInquireScript
(
aeiObjects
.
getActivity
()))
{
if
(
this
.
hasAfterInquireScript
(
aeiObjects
.
getActivity
()))
{
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_AFTERINQUIRE
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_AFTERINQUIRE
);
cs
.
eval
(
scriptContext
);
cs
.
eval
(
scriptContext
);
}
}
}
}
}
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/AeiObjects.java
浏览文件 @
5abbcb48
...
@@ -10,7 +10,6 @@ import java.util.stream.Collectors;
...
@@ -10,7 +10,6 @@ import java.util.stream.Collectors;
import
javax.script.Bindings
;
import
javax.script.Bindings
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
...
@@ -27,9 +26,11 @@ import com.x.base.core.project.gson.GsonPropertyObject;
...
@@ -27,9 +26,11 @@ import com.x.base.core.project.gson.GsonPropertyObject;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.script.AbstractResources
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.webservices.WebservicesClient
;
import
com.x.base.core.project.webservices.WebservicesClient
;
import
com.x.organization.core.express.Organization
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.DocumentVersion
;
import
com.x.processplatform.core.entity.content.DocumentVersion
;
...
@@ -53,7 +54,6 @@ import com.x.processplatform.core.entity.element.Route;
...
@@ -53,7 +54,6 @@ import com.x.processplatform.core.entity.element.Route;
import
com.x.processplatform.core.entity.element.util.MappingFactory
;
import
com.x.processplatform.core.entity.element.util.MappingFactory
;
import
com.x.processplatform.core.entity.element.util.ProjectionFactory
;
import
com.x.processplatform.core.entity.element.util.ProjectionFactory
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.core.express.ProcessingAttributes
;
import
com.x.processplatform.service.processing.ApplicationDictHelper
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.processplatform.service.processing.Business
;
import
com.x.processplatform.service.processing.MessageFactory
;
import
com.x.processplatform.service.processing.MessageFactory
;
import
com.x.processplatform.service.processing.ThisApplication
;
import
com.x.processplatform.service.processing.ThisApplication
;
...
@@ -66,7 +66,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -66,7 +66,7 @@ public class AeiObjects extends GsonPropertyObject {
private
static
final
long
serialVersionUID
=
-
4125441813647193068L
;
private
static
final
long
serialVersionUID
=
-
4125441813647193068L
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AeiObjects
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
AeiObjects
.
class
);
public
AeiObjects
(
Business
business
,
Work
work
,
Activity
activity
,
ProcessingConfigurator
processingConfigurator
,
public
AeiObjects
(
Business
business
,
Work
work
,
Activity
activity
,
ProcessingConfigurator
processingConfigurator
,
ProcessingAttributes
processingAttributes
)
throws
Exception
{
ProcessingAttributes
processingAttributes
)
throws
Exception
{
...
@@ -194,9 +194,13 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -194,9 +194,13 @@ public class AeiObjects extends GsonPropertyObject {
.
orElse
(
null
);
.
orElse
(
null
);
}
}
public
WorkDataHelper
getWorkDataHelper
()
throws
Exception
{
public
WorkDataHelper
getWorkDataHelper
()
{
if
(
null
==
this
.
workDataHelper
)
{
try
{
this
.
workDataHelper
=
new
WorkDataHelper
(
business
.
entityManagerContainer
(),
work
);
if
(
null
==
this
.
workDataHelper
)
{
this
.
workDataHelper
=
new
WorkDataHelper
(
business
.
entityManagerContainer
(),
work
);
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
return
this
.
workDataHelper
;
return
this
.
workDataHelper
;
}
}
...
@@ -560,7 +564,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -560,7 +564,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
executeProjection
();
this
.
executeProjection
();
this
.
executeMapping
();
this
.
executeMapping
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
this
.
commitWork
();
this
.
commitWork
();
this
.
commitWorkCompleted
();
this
.
commitWorkCompleted
();
...
@@ -788,7 +792,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -788,7 +792,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 更新工作
// 更新工作
...
@@ -796,7 +800,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -796,7 +800,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 删除工作
// 删除工作
...
@@ -808,7 +812,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -808,7 +812,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -823,7 +827,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -823,7 +827,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 更新完成工作
// 更新完成工作
...
@@ -831,7 +835,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -831,7 +835,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 删除完成工作
// 删除完成工作
...
@@ -843,7 +847,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -843,7 +847,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -858,7 +862,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -858,7 +862,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 更新工作日志
// 更新工作日志
...
@@ -866,7 +870,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -866,7 +870,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 删除工作日志
// 删除工作日志
...
@@ -878,7 +882,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -878,7 +882,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -913,7 +917,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -913,7 +917,7 @@ public class AeiObjects extends GsonPropertyObject {
// 创建待办的参阅
// 创建待办的参阅
this
.
createReview
(
new
Review
(
this
.
getWork
(),
o
.
getPerson
()));
this
.
createReview
(
new
Review
(
this
.
getWork
(),
o
.
getPerson
()));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -923,7 +927,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -923,7 +927,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -937,7 +941,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -937,7 +941,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -965,7 +969,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -965,7 +969,7 @@ public class AeiObjects extends GsonPropertyObject {
// 创建已办的参阅
// 创建已办的参阅
this
.
createReview
(
new
Review
(
this
.
getWork
(),
o
.
getPerson
()));
this
.
createReview
(
new
Review
(
this
.
getWork
(),
o
.
getPerson
()));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -975,7 +979,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -975,7 +979,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -997,7 +1001,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -997,7 +1001,7 @@ public class AeiObjects extends GsonPropertyObject {
.
findFirst
().
ifPresent
(
q
->
q
.
setLatest
(
true
));
.
findFirst
().
ifPresent
(
q
->
q
.
setLatest
(
true
));
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1041,7 +1045,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1041,7 +1045,7 @@ public class AeiObjects extends GsonPropertyObject {
o
.
copyTo
(
existOptional
.
get
(),
JpaObject
.
FieldsUnmodify
);
o
.
copyTo
(
existOptional
.
get
(),
JpaObject
.
FieldsUnmodify
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
}));
}));
...
@@ -1052,7 +1056,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1052,7 +1056,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1066,7 +1070,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1066,7 +1070,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1101,7 +1105,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1101,7 +1105,7 @@ public class AeiObjects extends GsonPropertyObject {
o
.
copyTo
(
optional
.
get
(),
JpaObject
.
FieldsUnmodify
);
o
.
copyTo
(
optional
.
get
(),
JpaObject
.
FieldsUnmodify
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1111,7 +1115,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1111,7 +1115,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1125,7 +1129,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1125,7 +1129,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1164,7 +1168,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1164,7 +1168,7 @@ public class AeiObjects extends GsonPropertyObject {
o
.
copyTo
(
existOptional
.
get
(),
JpaObject
.
FieldsUnmodify
);
o
.
copyTo
(
existOptional
.
get
(),
JpaObject
.
FieldsUnmodify
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
}));
}));
}
}
...
@@ -1174,7 +1178,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1174,7 +1178,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1188,7 +1192,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1188,7 +1192,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1203,7 +1207,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1203,7 +1207,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 更新版式文件
// 更新版式文件
...
@@ -1211,7 +1215,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1211,7 +1215,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 删除版式文件
// 删除版式文件
...
@@ -1222,7 +1226,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1222,7 +1226,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1236,14 +1240,14 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1236,14 +1240,14 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
this
.
getUpdateSnaps
().
stream
().
forEach
(
o
->
{
this
.
getUpdateSnaps
().
stream
().
forEach
(
o
->
{
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
this
.
getDeleteSnaps
().
stream
().
forEach
(
o
->
{
this
.
getDeleteSnaps
().
stream
().
forEach
(
o
->
{
...
@@ -1253,7 +1257,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1253,7 +1257,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1268,7 +1272,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1268,7 +1272,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 删除记录
// 删除记录
...
@@ -1276,7 +1280,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1276,7 +1280,7 @@ public class AeiObjects extends GsonPropertyObject {
try
{
try
{
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
this
.
getDeleteRecords
().
stream
().
forEach
(
o
->
{
this
.
getDeleteRecords
().
stream
().
forEach
(
o
->
{
...
@@ -1287,7 +1291,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1287,7 +1291,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1310,7 +1314,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1310,7 +1314,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
obj
,
CheckRemoveType
.
all
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
}
}
...
@@ -1325,11 +1329,10 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1325,11 +1329,10 @@ public class AeiObjects extends GsonPropertyObject {
}
else
{
}
else
{
dataToUpdate
.
setWork
(
this
.
getWork
());
dataToUpdate
.
setWork
(
this
.
getWork
());
}
}
// this.getWorkDataHelper().update(data);
this
.
getWorkDataHelper
().
update
(
dataToUpdate
);
this
.
getWorkDataHelper
().
update
(
dataToUpdate
);
}
}
private
void
commitDynamicEntity
()
throws
Exception
{
private
void
commitDynamicEntity
()
{
if
(
ListTools
.
isNotEmpty
(
this
.
getCreateDynamicEntities
())
if
(
ListTools
.
isNotEmpty
(
this
.
getCreateDynamicEntities
())
||
ListTools
.
isNotEmpty
(
this
.
getDeleteDynamicEntities
())
||
ListTools
.
isNotEmpty
(
this
.
getDeleteDynamicEntities
())
||
ListTools
.
isNotEmpty
(
this
.
getUpdateDynamicEntities
()))
{
||
ListTools
.
isNotEmpty
(
this
.
getUpdateDynamicEntities
()))
{
...
@@ -1339,7 +1342,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1339,7 +1342,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
beginTransaction
(
o
.
getClass
());
this
.
business
.
entityManagerContainer
().
beginTransaction
(
o
.
getClass
());
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
persist
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 更新自定义对象
// 更新自定义对象
...
@@ -1348,7 +1351,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1348,7 +1351,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
beginTransaction
(
o
.
getClass
());
this
.
business
.
entityManagerContainer
().
beginTransaction
(
o
.
getClass
());
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
this
.
business
.
entityManagerContainer
().
check
(
o
,
CheckPersistType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
// 删除自定义对象
// 删除自定义对象
...
@@ -1357,7 +1360,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1357,7 +1360,7 @@ public class AeiObjects extends GsonPropertyObject {
this
.
business
.
entityManagerContainer
().
beginTransaction
(
o
.
getClass
());
this
.
business
.
entityManagerContainer
().
beginTransaction
(
o
.
getClass
());
this
.
business
.
entityManagerContainer
().
remove
(
o
,
CheckRemoveType
.
all
);
this
.
business
.
entityManagerContainer
().
remove
(
o
,
CheckRemoveType
.
all
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
});
});
...
@@ -1487,7 +1490,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1487,7 +1490,7 @@ public class AeiObjects extends GsonPropertyObject {
MessageFactory
.
read_create
(
o
);
MessageFactory
.
read_create
(
o
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
}));
}));
}
}
...
@@ -1526,7 +1529,7 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1526,7 +1529,7 @@ public class AeiObjects extends GsonPropertyObject {
MessageFactory
.
review_create
(
o
);
MessageFactory
.
review_create
(
o
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
LOGGER
.
error
(
e
);
}
}
}));
}));
}
}
...
@@ -1615,22 +1618,32 @@ public class AeiObjects extends GsonPropertyObject {
...
@@ -1615,22 +1618,32 @@ public class AeiObjects extends GsonPropertyObject {
return
deleteDynamicEntities
;
return
deleteDynamicEntities
;
}
}
public
static
class
Resources
extends
AbstractResources
{
private
Organization
organization
;
public
Organization
getOrganization
()
{
return
organization
;
}
public
void
setOrganization
(
Organization
organization
)
{
this
.
organization
=
organization
;
}
}
public
ScriptContext
scriptContext
()
throws
Exception
{
public
ScriptContext
scriptContext
()
throws
Exception
{
if
(
null
==
this
.
scriptContext
)
{
if
(
null
==
this
.
scriptContext
)
{
this
.
scriptContext
=
new
SimpleScriptContext
();
this
.
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialScript
();
Bindings
bindings
=
this
.
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
}
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_WORKCONTEXT
,
new
WorkContext
(
this
));
Bindings
bindings
=
this
.
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_GSON
,
XGsonBuilder
.
instance
());
Resources
resources
=
new
Resources
();
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_DATA
,
this
.
getData
());
resources
.
setApplications
(
ThisApplication
.
context
().
applications
());
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_ORGANIZATION
,
this
.
business
().
organization
());
resources
.
setOrganization
(
this
.
business
().
organization
());
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_WEBSERVICESCLIENT
,
new
WebservicesClient
());
resources
.
setWebservicesClient
(
new
WebservicesClient
());
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_DICTIONARY
,
resources
.
setContext
(
ThisApplication
.
context
());
new
ApplicationDictHelper
(
this
.
entityManagerContainer
(),
this
.
getWork
().
getApplication
()));
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_RESOURCES
,
resources
);
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_APPLICATIONS
,
ThisApplication
.
context
().
applications
());
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_WORKCONTEXT
,
new
WorkContext
(
this
));
bindings
.
put
(
ScriptFactory
.
BINDING_NAME_ROUTES
,
this
.
getRoutes
());
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_DATA
,
this
.
getData
());
// 重新创建的ScriptContext是需要初始化的
ScriptFactory
.
initialScriptText
().
eval
(
this
.
scriptContext
);
}
return
this
.
scriptContext
;
return
this
.
scriptContext
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/TranslateReadIdentityTools.java
浏览文件 @
5abbcb48
...
@@ -15,7 +15,7 @@ import com.google.gson.JsonObject;
...
@@ -15,7 +15,7 @@ import com.google.gson.JsonObject;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script
.ScriptFactory
;
import
com.x.base.core.project.script
ing.JsonScriptingExecutor
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.express.Organization.ClassifyDistinguishedName
;
import
com.x.organization.core.express.Organization.ClassifyDistinguishedName
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.Data
;
...
@@ -30,7 +30,11 @@ import com.x.processplatform.service.processing.Business;
...
@@ -30,7 +30,11 @@ import com.x.processplatform.service.processing.Business;
*/
*/
public
class
TranslateReadIdentityTools
{
public
class
TranslateReadIdentityTools
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TranslateReadIdentityTools
.
class
);
private
TranslateReadIdentityTools
()
{
// nothing
}
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TranslateReadIdentityTools
.
class
);
/** 计算活动节点中所有的待阅,全部翻译成Identity */
/** 计算活动节点中所有的待阅,全部翻译成Identity */
public
static
List
<
String
>
translate
(
AeiObjects
aeiObjects
)
throws
Exception
{
public
static
List
<
String
>
translate
(
AeiObjects
aeiObjects
)
throws
Exception
{
...
@@ -66,12 +70,12 @@ public class TranslateReadIdentityTools {
...
@@ -66,12 +70,12 @@ public class TranslateReadIdentityTools {
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithGroup
(
groups
));
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithGroup
(
groups
));
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithUnitSubDirect
(
units
));
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithUnitSubDirect
(
units
));
identities
=
ListTools
.
trim
(
identities
,
true
,
true
);
identities
=
ListTools
.
trim
(
identities
,
true
,
true
);
logger
.
debug
(
"work title:{}, id:{}, activity name:{}, id:{}, translate read identity: {}"
,
LOGGER
.
debug
(
"work title:{}, id:{}, activity name:{}, id:{}, translate read identity: {}"
,
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
));
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
));
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
identity
().
list
(
identities
);
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
identity
().
list
(
identities
);
if
(
os
.
size
()
!=
identities
.
size
())
{
if
(
os
.
size
()
!=
identities
.
size
())
{
logger
.
warn
(
LOGGER
.
warn
(
"work title:{}, id:{}, activity name:{}, id:{}, translate read identity: {}, result not with same length: {}."
,
"work title:{}, id:{}, activity name:{}, id:{}, translate read identity: {}, result not with same length: {}."
,
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
),
XGsonBuilder
.
toJson
(
os
));
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
),
XGsonBuilder
.
toJson
(
os
));
...
@@ -91,17 +95,19 @@ public class TranslateReadIdentityTools {
...
@@ -91,17 +95,19 @@ public class TranslateReadIdentityTools {
String
code
=
o
.
get
(
"code"
).
getAsString
();
String
code
=
o
.
get
(
"code"
).
getAsString
();
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
.
getCompiledScript
(
aeiObjects
.
getActivity
(),
Business
.
EVENT_READDUTY
,
name
,
code
);
.
getCompiledScript
(
aeiObjects
.
getActivity
(),
Business
.
EVENT_READDUTY
,
name
,
code
);
Object
objectValue
=
compiledScript
.
eval
(
aeiObjects
.
scriptContext
());
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
aeiObjects
.
scriptContext
(),
ds
->
{
List
<
String
>
ds
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
try
{
if
(
ListTools
.
isNotEmpty
(
ds
)
)
{
for
(
String
str
:
ds
)
{
for
(
String
str
:
ds
)
{
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
unitDuty
()
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
unitDuty
()
.
listIdentityWithUnitWithName
(
str
,
name
);
.
listIdentityWithUnitWithName
(
str
,
name
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
if
(
ListTools
.
isNotEmpty
(
os
))
{
list
.
addAll
(
os
);
list
.
addAll
(
os
);
}
}
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
}
}
);
}
}
}
}
return
ListTools
.
trim
(
list
,
true
,
true
);
return
ListTools
.
trim
(
list
,
true
,
true
);
...
@@ -115,11 +121,7 @@ public class TranslateReadIdentityTools {
...
@@ -115,11 +121,7 @@ public class TranslateReadIdentityTools {
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_READ
);
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_READ
);
Object
objectValue
=
compiledScript
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
scriptContext
,
list:
:
addAll
);
List
<
String
>
os
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
list
.
addAll
(
os
);
}
}
}
return
list
;
return
list
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/TranslateReviewPersonTools.java
浏览文件 @
5abbcb48
...
@@ -5,7 +5,6 @@ import java.util.Iterator;
...
@@ -5,7 +5,6 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.List
;
import
javax.script.CompiledScript
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -15,7 +14,7 @@ import com.google.gson.JsonObject;
...
@@ -15,7 +14,7 @@ import com.google.gson.JsonObject;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script
.ScriptFactory
;
import
com.x.base.core.project.script
ing.JsonScriptingExecutor
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.express.Organization.ClassifyDistinguishedName
;
import
com.x.organization.core.express.Organization.ClassifyDistinguishedName
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.Data
;
...
@@ -30,7 +29,11 @@ import com.x.processplatform.service.processing.Business;
...
@@ -30,7 +29,11 @@ import com.x.processplatform.service.processing.Business;
*/
*/
public
class
TranslateReviewPersonTools
{
public
class
TranslateReviewPersonTools
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TranslateReviewPersonTools
.
class
);
private
TranslateReviewPersonTools
()
{
// nothing
}
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TranslateReviewPersonTools
.
class
);
/* 计算参阅人,全部翻译成Identity,最终全部转换为person */
/* 计算参阅人,全部翻译成Identity,最终全部转换为person */
public
static
List
<
String
>
translate
(
AeiObjects
aeiObjects
)
throws
Exception
{
public
static
List
<
String
>
translate
(
AeiObjects
aeiObjects
)
throws
Exception
{
...
@@ -66,12 +69,12 @@ public class TranslateReviewPersonTools {
...
@@ -66,12 +69,12 @@ public class TranslateReviewPersonTools {
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithGroup
(
groups
));
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithGroup
(
groups
));
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithUnitSubNested
(
units
));
identities
.
addAll
(
aeiObjects
.
business
().
organization
().
identity
().
listWithUnitSubNested
(
units
));
identities
=
ListTools
.
trim
(
identities
,
true
,
true
);
identities
=
ListTools
.
trim
(
identities
,
true
,
true
);
logger
.
debug
(
"work title:{}, id:{}, activity name:{}, id:{}, translate review identity: {}"
,
LOGGER
.
debug
(
"work title:{}, id:{}, activity name:{}, id:{}, translate review identity: {}"
,
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
));
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
));
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
person
().
listWithIdentity
(
identities
);
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
person
().
listWithIdentity
(
identities
);
if
(
os
.
size
()
!=
identities
.
size
())
{
if
(
os
.
size
()
!=
identities
.
size
())
{
logger
.
warn
(
LOGGER
.
warn
(
"work title:{}, id:{}, activity name:{}, id:{}, translate review identity: {}, result not with same length: {}."
,
"work title:{}, id:{}, activity name:{}, id:{}, translate review identity: {}, result not with same length: {}."
,
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getWork
().
getTitle
(),
aeiObjects
.
getWork
().
getId
(),
aeiObjects
.
getActivity
().
getName
(),
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
),
XGsonBuilder
.
toJson
(
os
));
aeiObjects
.
getActivity
().
getId
(),
XGsonBuilder
.
toJson
(
identities
),
XGsonBuilder
.
toJson
(
os
));
...
@@ -92,17 +95,20 @@ public class TranslateReviewPersonTools {
...
@@ -92,17 +95,20 @@ public class TranslateReviewPersonTools {
String
code
=
o
.
get
(
"code"
).
getAsString
();
String
code
=
o
.
get
(
"code"
).
getAsString
();
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
.
getCompiledScript
(
aeiObjects
.
getActivity
(),
Business
.
EVENT_REVIEWDUTY
,
name
,
code
);
.
getCompiledScript
(
aeiObjects
.
getActivity
(),
Business
.
EVENT_REVIEWDUTY
,
name
,
code
);
Object
objectValue
=
compiledScript
.
eval
(
aeiObjects
.
scriptContext
());
// Object objectValue = compiledScript.eval(aeiObjects.scriptContext());
List
<
String
>
ds
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
aeiObjects
.
scriptContext
(),
ds
->
{
if
(
ListTools
.
isNotEmpty
(
ds
))
{
try
{
for
(
String
str
:
ds
)
{
for
(
String
str
:
ds
)
{
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
unitDuty
()
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
unitDuty
()
.
listIdentityWithUnitWithName
(
str
,
name
);
.
listIdentityWithUnitWithName
(
str
,
name
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
if
(
ListTools
.
isNotEmpty
(
os
))
{
list
.
addAll
(
os
);
list
.
addAll
(
os
);
}
}
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
}
}
);
}
}
}
}
return
ListTools
.
trim
(
list
,
true
,
true
);
return
ListTools
.
trim
(
list
,
true
,
true
);
...
@@ -113,14 +119,9 @@ public class TranslateReviewPersonTools {
...
@@ -113,14 +119,9 @@ public class TranslateReviewPersonTools {
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
if
((
StringUtils
.
isNotEmpty
(
aeiObjects
.
getActivity
().
getReviewScript
()))
if
((
StringUtils
.
isNotEmpty
(
aeiObjects
.
getActivity
().
getReviewScript
()))
||
(
StringUtils
.
isNotEmpty
(
aeiObjects
.
getActivity
().
getReviewScriptText
())))
{
||
(
StringUtils
.
isNotEmpty
(
aeiObjects
.
getActivity
().
getReviewScriptText
())))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_REVIEW
);
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_REVIEW
);
Object
objectValue
=
compiledScript
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
aeiObjects
.
scriptContext
(),
list:
:
addAll
);
List
<
String
>
os
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
list
.
addAll
(
os
);
}
}
}
return
list
;
return
list
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/choice/ChoiceProcessor.java
浏览文件 @
5abbcb48
...
@@ -3,14 +3,14 @@ package com.x.processplatform.service.processing.processor.choice;
...
@@ -3,14 +3,14 @@ package com.x.processplatform.service.processing.processor.choice;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.script.
ScriptContex
t
;
import
javax.script.
CompiledScrip
t
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script
.ScriptFactory
;
import
com.x.base.core.project.script
ing.JsonScriptingExecutor
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.Choice
;
import
com.x.processplatform.core.entity.element.Choice
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Route
;
...
@@ -20,7 +20,7 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
...
@@ -20,7 +20,7 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
public
class
ChoiceProcessor
extends
AbstractChoiceProcessor
{
public
class
ChoiceProcessor
extends
AbstractChoiceProcessor
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ChoiceProcessor
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ChoiceProcessor
.
class
);
public
ChoiceProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
public
ChoiceProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
super
(
entityManagerContainer
);
super
(
entityManagerContainer
);
...
@@ -61,12 +61,9 @@ public class ChoiceProcessor extends AbstractChoiceProcessor {
...
@@ -61,12 +61,9 @@ public class ChoiceProcessor extends AbstractChoiceProcessor {
List
<
Route
>
results
=
new
ArrayList
<>();
List
<
Route
>
results
=
new
ArrayList
<>();
// 多条路由进行判断
// 多条路由进行判断
for
(
Route
o
:
aeiObjects
.
getRoutes
())
{
for
(
Route
o
:
aeiObjects
.
getRoutes
())
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_ROUTE
,
o
);
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
o
,
Business
.
EVENT_ROUTE
);
Object
objectValue
=
aeiObjects
.
business
().
element
()
if
(
BooleanUtils
.
isTrue
(
JsonScriptingExecutor
.
evalBoolean
(
compiledScript
,
aeiObjects
.
scriptContext
())))
{
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
o
,
Business
.
EVENT_ROUTE
)
.
eval
(
scriptContext
);
if
(
BooleanUtils
.
isTrue
(
ScriptFactory
.
asBoolean
(
objectValue
)))
{
results
.
add
(
o
);
results
.
add
(
o
);
break
;
break
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/embed/EmbedProcessor.java
浏览文件 @
5abbcb48
...
@@ -3,6 +3,7 @@ package com.x.processplatform.service.processing.processor.embed;
...
@@ -3,6 +3,7 @@ package com.x.processplatform.service.processing.processor.embed;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
...
@@ -12,7 +13,8 @@ import com.x.base.core.container.EntityManagerContainer;
...
@@ -12,7 +13,8 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.Attachment
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
...
@@ -43,6 +45,7 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
...
@@ -43,6 +45,7 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
@Override
@Override
protected
void
arrivingCommitted
(
AeiObjects
aeiObjects
,
Embed
embed
)
throws
Exception
{
protected
void
arrivingCommitted
(
AeiObjects
aeiObjects
,
Embed
embed
)
throws
Exception
{
// nothing
}
}
@Override
@Override
...
@@ -80,7 +83,7 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
...
@@ -80,7 +83,7 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
WrapScriptObject
wrap
=
new
WrapScriptObject
();
WrapScriptObject
wrap
=
new
WrapScriptObject
();
wrap
.
set
(
gson
.
toJson
(
assginData
));
wrap
.
set
(
gson
.
toJson
(
assginData
));
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_ASSIGNDATA
,
wrap
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ing
Factory
.
BINDING_NAME_ASSIGNDATA
,
wrap
);
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
embed
,
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
embed
,
Business
.
EVENT_EMBEDTARGETASSIGNDATA
).
eval
(
scriptContext
);
Business
.
EVENT_EMBEDTARGETASSIGNDATA
).
eval
(
scriptContext
);
assginData
=
gson
.
fromJson
(
wrap
.
get
(),
AssginData
.
class
);
assginData
=
gson
.
fromJson
(
wrap
.
get
(),
AssginData
.
class
);
...
@@ -107,6 +110,8 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
...
@@ -107,6 +110,8 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
public
static
class
WoWorkId
extends
WoId
{
public
static
class
WoWorkId
extends
WoId
{
private
static
final
long
serialVersionUID
=
7931241930072510113L
;
}
}
@Override
@Override
...
@@ -138,12 +143,9 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
...
@@ -138,12 +143,9 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
}
}
if
(
this
.
hasIdentityScript
(
embed
))
{
if
(
this
.
hasIdentityScript
(
embed
))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_IDENTITY
,
value
);
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
Object
objectValue
=
aeiObjects
.
business
().
element
()
aeiObjects
.
getWork
().
getApplication
(),
embed
,
Business
.
EVENT_EMBEDTARGETIDENTITY
);
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
embed
,
Business
.
EVENT_EMBEDTARGETIDENTITY
)
List
<
String
>
os
=
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
scriptContext
);
.
eval
(
scriptContext
);
List
<
String
>
os
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
os
=
ListTools
.
trim
(
os
,
true
,
false
);
os
=
ListTools
.
trim
(
os
,
true
,
false
);
if
(
ListTools
.
isEmpty
(
os
))
{
if
(
ListTools
.
isEmpty
(
os
))
{
value
=
""
;
value
=
""
;
...
@@ -157,10 +159,9 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
...
@@ -157,10 +159,9 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
private
String
targetTitle
(
AeiObjects
aeiObjects
,
Embed
embed
)
throws
Exception
{
private
String
targetTitle
(
AeiObjects
aeiObjects
,
Embed
embed
)
throws
Exception
{
String
value
=
""
;
String
value
=
""
;
if
(
this
.
hasTitleScript
(
embed
))
{
if
(
this
.
hasTitleScript
(
embed
))
{
Object
objectValue
=
aeiObjects
.
business
().
element
()
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
embed
,
Business
.
EVENT_EMBEDTARGETTITLE
)
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
embed
,
Business
.
EVENT_EMBEDTARGETTITLE
);
.
eval
(
aeiObjects
.
scriptContext
());
value
=
JsonScriptingExecutor
.
evalString
(
compiledScript
,
aeiObjects
.
scriptContext
());
value
=
ScriptFactory
.
asString
(
objectValue
);
}
}
if
(
StringUtils
.
isEmpty
(
value
))
{
if
(
StringUtils
.
isEmpty
(
value
))
{
value
=
embed
.
getName
()
+
":"
+
aeiObjects
.
getWork
().
getTitle
();
value
=
embed
.
getName
()
+
":"
+
aeiObjects
.
getWork
().
getTitle
();
...
@@ -179,23 +180,24 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
...
@@ -179,23 +180,24 @@ public class EmbedProcessor extends AbstractEmbedProcessor {
}
}
}
}
private
boolean
hasTitleScript
(
Embed
embed
)
throws
Exception
{
private
boolean
hasTitleScript
(
Embed
embed
)
{
return
StringUtils
.
isNotEmpty
(
embed
.
getTargetTitleScript
())
return
StringUtils
.
isNotEmpty
(
embed
.
getTargetTitleScript
())
||
StringUtils
.
isNotEmpty
(
embed
.
getTargetTitleScriptText
());
||
StringUtils
.
isNotEmpty
(
embed
.
getTargetTitleScriptText
());
}
}
private
boolean
hasIdentityScript
(
Embed
embed
)
throws
Exception
{
private
boolean
hasIdentityScript
(
Embed
embed
)
{
return
StringUtils
.
isNotEmpty
(
embed
.
getTargetIdentityScript
())
return
StringUtils
.
isNotEmpty
(
embed
.
getTargetIdentityScript
())
||
StringUtils
.
isNotEmpty
(
embed
.
getTargetIdentityScriptText
());
||
StringUtils
.
isNotEmpty
(
embed
.
getTargetIdentityScriptText
());
}
}
private
boolean
hasAssginDataScript
(
Embed
embed
)
throws
Exception
{
private
boolean
hasAssginDataScript
(
Embed
embed
)
{
return
StringUtils
.
isNotEmpty
(
embed
.
getTargetAssginDataScript
())
return
StringUtils
.
isNotEmpty
(
embed
.
getTargetAssginDataScript
())
||
StringUtils
.
isNotEmpty
(
embed
.
getTargetAssginDataScriptText
());
||
StringUtils
.
isNotEmpty
(
embed
.
getTargetAssginDataScriptText
());
}
}
@Override
@Override
protected
void
inquiringCommitted
(
AeiObjects
aeiObjects
,
Embed
embed
)
throws
Exception
{
protected
void
inquiringCommitted
(
AeiObjects
aeiObjects
,
Embed
embed
)
throws
Exception
{
// nothing
}
}
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/invoke/InvokeProcessor.java
浏览文件 @
5abbcb48
...
@@ -23,7 +23,8 @@ import com.x.base.core.project.exception.RunningException;
...
@@ -23,7 +23,8 @@ import com.x.base.core.project.exception.RunningException;
import
com.x.base.core.project.http.ActionResult.Type
;
import
com.x.base.core.project.http.ActionResult.Type
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.Invoke
;
import
com.x.processplatform.core.entity.element.Invoke
;
...
@@ -36,7 +37,7 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
...
@@ -36,7 +37,7 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
public
class
InvokeProcessor
extends
AbstractInvokeProcessor
{
public
class
InvokeProcessor
extends
AbstractInvokeProcessor
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
InvokeProcessor
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
InvokeProcessor
.
class
);
public
InvokeProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
public
InvokeProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
super
(
entityManagerContainer
);
super
(
entityManagerContainer
);
...
@@ -92,7 +93,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -92,7 +93,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
}
}
}
}
private
boolean
jaxwsInternal
(
AeiObjects
aeiObjects
,
Invoke
invoke
)
throws
Exception
{
private
boolean
jaxwsInternal
(
AeiObjects
aeiObjects
,
Invoke
invoke
)
{
return
true
;
return
true
;
}
}
...
@@ -115,9 +116,9 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -115,9 +116,9 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXWSRESPONSE
);
Business
.
EVENT_INVOKEJAXWSRESPONSE
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_JAXWSRESPONSE
,
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ing
Factory
.
BINDING_NAME_JAXWSRESPONSE
,
response
);
response
);
passThrough
=
ScriptFactory
.
asBoolean
(
cs
.
eval
(
scriptContext
)
);
passThrough
=
JsonScriptingExecutor
.
evalBoolean
(
cs
,
scriptContext
);
}
else
{
}
else
{
passThrough
=
true
;
passThrough
=
true
;
}
}
...
@@ -132,9 +133,13 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -132,9 +133,13 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXWSPARAMETER
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXWSPARAMETER
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
Factory
.
BINDING_NAME_
PARAMETERS
,
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ingFactory
.
BINDING_NAME_JAXWS
PARAMETERS
,
parameters
);
parameters
);
cs
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
jsonArray
(
cs
,
scriptContext
,
o
->
{
if
(
o
.
size
()
>
0
)
{
parameters
=
gson
.
fromJson
(
o
,
parameters
.
getClass
());
}
});
}
}
return
parameters
.
toArray
();
return
parameters
.
toArray
();
}
}
...
@@ -184,6 +189,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -184,6 +189,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
if
(!
BooleanUtils
.
isTrue
(
invoke
.
getAsync
()))
{
if
(!
BooleanUtils
.
isTrue
(
invoke
.
getAsync
()))
{
WrapScriptObject
jaxrsResponse
=
new
WrapScriptObject
();
WrapScriptObject
jaxrsResponse
=
new
WrapScriptObject
();
if
(
null
!=
resp
)
{
if
(
null
!=
resp
)
{
jaxrsResponse
.
type
(
resp
.
getType
().
toString
());
jaxrsResponse
.
set
(
gson
.
toJson
(
resp
.
getData
()));
jaxrsResponse
.
set
(
gson
.
toJson
(
resp
.
getData
()));
}
}
if
((
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsResponseScript
()))
if
((
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsResponseScript
()))
...
@@ -192,9 +198,10 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -192,9 +198,10 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSRESPONSE
);
Business
.
EVENT_INVOKEJAXRSRESPONSE
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_JAXRSRESPONSE
,
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ing
Factory
.
BINDING_NAME_JAXRSRESPONSE
,
jaxrsResponse
);
jaxrsResponse
);
passThrough
=
ScriptFactory
.
asBoolean
(
cs
.
eval
(
scriptContext
),
true
);
passThrough
=
JsonScriptingExecutor
.
evalBoolean
(
cs
,
scriptContext
);
// passThrough = ScriptFactory.asBoolean(cs.eval(scriptContext), true);
}
else
{
}
else
{
passThrough
=
true
;
passThrough
=
true
;
}
}
...
@@ -280,7 +287,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -280,7 +287,7 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
String
result
=
""
;
String
result
=
""
;
String
uri
=
this
.
jaxrsUrl
(
aeiObjects
,
invoke
);
String
uri
=
this
.
jaxrsUrl
(
aeiObjects
,
invoke
);
JaxrsObject
jaxrsObject
=
new
JaxrsObject
();
JaxrsObject
jaxrsObject
=
new
JaxrsObject
();
jaxrsObject
.
setHead
(
this
.
jaxrsEvalHead
(
aeiObjects
,
invoke
));
jaxrsObject
.
setHead
(
this
.
jaxrsEvalHead
er
(
aeiObjects
,
invoke
));
switch
(
StringUtils
.
upperCase
(
invoke
.
getJaxrsMethod
()))
{
switch
(
StringUtils
.
upperCase
(
invoke
.
getJaxrsMethod
()))
{
case
ConnectionAction
.
METHOD_POST
:
case
ConnectionAction
.
METHOD_POST
:
result
=
jaxrsExternalPost
(
aeiObjects
,
invoke
,
uri
,
jaxrsObject
);
result
=
jaxrsExternalPost
(
aeiObjects
,
invoke
,
uri
,
jaxrsObject
);
...
@@ -312,6 +319,11 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -312,6 +319,11 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
boolean
passThrough
=
false
;
boolean
passThrough
=
false
;
if
(!
BooleanUtils
.
isTrue
(
invoke
.
getAsync
()))
{
if
(!
BooleanUtils
.
isTrue
(
invoke
.
getAsync
()))
{
WrapScriptObject
jaxrsResponse
=
new
WrapScriptObject
();
WrapScriptObject
jaxrsResponse
=
new
WrapScriptObject
();
if
(
null
==
result
)
{
jaxrsResponse
.
type
(
Type
.
connectFatal
.
toString
());
}
else
{
jaxrsResponse
.
type
(
Type
.
success
.
toString
());
}
jaxrsResponse
.
set
(
result
);
jaxrsResponse
.
set
(
result
);
if
((
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsResponseScript
()))
if
((
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsResponseScript
()))
||
(
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsResponseScriptText
())))
{
||
(
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsResponseScriptText
())))
{
...
@@ -319,9 +331,9 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -319,9 +331,9 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSRESPONSE
);
Business
.
EVENT_INVOKEJAXRSRESPONSE
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_JAXRSRESPONSE
,
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ing
Factory
.
BINDING_NAME_JAXRSRESPONSE
,
jaxrsResponse
);
jaxrsResponse
);
passThrough
=
ScriptFactory
.
asBoolean
(
cs
.
eval
(
scriptContext
),
true
);
passThrough
=
JsonScriptingExecutor
.
evalBoolean
(
cs
,
scriptContext
);
}
else
{
}
else
{
passThrough
=
true
;
passThrough
=
true
;
}
}
...
@@ -404,9 +416,9 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -404,9 +416,9 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSPARAMETER
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSPARAMETER
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
Factory
.
BINDING_NAME_
PARAMETERS
,
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ingFactory
.
BINDING_NAME_JAXRS
PARAMETERS
,
parameters
);
parameters
);
cs
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
for
(
Entry
<
String
,
String
>
entry
:
parameters
.
entrySet
())
{
for
(
Entry
<
String
,
String
>
entry
:
parameters
.
entrySet
())
{
url
=
StringUtils
.
replace
(
url
,
"{"
+
entry
.
getKey
()
+
"}"
,
entry
.
getValue
());
url
=
StringUtils
.
replace
(
url
,
"{"
+
entry
.
getKey
()
+
"}"
,
entry
.
getValue
());
...
@@ -421,21 +433,22 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
...
@@ -421,21 +433,22 @@ public class InvokeProcessor extends AbstractInvokeProcessor {
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSBODY
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSBODY
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_JAXRSBODY
,
jaxrsBody
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptingFactory
.
BINDING_NAME_JAXRSBODY
,
cs
.
eval
(
scriptContext
);
jaxrsBody
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
return
jaxrsBody
.
get
();
return
jaxrsBody
.
get
();
}
}
private
Map
<
String
,
String
>
jaxrsEvalHead
(
AeiObjects
aeiObjects
,
Invoke
invoke
)
throws
Exception
{
private
Map
<
String
,
String
>
jaxrsEvalHead
er
(
AeiObjects
aeiObjects
,
Invoke
invoke
)
throws
Exception
{
Map
<
String
,
String
>
map
=
new
LinkedHashMap
<>();
Map
<
String
,
String
>
map
=
new
LinkedHashMap
<>();
if
((
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsHeadScript
()))
if
((
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsHeadScript
()))
||
(
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsHeadScriptText
())))
{
||
(
StringUtils
.
isNotEmpty
(
invoke
.
getJaxrsHeadScriptText
())))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSHEAD
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_INVOKEJAXRSHEAD
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
Factory
.
BINDING_NAME_JAXRSHEAD
,
map
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ingFactory
.
BINDING_NAME_JAXRSHEADERS
,
map
);
cs
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
return
map
;
return
map
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/ManualProcessor.java
浏览文件 @
5abbcb48
...
@@ -28,7 +28,8 @@ import com.x.base.core.project.config.Config;
...
@@ -28,7 +28,8 @@ import com.x.base.core.project.config.Config;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.organization.EmpowerLog
;
import
com.x.base.core.project.organization.EmpowerLog
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.NumberTools
;
import
com.x.base.core.project.tools.NumberTools
;
...
@@ -325,10 +326,9 @@ public class ManualProcessor extends AbstractManualProcessor {
...
@@ -325,10 +326,9 @@ public class ManualProcessor extends AbstractManualProcessor {
// Manual Work 还没有处理完 发生了停留,出发了停留事件
// Manual Work 还没有处理完 发生了停留,出发了停留事件
if
((
ListTools
.
isEmpty
(
works
))
&&
this
.
hasManualStayScript
(
manual
))
{
if
((
ListTools
.
isEmpty
(
works
))
&&
this
.
hasManualStayScript
(
manual
))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
CompiledScript
cs
=
null
;
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getApplication
().
getId
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_MANUALSTAY
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_MANUALSTAY
);
cs
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
}
}
}
}
...
@@ -670,12 +670,12 @@ public class ManualProcessor extends AbstractManualProcessor {
...
@@ -670,12 +670,12 @@ public class ManualProcessor extends AbstractManualProcessor {
private
void
expireScript
(
AeiObjects
aeiObjects
,
Manual
manual
,
Task
task
)
throws
Exception
{
private
void
expireScript
(
AeiObjects
aeiObjects
,
Manual
manual
,
Task
task
)
throws
Exception
{
ExpireScriptResult
expire
=
new
ExpireScriptResult
();
ExpireScriptResult
expire
=
new
ExpireScriptResult
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
//
Bindings bindings = scriptContext.getBindings(ScriptContext.ENGINE_SCOPE);
bindings
.
put
(
Script
Factory
.
BINDING_NAME_TASK
,
task
);
// bindings.put(Scripting
Factory.BINDING_NAME_TASK, task);
bindings
.
put
(
Script
Factory
.
BINDING_NAME_EXPIRE
,
expire
);
// bindings.put(Scripting
Factory.BINDING_NAME_EXPIRE, expire);
aeiObjects
.
business
().
element
()
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
manual
,
Business
.
EVENT_MANUALTASKEXPIRE
)
manual
,
Business
.
EVENT_MANUALTASKEXPIRE
);
.
eval
(
scriptContext
);
JsonScriptingExecutor
.
eval
(
cs
,
scriptContext
);
if
(
BooleanUtils
.
isTrue
(
NumberTools
.
greaterThan
(
expire
.
getWorkHour
(),
0
)))
{
if
(
BooleanUtils
.
isTrue
(
NumberTools
.
greaterThan
(
expire
.
getWorkHour
(),
0
)))
{
Integer
m
=
0
;
Integer
m
=
0
;
m
+=
expire
.
getWorkHour
()
*
60
;
m
+=
expire
.
getWorkHour
()
*
60
;
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/manual/TranslateTaskIdentityTools.java
浏览文件 @
5abbcb48
package
com.x.processplatform.service.processing.processor.manual
;
package
com.x.processplatform.service.processing.processor.manual
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
...
@@ -7,17 +8,19 @@ import java.util.Objects;
...
@@ -7,17 +8,19 @@ import java.util.Objects;
import
javax.script.CompiledScript
;
import
javax.script.CompiledScript
;
import
org.apache.commons.beanutils.PropertyUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonObject
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.script
.ScriptFactory
;
import
com.x.base.core.project.script
ing.JsonScriptingExecutor
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.PropertyTools
;
import
com.x.base.core.project.tools.PropertyTools
;
import
com.x.processplatform.core.entity.content.Data
;
import
com.x.processplatform.core.entity.content.Data
;
...
@@ -33,6 +36,10 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
...
@@ -33,6 +36,10 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
*/
*/
public
class
TranslateTaskIdentityTools
{
public
class
TranslateTaskIdentityTools
{
private
TranslateTaskIdentityTools
()
{
// nothing
}
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TranslateTaskIdentityTools
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TranslateTaskIdentityTools
.
class
);
/* 计算manual节点中所有的待办,全部翻译成Identity */
/* 计算manual节点中所有的待办,全部翻译成Identity */
...
@@ -67,13 +74,6 @@ public class TranslateTaskIdentityTools {
...
@@ -67,13 +74,6 @@ public class TranslateTaskIdentityTools {
}
}
List
<
String
>
identities
=
aeiObjects
.
business
().
organization
().
identity
().
list
(
taskIdentities
.
identities
());
List
<
String
>
identities
=
aeiObjects
.
business
().
organization
().
identity
().
list
(
taskIdentities
.
identities
());
return
new
TaskIdentities
(
identities
);
return
new
TaskIdentities
(
identities
);
/*Iterator<TaskIdentity> iterator = taskIdentities.iterator();
while (iterator.hasNext()) {
if (!identities.contains(iterator.next().getIdentity())) {
iterator.remove();
}
}
return taskIdentities;*/
}
}
/* 取到指定职务的identity */
/* 取到指定职务的identity */
...
@@ -88,8 +88,8 @@ public class TranslateTaskIdentityTools {
...
@@ -88,8 +88,8 @@ public class TranslateTaskIdentityTools {
String
code
=
o
.
get
(
"code"
).
getAsString
();
String
code
=
o
.
get
(
"code"
).
getAsString
();
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
CompiledScript
compiledScript
=
aeiObjects
.
business
().
element
()
.
getCompiledScript
(
aeiObjects
.
getActivity
(),
Business
.
EVENT_TASKDUTY
,
name
,
code
);
.
getCompiledScript
(
aeiObjects
.
getActivity
(),
Business
.
EVENT_TASKDUTY
,
name
,
code
);
Object
objectValue
=
compiledScript
.
eval
(
aeiObjects
.
scriptContext
());
List
<
String
>
ds
=
JsonScriptingExecutor
.
evalDistinguishedNames
(
compiledScript
,
List
<
String
>
ds
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
aeiObjects
.
scriptContext
()
);
if
(
ListTools
.
isNotEmpty
(
ds
))
{
if
(
ListTools
.
isNotEmpty
(
ds
))
{
for
(
String
str
:
ds
)
{
for
(
String
str
:
ds
)
{
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
unitDuty
()
List
<
String
>
os
=
aeiObjects
.
business
().
organization
().
unitDuty
()
...
@@ -115,47 +115,6 @@ public class TranslateTaskIdentityTools {
...
@@ -115,47 +115,6 @@ public class TranslateTaskIdentityTools {
if
(
null
!=
o
)
{
if
(
null
!=
o
)
{
addObjectToTaskIdentities
(
taskIdentities
,
units
,
groups
,
o
);
addObjectToTaskIdentities
(
taskIdentities
,
units
,
groups
,
o
);
}
}
// if (null != o) {
// if (o instanceof CharSequence) {
// taskIdentities.addIdentity(o.toString());
// } else if (o instanceof JsonObject) {
// JsonObject jsonObject = (JsonObject) o;
// addJsonObjectToTaskIdentities(taskIdentities, units, groups, jsonObject);
// } else if (o instanceof JsonArray) {
// for (JsonElement jsonElement : (JsonArray) o) {
// if (jsonElement.isJsonObject()) {
// JsonObject jsonObject = jsonElement.getAsJsonObject();
// addJsonObjectToTaskIdentities(taskIdentities, units, groups, jsonObject);
// }
// }
// } else if (o instanceof Iterable) {
// for (Object obj : (Iterable<?>) o) {
// if (null != obj) {
// if (obj instanceof CharSequence) {
// taskIdentities.addIdentity(Objects.toString(obj, ""));
// } else {
// addObjectToTaskIdentities(taskIdentities, units, groups, obj);
// }
// }
// }
// } else if (o instanceof ScriptObjectMirror) {
// ScriptObjectMirror som = (ScriptObjectMirror) o;
// if (som.isArray()) {
// Object[] objs = (som.to(Object[].class));
// for (Object obj : objs) {
// if (null != obj) {
// if (obj instanceof CharSequence) {
// taskIdentities.addIdentity(Objects.toString(obj, ""));
// } else {
// addObjectToTaskIdentities(taskIdentities, units, groups, obj);
// }
// }
// }
// } else {
// addObjectToTaskIdentities(taskIdentities, units, groups, som);
// }
// }
// }
}
}
return
list
;
return
list
;
}
}
...
@@ -169,49 +128,13 @@ public class TranslateTaskIdentityTools {
...
@@ -169,49 +128,13 @@ public class TranslateTaskIdentityTools {
if
(
null
!=
o
)
{
if
(
null
!=
o
)
{
addObjectToTaskIdentities
(
taskIdentities
,
units
,
groups
,
o
);
addObjectToTaskIdentities
(
taskIdentities
,
units
,
groups
,
o
);
}
}
// if (null != o) {
// if (o instanceof CharSequence) {
// if (OrganizationDefinition.isUnitDistinguishedName(str)) {
// units.add(str);
// } else if (OrganizationDefinition.isGroupDistinguishedName(str)) {
// groups.add(str);
// } else {
// taskIdentities.addIdentity(o.toString());
// }
// } else if (o instanceof Iterable) {
// for (Object v : (Iterable<?>) o) {
// System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!v class:" + v.getClass());
// System.out.println(XGsonBuilder.toJson(v));
// if (null != v) {
// if (v instanceof CharSequence) {
// String vs = v.toString();
// if (OrganizationDefinition.isUnitDistinguishedName(vs)) {
// units.add(vs);
// } else if (OrganizationDefinition.isGroupDistinguishedName(vs)) {
// groups.add(vs);
// } else {
// taskIdentities.addIdentity(vs);
// }
// // } else if (v instanceof Entry) {
// } else {
// addObjectToTaskIdentities(taskIdentities, units, groups, v);
// }
// }
// }
// } else {
// addObjectToTaskIdentities(taskIdentities, units, groups, o);
// }
// }
}
}
}
}
}
}
private
static
void
addObjectToTaskIdentities
(
TaskIdentities
taskIdentities
,
List
<
String
>
units
,
private
static
void
addObjectToTaskIdentities
(
TaskIdentities
taskIdentities
,
List
<
String
>
units
,
List
<
String
>
groups
,
Object
o
)
throws
Exception
{
List
<
String
>
groups
,
Object
o
)
throws
Exception
{
// String d = PropertyTools.getOrElse(o, JpaObject.DISTINGUISHEDNAME,
for
(
String
d
:
asDistinguishedNames
(
o
))
{
// String.class, "");
for
(
String
d
:
ScriptFactory
.
asDistinguishedNameList
(
o
))
{
if
(
OrganizationDefinition
.
isIdentityDistinguishedName
(
d
))
{
if
(
OrganizationDefinition
.
isIdentityDistinguishedName
(
d
))
{
Boolean
ignore
=
BooleanUtils
.
isTrue
(
BooleanUtils
.
toBooleanObject
(
Objects
.
toString
(
Boolean
ignore
=
BooleanUtils
.
isTrue
(
BooleanUtils
.
toBooleanObject
(
Objects
.
toString
(
PropertyTools
.
getOrElse
(
o
,
TaskIdentity
.
IGNOREEMPOWER
,
Boolean
.
class
,
Boolean
.
FALSE
),
PropertyTools
.
getOrElse
(
o
,
TaskIdentity
.
IGNOREEMPOWER
,
Boolean
.
class
,
Boolean
.
FALSE
),
...
@@ -227,4 +150,32 @@ public class TranslateTaskIdentityTools {
...
@@ -227,4 +150,32 @@ public class TranslateTaskIdentityTools {
}
}
}
}
}
}
public
static
List
<
String
>
asDistinguishedNames
(
Object
o
)
throws
Exception
{
List
<
String
>
list
=
new
ArrayList
<>();
if
(
null
!=
o
)
{
if
(
o
instanceof
CharSequence
)
{
list
.
add
(
Objects
.
toString
(
o
));
}
else
if
(
o
instanceof
Iterable
)
{
asIterable
(
o
,
list
);
}
}
return
list
;
}
private
static
void
asIterable
(
Object
o
,
List
<
String
>
list
)
throws
IllegalAccessException
,
InvocationTargetException
,
NoSuchMethodException
{
for
(
Object
obj
:
(
Iterable
<?>)
o
)
{
if
(
null
!=
obj
)
{
if
(
obj
instanceof
CharSequence
)
{
list
.
add
(
Objects
.
toString
(
obj
));
}
else
{
Object
d
=
PropertyUtils
.
getProperty
(
obj
,
JpaObject
.
DISTINGUISHEDNAME
);
if
(
null
!=
d
)
{
list
.
add
(
Objects
.
toString
(
d
));
}
}
}
}
}
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/parallel/ParallelProcessor.java
浏览文件 @
5abbcb48
...
@@ -3,6 +3,7 @@ package com.x.processplatform.service.processing.processor.parallel;
...
@@ -3,6 +3,7 @@ package com.x.processplatform.service.processing.processor.parallel;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
...
@@ -11,7 +12,8 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -11,7 +12,8 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkLog
;
import
com.x.processplatform.core.entity.content.WorkLog
;
...
@@ -73,11 +75,10 @@ public class ParallelProcessor extends AbstractParallelProcessor {
...
@@ -73,11 +75,10 @@ public class ParallelProcessor extends AbstractParallelProcessor {
/* 多条路由进行判断 */
/* 多条路由进行判断 */
for
(
Route
o
:
aeiObjects
.
getRoutes
())
{
for
(
Route
o
:
aeiObjects
.
getRoutes
())
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
ScriptFactory
.
BINDING_NAME_ROUTE
,
o
);
//scriptContext.getBindings(ScriptContext.ENGINE_SCOPE).put(ScriptingFactory.BINDING_NAME_ROUTE, o);
Object
objectValue
=
aeiObjects
.
business
().
element
()
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
o
,
Business
.
EVENT_ROUTE
)
o
,
Business
.
EVENT_ROUTE
);
.
eval
(
scriptContext
);
if
(
BooleanUtils
.
isTrue
(
JsonScriptingExecutor
.
evalBoolean
(
cs
,
scriptContext
)))
{
if
(
BooleanUtils
.
isTrue
(
ScriptFactory
.
asBoolean
(
objectValue
)))
{
routes
.
add
(
o
);
routes
.
add
(
o
);
}
}
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/service/ServiceProcessor.java
浏览文件 @
5abbcb48
...
@@ -12,7 +12,8 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -12,7 +12,8 @@ import org.apache.commons.lang3.StringUtils;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Route
;
import
com.x.processplatform.core.entity.element.Service
;
import
com.x.processplatform.core.entity.element.Service
;
...
@@ -22,7 +23,7 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
...
@@ -22,7 +23,7 @@ import com.x.processplatform.service.processing.processor.AeiObjects;
public
class
ServiceProcessor
extends
AbstractServiceProcessor
{
public
class
ServiceProcessor
extends
AbstractServiceProcessor
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ServiceProcessor
.
class
);
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ServiceProcessor
.
class
);
public
ServiceProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
public
ServiceProcessor
(
EntityManagerContainer
entityManagerContainer
)
throws
Exception
{
super
(
entityManagerContainer
);
super
(
entityManagerContainer
);
...
@@ -52,11 +53,11 @@ public class ServiceProcessor extends AbstractServiceProcessor {
...
@@ -52,11 +53,11 @@ public class ServiceProcessor extends AbstractServiceProcessor {
boolean
passThrough
=
false
;
boolean
passThrough
=
false
;
if
(
StringUtils
.
isNotEmpty
(
service
.
getScript
())
||
StringUtils
.
isNotEmpty
(
service
.
getScriptText
()))
{
if
(
StringUtils
.
isNotEmpty
(
service
.
getScript
())
||
StringUtils
.
isNotEmpty
(
service
.
getScriptText
()))
{
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
ScriptContext
scriptContext
=
aeiObjects
.
scriptContext
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
Factory
.
BINDING_NAME_SERVICEVALUE
,
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
Script
ingFactory
.
BINDING_NAME_REQUESTTEXT
,
gson
.
toJson
(
aeiObjects
.
getWork
().
getProperties
().
getServiceValue
()));
gson
.
toJson
(
aeiObjects
.
getWork
().
getProperties
().
getServiceValue
()));
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
aeiObjects
.
getActivity
(),
Business
.
EVENT_SERVICE
);
aeiObjects
.
getActivity
(),
Business
.
EVENT_SERVICE
);
passThrough
=
ScriptFactory
.
asBoolean
(
cs
.
eval
(
scriptContext
)
);
passThrough
=
JsonScriptingExecutor
.
evalBoolean
(
cs
,
scriptContext
);
}
else
{
}
else
{
passThrough
=
true
;
passThrough
=
true
;
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/split/SplitProcessor.java
浏览文件 @
5abbcb48
...
@@ -4,12 +4,14 @@ import java.util.ArrayList;
...
@@ -4,12 +4,14 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Optional
;
import
javax.script.CompiledScript
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script
.ScriptFactory
;
import
com.x.base.core.project.script
ing.JsonScriptingExecutor
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.Work
;
...
@@ -108,13 +110,10 @@ public class SplitProcessor extends AbstractSplitProcessor {
...
@@ -108,13 +110,10 @@ public class SplitProcessor extends AbstractSplitProcessor {
private
List
<
String
>
splitWithPath
(
AeiObjects
aeiObjects
,
Split
split
)
throws
Exception
{
private
List
<
String
>
splitWithPath
(
AeiObjects
aeiObjects
,
Split
split
)
throws
Exception
{
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
if
((
StringUtils
.
isNotEmpty
(
split
.
getScript
()))
||
(
StringUtils
.
isNotEmpty
(
split
.
getScriptText
())))
{
if
((
StringUtils
.
isNotEmpty
(
split
.
getScript
()))
||
(
StringUtils
.
isNotEmpty
(
split
.
getScriptText
())))
{
Object
objectValue
=
aeiObjects
.
business
().
element
()
CompiledScript
cs
=
aeiObjects
.
business
().
element
().
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
.
getCompiledScript
(
aeiObjects
.
getWork
().
getApplication
(),
split
,
Business
.
EVENT_SPLIT
)
split
,
Business
.
EVENT_SPLIT
);
.
eval
(
aeiObjects
.
scriptContext
());
List
<
String
>
os
=
JsonScriptingExecutor
.
evalDistinguishedNames
(
cs
,
aeiObjects
.
scriptContext
());
List
<
String
>
os
=
ScriptFactory
.
asDistinguishedNameList
(
objectValue
);
list
.
addAll
(
os
);
if
(
ListTools
.
isNotEmpty
(
os
))
{
list
.
addAll
(
os
);
}
}
}
return
list
;
return
list
;
}
}
...
...
o2server/x_program_center/src/main/java/com/x/program/center/dingding/SyncOrganization.java
浏览文件 @
5abbcb48
...
@@ -18,10 +18,9 @@ import javax.persistence.criteria.CriteriaQuery;
...
@@ -18,10 +18,9 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.persistence.criteria.Root
;
import
javax.script.Bindings
;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -31,12 +30,14 @@ import com.x.base.core.container.EntityManagerContainer;
...
@@ -31,12 +30,14 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Identity_
;
import
com.x.organization.core.entity.Identity_
;
...
@@ -190,9 +191,9 @@ public class SyncOrganization {
...
@@ -190,9 +191,9 @@ public class SyncOrganization {
emc
.
beginTransaction
(
Unit
.
class
);
emc
.
beginTransaction
(
Unit
.
class
);
unit
.
setDingdingHash
(
DigestUtils
.
sha256Hex
(
XGsonBuilder
.
toJson
(
department
)));
unit
.
setDingdingHash
(
DigestUtils
.
sha256Hex
(
XGsonBuilder
.
toJson
(
department
)));
unit
.
setName
(
department
.
getName
());
unit
.
setName
(
department
.
getName
());
if
(
null
!=
department
.
getOrder
())
{
if
(
null
!=
department
.
getOrder
())
{
unit
.
setOrderNumber
(
department
.
getOrder
().
intValue
());
unit
.
setOrderNumber
(
department
.
getOrder
().
intValue
());
}
}
business
.
unit
().
adjustInherit
(
unit
);
business
.
unit
().
adjustInherit
(
unit
);
emc
.
check
(
unit
,
CheckPersistType
.
all
);
emc
.
check
(
unit
,
CheckPersistType
.
all
);
emc
.
commit
();
emc
.
commit
();
...
@@ -264,8 +265,8 @@ public class SyncOrganization {
...
@@ -264,8 +265,8 @@ public class SyncOrganization {
person
.
setMobile
(
user
.
getMobile
());
person
.
setMobile
(
user
.
getMobile
());
person
.
setUnique
(
user
.
getUserid
());
person
.
setUnique
(
user
.
getUserid
());
String
employee
=
user
.
getJobnumber
();
String
employee
=
user
.
getJobnumber
();
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
business
.
person
().
employeeExists
(
employee
,
person
.
getUnique
()))
{
if
(
business
.
person
().
employeeExists
(
employee
,
person
.
getUnique
()))
{
employee
=
""
;
employee
=
""
;
}
}
}
}
...
@@ -283,8 +284,8 @@ public class SyncOrganization {
...
@@ -283,8 +284,8 @@ public class SyncOrganization {
person
.
setMobile
(
user
.
getMobile
());
person
.
setMobile
(
user
.
getMobile
());
person
.
setUnique
(
user
.
getUserid
());
person
.
setUnique
(
user
.
getUserid
());
String
employee
=
user
.
getJobnumber
();
String
employee
=
user
.
getJobnumber
();
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
business
.
person
().
employeeExists
(
employee
,
person
.
getUnique
()))
{
if
(
business
.
person
().
employeeExists
(
employee
,
person
.
getUnique
()))
{
employee
=
""
;
employee
=
""
;
}
}
}
}
...
@@ -306,12 +307,12 @@ public class SyncOrganization {
...
@@ -306,12 +307,12 @@ public class SyncOrganization {
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
String
eval
=
ScriptFactory
.
functionalization
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
CompiledScript
cs
=
ScriptingFactory
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
.
functionalizationCompile
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
"person"
,
person
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
person
);
Object
o
=
ScriptFactory
.
scriptEngine
.
eval
(
eval
,
scriptContext
);
return
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
return
o
.
toString
();
}
else
{
}
else
{
return
str
;
return
str
;
}
}
...
@@ -322,8 +323,8 @@ public class SyncOrganization {
...
@@ -322,8 +323,8 @@ public class SyncOrganization {
emc
.
beginTransaction
(
Person
.
class
);
emc
.
beginTransaction
(
Person
.
class
);
person
.
setDingdingHash
(
DigestUtils
.
sha256Hex
(
XGsonBuilder
.
toJson
(
user
)));
person
.
setDingdingHash
(
DigestUtils
.
sha256Hex
(
XGsonBuilder
.
toJson
(
user
)));
String
employee
=
user
.
getJobnumber
();
String
employee
=
user
.
getJobnumber
();
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
StringUtils
.
isNotEmpty
(
employee
))
{
if
(
business
.
person
().
employeeExists
(
employee
,
person
.
getUnique
()))
{
if
(
business
.
person
().
employeeExists
(
employee
,
person
.
getUnique
()))
{
employee
=
""
;
employee
=
""
;
}
}
}
}
...
@@ -434,7 +435,7 @@ public class SyncOrganization {
...
@@ -434,7 +435,7 @@ public class SyncOrganization {
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
emc
.
beginTransaction
(
Identity
.
class
);
emc
.
beginTransaction
(
Identity
.
class
);
Identity
identity
=
new
Identity
();
Identity
identity
=
new
Identity
();
identity
.
setUnique
(
unit
.
getUnique
()
+
"_"
+
person
.
getUnique
());
identity
.
setUnique
(
unit
.
getUnique
()
+
"_"
+
person
.
getUnique
());
identity
.
setName
(
person
.
getName
());
identity
.
setName
(
person
.
getName
());
identity
.
setPerson
(
person
.
getId
());
identity
.
setPerson
(
person
.
getId
());
identity
.
setUnit
(
unit
.
getId
());
identity
.
setUnit
(
unit
.
getId
());
...
...
o2server/x_program_center/src/main/java/com/x/program/center/qiyeweixin/SyncOrganization.java
浏览文件 @
5abbcb48
package
com.x.program.center.qiyeweixin
;
package
com.x.program.center.qiyeweixin
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.text.StringEscapeUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
...
@@ -10,28 +33,21 @@ import com.x.base.core.project.gson.GsonPropertyObject;
...
@@ -10,28 +33,21 @@ import com.x.base.core.project.gson.GsonPropertyObject;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.entity.*
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Identity_
;
import
com.x.organization.core.entity.Person
;
import
com.x.organization.core.entity.PersonAttribute
;
import
com.x.organization.core.entity.PersonAttribute_
;
import
com.x.organization.core.entity.Person_
;
import
com.x.organization.core.entity.Unit
;
import
com.x.organization.core.entity.UnitAttribute
;
import
com.x.organization.core.entity.UnitDuty
;
import
com.x.organization.core.entity.Unit_
;
import
com.x.program.center.Business
;
import
com.x.program.center.Business
;
import
com.x.program.center.qiyeweixin.User.Extattr.Attr
;
import
com.x.program.center.qiyeweixin.User.Extattr.Attr
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.text.StringEscapeUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.script.Bindings
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
java.util.*
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
public
class
SyncOrganization
{
public
class
SyncOrganization
{
...
@@ -295,12 +311,12 @@ public class SyncOrganization {
...
@@ -295,12 +311,12 @@ public class SyncOrganization {
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
String
eval
=
ScriptFactory
.
functionalization
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
CompiledScript
cs
=
ScriptingFactory
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
.
functionalizationCompile
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
"person"
,
person
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
person
);
Object
o
=
ScriptFactory
.
scriptEngine
.
eval
(
eval
,
scriptContext
);
return
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
return
o
.
toString
();
}
else
{
}
else
{
return
str
;
return
str
;
}
}
...
@@ -410,7 +426,7 @@ public class SyncOrganization {
...
@@ -410,7 +426,7 @@ public class SyncOrganization {
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
emc
.
beginTransaction
(
Identity
.
class
);
emc
.
beginTransaction
(
Identity
.
class
);
Identity
identity
=
new
Identity
();
Identity
identity
=
new
Identity
();
identity
.
setUnique
(
unit
.
getUnique
()
+
"_"
+
person
.
getUnique
());
identity
.
setUnique
(
unit
.
getUnique
()
+
"_"
+
person
.
getUnique
());
identity
.
setName
(
person
.
getName
());
identity
.
setName
(
person
.
getName
());
identity
.
setPerson
(
person
.
getId
());
identity
.
setPerson
(
person
.
getId
());
identity
.
setUnit
(
unit
.
getId
());
identity
.
setUnit
(
unit
.
getId
());
...
...
o2server/x_program_center/src/main/java/com/x/program/center/welink/SyncOrganization.java
浏览文件 @
5abbcb48
此差异已折叠。
点击以展开。
o2server/x_program_center/src/main/java/com/x/program/center/zhengwudingding/SyncOrganization.java
浏览文件 @
5abbcb48
...
@@ -15,10 +15,9 @@ import javax.persistence.criteria.CriteriaQuery;
...
@@ -15,10 +15,9 @@ import javax.persistence.criteria.CriteriaQuery;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.persistence.criteria.Root
;
import
javax.script.Bindings
;
import
javax.script.Bindings
;
import
javax.script.CompiledScript
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
com.x.base.core.project.cache.CacheManager
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -28,12 +27,14 @@ import com.x.base.core.container.EntityManagerContainer;
...
@@ -28,12 +27,14 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.entity.annotation.CheckRemoveType
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.entity.type.GenderType
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Identity
;
import
com.x.organization.core.entity.Identity_
;
import
com.x.organization.core.entity.Identity_
;
...
@@ -286,12 +287,12 @@ public class SyncOrganization {
...
@@ -286,12 +287,12 @@ public class SyncOrganization {
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Pattern
pattern
=
Pattern
.
compile
(
com
.
x
.
base
.
core
.
project
.
config
.
Person
.
REGULAREXPRESSION_SCRIPT
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
Matcher
matcher
=
pattern
.
matcher
(
str
);
if
(
matcher
.
matches
())
{
if
(
matcher
.
matches
())
{
String
eval
=
ScriptFactory
.
functionalization
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
CompiledScript
cs
=
ScriptingFactory
ScriptContext
scriptContext
=
new
SimpleScriptContext
();
.
functionalizationCompile
(
StringEscapeUtils
.
unescapeJson
(
matcher
.
group
(
1
)));
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScript
();
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
Bindings
bindings
=
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
);
bindings
.
put
(
"person"
,
person
);
bindings
.
put
(
ScriptingFactory
.
BINDING_NAME_SERVICE_PERSON
,
person
);
Object
o
=
ScriptFactory
.
scriptEngine
.
eval
(
eval
,
scriptContext
);
return
JsonScriptingExecutor
.
evalString
(
cs
,
scriptContext
);
return
o
.
toString
();
}
else
{
}
else
{
return
str
;
return
str
;
}
}
...
@@ -409,7 +410,7 @@ public class SyncOrganization {
...
@@ -409,7 +410,7 @@ public class SyncOrganization {
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
EntityManagerContainer
emc
=
business
.
entityManagerContainer
();
emc
.
beginTransaction
(
Identity
.
class
);
emc
.
beginTransaction
(
Identity
.
class
);
Identity
identity
=
new
Identity
();
Identity
identity
=
new
Identity
();
identity
.
setUnique
(
unit
.
getUnique
()
+
"_"
+
person
.
getUnique
());
identity
.
setUnique
(
unit
.
getUnique
()
+
"_"
+
person
.
getUnique
());
identity
.
setName
(
person
.
getName
());
identity
.
setName
(
person
.
getName
());
identity
.
setPerson
(
person
.
getId
());
identity
.
setPerson
(
person
.
getId
());
identity
.
setUnit
(
unit
.
getId
());
identity
.
setUnit
(
unit
.
getId
());
...
...
o2server/x_query_core_express/src/main/java/com/x/query/core/express/plan/Plan.java
浏览文件 @
5abbcb48
package
com.x.query.core.express.plan
;
package
com.x.query.core.express.plan
;
import
java.util.*
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
java.util.Objects
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
...
@@ -9,7 +15,11 @@ import java.util.stream.Collectors;
...
@@ -9,7 +15,11 @@ import java.util.stream.Collectors;
import
javax.persistence.EntityManager
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Tuple
;
import
javax.persistence.Tuple
;
import
javax.persistence.criteria.*
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Order
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
javax.script.ScriptEngine
;
import
javax.script.ScriptEngine
;
import
javax.script.ScriptException
;
import
javax.script.ScriptException
;
...
@@ -25,7 +35,7 @@ import com.x.base.core.entity.tools.JpaObjectTools;
...
@@ -25,7 +35,7 @@ import com.x.base.core.entity.tools.JpaObjectTools;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.organization.OrganizationDefinition
;
import
com.x.base.core.project.script
.Script
Factory
;
import
com.x.base.core.project.script
ing.Scripting
Factory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.core.entity.Item
;
import
com.x.query.core.entity.Item
;
import
com.x.query.core.entity.Item_
;
import
com.x.query.core.entity.Item_
;
...
@@ -584,8 +594,8 @@ public abstract class Plan extends GsonPropertyObject {
...
@@ -584,8 +594,8 @@ public abstract class Plan extends GsonPropertyObject {
/* 有两个地方用到了 */
/* 有两个地方用到了 */
private
ScriptEngine
getScriptEngine
()
throws
ScriptException
,
Exception
{
private
ScriptEngine
getScriptEngine
()
throws
ScriptException
,
Exception
{
if
(
null
==
this
.
scriptEngine
)
{
if
(
null
==
this
.
scriptEngine
)
{
scriptEngine
=
ScriptFactory
.
newScriptEngine
();
scriptEngine
=
Script
ing
Factory
.
newScriptEngine
();
scriptEngine
.
eval
(
Config
.
mooToolsScriptText
());
//
scriptEngine.eval(Config.mooToolsScriptText());
}
}
return
scriptEngine
;
return
scriptEngine
;
}
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/ActionListCalculateWithWork.java
浏览文件 @
5abbcb48
...
@@ -4,11 +4,11 @@ import java.util.ArrayList;
...
@@ -4,11 +4,11 @@ import java.util.ArrayList;
import
java.util.Comparator
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.TreeSet
;
import
java.util.TreeSet
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.script.ScriptContext
;
import
javax.script.ScriptContext
;
import
javax.script.SimpleScriptContext
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.neuroph.core.NeuralNetwork
;
import
org.neuroph.core.NeuralNetwork
;
...
@@ -20,6 +20,8 @@ import com.x.base.core.container.EntityManagerContainer;
...
@@ -20,6 +20,8 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.dataitem.DataItemConverter
;
import
com.x.base.core.entity.dataitem.DataItemConverter
;
import
com.x.base.core.entity.dataitem.ItemCategory
;
import
com.x.base.core.entity.dataitem.ItemCategory
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.config.StorageMapping
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
...
@@ -28,7 +30,8 @@ import com.x.base.core.project.http.ActionResult;
...
@@ -28,7 +30,8 @@ import com.x.base.core.project.http.ActionResult;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.script.ScriptFactory
;
import
com.x.base.core.project.scripting.JsonScriptingExecutor
;
import
com.x.base.core.project.scripting.ScriptingFactory
;
import
com.x.base.core.project.tools.ByteTools
;
import
com.x.base.core.project.tools.ByteTools
;
import
com.x.base.core.project.tools.DoubleTools
;
import
com.x.base.core.project.tools.DoubleTools
;
import
com.x.base.core.project.tools.MapTools
;
import
com.x.base.core.project.tools.MapTools
;
...
@@ -42,9 +45,6 @@ import com.x.query.service.processing.Business;
...
@@ -42,9 +45,6 @@ import com.x.query.service.processing.Business;
import
com.x.query.service.processing.ThisApplication
;
import
com.x.query.service.processing.ThisApplication
;
import
com.x.query.service.processing.helper.ExtractTextHelper
;
import
com.x.query.service.processing.helper.ExtractTextHelper
;
import
com.x.query.service.processing.helper.LanguageProcessingHelper
;
import
com.x.query.service.processing.helper.LanguageProcessingHelper
;
import
com.x.base.core.project.cache.Cache.CacheKey
;
import
com.x.base.core.project.cache.CacheManager
;
import
java.util.Optional
;
class
ActionListCalculateWithWork
extends
BaseAction
{
class
ActionListCalculateWithWork
extends
BaseAction
{
...
@@ -157,9 +157,9 @@ class ActionListCalculateWithWork extends BaseAction {
...
@@ -157,9 +157,9 @@ class ActionListCalculateWithWork extends BaseAction {
break
;
break
;
}
}
if
(
StringUtils
.
isNotBlank
(
model
.
getInValueScriptText
()))
{
if
(
StringUtils
.
isNotBlank
(
model
.
getInValueScriptText
()))
{
ScriptContext
scriptContext
=
new
SimpleScriptContex
t
();
ScriptContext
scriptContext
=
ScriptingFactory
.
scriptContextEvalInitialServiceScrip
t
();
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
PROPERTY_INVALUES
,
inValue
);
scriptContext
.
getBindings
(
ScriptContext
.
ENGINE_SCOPE
).
put
(
PROPERTY_INVALUES
,
inValue
);
ScriptFactory
.
scriptEngine
.
eval
(
model
.
getInValueScriptText
()
,
scriptContext
);
JsonScriptingExecutor
.
eval
(
null
,
scriptContext
);
}
}
return
inValue
;
return
inValue
;
}
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/neural/Generate.java
浏览文件 @
5abbcb48
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录