Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
dc8507c7
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dc8507c7
编写于
4月 01, 2022
作者:
R
Ray
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update table
上级
54a4f361
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
65 addition
and
687 deletion
+65
-687
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ProcessPlatform.java
.../java/com/x/base/core/project/config/ProcessPlatform.java
+17
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_service_processing.java
...se/core/project/x_processplatform_service_processing.java
+2
-1
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/query/ActionListTableStatusBuild.java
...mble/designer/jaxrs/query/ActionListTableStatusBuild.java
+0
-63
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/query/BaseAction.java
...essplatform/assemble/designer/jaxrs/query/BaseAction.java
+0
-7
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/query/QueryAction.java
...ssplatform/assemble/designer/jaxrs/query/QueryAction.java
+0
-48
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing2.java
...atform/assemble/surface/jaxrs/task/ActionProcessing2.java
+0
-477
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
+1
-1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/message/Event.java
...java/com/x/processplatform/core/entity/message/Event.java
+11
-12
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ThisApplication.java
...x/processplatform/service/processing/ThisApplication.java
+4
-0
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/UpdateTableQueue.java
.../processplatform/service/processing/UpdateTableQueue.java
+14
-11
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java
...atform/service/processing/processor/end/EndProcessor.java
+5
-3
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ApplicationServletContextListener.java
...service/processing/ApplicationServletContextListener.java
+2
-1
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ThisApplication.java
.../java/com/x/query/service/processing/ThisApplication.java
+4
-0
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionListTableStatusBuild.java
...ce/processing/jaxrs/table/ActionListTableStatusBuild.java
+0
-45
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionUpdate.java
.../x/query/service/processing/jaxrs/table/ActionUpdate.java
+5
-0
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/TableAction.java
...m/x/query/service/processing/jaxrs/table/TableAction.java
+0
-18
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/ProcessPlatform.java
浏览文件 @
dc8507c7
...
@@ -991,5 +991,22 @@ public class ProcessPlatform extends ConfigObject {
...
@@ -991,5 +991,22 @@ public class ProcessPlatform extends ConfigObject {
public
void
setEnable
(
Boolean
enable
)
{
public
void
setEnable
(
Boolean
enable
)
{
this
.
enable
=
enable
;
this
.
enable
=
enable
;
}
}
public
Integer
getRetryMinutes
()
{
return
NumberTools
.
nullOrLessThan
(
this
.
retryMinutes
,
0
)
?
DEFAULT_RETRYMINUTES
:
this
.
retryMinutes
;
}
public
void
setRetryMinutes
(
Integer
retryMinutes
)
{
this
.
retryMinutes
=
retryMinutes
;
}
public
Integer
getThresholdMinutes
()
{
return
NumberTools
.
nullOrLessThan
(
this
.
thresholdMinutes
,
0
)
?
DEFAULT_THRESHOLDMINUTES
:
this
.
thresholdMinutes
;
}
public
void
setThresholdMinutes
(
Integer
thresholdMinutes
)
{
this
.
thresholdMinutes
=
thresholdMinutes
;
}
}
}
}
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_processplatform_service_processing.java
浏览文件 @
dc8507c7
...
@@ -58,7 +58,8 @@ import com.x.base.core.project.annotation.ModuleType;
...
@@ -58,7 +58,8 @@ import com.x.base.core.project.annotation.ModuleType;
"com.x.processplatform.core.entity.element.File"
,
"com.x.processplatform.core.entity.element.Form"
,
"com.x.processplatform.core.entity.element.File"
,
"com.x.processplatform.core.entity.element.Form"
,
"com.x.processplatform.core.entity.element.FormField"
,
"com.x.processplatform.core.entity.element.Embed"
,
"com.x.processplatform.core.entity.element.FormField"
,
"com.x.processplatform.core.entity.element.Embed"
,
"com.x.processplatform.core.entity.element.Mapping"
,
"com.x.processplatform.core.entity.log.SignalStackLog"
,
"com.x.processplatform.core.entity.element.Mapping"
,
"com.x.processplatform.core.entity.log.SignalStackLog"
,
"com.x.query.core.entity.Item"
,
"com.x.cms.core.entity.element.Script"
,
"com.x.processplatform.core.entity.message.Event"
,
"com.x.query.core.entity.Item"
,
"com.x.cms.core.entity.element.Script"
,
"com.x.portal.core.entity.Script"
},
storageTypes
=
{
StorageType
.
processPlatform
},
storeJars
=
{
"com.x.portal.core.entity.Script"
},
storageTypes
=
{
StorageType
.
processPlatform
},
storeJars
=
{
"x_organization_core_entity"
,
"x_organization_core_express"
,
"x_processplatform_core_entity"
,
"x_organization_core_entity"
,
"x_organization_core_express"
,
"x_processplatform_core_entity"
,
"x_processplatform_core_express"
,
"x_query_core_entity"
,
"x_cms_core_entity"
,
"x_portal_core_entity"
})
"x_processplatform_core_express"
,
"x_query_core_entity"
,
"x_cms_core_entity"
,
"x_portal_core_entity"
})
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/query/ActionListTableStatusBuild.java
已删除
100644 → 0
浏览文件 @
54a4f361
package
com.x.processplatform.assemble.designer.jaxrs.query
;
import
java.util.List
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.x_query_service_processing
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.processplatform.assemble.designer.ThisApplication
;
class
ActionListTableStatusBuild
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListTableStatusBuild
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
List
<
Wo
>
wos
=
ThisApplication
.
context
().
applications
()
.
getQuery
(
x_query_service_processing
.
class
,
Applications
.
joinQueryUri
(
"list"
,
"status"
,
"build"
))
.
getDataAsList
(
Wo
.
class
);
result
.
setData
(
wos
);
return
result
;
}
public
static
class
Wo
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
5440962359854767814L
;
@FieldDescribe
(
"标识"
)
private
String
id
;
@FieldDescribe
(
"名称"
)
private
String
name
;
@FieldDescribe
(
"说明"
)
private
String
description
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
description
)
{
this
.
description
=
description
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/query/BaseAction.java
已删除
100644 → 0
浏览文件 @
54a4f361
package
com.x.processplatform.assemble.designer.jaxrs.query
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
abstract
class
BaseAction
extends
StandardJaxrsAction
{
}
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/query/QueryAction.java
已删除
100644 → 0
浏览文件 @
54a4f361
package
com.x.processplatform.assemble.designer.jaxrs.query
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.Consumes
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.PathParam
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.annotation.JaxrsParameterDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.jaxrs.ResponseFactory
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
@Path
(
"query"
)
@JaxrsDescribe
(
"数据中心"
)
public
class
QueryAction
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
QueryAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"列示数据中心可用自建表"
,
action
=
ActionListTableStatusBuild
.
class
)
@GET
@Path
(
"list/table/status/build"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
get
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
List
<
ActionListTableStatusBuild
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListTableStatusBuild
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/ActionProcessing2.java
已删除
100644 → 0
浏览文件 @
54a4f361
package
com.x.processplatform.assemble.surface.jaxrs.task
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.x_processplatform_service_processing
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.jaxrs.WrapStringList
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.processplatform.assemble.surface.Business
;
import
com.x.processplatform.assemble.surface.ThisApplication
;
import
com.x.processplatform.core.entity.content.Record
;
import
com.x.processplatform.core.entity.content.RecordProperties.NextManual
;
import
com.x.processplatform.core.entity.content.Task
;
import
com.x.processplatform.core.entity.content.TaskCompleted
;
import
com.x.processplatform.core.entity.content.Work
;
import
com.x.processplatform.core.entity.content.WorkCompleted
;
import
com.x.processplatform.core.entity.content.WorkLog
;
import
com.x.processplatform.core.entity.element.Manual
;
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.WrapProcessing
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity
;
import
com.x.processplatform.core.express.service.processing.jaxrs.task.WrapUpdatePrevTaskIdentity.PrevTask
;
import
com.x.processplatform.core.express.service.processing.jaxrs.taskcompleted.WrapUpdateNextTaskIdentity
;
class
ActionProcessing2
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionProcessing2
.
class
);
private
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
private
Wi
wi
;
private
Task
task
;
private
WorkLog
workLog
;
private
Work
work
;
private
String
taskCompletedId
;
private
String
type
;
private
EffectivePerson
effectivePerson
;
private
List
<
TaskCompleted
>
taskCompleteds
=
new
ArrayList
<>();
private
List
<
Task
>
newTasks
=
new
ArrayList
<>();
private
Record
record
;
private
String
series
=
StringTools
.
uniqueToken
();
private
static
final
String
TYPE_APPENDTASK
=
"appendTask"
;
private
static
final
String
TYPE_TASK
=
"task"
;
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
,
JsonElement
jsonElement
)
throws
Exception
{
this
.
effectivePerson
=
effectivePerson
;
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
this
.
task
=
emc
.
find
(
id
,
Task
.
class
);
if
(
null
==
this
.
task
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Task
.
class
);
}
// 获取当前环节已经完成的待办
this
.
taskCompleteds
=
emc
.
listEqual
(
TaskCompleted
.
class
,
TaskCompleted
.
activityToken_FIELDNAME
,
task
.
getActivityToken
());
this
.
workLog
=
emc
.
firstEqualAndEqual
(
WorkLog
.
class
,
WorkLog
.
job_FIELDNAME
,
task
.
getJob
(),
WorkLog
.
fromActivityToken_FIELDNAME
,
task
.
getActivityToken
());
if
(
null
==
workLog
)
{
throw
new
ExceptionEntityNotExist
(
WorkLog
.
class
);
}
this
.
work
=
emc
.
find
(
this
.
task
.
getWork
(),
Work
.
class
);
if
(
null
==
this
.
work
)
{
throw
new
ExceptionEntityNotExist
(
this
.
task
.
getWork
(),
Work
.
class
);
}
if
((!
effectivePerson
.
isCipher
())
&&
effectivePerson
.
isNotPerson
(
this
.
task
.
getPerson
()))
{
throw
new
ExceptionAccessDenied
(
effectivePerson
,
this
.
task
);
}
if
(
StringUtils
.
isNotEmpty
(
wi
.
getRouteName
())
||
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
())
||
(!
StringUtils
.
equals
(
this
.
task
.
getMediaOpinion
(),
wi
.
getMediaOpinion
())))
{
emc
.
beginTransaction
(
Task
.
class
);
this
.
updateRouteNameOpinionMediaOpinion
(
task
,
wi
);
emc
.
commit
();
}
this
.
type
=
this
.
type
(
business
,
task
,
wi
);
}
this
.
processing
();
Wo
wo
=
Wo
.
copier
.
copy
(
record
);
result
.
setData
(
wo
);
return
result
;
}
private
void
updateRouteNameOpinionMediaOpinion
(
Task
task
,
Wi
wi
)
{
/* 如果有输入新的路由决策覆盖原有决策 */
if
(
StringUtils
.
isNotEmpty
(
wi
.
getRouteName
()))
{
task
.
setRouteName
(
wi
.
getRouteName
());
}
/* 如果有新的流程意见那么覆盖原有流程意见 */
if
(
StringUtils
.
isNotEmpty
(
wi
.
getOpinion
()))
{
task
.
setOpinion
(
wi
.
getOpinion
());
}
/* 强制覆盖多媒体意见 */
task
.
setMediaOpinion
(
wi
.
getMediaOpinion
());
}
private
String
type
(
Business
business
,
Task
task
,
Wi
wi
)
throws
Exception
{
Manual
manual
=
business
.
manual
().
pick
(
task
.
getActivity
());
if
(
null
!=
manual
)
{
Route
route
=
null
;
for
(
Route
o
:
business
.
route
().
pick
(
manual
.
getRouteList
()))
{
if
(
StringUtils
.
equals
(
o
.
getName
(),
task
.
getRouteName
()))
{
route
=
o
;
break
;
}
}
if
((
null
!=
route
)
&&
(
StringUtils
.
equals
(
route
.
getType
(),
Route
.
TYPE_APPENDTASK
))
&&
StringUtils
.
equals
(
manual
.
getId
(),
route
.
getActivity
()))
{
return
TYPE_APPENDTASK
;
}
}
return
TYPE_TASK
;
}
private
void
processing
()
throws
Exception
{
switch
(
type
)
{
case
TYPE_APPENDTASK:
this
.
processingAppendTask
();
break
;
default
:
this
.
processingTask
();
break
;
}
}
private
void
processingAppendTask
()
throws
Exception
{
this
.
processingAppendTask_append
();
this
.
taskCompletedId
=
this
.
processing_processingTask
(
TaskCompleted
.
PROCESSINGTYPE_APPENDTASK
);
this
.
processing_processingWork
(
ProcessingAttributes
.
TYPE_APPENDTASK
);
this
.
processing_record
(
Record
.
TYPE_APPENDTASK
);
this
.
processing_updateTaskCompleted
();
this
.
processing_updateTask
();
}
private
void
processingAppendTask_append
()
throws
Exception
{
WrapAppend
req
=
new
WrapAppend
();
req
.
setIdentityList
(
this
.
wi
.
getAppendTaskIdentityList
());
ThisApplication
.
context
().
applications
()
.
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
this
.
task
.
getId
(),
"append"
),
req
,
this
.
task
.
getJob
())
.
getData
(
WrapStringList
.
class
);
}
private
void
processingTask
()
throws
Exception
{
this
.
taskCompletedId
=
this
.
processing_processingTask
(
TaskCompleted
.
PROCESSINGTYPE_TASK
);
this
.
processing_processingWork
(
ProcessingAttributes
.
TYPE_TASK
);
// 流程流转到取消环节,此时工作已被删除
boolean
flag
=
true
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
if
((
emc
.
countEqual
(
Work
.
class
,
Work
.
job_FIELDNAME
,
task
.
getJob
())
==
0
)
&&
(
emc
.
countEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
task
.
getJob
())
==
0
))
{
flag
=
false
;
}
}
if
(
flag
)
{
this
.
processing_record
(
Record
.
TYPE_TASK
);
this
.
processing_updateTaskCompleted
();
this
.
processing_updateTask
();
}
else
{
record
=
new
Record
(
workLog
,
task
);
record
.
setCompleted
(
true
);
record
.
setType
(
Record
.
TYPE_TASK
);
}
}
private
String
processing_processingTask
(
String
processType
)
throws
Exception
{
WrapProcessing
req
=
new
WrapProcessing
();
req
.
setProcessingType
(
processType
);
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
putQuery
(
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
task
.
getId
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionTaskProcessing
(
task
.
getId
());
}
else
{
/* 获得已办id */
return
resp
.
getId
();
}
}
private
void
processing_processingWork
(
String
type
)
throws
Exception
{
ProcessingAttributes
req
=
new
ProcessingAttributes
();
req
.
setIgnoreEmpowerIdentityList
(
wi
.
getIgnoreEmpowerIdentityList
());
req
.
setType
(
ProcessingAttributes
.
TYPE_TASK
);
req
.
setSeries
(
this
.
series
);
req
.
setPerson
(
task
.
getPerson
());
req
.
setIdentity
(
task
.
getIdentity
());
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"work"
,
task
.
getWork
(),
"processing"
),
req
,
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionWorkProcessing
(
task
.
getId
());
}
}
private
void
processing_record
(
String
type
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
final
List
<
String
>
nextTaskIdentities
=
new
ArrayList
<>();
record
=
new
Record
(
workLog
,
task
);
// 校验workCompleted,如果存在,那么说明工作已经完成,标识状态为已经完成.
WorkCompleted
workCompleted
=
emc
.
firstEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
task
.
getJob
());
if
(
null
!=
workCompleted
)
{
record
.
setCompleted
(
true
);
record
.
setWorkCompleted
(
workCompleted
.
getId
());
}
record
.
getProperties
().
setElapsed
(
Config
.
workTime
().
betweenMinutes
(
record
.
getProperties
().
getStartTime
(),
record
.
getRecordTime
()));
record
.
setType
(
type
);
List
<
Task
>
list
=
emc
.
fetchEqualAndEqual
(
Task
.
class
,
ListTools
.
toList
(
Task
.
person_FIELDNAME
,
Task
.
identity_FIELDNAME
,
Task
.
unit_FIELDNAME
,
Task
.
job_FIELDNAME
,
Task
.
work_FIELDNAME
,
Task
.
activity_FIELDNAME
,
Task
.
activityAlias_FIELDNAME
,
Task
.
activityName_FIELDNAME
,
Task
.
activityToken_FIELDNAME
,
Task
.
activityType_FIELDNAME
,
Task
.
empowerFromIdentity_FIELDNAME
),
Task
.
job_FIELDNAME
,
task
.
getJob
(),
Task
.
series_FIELDNAME
,
this
.
series
);
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Task:
:
getActivity
,
Collectors
.
toList
())).
entrySet
().
stream
()
.
forEach
(
o
->
{
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
o
.
getValue
().
get
(
0
).
getActivity
());
nextManual
.
setActivityAlias
(
o
.
getValue
().
get
(
0
).
getActivityAlias
());
nextManual
.
setActivityName
(
o
.
getValue
().
get
(
0
).
getActivityName
());
nextManual
.
setActivityToken
(
o
.
getValue
().
get
(
0
).
getActivityToken
());
nextManual
.
setActivityType
(
o
.
getValue
().
get
(
0
).
getActivityType
());
for
(
Task
t
:
o
.
getValue
())
{
nextManual
.
getTaskIdentityList
().
add
(
t
.
getIdentity
());
this
.
newTasks
.
add
(
t
);
nextTaskIdentities
.
add
(
t
.
getIdentity
());
}
record
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
});
// 去重
record
.
getProperties
().
setNextManualTaskIdentityList
(
ListTools
.
trim
(
nextTaskIdentities
,
true
,
true
));
TaskCompleted
taskCompleted
=
emc
.
find
(
taskCompletedId
,
TaskCompleted
.
class
);
if
(
null
!=
taskCompleted
)
{
// 处理完成后在重新写入待办信息
record
.
getProperties
().
setOpinion
(
taskCompleted
.
getOpinion
());
record
.
getProperties
().
setRouteName
(
taskCompleted
.
getRouteName
());
record
.
getProperties
().
setMediaOpinion
(
taskCompleted
.
getMediaOpinion
());
}
}
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"record"
,
"job"
,
this
.
work
.
getJob
()),
record
,
this
.
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionWorkProcessing
(
this
.
work
.
getId
());
}
}
private
void
processing_updateTaskCompleted
()
throws
Exception
{
// 记录下一处理人信息
WrapUpdateNextTaskIdentity
req
=
new
WrapUpdateNextTaskIdentity
();
req
.
getTaskCompletedList
().
add
(
taskCompletedId
);
req
.
setNextTaskIdentityList
(
record
.
getProperties
().
getNextManualTaskIdentityList
());
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"taskcompleted"
,
"next"
,
"task"
,
"identity"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
}
private
void
processing_updateTask
()
throws
Exception
{
// 记录上一处理人信息
if
(
ListTools
.
isNotEmpty
(
newTasks
))
{
WrapUpdatePrevTaskIdentity
req
=
new
WrapUpdatePrevTaskIdentity
();
req
.
setTaskList
(
ListTools
.
extractProperty
(
newTasks
,
JpaObject
.
id_FIELDNAME
,
String
.
class
,
true
,
true
));
this
.
taskCompleteds
.
stream
().
forEach
(
o
->
{
PrevTask
prevTask
=
new
PrevTask
();
prevTask
.
setCompletedTime
(
o
.
getCompletedTime
());
prevTask
.
setStartTime
(
o
.
getStartTime
());
prevTask
.
setOpinion
(
o
.
getOpinion
());
prevTask
.
setPerson
(
o
.
getPerson
());
prevTask
.
setIdentity
(
o
.
getIdentity
());
prevTask
.
setUnit
(
o
.
getUnit
());
prevTask
.
setRouteName
(
o
.
getRouteName
());
req
.
getPrevTaskIdentityList
().
add
(
prevTask
.
getIdentity
());
req
.
getPrevTaskList
().
add
(
prevTask
);
});
PrevTask
prevTask
=
new
PrevTask
();
prevTask
.
setCompletedTime
(
new
Date
());
prevTask
.
setStartTime
(
task
.
getStartTime
());
prevTask
.
setOpinion
(
task
.
getOpinion
());
prevTask
.
setPerson
(
task
.
getPerson
());
prevTask
.
setIdentity
(
task
.
getIdentity
());
prevTask
.
setUnit
(
task
.
getUnit
());
prevTask
.
setRouteName
(
task
.
getRouteName
());
req
.
getPrevTaskIdentityList
().
add
(
prevTask
.
getIdentity
());
req
.
setPrevTaskIdentity
(
prevTask
.
getIdentity
());
req
.
getPrevTaskList
().
add
(
prevTask
);
req
.
setPrevTask
(
prevTask
);
// 去重
req
.
setPrevTaskIdentityList
(
ListTools
.
trim
(
req
.
getPrevTaskIdentityList
(),
true
,
true
));
ThisApplication
.
context
().
applications
()
.
putQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"task"
,
"prev"
,
"task"
,
"identity"
),
req
,
task
.
getJob
())
.
getData
(
WrapBoolean
.
class
);
}
List
<
Task
>
empowerTasks
=
new
ArrayList
<>();
for
(
Task
o
:
newTasks
)
{
if
(
StringUtils
.
isNotEmpty
(
o
.
getEmpowerFromIdentity
())
&&
(!
StringUtils
.
equals
(
o
.
getEmpowerFromIdentity
(),
o
.
getIdentity
())))
{
empowerTasks
.
add
(
o
);
}
}
if
(!
empowerTasks
.
isEmpty
())
{
List
<
Record
>
empowerRecords
=
new
ArrayList
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
for
(
Task
o
:
empowerTasks
)
{
empowerRecords
.
add
(
createEmpowerRecord
(
business
,
o
));
}
}
for
(
Record
r
:
empowerRecords
)
{
WoId
resp
=
ThisApplication
.
context
().
applications
()
.
postQuery
(
effectivePerson
.
getDebugger
(),
x_processplatform_service_processing
.
class
,
Applications
.
joinQueryUri
(
"record"
,
"job"
,
this
.
work
.
getJob
()),
r
,
this
.
task
.
getJob
())
.
getData
(
WoId
.
class
);
if
(
StringUtils
.
isBlank
(
resp
.
getId
()))
{
throw
new
ExceptionWorkProcessing
(
this
.
work
.
getId
());
}
}
}
}
private
Record
createEmpowerRecord
(
Business
business
,
Task
task
)
throws
Exception
{
Record
o
=
new
Record
();
o
.
setType
(
Record
.
TYPE_EMPOWER
);
o
.
setApplication
(
task
.
getApplication
());
o
.
setProcess
(
task
.
getProcess
());
o
.
setJob
(
task
.
getJob
());
o
.
setCompleted
(
false
);
o
.
setWork
(
task
.
getWork
());
o
.
setFromActivity
(
task
.
getActivity
());
o
.
setFromActivityAlias
(
task
.
getActivityAlias
());
o
.
setFromActivityName
(
task
.
getActivityName
());
o
.
setFromActivityToken
(
task
.
getActivityToken
());
o
.
setFromActivityType
(
task
.
getActivityType
());
o
.
setArrivedActivity
(
task
.
getActivity
());
o
.
setArrivedActivityAlias
(
task
.
getActivityAlias
());
o
.
setArrivedActivityName
(
task
.
getActivityName
());
o
.
setArrivedActivityToken
(
task
.
getActivityToken
());
o
.
setArrivedActivityType
(
task
.
getActivityType
());
o
.
getProperties
().
setEmpowerToPerson
(
task
.
getPerson
());
o
.
getProperties
().
setEmpowerToIdentity
(
task
.
getIdentity
());
o
.
getProperties
().
setEmpowerToUnit
(
task
.
getUnit
());
o
.
setIdentity
(
task
.
getEmpowerFromIdentity
());
o
.
setPerson
(
business
.
organization
().
person
().
getWithIdentity
(
o
.
getIdentity
()));
o
.
setUnit
(
business
.
organization
().
unit
().
getWithIdentity
(
o
.
getIdentity
()));
o
.
getProperties
().
setElapsed
(
0L
);
NextManual
nextManual
=
new
NextManual
();
nextManual
.
setActivity
(
task
.
getActivity
());
nextManual
.
setActivityAlias
(
task
.
getActivityAlias
());
nextManual
.
setActivityName
(
task
.
getActivityName
());
nextManual
.
setActivityToken
(
task
.
getActivityToken
());
nextManual
.
setActivityType
(
task
.
getActivityType
());
o
.
getProperties
().
getNextManualList
().
add
(
nextManual
);
o
.
getProperties
().
getNextManualTaskIdentityList
().
add
(
task
.
getIdentity
());
return
o
;
}
public
static
class
Wo
extends
Record
{
private
static
final
long
serialVersionUID
=
-
1771383649634969945L
;
static
WrapCopier
<
Record
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Record
.
class
,
Wo
.
class
,
null
,
JpaObject
.
FieldsInvisible
);
}
public
static
class
WoTask
extends
Task
{
private
static
final
long
serialVersionUID
=
2702712453822143654L
;
static
WrapCopier
<
Task
,
WoTask
>
copier
=
WrapCopierFactory
.
wo
(
Task
.
class
,
WoTask
.
class
,
ListTools
.
toList
(
JpaObject
.
id_FIELDNAME
,
Task
.
activity_FIELDNAME
,
Task
.
activityName_FIELDNAME
,
Task
.
person_FIELDNAME
,
Task
.
identity_FIELDNAME
,
Task
.
unit_FIELDNAME
),
null
);
}
public
static
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"路由名称"
)
private
String
routeName
;
@FieldDescribe
(
"意见"
)
private
String
opinion
;
@FieldDescribe
(
"多媒体意见"
)
private
String
mediaOpinion
;
@FieldDescribe
(
"路由数据"
)
private
JsonElement
routeData
;
@FieldDescribe
(
"新添加的待办处理人"
)
private
List
<
String
>
appendTaskIdentityList
;
@FieldDescribe
(
"忽略授权身份"
)
private
List
<
String
>
ignoreEmpowerIdentityList
;
public
List
<
String
>
getAppendTaskIdentityList
()
{
return
appendTaskIdentityList
;
}
public
void
setAppendTaskIdentityList
(
List
<
String
>
appendTaskIdentityList
)
{
this
.
appendTaskIdentityList
=
appendTaskIdentityList
;
}
public
String
getRouteName
()
{
return
routeName
;
}
public
void
setRouteName
(
String
routeName
)
{
this
.
routeName
=
routeName
;
}
public
String
getOpinion
()
{
return
opinion
;
}
public
void
setOpinion
(
String
opinion
)
{
this
.
opinion
=
opinion
;
}
public
String
getMediaOpinion
()
{
return
mediaOpinion
;
}
public
void
setMediaOpinion
(
String
mediaOpinion
)
{
this
.
mediaOpinion
=
mediaOpinion
;
}
public
JsonElement
getRouteData
()
{
return
routeData
;
}
public
void
setRouteData
(
JsonElement
routeData
)
{
this
.
routeData
=
routeData
;
}
public
List
<
String
>
getIgnoreEmpowerIdentityList
()
{
return
ignoreEmpowerIdentityList
;
}
public
void
setIgnoreEmpowerIdentityList
(
List
<
String
>
ignoreEmpowerIdentityList
)
{
this
.
ignoreEmpowerIdentityList
=
ignoreEmpowerIdentityList
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/element/Process.java
浏览文件 @
dc8507c7
...
@@ -105,7 +105,7 @@ public class Process extends SliceJpaObject {
...
@@ -105,7 +105,7 @@ public class Process extends SliceJpaObject {
return
updateTableEnable
;
return
updateTableEnable
;
}
}
public
void
set
AsyncSupported
(
Boolean
updateTableEnable
)
{
public
void
set
UpdateTableEnable
(
Boolean
updateTableEnable
)
{
this
.
updateTableEnable
=
updateTableEnable
;
this
.
updateTableEnable
=
updateTableEnable
;
this
.
getProperties
().
setUpdateTableEnable
(
updateTableEnable
);
this
.
getProperties
().
setUpdateTableEnable
(
updateTableEnable
);
}
}
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/message/Event.java
浏览文件 @
dc8507c7
...
@@ -55,12 +55,11 @@ public class Event extends SliceJpaObject {
...
@@ -55,12 +55,11 @@ public class Event extends SliceJpaObject {
this
.
failure
=
0
;
this
.
failure
=
0
;
}
}
public
static
final
String
WORKCOMPLETED_FIELDNAME
=
"workCompleted
"
;
public
static
final
String
JOB_FIELDNAME
=
"job
"
;
@FieldDescribe
(
"任务标识."
)
@FieldDescribe
(
"任务标识."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
WORKCOMPLETED_FIELDNAME
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
JOB_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
WORKCOMPLETED_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
workCompleted
;
private
String
job
;
public
static
final
String
TARGET_FIELDNAME
=
"target"
;
public
static
final
String
TARGET_FIELDNAME
=
"target"
;
@FieldDescribe
(
"目标对象标识."
)
@FieldDescribe
(
"目标对象标识."
)
...
@@ -81,6 +80,14 @@ public class Event extends SliceJpaObject {
...
@@ -81,6 +80,14 @@ public class Event extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
true
)
@CheckPersist
(
allowEmpty
=
true
)
private
Integer
failure
;
private
Integer
failure
;
public
String
getJob
()
{
return
job
;
}
public
void
setJob
(
String
job
)
{
this
.
job
=
job
;
}
public
Integer
getFailure
()
{
public
Integer
getFailure
()
{
return
failure
;
return
failure
;
}
}
...
@@ -105,12 +112,4 @@ public class Event extends SliceJpaObject {
...
@@ -105,12 +112,4 @@ public class Event extends SliceJpaObject {
this
.
type
=
type
;
this
.
type
=
type
;
}
}
public
String
getWorkCompleted
()
{
return
workCompleted
;
}
public
void
setWorkCompleted
(
String
workCompleted
)
{
this
.
workCompleted
=
workCompleted
;
}
}
}
\ No newline at end of file
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/ThisApplication.java
浏览文件 @
dc8507c7
...
@@ -22,6 +22,7 @@ import com.x.processplatform.service.processing.schedule.Merge;
...
@@ -22,6 +22,7 @@ import com.x.processplatform.service.processing.schedule.Merge;
import
com.x.processplatform.service.processing.schedule.PassExpired
;
import
com.x.processplatform.service.processing.schedule.PassExpired
;
import
com.x.processplatform.service.processing.schedule.TouchDelay
;
import
com.x.processplatform.service.processing.schedule.TouchDelay
;
import
com.x.processplatform.service.processing.schedule.TouchDetained
;
import
com.x.processplatform.service.processing.schedule.TouchDetained
;
import
com.x.processplatform.service.processing.schedule.UpdateTable
;
import
com.x.processplatform.service.processing.schedule.Urge
;
import
com.x.processplatform.service.processing.schedule.Urge
;
public
class
ThisApplication
{
public
class
ThisApplication
{
...
@@ -94,6 +95,9 @@ public class ThisApplication {
...
@@ -94,6 +95,9 @@ public class ThisApplication {
if
(
BooleanUtils
.
isTrue
(
Config
.
processPlatform
().
getUrge
().
getEnable
()))
{
if
(
BooleanUtils
.
isTrue
(
Config
.
processPlatform
().
getUrge
().
getEnable
()))
{
context
.
schedule
(
Urge
.
class
,
Config
.
processPlatform
().
getUrge
().
getCron
());
context
.
schedule
(
Urge
.
class
,
Config
.
processPlatform
().
getUrge
().
getCron
());
}
}
if
(
BooleanUtils
.
isTrue
(
Config
.
processPlatform
().
getUpdateTable
().
getEnable
()))
{
context
.
schedule
(
UpdateTable
.
class
,
Config
.
processPlatform
().
getUpdateTable
().
getCron
());
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/UpdateTableQueue.java
浏览文件 @
dc8507c7
...
@@ -19,6 +19,7 @@ import com.x.base.core.container.EntityManagerContainer;
...
@@ -19,6 +19,7 @@ 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.project.Applications
;
import
com.x.base.core.project.Applications
;
import
com.x.base.core.project.x_query_service_processing
;
import
com.x.base.core.project.x_query_service_processing
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.jaxrs.WrapBoolean
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.Logger
;
...
@@ -50,32 +51,32 @@ public class UpdateTableQueue extends AbstractQueue<String> {
...
@@ -50,32 +51,32 @@ public class UpdateTableQueue extends AbstractQueue<String> {
private
boolean
update
(
String
id
)
throws
Exception
{
private
boolean
update
(
String
id
)
throws
Exception
{
Event
event
=
exist
(
id
);
Event
event
=
exist
(
id
);
if
(
null
!=
event
)
{
if
(
(
null
!=
event
)
&&
StringUtils
.
equals
(
event
.
getType
(),
Event
.
EVENTTYPE_UPDATETABLE
)
)
{
if
(
push
(
event
))
{
if
(
push
(
event
))
{
success
(
id
);
success
(
id
);
}
else
{
}
else
{
failure
(
id
);
failure
(
id
);
LOGGER
.
warn
(
"更新到自建表失败:{}."
,
()
->
id
);
}
}
}
}
return
false
;
return
false
;
}
}
private
boolean
push
(
Event
event
)
{
private
boolean
push
(
Event
event
)
{
String
tableName
=
event
.
getTarget
(
);
LOGGER
.
debug
(
"更新到自建表:{}, bundle:{}."
,
event:
:
getTarget
,
event:
:
getJob
);
Data
data
=
null
;
Data
data
=
null
;
WorkCompleted
workCompleted
=
null
;
WorkCompleted
workCompleted
=
null
;
try
{
try
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
workCompleted
=
emc
.
fi
nd
(
event
.
getWorkCompleted
(),
WorkCompleted
.
class
);
workCompleted
=
emc
.
fi
rstEqual
(
WorkCompleted
.
class
,
WorkCompleted
.
job_FIELDNAME
,
event
.
getJob
()
);
if
(
null
!=
workCompleted
)
{
if
(
null
!=
workCompleted
)
{
data
=
new
WorkDataHelper
(
emc
,
workCompleted
).
get
();
data
=
new
WorkDataHelper
(
emc
,
workCompleted
).
get
();
}
}
}
}
if
(
null
!=
data
&&
null
!=
workCompleted
)
{
if
((
null
!=
data
)
&&
(
null
!=
workCompleted
))
{
JsonElement
jsonElement
=
XGsonBuilder
.
merge
(
gson
.
toJsonTree
(
data
),
gson
.
toJsonTree
(
data
));
JsonElement
jsonElement
=
XGsonBuilder
.
merge
(
gson
.
toJsonTree
(
workCompleted
),
gson
.
toJsonTree
(
data
));
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
()
WrapBoolean
resp
=
ThisApplication
.
context
().
applications
().
postQuery
(
x_query_service_processing
.
class
,
.
postQuery
(
x_query_service_processing
.
class
,
Applications
.
joinQueryUri
(
"table"
,
event
.
getTarget
(),
"update"
,
event
.
getJob
()),
jsonElement
)
Applications
.
joinQueryUri
(
"table"
,
tableName
,
"update"
,
event
.
getTarget
()),
jsonElement
)
.
getData
(
WrapBoolean
.
class
);
.
getData
(
WrapBoolean
.
class
);
return
resp
.
getValue
();
return
resp
.
getValue
();
}
}
...
@@ -130,7 +131,8 @@ public class UpdateTableQueue extends AbstractQueue<String> {
...
@@ -130,7 +131,8 @@ public class UpdateTableQueue extends AbstractQueue<String> {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Event
>
root
=
cq
.
from
(
Event
.
class
);
Root
<
Event
>
root
=
cq
.
from
(
Event
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Event_
.
type
),
Event
.
EVENTTYPE_UPDATETABLE
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Event_
.
type
),
Event
.
EVENTTYPE_UPDATETABLE
);
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Event_
.
updateTime
),
DateUtils
.
addMinutes
(
new
Date
(),
-
20
)));
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Event_
.
updateTime
),
DateUtils
.
addMinutes
(
new
Date
(),
-
Config
.
processPlatform
().
getUpdateTable
().
getRetryMinutes
())));
list
.
addAll
(
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Event_
.
id
)).
where
(
p
)).
setMaxResults
(
100
).
getResultList
());
list
.
addAll
(
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Event_
.
id
)).
where
(
p
)).
setMaxResults
(
100
).
getResultList
());
}
}
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
...
@@ -147,7 +149,8 @@ public class UpdateTableQueue extends AbstractQueue<String> {
...
@@ -147,7 +149,8 @@ public class UpdateTableQueue extends AbstractQueue<String> {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Event
>
root
=
cq
.
from
(
Event
.
class
);
Root
<
Event
>
root
=
cq
.
from
(
Event
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Event_
.
type
),
Event
.
EVENTTYPE_UPDATETABLE
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Event_
.
type
),
Event
.
EVENTTYPE_UPDATETABLE
);
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Event_
.
updateTime
),
DateUtils
.
addDays
(
new
Date
(),
-
7
)));
p
=
cb
.
and
(
p
,
cb
.
lessThanOrEqualTo
(
root
.
get
(
Event_
.
createTime
),
DateUtils
.
addMinutes
(
new
Date
(),
-
Config
.
processPlatform
().
getUpdateTable
().
getThresholdMinutes
())));
list
.
addAll
(
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Event_
.
id
)).
where
(
p
)).
setMaxResults
(
100
).
getResultList
());
list
.
addAll
(
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Event_
.
id
)).
where
(
p
)).
setMaxResults
(
100
).
getResultList
());
if
(!
list
.
isEmpty
())
{
if
(!
list
.
isEmpty
())
{
emc
.
beginTransaction
(
Event
.
class
);
emc
.
beginTransaction
(
Event
.
class
);
...
...
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/processor/end/EndProcessor.java
浏览文件 @
dc8507c7
...
@@ -169,7 +169,7 @@ public class EndProcessor extends AbstractEndProcessor {
...
@@ -169,7 +169,7 @@ public class EndProcessor extends AbstractEndProcessor {
addUpdateTableEvent
(
aeiObjects
);
addUpdateTableEvent
(
aeiObjects
);
}
}
p
ublic
void
addUpdateTableEvent
(
AeiObjects
aeiObjects
)
throws
Exception
{
p
rivate
void
addUpdateTableEvent
(
AeiObjects
aeiObjects
)
throws
Exception
{
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getProcess
().
getUpdateTableEnable
())
if
(
BooleanUtils
.
isTrue
(
aeiObjects
.
getProcess
().
getUpdateTableEnable
())
&&
ListTools
.
isNotEmpty
(
aeiObjects
.
getProcess
().
getUpdateTableList
()))
{
&&
ListTools
.
isNotEmpty
(
aeiObjects
.
getProcess
().
getUpdateTableList
()))
{
List
<
Event
>
events
=
new
ArrayList
<>();
List
<
Event
>
events
=
new
ArrayList
<>();
...
@@ -177,7 +177,7 @@ public class EndProcessor extends AbstractEndProcessor {
...
@@ -177,7 +177,7 @@ public class EndProcessor extends AbstractEndProcessor {
if
(
StringUtils
.
isNotEmpty
(
table
))
{
if
(
StringUtils
.
isNotEmpty
(
table
))
{
Event
event
=
new
Event
();
Event
event
=
new
Event
();
event
.
setTarget
(
table
);
event
.
setTarget
(
table
);
event
.
set
Id
(
aeiObjects
.
getWork
().
getJob
());
event
.
set
Job
(
aeiObjects
.
getWork
().
getJob
());
event
.
setType
(
Event
.
EVENTTYPE_UPDATETABLE
);
event
.
setType
(
Event
.
EVENTTYPE_UPDATETABLE
);
events
.
add
(
event
);
events
.
add
(
event
);
}
}
...
@@ -188,7 +188,9 @@ public class EndProcessor extends AbstractEndProcessor {
...
@@ -188,7 +188,9 @@ public class EndProcessor extends AbstractEndProcessor {
aeiObjects
.
entityManagerContainer
().
persist
(
event
,
CheckPersistType
.
all
);
aeiObjects
.
entityManagerContainer
().
persist
(
event
,
CheckPersistType
.
all
);
}
}
aeiObjects
.
entityManagerContainer
().
commit
();
aeiObjects
.
entityManagerContainer
().
commit
();
ThisApplication
.
updateTableQueue
.
send
(
aeiObjects
.
getWork
().
getJob
());
for
(
Event
event
:
events
)
{
ThisApplication
.
updateTableQueue
.
send
(
event
.
getId
());
}
}
}
}
}
}
}
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ApplicationServletContextListener.java
浏览文件 @
dc8507c7
...
@@ -12,7 +12,8 @@ public class ApplicationServletContextListener implements ServletContextListener
...
@@ -12,7 +12,8 @@ public class ApplicationServletContextListener implements ServletContextListener
@Override
@Override
public
void
contextInitialized
(
ServletContextEvent
servletContextEvent
)
{
public
void
contextInitialized
(
ServletContextEvent
servletContextEvent
)
{
try
{
try
{
ThisApplication
.
context
=
Context
.
concrete
(
servletContextEvent
);
ThisApplication
.
setContext
(
Context
.
concrete
(
servletContextEvent
,
true
,
Business
.
getDynamicEntityClassLoader
()));
ThisApplication
.
init
();
ThisApplication
.
init
();
ThisApplication
.
context
().
regist
();
ThisApplication
.
context
().
regist
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/ThisApplication.java
浏览文件 @
dc8507c7
...
@@ -42,6 +42,10 @@ public class ThisApplication {
...
@@ -42,6 +42,10 @@ public class ThisApplication {
return
context
;
return
context
;
}
}
protected
static
void
setContext
(
Context
context
)
{
ThisApplication
.
context
=
context
;
}
public
static
void
init
()
{
public
static
void
init
()
{
try
{
try
{
initThreadPool
();
initThreadPool
();
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionListTableStatusBuild.java
已删除
100644 → 0
浏览文件 @
54a4f361
package
com.x.query.service.processing.jaxrs.table
;
import
java.util.ArrayList
;
import
java.util.List
;
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.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.query.core.entity.schema.Table
;
class
ActionListTableStatusBuild
extends
BaseAction
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
ActionListTableStatusBuild
.
class
);
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
LOGGER
.
debug
(
"execute:{}."
,
effectivePerson:
:
getDistinguishedName
);
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
List
<
Table
>
list
=
new
ArrayList
<>();
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
list
.
addAll
(
emc
.
listEqual
(
Table
.
class
,
Table
.
status_FIELDNAME
,
Table
.
STATUS_build
));
}
List
<
Wo
>
wos
=
Wo
.
copier
.
copy
(
list
);
result
.
setData
(
wos
);
return
result
;
}
public
static
class
Wo
extends
Table
{
private
static
final
long
serialVersionUID
=
-
7917195300999020294L
;
static
WrapCopier
<
Table
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
Table
.
class
,
Wo
.
class
,
ListTools
.
toList
(
Table
.
id_FIELDNAME
,
Table
.
description_FIELDNAME
,
Table
.
name_FIELDNAME
),
JpaObject
.
FieldsInvisible
);
}
}
\ No newline at end of file
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/ActionUpdate.java
浏览文件 @
dc8507c7
...
@@ -41,6 +41,10 @@ class ActionUpdate extends BaseAction {
...
@@ -41,6 +41,10 @@ class ActionUpdate extends BaseAction {
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
String
bundle
,
JsonElement
jsonElement
)
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
flag
,
String
bundle
,
JsonElement
jsonElement
)
throws
Exception
{
throws
Exception
{
LOGGER
.
debug
(
"execute:{}, flag:{}, bundle:{}."
,
effectivePerson:
:
getDistinguishedName
,
()
->
flag
,
()
->
bundle
);
ClassLoader
classLoader
=
Business
.
getDynamicEntityClassLoader
();
ClassLoader
classLoader
=
Business
.
getDynamicEntityClassLoader
();
Thread
.
currentThread
().
setContextClassLoader
(
classLoader
);
Thread
.
currentThread
().
setContextClassLoader
(
classLoader
);
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
...
@@ -71,6 +75,7 @@ class ActionUpdate extends BaseAction {
...
@@ -71,6 +75,7 @@ class ActionUpdate extends BaseAction {
}
}
emc
.
commit
();
emc
.
commit
();
Wo
wo
=
new
Wo
();
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
result
.
setData
(
wo
);
}
}
return
result
;
return
result
;
...
...
o2server/x_query_service_processing/src/main/java/com/x/query/service/processing/jaxrs/table/TableAction.java
浏览文件 @
dc8507c7
...
@@ -68,22 +68,4 @@ public class TableAction extends StandardJaxrsAction {
...
@@ -68,22 +68,4 @@ public class TableAction extends StandardJaxrsAction {
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
@JaxrsMethodDescribe
(
value
=
"获取可使用的自建表."
,
action
=
ActionListTableStatusBuild
.
class
)
@GET
@Path
(
"list/status/build"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listTableStatusBuild
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
List
<
ActionListTableStatusBuild
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListTableStatusBuild
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录