Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
f21654e2
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,发现更多精彩内容 >>
提交
f21654e2
编写于
12月 18, 2020
作者:
O
o2null
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/#436' into 'wrdp'
Feature/#436 See merge request o2oa/o2oa!2546
上级
02eb3f39
d826ed63
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
61 addition
and
7 deletion
+61
-7
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_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/ThisApplication.java
...java/com/x/calendar/assemble/control/ThisApplication.java
+1
-1
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
浏览文件 @
f21654e2
...
@@ -6,13 +6,13 @@ import org.quartz.JobListener;
...
@@ -6,13 +6,13 @@ import org.quartz.JobListener;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.connection.CipherConnectionAction
;
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.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.logger.LoggerFactory
;
public
class
JobReportListener
implements
JobListener
{
public
class
JobReportListener
implements
JobListener
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
JobReportListener
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
JobReportListener
.
class
);
@Override
@Override
public
String
getName
()
{
public
String
getName
()
{
return
this
.
getClass
().
getName
();
return
this
.
getClass
().
getName
();
...
@@ -25,7 +25,12 @@ public class JobReportListener implements JobListener {
...
@@ -25,7 +25,12 @@ public class JobReportListener implements JobListener {
@Override
@Override
public
void
jobToBeExecuted
(
JobExecutionContext
jobExecutionContext
)
{
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
@Override
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/schedule/ScheduleLogRequest.java
浏览文件 @
f21654e2
package
com.x.base.core.project.schedule
;
package
com.x.base.core.project.schedule
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Objects
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.quartz.JobDetail
;
import
org.quartz.JobDetail
;
...
@@ -8,9 +9,17 @@ import org.quartz.JobExecutionContext;
...
@@ -8,9 +9,17 @@ import org.quartz.JobExecutionContext;
import
org.quartz.JobExecutionException
;
import
org.quartz.JobExecutionException
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.tools.StringTools
;
public
class
ScheduleLogRequest
extends
GsonPropertyObject
{
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
type
;
private
String
node
;
private
String
node
;
...
@@ -27,8 +36,20 @@ public class ScheduleLogRequest extends GsonPropertyObject {
...
@@ -27,8 +36,20 @@ public class ScheduleLogRequest extends GsonPropertyObject {
private
Boolean
success
;
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
)
{
public
ScheduleLogRequest
(
JobExecutionContext
jobExecutionContext
,
JobExecutionException
jobExecutionException
)
{
JobDetail
jobDetail
=
jobExecutionContext
.
getJobDetail
();
JobDetail
jobDetail
=
jobExecutionContext
.
getJobDetail
();
this
.
scheduleLogId
=
Objects
.
toString
(
jobExecutionContext
.
get
(
FIELDSCHEDULELOGID
));
this
.
className
=
jobDetail
.
getKey
().
getName
();
this
.
className
=
jobDetail
.
getKey
().
getName
();
this
.
application
=
jobDetail
.
getKey
().
getGroup
();
this
.
application
=
jobDetail
.
getKey
().
getGroup
();
this
.
node
=
jobDetail
.
getDescription
();
this
.
node
=
jobDetail
.
getDescription
();
...
@@ -107,4 +128,12 @@ public class ScheduleLogRequest extends GsonPropertyObject {
...
@@ -107,4 +128,12 @@ public class ScheduleLogRequest extends GsonPropertyObject {
this
.
success
=
success
;
this
.
success
=
success
;
}
}
public
String
getScheduleLogId
()
{
return
scheduleLogId
;
}
public
void
setScheduleLogId
(
String
scheduleLogId
)
{
this
.
scheduleLogId
=
scheduleLogId
;
}
}
}
\ No newline at end of file
o2server/x_calendar_assemble_control/src/main/java/com/x/calendar/assemble/control/ThisApplication.java
浏览文件 @
f21654e2
...
@@ -38,7 +38,7 @@ public class ThisApplication {
...
@@ -38,7 +38,7 @@ public class ThisApplication {
// 每30秒检查一次需要推送的消息
// 每30秒检查一次需要推送的消息
context
.
schedule
(
AlarmTrigger
.
class
,
"0/30 * * * * ?"
);
context
.
schedule
(
AlarmTrigger
.
class
,
"0/30 * * * * ?"
);
// 每两小时检查一次comment信息的引用情况,删除多余的不必要的数据
// 每两小时检查一次comment信息的引用情况,删除多余的不必要的数据
context
.
schedule
(
CheckEventComment
.
class
,
"
* *
*/2 * * ?"
);
context
.
schedule
(
CheckEventComment
.
class
,
"
4 4
*/2 * * ?"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
o2server/x_program_center/src/main/java/com/x/program/center/LogQueue.java
浏览文件 @
f21654e2
...
@@ -57,9 +57,16 @@ public class LogQueue extends AbstractQueue<NameValuePair> {
...
@@ -57,9 +57,16 @@ public class LogQueue extends AbstractQueue<NameValuePair> {
private
<
T
extends
JpaObject
>
void
concrete
(
Class
<
T
>
cls
,
T
o
)
throws
Exception
{
private
<
T
extends
JpaObject
>
void
concrete
(
Class
<
T
>
cls
,
T
o
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
emc
.
beginTransaction
(
cls
);
T
t
=
emc
.
find
(
o
.
getId
(),
cls
);
emc
.
persist
(
o
,
CheckPersistType
.
all
);
if
(
null
!=
t
)
{
emc
.
commit
();
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
浏览文件 @
f21654e2
...
@@ -21,8 +21,10 @@ class ActionReport extends BaseAction {
...
@@ -21,8 +21,10 @@ class ActionReport extends BaseAction {
Wi
wi
=
gson
.
fromJson
(
jsonElement
,
Wi
.
class
);
Wi
wi
=
gson
.
fromJson
(
jsonElement
,
Wi
.
class
);
ScheduleLog
o
=
Wi
.
copier
.
copy
(
wi
);
ScheduleLog
o
=
Wi
.
copier
.
copy
(
wi
);
/** 默认使用传递过来的id,如果不存在那么重新赋值 */
/** 默认使用传递过来的id,如果不存在那么重新赋值 */
if
(
StringUtils
.
isEmpty
(
o
.
get
Id
()))
{
if
(
StringUtils
.
isEmpty
(
wi
.
getScheduleLog
Id
()))
{
o
.
setId
(
StringTools
.
uniqueToken
());
o
.
setId
(
StringTools
.
uniqueToken
());
}
else
{
o
.
setId
(
wi
.
getScheduleLogId
());
}
}
NameValuePair
pair
=
new
NameValuePair
();
NameValuePair
pair
=
new
NameValuePair
();
pair
.
setName
(
ScheduleLog
.
class
.
getName
());
pair
.
setName
(
ScheduleLog
.
class
.
getName
());
...
@@ -39,6 +41,17 @@ class ActionReport extends BaseAction {
...
@@ -39,6 +41,17 @@ class ActionReport extends BaseAction {
private
static
final
long
serialVersionUID
=
1996856138701159925L
;
private
static
final
long
serialVersionUID
=
1996856138701159925L
;
static
WrapCopier
<
Wi
,
ScheduleLog
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
ScheduleLog
.
class
,
null
,
static
WrapCopier
<
Wi
,
ScheduleLog
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
ScheduleLog
.
class
,
null
,
JpaObject
.
FieldsUnmodify
);
JpaObject
.
FieldsUnmodify
);
private
String
scheduleLogId
;
public
String
getScheduleLogId
()
{
return
scheduleLogId
;
}
public
void
setScheduleLogId
(
String
scheduleLogId
)
{
this
.
scheduleLogId
=
scheduleLogId
;
}
}
}
public
static
class
Wo
extends
WrapBoolean
{
public
static
class
Wo
extends
WrapBoolean
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录