xinelu-api/xinelu-quartz/src/main/java/com/xinelu/quartz/task/PaymentInfoTask.java
2023-10-16 17:00:31 +08:00

46 lines
1.4 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package com.xinelu.quartz.task;
import com.xinelu.quartz.service.PaymentInfoTaskService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @Description 支付定时任务类
* @Author 纪寒
* @Date 2022-10-21 14:34:36
* @Version 1.0
*/
@Slf4j
@Component("paymentTask")
public class PaymentInfoTask {
@Resource
private PaymentInfoTaskService paymentInfoTaskService;
/**
* 自动关闭商品订单2小时与预约订单2小时未支付的订单信息每15分钟执行一次
*
* @throws Exception 异常信息
*/
public void automaticOrderTask() throws Exception {
log.info("开始执行自动关闭订单定时任务......");
paymentInfoTaskService.automaticOrderTask();
log.info("完成自动关闭订单定时任务......");
}
/**
* 自动修改未支付的订单状态每15分钟执行一次
* 该定时任务用与接收微信支付回调通知失败或者网络原因导致微信支付系统支付成功,但是本地订单状态未同步更新的情况
*
* @throws Exception 异常信息
*/
public void automaticUpdateOrderStatusTask() throws Exception {
log.info("开始执行修改订单状态定时任务......");
paymentInfoTaskService.automaticUpdateOrderStatusTask();
log.info("完成修改订单状态定时任务......");
}
}