Commit 05bb962f by 吕明尚

增加定时任务注解

parent d091fad4
package share.quartz.task;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import share.system.service.ISCleanRecordsService;
......@@ -17,7 +16,6 @@ public class CleanRecordsTask {
@Autowired
private ISCleanRecordsService cleanRecordsService;
@XxlJob("finishCleanRecords")
public void finishCleanRecords() {
cleanRecordsService.finishCleanRecords();
}
......
......@@ -4,6 +4,7 @@ import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -39,6 +40,7 @@ public class CouponRetryTask {
private TiktokService tiktokService;
private static final Logger logger = LoggerFactory.getLogger(QPServiceImpl.class);
@XxlJob("AuToRetryCoupon")
public void AuToRetryCoupon() {
LambdaQueryWrapper<SConsumerCoupon> consumerCouponWrapper = new LambdaQueryWrapper<>();
consumerCouponWrapper.eq(SConsumerCoupon::getUseStatus, UserStatusEnum.UNUSED.getCode());
......@@ -57,6 +59,7 @@ public class CouponRetryTask {
}
// 自动生成优惠卷购买金额
@XxlJob("AutoGenerateCoupon")
public void AutoGenerateCoupon() {
LambdaQueryWrapper<SConsumerCoupon> consumerCouponWrapper = new LambdaQueryWrapper<>();
List<SStore> list = storeService.list();
......@@ -148,7 +151,7 @@ public class CouponRetryTask {
}
}
@XxlJob("AutoUpdateCouponPromotionPrice")
public void AutoUpdateCouponPromotionPrice() {
try {
LambdaQueryWrapper<SCoupon> sCouponLambdaQueryWrapper = Wrappers.lambdaQuery(SCoupon.class);
......@@ -209,6 +212,7 @@ public class CouponRetryTask {
//补齐美团团购id
@XxlJob("AutoGenerateTuangouId")
public void AutoGenerateTuangouId() {
LambdaQueryWrapper<SConsumerCoupon> consumerCouponWrapper = new LambdaQueryWrapper<>();
consumerCouponWrapper.eq(SConsumerCoupon::getIsDelete, YesNoEnum.no.getIndex());
......
package share.quartz.task;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import share.system.domain.Device;
import share.system.domain.DeviceGateway;
import share.system.service.DeviceGatewayService;
import share.system.service.DeviceService;
......@@ -37,6 +37,7 @@ public class DeviceTask {
/**
* 设备网关状态监控
*/
@XxlJob("deviceGatewayStatusMonitor")
public void deviceGatewayStatusMonitor() {
// 更新网关状态
List<DeviceGateway> list = deviceGatewayService.deviceGatewayStatusMonitor();
......@@ -52,6 +53,7 @@ public class DeviceTask {
* 定期修改门锁设备的开锁密码
* @param validTime 有效时长
*/
@XxlJob("updateDeviceDoorLockPassword")
public void updateDeviceDoorLockPassword(Integer validTime) {
if (validTime == null) {
validTime = 15;
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -84,7 +85,7 @@ public class OrderTask {
//14分钟的常量
final long FOURTEEN_MINUTES = 60 * 14;
@XxlJob("autoCancel")
public void autoCancel() {
String redisKey = Constants.ORDER_AUTO_CANCEL_KEY;
Long size = redisUtil.getListSize(redisKey);
......@@ -158,6 +159,7 @@ public class OrderTask {
* @author Mr.Zhang
* @since 2020-07-09
*/
@XxlJob("refundApply")
public void refundApply() {
String redisKey = Constants.ORDER_TASK_REDIS_KEY_AFTER_REFUND_BY_USER;
Long size = redisUtil.getListSize(redisKey);
......@@ -230,6 +232,7 @@ public class OrderTask {
}
//预约订单到期自动更新订单状态,更新房间状态
@XxlJob("autoToStore")
public void autoToStore() {
//查询所有已支付的订单
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.ORDER_NO.getValue() + "*");
......@@ -322,6 +325,7 @@ public class OrderTask {
* 订单状态因未知原因导致时间结束未完成的,修改订单状态
* 房间状态因未知原因导致未有使用中订单而占用的,修改房间状态
*/
@XxlJob("orderCompensate")
public void orderCompensate() {
// 订单状态处理
LambdaQueryWrapper<SOrder> queryWrapper = new LambdaQueryWrapper();
......
......@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dianping.openapi.sdk.api.oauth.entity.CustomerRefreshTokenResponse;
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.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -124,6 +125,7 @@ public class RedisTask {
/**
* 自动删除所有可用但已退款的优惠券
*/
@XxlJob("AutoDelRefundedCoupon")
public void AutoDelRefundedCoupon() {
//获取所有待使用的优惠卷
LambdaQueryWrapper<SConsumerCoupon> wrapper = Wrappers.lambdaQuery();
......@@ -217,7 +219,7 @@ public class RedisTask {
});
}
@XxlJob("AutomaticMtSessionKey")
public void AutomaticMtSessionKey() {
Boolean b = redisTemplate.hasKey(ReceiptRdeisEnum.MT_SESSION_KEY.getValue());
if (!b) {
......@@ -238,6 +240,7 @@ public class RedisTask {
}
//自动添加保洁记录
@XxlJob("AutoAddSCleanRecords")
public void AutoAddSCleanRecords() {
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + "*");
if (keys.size() == 0) {
......@@ -351,6 +354,7 @@ public class RedisTask {
}
@XxlJob("autoRoomExpireTime")
public void autoRoomExpireTime() {
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.ROOM_EXPIRE_TIME.getValue() + "*");
if (keys.size() == 0) {
......@@ -408,6 +412,7 @@ public class RedisTask {
* 设备消息发送队列失败中断监控
* 删除中断消息,继续发送设备消息
*/
@XxlJob("monitorDeviceQueue")
public void monitorDeviceQueue() {
Set<String> keys = redisTemplate.keys(MqttConstants.MQTT_STORE_LAST_TIME_KEY + "*");
if (keys.size() == 0) {
......@@ -451,6 +456,7 @@ public class RedisTask {
});
}
@XxlJob("AutoOrderCancelPay")
public void AutoOrderCancelPay() {
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.ORDER_CANCEL_PAY + "*");
if (keys.size() == 0) {
......@@ -479,6 +485,7 @@ public class RedisTask {
/**
* 自动发送权益会员过期短信
*/
@XxlJob("AutoEquityMembersSms")
public void AutoEquityMembersSms() {
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + "*");
if (keys.size() == 0) {
......@@ -501,6 +508,7 @@ public class RedisTask {
}
//权益会员降级
@XxlJob("AutoUpdateEquityMembers")
public void AutoUpdateEquityMembers() {
Set<String> keys = redisTemplate.keys(ReceiptRdeisEnum.EQUITY_MEMBERS_TIME + "*");
if (keys.size() == 0) {
......@@ -536,6 +544,7 @@ public class RedisTask {
/**
* 会员等级滚动降级
*/
@XxlJob("AutoProgressLog")
public void AutoProgressLog() {
//查询1年之前的数据
List<MemberProgressLog> list = memberProgressLogService.list(new LambdaQueryWrapper<MemberProgressLog>()
......@@ -644,6 +653,7 @@ public class RedisTask {
}
//自动更新用户unionid
@XxlJob("AutoUpdateOpenid")
public void AutoUpdateOpenid() {
List<SConsumerToken> sConsumerTokenList = sConsumerTokenService.list(new LambdaQueryWrapper<SConsumerToken>().isNotNull(SConsumerToken::getUnionId).isNull(SConsumerToken::getOpenId));
if (CollectionUtils.isEmpty(sConsumerTokenList)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment