Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
f373fddb
Commit
f373fddb
authored
Jul 06, 2023
by
王亮
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-xxl-20230630' into 'master'
Feature xxl 20230630 See merge request
!122
parents
a92e9c3f
e23b20b0
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
84 deletions
+23
-84
pom.xml
pom.xml
+2
-2
XxlJobSpringExecutor.java
...in/java/cn/quantgroup/xyqb/util/XxlJobSpringExecutor.java
+0
-55
DeregisterTimeJobHandler.java
...a/cn/quantgroup/xyqb/xxlJob/DeregisterTimeJobHandler.java
+6
-8
GeetestLogTimeJobHandler.java
...a/cn/quantgroup/xyqb/xxlJob/GeetestLogTimeJobHandler.java
+6
-8
WechatFollowStatusJobHandler.java
.../quantgroup/xyqb/xxlJob/WechatFollowStatusJobHandler.java
+6
-8
XxlJobConfig.java
src/main/java/cn/quantgroup/xyqb/xxlJob/XxlJobConfig.java
+3
-3
No files found.
pom.xml
View file @
f373fddb
...
...
@@ -310,7 +310,7 @@
<dependency>
<groupId>
com.xuxueli
</groupId>
<artifactId>
xxl-job-core
</artifactId>
<version>
2.
1
.0
</version>
<version>
2.
4
.0
</version>
<exclusions>
<exclusion>
<groupId>
org.codehaus.groovy
</groupId>
...
...
@@ -326,7 +326,7 @@
<dependency>
<groupId>
io.netty
</groupId>
<artifactId>
netty-all
</artifactId>
<version>
4.1.
77
.Final
</version>
<version>
4.1.
90
.Final
</version>
</dependency>
<dependency>
<groupId>
cn.quantgroup
</groupId>
...
...
src/main/java/cn/quantgroup/xyqb/util/XxlJobSpringExecutor.java
deleted
100644 → 0
View file @
a92e9c3f
package
cn
.
quantgroup
.
xyqb
.
util
;
import
com.xxl.job.core.executor.XxlJobExecutor
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
java.util.Iterator
;
import
java.util.Map
;
public
class
XxlJobSpringExecutor
extends
XxlJobExecutor
implements
ApplicationContextAware
{
private
static
ApplicationContext
applicationContext
;
public
void
start
()
throws
Exception
{
this
.
initJobHandlerRepository
(
applicationContext
);
super
.
start
();
}
private
void
initJobHandlerRepository
(
ApplicationContext
applicationContext
)
{
if
(
applicationContext
!=
null
)
{
Map
<
String
,
Object
>
serviceBeanMap
=
applicationContext
.
getBeansWithAnnotation
(
JobHandler
.
class
);
if
(
serviceBeanMap
!=
null
&&
serviceBeanMap
.
size
()
>
0
)
{
Iterator
var3
=
serviceBeanMap
.
values
().
iterator
();
while
(
var3
.
hasNext
())
{
Object
serviceBean
=
var3
.
next
();
if
(
serviceBean
instanceof
IJobHandler
)
{
String
name
=
((
JobHandler
)
serviceBean
.
getClass
().
getAnnotation
(
JobHandler
.
class
))
.
value
();
IJobHandler
handler
=
(
IJobHandler
)
serviceBean
;
if
(
loadJobHandler
(
name
)
!=
null
)
{
throw
new
RuntimeException
(
"xxl-job jobhandler naming conflicts."
);
}
registJobHandler
(
name
,
handler
);
}
}
}
}
}
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
XxlJobSpringExecutor
.
applicationContext
=
applicationContext
;
}
public
static
ApplicationContext
getApplicationContext
()
{
return
applicationContext
;
}
}
src/main/java/cn/quantgroup/xyqb/xxlJob/DeregisterTimeJobHandler.java
View file @
f373fddb
package
cn
.
quantgroup
.
xyqb
.
xxlJob
;
import
cn.quantgroup.xyqb.service.register.IUserDeregisterService
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -11,14 +10,13 @@ import org.springframework.stereotype.Component;
* 删除注销时间大于90的注销记录
*/
@Component
@JobHandler
(
value
=
"DeregisterTimeJobHandler"
)
public
class
DeregisterTimeJobHandler
extends
IJobHandler
{
public
class
DeregisterTimeJobHandler
{
@Autowired
private
IUserDeregisterService
userDeregisterService
;
@
Override
public
ReturnT
<
String
>
execute
(
String
s
)
throws
Exception
{
@
XxlJob
(
value
=
"DeregisterTimeJobHandler"
)
public
void
execute
(
)
throws
Exception
{
userDeregisterService
.
executeTask
();
return
SUCCESS
;
XxlJobHelper
.
handleSuccess
()
;
}
}
src/main/java/cn/quantgroup/xyqb/xxlJob/GeetestLogTimeJobHandler.java
View file @
f373fddb
package
cn
.
quantgroup
.
xyqb
.
xxlJob
;
import
cn.quantgroup.xyqb.service.captcha.IGeetestLogService
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
...
...
@@ -11,14 +10,13 @@ import org.springframework.stereotype.Component;
* 删除极验验证时间大于180天的记录
*/
@Component
@JobHandler
(
value
=
"GeetestLogTimeJobHandler"
)
public
class
GeetestLogTimeJobHandler
extends
IJobHandler
{
public
class
GeetestLogTimeJobHandler
{
@Autowired
private
IGeetestLogService
geetestLogService
;
@
Override
public
ReturnT
<
String
>
execute
(
String
s
)
throws
Exception
{
@
XxlJob
(
value
=
"GeetestLogTimeJobHandler"
)
public
void
execute
(
)
throws
Exception
{
geetestLogService
.
executeTask
();
return
SUCCESS
;
XxlJobHelper
.
handleSuccess
()
;
}
}
src/main/java/cn/quantgroup/xyqb/xxlJob/WechatFollowStatusJobHandler.java
View file @
f373fddb
package
cn
.
quantgroup
.
xyqb
.
xxlJob
;
import
cn.quantgroup.xyqb.service.wechat.IWechatFollowService
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
@JobHandler
(
value
=
"WechatFollowStatusJobHandler"
)
public
class
WechatFollowStatusJobHandler
extends
IJobHandler
{
public
class
WechatFollowStatusJobHandler
{
@Autowired
private
IWechatFollowService
wechatFollowService
;
@
Override
public
ReturnT
<
String
>
execute
(
String
s
)
throws
Exception
{
@
XxlJob
(
value
=
"WechatFollowStatusJobHandler"
)
public
void
execute
(
)
throws
Exception
{
wechatFollowService
.
executeTask
();
return
SUCCESS
;
XxlJobHelper
.
handleSuccess
()
;
}
}
src/main/java/cn/quantgroup/xyqb/xxlJob/XxlJobConfig.java
View file @
f373fddb
package
cn
.
quantgroup
.
xyqb
.
xxlJob
;
import
c
n.quantgroup.xyqb.uti
l.XxlJobSpringExecutor
;
import
c
om.xxl.job.core.executor.imp
l.XxlJobSpringExecutor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -31,7 +31,7 @@ public class XxlJobConfig {
private
int
logRetentionDays
;
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"destroy"
)
@Bean
public
XxlJobSpringExecutor
xxlJobSpringExecutor
()
{
log
.
info
(
">>>>>>>>>>> xxl-job config init."
);
XxlJobSpringExecutor
xxlJobSpringExecutor
=
new
XxlJobSpringExecutor
();
...
...
@@ -41,7 +41,7 @@ public class XxlJobConfig {
// 执行器AppName [选填]:执行器心跳注册分组依据;为空则关闭自动注册
xxlJobSpringExecutor
.
setApp
N
ame
(
appName
);
xxlJobSpringExecutor
.
setApp
n
ame
(
appName
);
//xxlJobSpringExecutor.setAppName("xxl-job-executor-vcc-analysis");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment