Browse Source

feature:添加定时任务

feature-1.1
Penny 3 years ago
parent
commit
6cb1455447
  1. 34
      bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/utils/DateUtils.java
  2. 5
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/ImgMqMessageRecordService.java
  3. 5
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/UserVipRecordService.java
  4. 35
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/ImgMqMessageRecordServiceImpl.java
  5. 32
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/UserVipServiceRecordImpl.java
  6. 30
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/CheckVipDateTask.java
  7. 30
      bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/ImgMessageCompensationTask.java
  8. 10
      bnyer-services/bnyer-order/pom.xml
  9. 5
      bnyer-services/bnyer-order/src/main/java/com/bnyer/order/service/OrderMqMessageRecordService.java
  10. 34
      bnyer-services/bnyer-order/src/main/java/com/bnyer/order/service/impl/OrderMqMessageRecordServiceImpl.java
  11. 29
      bnyer-services/bnyer-order/src/main/java/com/bnyer/order/task/OrderMessageCompensationTask.java
  12. 10
      bnyer-services/bnyer-pay/pom.xml
  13. 5
      bnyer-services/bnyer-pay/src/main/java/com/bnyer/pay/service/PayMqMessageRecordService.java
  14. 34
      bnyer-services/bnyer-pay/src/main/java/com/bnyer/pay/service/impl/PayMqMessageRecordServiceImpl.java
  15. 29
      bnyer-services/bnyer-pay/src/main/java/com/bnyer/pay/task/PayMessageCompensationTask.java

34
bnyer-common/bnyer-common-core/src/main/java/com/bnyer/common/core/utils/DateUtils.java

@ -1,6 +1,7 @@
package com.bnyer.common.core.utils; package com.bnyer.common.core.utils;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.text.DateFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.*; import java.time.*;
@ -311,10 +312,37 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
return currentDateTime.isAfter(startDateTime) && currentDateTime.isBefore(endDateTime); return currentDateTime.isAfter(startDateTime) && currentDateTime.isBefore(endDateTime);
} }
/**
* 判断指定时间是否在30分钟内
* @param date 指定时间
* @return -
*/
public static boolean isLessThan30Min(Date date){
// 将当前时间转换为时间戳
long timestamp = date.getTime();
// 计算当前时间和目标时间的时间差
long diff = System.currentTimeMillis() - timestamp;
// 将毫秒转换为分钟
long minutes = diff / 1000 / 60;
if (minutes < 30) {
return true;
} else {
return false;
}
}
public static void main(String[] args) { public static void main(String[] args) {
DateTime dateTime1 = DateUtil.parseDateTime("2023-05-18 00:00:00"); // DateTime dateTime1 = DateUtil.parseDateTime("2023-05-18 00:00:00");
DateTime dateTime2 = DateUtil.parseDateTime("2023-05-19 00:00:01"); // DateTime dateTime2 = DateUtil.parseDateTime("2023-05-19 00:00:01");
System.out.println(isRang(dateTime1, dateTime2)); // System.out.println(isRang(dateTime1, dateTime2));
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date today = df.parse("2023-05-22 21:05:44");
System.out.println(isLessThan30Min(today));
} catch (ParseException e) {
e.printStackTrace();
}
} }
} }

5
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/ImgMqMessageRecordService.java

@ -57,4 +57,9 @@ public interface ImgMqMessageRecordService {
*/ */
void editMessageRecordStatus(Long id, EnumMessageStatus status,String errMsg); void editMessageRecordStatus(Long id, EnumMessageStatus status,String errMsg);
/**
* 消息补偿
*/
void imgMessageCompensation();
} }

5
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/UserVipRecordService.java

@ -29,4 +29,9 @@ public interface UserVipRecordService {
* @return * @return
*/ */
UserVipRecordVo queryUserVipRecord(UserVipRecordQuery query); UserVipRecordVo queryUserVipRecord(UserVipRecordQuery query);
/**
* 检查会员是否过期
*/
void checkVipDateTask();
} }

35
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/ImgMqMessageRecordServiceImpl.java

@ -1,10 +1,15 @@
package com.bnyer.img.service.impl; package com.bnyer.img.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bnyer.common.core.domain.ImgMqMessageRecord; import com.bnyer.common.core.domain.ImgMqMessageRecord;
import com.bnyer.common.core.enums.EnumMessageStatus; import com.bnyer.common.core.enums.EnumMessageStatus;
import com.bnyer.common.core.utils.DateUtils;
import com.bnyer.common.rocketmq.constant.RocketMqConstant; import com.bnyer.common.rocketmq.constant.RocketMqConstant;
import com.bnyer.common.rocketmq.constant.RocketMqTopic; import com.bnyer.common.rocketmq.constant.RocketMqTopic;
import com.bnyer.common.rocketmq.domain.MqRecordMessage; import com.bnyer.common.rocketmq.domain.MqRecordMessage;
@ -26,6 +31,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
@ -192,4 +198,33 @@ public class ImgMqMessageRecordServiceImpl implements ImgMqMessageRecordService
imgMqMessageRecordMapper.updateStatusByStatus(id,status,errMsg); imgMqMessageRecordMapper.updateStatusByStatus(id,status,errMsg);
} }
@Override
public void imgMessageCompensation() {
log.info("==============img服务消费补偿任务开始!===============");
long startTime = System.currentTimeMillis();
//获取全表状态为process处理中的数据
LambdaQueryWrapper<ImgMqMessageRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ImgMqMessageRecord::getStatus, EnumMessageStatus.PROCESS);
List<ImgMqMessageRecord> imgMqMessageRecords = imgMqMessageRecordMapper.selectList(wrapper);
Date now = new Date();
System.out.println(now);
if(CollectionUtil.isNotEmpty(imgMqMessageRecords)){
for (ImgMqMessageRecord imgMqMessageRecord : imgMqMessageRecords) {
//判断消息是否超过30分钟,超过则改状态为INVALID废弃,否则调用发送消息方法
if(DateUtils.isLessThan30Min(imgMqMessageRecord.getCreateTime())){
String content = imgMqMessageRecord.getContent();
JSONObject jsonObject = JSON.parseObject(content);
String msg = jsonObject.getString("content");
//少于30分钟,发送消息
sendAsyncMsg(imgMqMessageRecord.getTopic(),null,msg);
}else{
//超过30分钟,修改状态为废弃
imgMqMessageRecord.setStatus(EnumMessageStatus.INVALID);
imgMqMessageRecordMapper.updateById(imgMqMessageRecord);
}
}
}
log.info("==============img服务消费补偿任务完成,耗时【{}】毫秒!===============",System.currentTimeMillis() - startTime);
}
} }

32
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/service/impl/UserVipServiceRecordImpl.java

@ -1,6 +1,8 @@
package com.bnyer.img.service.impl; package com.bnyer.img.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.bnyer.common.core.domain.UserVipRecord; import com.bnyer.common.core.domain.UserVipRecord;
import com.bnyer.common.core.dto.AddUserVipRecordDto; import com.bnyer.common.core.dto.AddUserVipRecordDto;
import com.bnyer.common.core.dto.PayUserVipDto; import com.bnyer.common.core.dto.PayUserVipDto;
@ -17,8 +19,11 @@ import com.bnyer.img.vo.UserVipRecordVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Objects; import java.util.Objects;
@Service @Service
@ -143,4 +148,31 @@ public class UserVipServiceRecordImpl implements UserVipRecordService {
} }
return userVipRecordVo; return userVipRecordVo;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void checkVipDateTask() {
log.info("==============检查会员过期任务开始!===============");
long startTime = System.currentTimeMillis();
//获取当前时间
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// String date = df.format(new Date());
Date now = new Date();
System.out.println(now);
//获取会员记录表未过期数据
LambdaQueryWrapper<UserVipRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(UserVipRecord::getIsShow, "1");
wrapper.eq(UserVipRecord::getStatus,"1");
List<UserVipRecord> userVipRecords = userVipRecordMapper.selectList(wrapper);
if(CollectionUtil.isNotEmpty(userVipRecords)){
for (UserVipRecord userVipRecord : userVipRecords) {
if(now.before(userVipRecord.getStartTime()) || now.after(userVipRecord.getEndTime())){
//修改为失效
userVipRecord.setStatus(0);
userVipRecordMapper.updateById(userVipRecord);
}
}
}
log.info("==============检查会员过期任务完成,耗时【{}】毫秒!===============",System.currentTimeMillis() - startTime);
}
} }

30
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/CheckVipDateTask.java

@ -0,0 +1,30 @@
package com.bnyer.img.task;
import com.bnyer.img.service.TiktokCollectionService;
import com.bnyer.img.service.UserVipRecordService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 检查会员是否过期任务
* @author chengkun
* @date 2023/5/22 18:13
*/
@Component
@Slf4j
public class CheckVipDateTask {
@Autowired
private UserVipRecordService userVipRecordService;
@XxlJob("checkVipDateTask")
public ReturnT<String> checkVipDateTask(String param) throws Exception {
userVipRecordService.checkVipDateTask();
XxlJobHelper.log("{} 我执行了检查会员过期任务", System.currentTimeMillis());
return ReturnT.SUCCESS;
}
}

30
bnyer-services/bnyer-img/src/main/java/com/bnyer/img/task/ImgMessageCompensationTask.java

@ -0,0 +1,30 @@
package com.bnyer.img.task;
import com.bnyer.img.service.ImgMqMessageRecordService;
import com.bnyer.img.service.UserVipRecordService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* img服务消息补偿任务
* @author chengkun
* @date 2023/5/22 18:13
*/
@Component
@Slf4j
public class ImgMessageCompensationTask {
@Autowired
private ImgMqMessageRecordService imgMqMessageRecordService;
@XxlJob("imgMessageCompensationTask")
public ReturnT<String> imgMessageCompensation(String param) throws Exception {
imgMqMessageRecordService.imgMessageCompensation();
XxlJobHelper.log("{} 我执行了img服务消息补偿任务", System.currentTimeMillis());
return ReturnT.SUCCESS;
}
}

10
bnyer-services/bnyer-order/pom.xml

@ -90,11 +90,11 @@
<artifactId>bnyer-common-rocketmq</artifactId> <artifactId>bnyer-common-rocketmq</artifactId>
</dependency> </dependency>
<!--任务调度中心--> <!--任务调度中心-->
<!-- <dependency>--> <dependency>
<!-- <groupId>com.xuxueli</groupId>--> <groupId>com.xuxueli</groupId>
<!-- <artifactId>xxl-job-core</artifactId>--> <artifactId>xxl-job-core</artifactId>
<!-- <version>2.3.1</version>--> <version>2.3.1</version>
<!-- </dependency>--> </dependency>
<!--微信支付工具包--> <!--微信支付工具包-->
<!-- <dependency>--> <!-- <dependency>-->

5
bnyer-services/bnyer-order/src/main/java/com/bnyer/order/service/OrderMqMessageRecordService.java

@ -57,4 +57,9 @@ public interface OrderMqMessageRecordService {
*/ */
void editMessageRecordStatus(Long id, EnumMessageStatus status,String errMsg); void editMessageRecordStatus(Long id, EnumMessageStatus status,String errMsg);
/**
* 消息补偿
*/
void orderMessageCompensation();
} }

34
bnyer-services/bnyer-order/src/main/java/com/bnyer/order/service/impl/OrderMqMessageRecordServiceImpl.java

