Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
pseer
gxpt_ht
Commits
05bb962f
Commit
05bb962f
authored
Aug 13, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加定时任务注解
parent
d091fad4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
6 deletions
+24
-6
CleanRecordsTask.java
...rtz/src/main/java/share/quartz/task/CleanRecordsTask.java
+0
-2
CouponRetryTask.java
...artz/src/main/java/share/quartz/task/CouponRetryTask.java
+5
-1
DeviceTask.java
share-quartz/src/main/java/share/quartz/task/DeviceTask.java
+3
-1
OrderTask.java
share-quartz/src/main/java/share/quartz/task/OrderTask.java
+5
-1
RedisTask.java
share-quartz/src/main/java/share/quartz/task/RedisTask.java
+11
-1
No files found.
share-quartz/src/main/java/share/quartz/task/CleanRecordsTask.java
View file @
05bb962f
package
share
.
quartz
.
task
;
package
share
.
quartz
.
task
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
share.system.service.ISCleanRecordsService
;
import
share.system.service.ISCleanRecordsService
;
...
@@ -17,7 +16,6 @@ public class CleanRecordsTask {
...
@@ -17,7 +16,6 @@ public class CleanRecordsTask {
@Autowired
@Autowired
private
ISCleanRecordsService
cleanRecordsService
;
private
ISCleanRecordsService
cleanRecordsService
;
@XxlJob
(
"finishCleanRecords"
)
public
void
finishCleanRecords
()
{
public
void
finishCleanRecords
()
{
cleanRecordsService
.
finishCleanRecords
();
cleanRecordsService
.
finishCleanRecords
();
}
}
...
...
share-quartz/src/main/java/share/quartz/task/CouponRetryTask.java
View file @
05bb962f
...
@@ -4,6 +4,7 @@ import cn.hutool.json.JSONObject;
...
@@ -4,6 +4,7 @@ import cn.hutool.json.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.apache.commons.lang3.math.NumberUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -39,6 +40,7 @@ public class CouponRetryTask {
...
@@ -39,6 +40,7 @@ public class CouponRetryTask {
private
TiktokService
tiktokService
;
private
TiktokService
tiktokService
;
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QPServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QPServiceImpl
.
class
);
@XxlJob
(
"AuToRetryCoupon"
)
public
void
AuToRetryCoupon
()
{
public
void
AuToRetryCoupon
()
{
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getUseStatus
,
UserStatusEnum
.
UNUSED
.
getCode
());
...
@@ -57,6 +59,7 @@ public class CouponRetryTask {
...
@@ -57,6 +59,7 @@ public class CouponRetryTask {
}
}
// 自动生成优惠卷购买金额
// 自动生成优惠卷购买金额
@XxlJob
(
"AutoGenerateCoupon"
)
public
void
AutoGenerateCoupon
()
{
public
void
AutoGenerateCoupon
()
{
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
List
<
SStore
>
list
=
storeService
.
list
();
List
<
SStore
>
list
=
storeService
.
list
();
...
@@ -148,7 +151,7 @@ public class CouponRetryTask {
...
@@ -148,7 +151,7 @@ public class CouponRetryTask {
}
}
}
}
@XxlJob
(
"AutoUpdateCouponPromotionPrice"
)
public
void
AutoUpdateCouponPromotionPrice
()
{
public
void
AutoUpdateCouponPromotionPrice
()
{
try
{
try
{
LambdaQueryWrapper
<
SCoupon
>
sCouponLambdaQueryWrapper
=
Wrappers
.
lambdaQuery
(
SCoupon
.
class
);
LambdaQueryWrapper
<
SCoupon
>
sCouponLambdaQueryWrapper
=
Wrappers
.
lambdaQuery
(
SCoupon
.
class
);
...
@@ -209,6 +212,7 @@ public class CouponRetryTask {
...
@@ -209,6 +212,7 @@ public class CouponRetryTask {
//补齐美团团购id
//补齐美团团购id
@XxlJob
(
"AutoGenerateTuangouId"
)
public
void
AutoGenerateTuangouId
()
{
public
void
AutoGenerateTuangouId
()
{
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SConsumerCoupon
>
consumerCouponWrapper
=
new
LambdaQueryWrapper
<>();
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
consumerCouponWrapper
.
eq
(
SConsumerCoupon:
:
getIsDelete
,
YesNoEnum
.
no
.
getIndex
());
...
...
share-quartz/src/main/java/share/quartz/task/DeviceTask.java
View file @
05bb962f
package
share
.
quartz
.
task
;
package
share
.
quartz
.
task
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
share.system.domain.Device
;
import
share.system.domain.DeviceGateway
;
import
share.system.domain.DeviceGateway
;
import
share.system.service.DeviceGatewayService
;
import
share.system.service.DeviceGatewayService
;
import
share.system.service.DeviceService
;
import
share.system.service.DeviceService
;
...
@@ -37,6 +37,7 @@ public class DeviceTask {
...
@@ -37,6 +37,7 @@ public class DeviceTask {
/**
/**
* 设备网关状态监控
* 设备网关状态监控
*/
*/
@XxlJob
(
"deviceGatewayStatusMonitor"
)
public
void
deviceGatewayStatusMonitor
()
{
public
void
deviceGatewayStatusMonitor
()
{
// 更新网关状态
// 更新网关状态
List
<
DeviceGateway
>
list
=
deviceGatewayService
.
deviceGatewayStatusMonitor
();
List
<
DeviceGateway
>
list
=
deviceGatewayService
.
deviceGatewayStatusMonitor
();
...
@@ -52,6 +53,7 @@ public class DeviceTask {
...
@@ -52,6 +53,7 @@ public class DeviceTask {
* 定期修改门锁设备的开锁密码
* 定期修改门锁设备的开锁密码
* @param validTime 有效时长
* @param validTime 有效时长
*/
*/
@XxlJob
(
"updateDeviceDoorLockPassword"
)
public
void
updateDeviceDoorLockPassword
(
Integer
validTime
)
{
public
void
updateDeviceDoorLockPassword
(
Integer
validTime
)
{
if
(
validTime
==
null
)
{
if
(
validTime
==
null
)
{
validTime
=
15
;
validTime
=
15
;
...
...
share-quartz/src/main/java/share/quartz/task/OrderTask.java
View file @
05bb962f
...
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
...
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -84,7 +85,7 @@ public class OrderTask {
...
@@ -84,7 +85,7 @@ public class OrderTask {
//14分钟的常量
//14分钟的常量
final
long
FOURTEEN_MINUTES
=
60
*
14
;
final
long
FOURTEEN_MINUTES
=
60
*
14
;
@XxlJob
(
"autoCancel"
)
public
void
autoCancel
()
{
public
void
autoCancel
()
{
String
redisKey
=
Constants
.
ORDER_AUTO_CANCEL_KEY
;
String
redisKey
=
Constants
.
ORDER_AUTO_CANCEL_KEY
;
Long
size
=
redisUtil
.
getListSize
(
redisKey
);
Long
size
=
redisUtil
.
getListSize
(
redisKey
);
...
@@ -158,6 +159,7 @@ public class OrderTask {
...
@@ -158,6 +159,7 @@ public class OrderTask {
* @author Mr.Zhang
* @author Mr.Zhang
* @since 2020-07-09
* @since 2020-07-09
*/
*/
@XxlJob
(
"refundApply"
)
public
void
refundApply
()
{
public
void
refundApply
()
{
String
redisKey
=
Constants
.
ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER
;
String
redisKey
=
Constants
.
ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER
;
Long
size
=
redisUtil
.
getListSize
(
redisKey
);
Long
size
=
redisUtil
.
getListSize
(
redisKey
);
...
@@ -230,6 +232,7 @@ public class OrderTask {
...
@@ -230,6 +232,7 @@ public class OrderTask {
}
}
//预约订单到期自动更新订单状态,更新房间状态
//预约订单到期自动更新订单状态,更新房间状态
@XxlJob
(
"autoToStore"
)
public
void
autoToStore
()
{
public
void
autoToStore
()
{
//查询所有已支付的订单
//查询所有已支付的订单
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_NO
.
getValue
()
+
"*"
);
...
@@ -322,6 +325,7 @@ public class OrderTask {
...
@@ -322,6 +325,7 @@ public class OrderTask {
* 订单状态因未知原因导致时间结束未完成的,修改订单状态
* 订单状态因未知原因导致时间结束未完成的,修改订单状态
* 房间状态因未知原因导致未有使用中订单而占用的,修改房间状态
* 房间状态因未知原因导致未有使用中订单而占用的,修改房间状态
*/
*/
@XxlJob
(
"orderCompensate"
)
public
void
orderCompensate
()
{
public
void
orderCompensate
()
{
// 订单状态处理
// 订单状态处理
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
();
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
();
...
...
share-quartz/src/main/java/share/quartz/task/RedisTask.java
View file @
05bb962f
...
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
com.dianping.openapi.sdk.api.tuangou.entity.TuangouReceiptGetConsumedReponseEntity
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -124,6 +125,7 @@ public class RedisTask {
...
@@ -124,6 +125,7 @@ public class RedisTask {
/**
/**
* 自动删除所有可用但已退款的优惠券
* 自动删除所有可用但已退款的优惠券
*/
*/
@XxlJob
(
"AutoDelRefundedCoupon"
)
public
void
AutoDelRefundedCoupon
()
{
public
void
AutoDelRefundedCoupon
()
{
//获取所有待使用的优惠卷
//获取所有待使用的优惠卷
LambdaQueryWrapper
<
SConsumerCoupon
>
wrapper
=
Wrappers
.
lambdaQuery
();
LambdaQueryWrapper
<
SConsumerCoupon
>
wrapper
=
Wrappers
.
lambdaQuery
();
...
@@ -217,7 +219,7 @@ public class RedisTask {
...
@@ -217,7 +219,7 @@ public class RedisTask {
});
});
}
}
@XxlJob
(
"AutomaticMtSessionKey"
)
public
void
AutomaticMtSessionKey
()
{
public
void
AutomaticMtSessionKey
()
{
Boolean
b
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
MT_SESSION_KEY
.
getValue
());
Boolean
b
=
redisTemplate
.
hasKey
(
ReceiptRdeisEnum
.
MT_SESSION_KEY
.
getValue
());
if
(!
b
)
{
if
(!
b
)
{
...
@@ -238,6 +240,7 @@ public class RedisTask {
...
@@ -238,6 +240,7 @@ public class RedisTask {
}
}
//自动添加保洁记录
//自动添加保洁记录
@XxlJob
(
"AutoAddSCleanRecords"
)
public
void
AutoAddSCleanRecords
()
{
public
void
AutoAddSCleanRecords
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_NO_KEY
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
if
(
keys
.
size
()
==
0
)
{
...
@@ -351,6 +354,7 @@ public class RedisTask {
...
@@ -351,6 +354,7 @@ public class RedisTask {
}
}
@XxlJob
(
"autoRoomExpireTime"
)
public
void
autoRoomExpireTime
()
{
public
void
autoRoomExpireTime
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ROOM_EXPIRE_TIME
.
getValue
()
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ROOM_EXPIRE_TIME
.
getValue
()
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
if
(
keys
.
size
()
==
0
)
{
...
@@ -408,6 +412,7 @@ public class RedisTask {
...
@@ -408,6 +412,7 @@ public class RedisTask {
* 设备消息发送队列失败中断监控
* 设备消息发送队列失败中断监控
* 删除中断消息,继续发送设备消息
* 删除中断消息,继续发送设备消息
*/
*/
@XxlJob
(
"monitorDeviceQueue"
)
public
void
monitorDeviceQueue
()
{
public
void
monitorDeviceQueue
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
MqttConstants
.
MQTT_STORE_LAST_TIME_KEY
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
MqttConstants
.
MQTT_STORE_LAST_TIME_KEY
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
if
(
keys
.
size
()
==
0
)
{
...
@@ -451,6 +456,7 @@ public class RedisTask {
...
@@ -451,6 +456,7 @@ public class RedisTask {
});
});
}
}
@XxlJob
(
"AutoOrderCancelPay"
)
public
void
AutoOrderCancelPay
()
{
public
void
AutoOrderCancelPay
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_CANCEL_PAY
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
ORDER_CANCEL_PAY
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
if
(
keys
.
size
()
==
0
)
{
...
@@ -479,6 +485,7 @@ public class RedisTask {
...
@@ -479,6 +485,7 @@ public class RedisTask {
/**
/**
* 自动发送权益会员过期短信
* 自动发送权益会员过期短信
*/
*/
@XxlJob
(
"AutoEquityMembersSms"
)
public
void
AutoEquityMembersSms
()
{
public
void
AutoEquityMembersSms
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
if
(
keys
.
size
()
==
0
)
{
...
@@ -501,6 +508,7 @@ public class RedisTask {
...
@@ -501,6 +508,7 @@ public class RedisTask {
}
}
//权益会员降级
//权益会员降级
@XxlJob
(
"AutoUpdateEquityMembers"
)
public
void
AutoUpdateEquityMembers
()
{
public
void
AutoUpdateEquityMembers
()
{
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
"*"
);
Set
<
String
>
keys
=
redisTemplate
.
keys
(
ReceiptRdeisEnum
.
EQUITY_MEMBERS_TIME
+
"*"
);
if
(
keys
.
size
()
==
0
)
{
if
(
keys
.
size
()
==
0
)
{
...
@@ -536,6 +544,7 @@ public class RedisTask {
...
@@ -536,6 +544,7 @@ public class RedisTask {
/**
/**
* 会员等级滚动降级
* 会员等级滚动降级
*/
*/
@XxlJob
(
"AutoProgressLog"
)
public
void
AutoProgressLog
()
{
public
void
AutoProgressLog
()
{
//查询1年之前的数据
//查询1年之前的数据
List
<
MemberProgressLog
>
list
=
memberProgressLogService
.
list
(
new
LambdaQueryWrapper
<
MemberProgressLog
>()
List
<
MemberProgressLog
>
list
=
memberProgressLogService
.
list
(
new
LambdaQueryWrapper
<
MemberProgressLog
>()
...
@@ -644,6 +653,7 @@ public class RedisTask {
...
@@ -644,6 +653,7 @@ public class RedisTask {
}
}
//自动更新用户unionid
//自动更新用户unionid
@XxlJob
(
"AutoUpdateOpenid"
)
public
void
AutoUpdateOpenid
()
{
public
void
AutoUpdateOpenid
()
{
List
<
SConsumerToken
>
sConsumerTokenList
=
sConsumerTokenService
.
list
(
new
LambdaQueryWrapper
<
SConsumerToken
>().
isNotNull
(
SConsumerToken:
:
getUnionId
).
isNull
(
SConsumerToken:
:
getOpenId
));
List
<
SConsumerToken
>
sConsumerTokenList
=
sConsumerTokenService
.
list
(
new
LambdaQueryWrapper
<
SConsumerToken
>().
isNotNull
(
SConsumerToken:
:
getUnionId
).
isNull
(
SConsumerToken:
:
getOpenId
));
if
(
CollectionUtils
.
isEmpty
(
sConsumerTokenList
))
{
if
(
CollectionUtils
.
isEmpty
(
sConsumerTokenList
))
{
...
...
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