Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
d826ed63
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,发现更多精彩内容 >>
提交
d826ed63
编写于
12月 18, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改日志报告
上级
e73f18a2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
60 addition
and
6 deletion
+60
-6
o2server/x_base_core_project/src/main/java/com/x/base/core/project/schedule/JobReportListener.java
...a/com/x/base/core/project/schedule/JobReportListener.java
+7
-2
o2server/x_base_core_project/src/main/java/com/x/base/core/project/schedule/ScheduleLogRequest.java
.../com/x/base/core/project/schedule/ScheduleLogRequest.java
+29
-0
o2server/x_program_center/src/main/java/com/x/program/center/LogQueue.java
...m_center/src/main/java/com/x/program/center/LogQueue.java
+10
-3
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/schedule/ActionReport.java
...ava/com/x/program/center/jaxrs/schedule/ActionReport.java
+14
-1
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/schedule/JobReportListener.java
浏览文件 @
d826ed63
...
...
@@ -6,13 +6,13 @@ import org.quartz.JobListener;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
public
class
JobReportListener
implements
JobListener
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
JobReportListener
.
class
);
@Override
public
String
getName
()
{
return
this
.
getClass
().
getName
();
...
...
@@ -25,7 +25,12 @@ public class JobReportListener implements JobListener {
@Override
public
void
jobToBeExecuted
(
JobExecutionContext
jobExecutionContext
)
{
ScheduleLogRequest
request
=
new
ScheduleLogRequest
(
jobExecutionContext
);
try
{
CipherConnectionAction
.
post
(
false
,
Config
.
url_x_program_center_jaxrs
(
"schedule"
,
"report"
),
request
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
);
}
}
@Override
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/schedule/ScheduleLogRequest.java
浏览文件 @
d826ed63
package
com.x.base.core.project.schedule
;
import
java.util.Date
;
import
java.util.Objects
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.quartz.JobDetail
;
...
...
@@ -8,9 +9,17 @@ import org.quartz.JobExecutionContext;
import
org.quartz.JobExecutionException
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.tools.StringTools
;
public
class
ScheduleLogRequest
extends
GsonPropertyObject
{
private
static
final
long
serialVersionUID
=
-
1472780383077011677L
;
public
static
final
String
FIELDSCHEDULELOGID
=
"scheduleLogId"
;
// 新增id字段,用于保存ScheduleLog的时候覆盖自动生成的id
private
String
scheduleLogId
;
private
String
type
;
private
String
node
;
...
...
@@ -27,8 +36,20 @@ public class ScheduleLogRequest extends GsonPropertyObject {
private
Boolean
success
;
public
ScheduleLogRequest
(
JobExecutionContext
jobExecutionContext
)
{
JobDetail
jobDetail
=
jobExecutionContext
.
getJobDetail
();
this
.
scheduleLogId
=
StringTools
.
uniqueToken
();
jobExecutionContext
.
put
(
FIELDSCHEDULELOGID
,
scheduleLogId
);
this
.
className
=
jobDetail
.
getKey
().
getName
();
this
.
application
=
jobDetail
.
getKey
().
getGroup
();
this
.
node
=
jobDetail
.
getDescription
();
this
.
type
=
jobExecutionContext
.
getTrigger
().
getDescription
();
this
.
fireTime
=
jobExecutionContext
.
getFireTime
();
}
public
ScheduleLogRequest
(
JobExecutionContext
jobExecutionContext
,
JobExecutionException
jobExecutionException
)
{
JobDetail
jobDetail
=
jobExecutionContext
.
getJobDetail
();
this
.
scheduleLogId
=
Objects
.
toString
(
jobExecutionContext
.
get
(
FIELDSCHEDULELOGID
));
this
.
className
=
jobDetail
.
getKey
().
getName
();
this
.
application
=
jobDetail
.
getKey
().
getGroup
();
this
.
node
=
jobDetail
.
getDescription
();
...
...
@@ -107,4 +128,12 @@ public class ScheduleLogRequest extends GsonPropertyObject {
this
.
success
=
success
;
}
public
String
getScheduleLogId
()
{
return
scheduleLogId
;
}
public
void
setScheduleLogId
(
String
scheduleLogId
)
{
this
.
scheduleLogId
=
scheduleLogId
;
}
}
\ No newline at end of file
o2server/x_program_center/src/main/java/com/x/program/center/LogQueue.java
浏览文件 @
d826ed63
...
...
@@ -57,9 +57,16 @@ public class LogQueue extends AbstractQueue<NameValuePair> {
private
<
T
extends
JpaObject
>
void
concrete
(
Class
<
T
>
cls
,
T
o
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
emc
.
beginTransaction
(
cls
);
emc
.
persist
(
o
,
CheckPersistType
.
all
);
emc
.
commit
();
T
t
=
emc
.
find
(
o
.
getId
(),
cls
);
if
(
null
!=
t
)
{
o
.
copyTo
(
t
,
JpaObject
.
FieldsUnmodify
);
emc
.
beginTransaction
(
cls
);
emc
.
commit
();
}
else
{
emc
.
beginTransaction
(
cls
);
emc
.
persist
(
o
,
CheckPersistType
.
all
);
emc
.
commit
();
}
}
}
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/schedule/ActionReport.java
浏览文件 @
d826ed63
...
...
@@ -21,8 +21,10 @@ class ActionReport extends BaseAction {
Wi
wi
=
gson
.
fromJson
(
jsonElement
,
Wi
.
class
);
ScheduleLog
o
=
Wi
.
copier
.
copy
(
wi
);
/** 默认使用传递过来的id,如果不存在那么重新赋值 */
if
(
StringUtils
.
isEmpty
(
o
.
get
Id
()))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getScheduleLog
Id
()))
{
o
.
setId
(
StringTools
.
uniqueToken
());
}
else
{
o
.
setId
(
wi
.
getScheduleLogId
());
}
NameValuePair
pair
=
new
NameValuePair
();
pair
.
setName
(
ScheduleLog
.
class
.
getName
());
...
...
@@ -39,6 +41,17 @@ class ActionReport extends BaseAction {
private
static
final
long
serialVersionUID
=
1996856138701159925L
;
static
WrapCopier
<
Wi
,
ScheduleLog
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
ScheduleLog
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
private
String
scheduleLogId
;
public
String
getScheduleLogId
()
{
return
scheduleLogId
;
}
public
void
setScheduleLogId
(
String
scheduleLogId
)
{
this
.
scheduleLogId
=
scheduleLogId
;
}
}
public
static
class
Wo
extends
WrapBoolean
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录