@ -1,10 +1,14 @@
package com.bnyer.order.service.impl; package com.bnyer.order.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bnyer.common.core.domain.ImgMqMessageRecord;
import com.bnyer.common.core.domain.OrderMqMessageRecord; import com.bnyer.common.core.domain.OrderMqMessageRecord;
import com.bnyer.common.core.enums.EnumMessageStatus; import com.bnyer.common.core.enums.EnumMessageStatus;
import com.bnyer.common.core.utils.DateUtils;
import com.bnyer.common.rocketmq.constant.RocketMqConstant; import com.bnyer.common.rocketmq.constant.RocketMqConstant;
import com.bnyer.common.rocketmq.constant.RocketMqTopic; import com.bnyer.common.rocketmq.constant.RocketMqTopic;
import com.bnyer.common.rocketmq.domain.MqRecordMessage; import com.bnyer.common.rocketmq.domain.MqRecordMessage;
@ -26,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author :WXC * @author :WXC
@ -191,4 +196,33 @@ public class OrderMqMessageRecordServiceImpl implements OrderMqMessageRecordServ
orderMqMessageRecordMapper.updateStatusByStatus(id,status,errMsg); orderMqMessageRecordMapper.updateStatusByStatus(id,status,errMsg);
} }
@Override
public void orderMessageCompensation() {
log.info("==============order服务消费补偿任务开始!===============");
long startTime = System.currentTimeMillis();
//获取全表状态为process处理中的数据
LambdaQueryWrapper<OrderMqMessageRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OrderMqMessageRecord::getStatus, EnumMessageStatus.PROCESS);
List<OrderMqMessageRecord> orderMqMessageRecords = orderMqMessageRecordMapper.selectList(wrapper);
Date now = new Date();
System.out.println(now);
if(CollectionUtil.isNotEmpty(orderMqMessageRecords)){
for (OrderMqMessageRecord orderMqMessageRecord : orderMqMessageRecords) {
//判断消息是否超过30分钟,超过则改状态为INVALID废弃,否则调用发送消息方法
if(DateUtils.isLessThan30Min(orderMqMessageRecord.getCreateTime())){
String content = orderMqMessageRecord.getContent();
JSONObject jsonObject = JSON.parseObject(content);
String msg = jsonObject.getString("content");
//少于30分钟,发送消息
sendAsyncMsg(orderMqMessageRecord.getTopic(),null,msg);
}else{
//超过30分钟,修改状态为废弃
orderMqMessageRecord.setStatus(EnumMessageStatus.INVALID);
orderMqMessageRecordMapper.updateById(orderMqMessageRecord);
}
}
}
log.info("==============order服务消费补偿任务完成,耗时【{}】毫秒!===============",System.currentTimeMillis() - startTime);
}
} }

29
bnyer-services/bnyer-order/src/main/java/com/bnyer/order/task/OrderMessageCompensationTask.java

@ -0,0 +1,29 @@
package com.bnyer.order.task;
import com.bnyer.order.service.OrderMqMessageRecordService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* order服务消息补偿任务
* @author chengkun
* @date 2023/5/22 18:13
*/
@Component
@Slf4j
public class OrderMessageCompensationTask {
@Autowired
private OrderMqMessageRecordService orderMqMessageRecordService;
@XxlJob("orderMessageCompensationTask")
public ReturnT<String> orderMessageCompensation(String param) throws Exception {
orderMqMessageRecordService.orderMessageCompensation();
XxlJobHelper.log("{} 我执行了order服务消息补偿任务", System.currentTimeMillis());
return ReturnT.SUCCESS;
}
}

10
bnyer-services/bnyer-pay/pom.xml

@ -114,11 +114,11 @@
</dependency> </dependency>
<!--任务调度中心--> <!--任务调度中心-->
<!-- <dependency>--> <dependency>
<!-- <groupId>com.xuxueli</groupId>--> <groupId>com.xuxueli</groupId>
<!-- <artifactId>xxl-job-core</artifactId>--> <artifactId>xxl-job-core</artifactId>
<!-- <version>2.3.1</version>--> <version>2.3.1</version>
<!-- </dependency>--> </dependency>
<!--微信支付工具包--> <!--微信支付工具包-->
<!-- <dependency>--> <!-- <dependency>-->

5
bnyer-services/bnyer-pay/src/main/java/com/bnyer/pay/service/PayMqMessageRecordService.java

@ -57,4 +57,9 @@ public interface PayMqMessageRecordService {
*/ */
void editMessageRecordStatus(Long id, EnumMessageStatus status,String errMsg); void editMessageRecordStatus(Long id, EnumMessageStatus status,String errMsg);
/**
* 消息补偿
*/
void payMessageCompensation();
} }

34
bnyer-services/bnyer-pay/src/main/java/com/bnyer/pay/service/impl/PayMqMessageRecordServiceImpl.java

@ -1,10 +1,14 @@
package com.bnyer.pay.service.impl; package com.bnyer.pay.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bnyer.common.core.domain.OrderMqMessageRecord;
import com.bnyer.common.core.domain.PayMqMessageRecord; import com.bnyer.common.core.domain.PayMqMessageRecord;
import com.bnyer.common.core.enums.EnumMessageStatus; import com.bnyer.common.core.enums.EnumMessageStatus;
import com.bnyer.common.core.utils.DateUtils;
import com.bnyer.common.rocketmq.constant.RocketMqConstant; import com.bnyer.common.rocketmq.constant.RocketMqConstant;
import com.bnyer.common.rocketmq.constant.RocketMqTopic; import com.bnyer.common.rocketmq.constant.RocketMqTopic;
import com.bnyer.common.rocketmq.domain.MqRecordMessage; import com.bnyer.common.rocketmq.domain.MqRecordMessage;
@ -26,6 +30,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @author :WXC * @author :WXC
@ -192,5 +197,34 @@ public class PayMqMessageRecordServiceImpl implements PayMqMessageRecordService
payMqMessageRecordMapper.updateStatusByStatus(id,status,errMsg); payMqMessageRecordMapper.updateStatusByStatus(id,status,errMsg);
} }
@Override
public void payMessageCompensation() {
log.info("==============pay服务消费补偿任务开始!===============");
long startTime = System.currentTimeMillis();
//获取全表状态为process处理中的数据
LambdaQueryWrapper<PayMqMessageRecord> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(PayMqMessageRecord::getStatus, EnumMessageStatus.PROCESS);
List<PayMqMessageRecord> payMqMessageRecords = payMqMessageRecordMapper.selectList(wrapper);
Date now = new Date();
System.out.println(now);
if(CollectionUtil.isNotEmpty(payMqMessageRecords)){
for (PayMqMessageRecord payMqMessageRecord : payMqMessageRecords) {
//判断消息是否超过30分钟,超过则改状态为INVALID废弃,否则调用发送消息方法
if(DateUtils.isLessThan30Min(payMqMessageRecord.getCreateTime())){
String content = payMqMessageRecord.getContent();
JSONObject jsonObject = JSON.parseObject(content);
String msg = jsonObject.getString("content");
//少于30分钟,发送消息
sendAsyncMsg(payMqMessageRecord.getTopic(),null,msg);
}else{
//超过30分钟,修改状态为废弃
payMqMessageRecord.setStatus(EnumMessageStatus.INVALID);
payMqMessageRecordMapper.updateById(payMqMessageRecord);
}
}
}
log.info("==============pay服务消费补偿任务完成,耗时【{}】毫秒!===============",System.currentTimeMillis() - startTime);
}
} }

29
bnyer-services/bnyer-pay/src/main/java/com/bnyer/pay/task/PayMessageCompensationTask.java

@ -0,0 +1,29 @@
package com.bnyer.pay.task;
import com.bnyer.pay.service.PayMqMessageRecordService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* pay服务消息补偿任务
* @author chengkun
* @date 2023/5/22 18:13
*/
@Component
@Slf4j
public class PayMessageCompensationTask {
@Autowired
private PayMqMessageRecordService payMqMessageRecordService;
@XxlJob("payMessageCompensationTask")
public ReturnT<String> payMessageCompensation(String param) throws Exception {
payMqMessageRecordService.payMessageCompensation();
XxlJobHelper.log("{} 我执行了pay服务消息补偿任务", System.currentTimeMillis());
return ReturnT.SUCCESS;
}
}
Loading…
Cancel
Save