|
@@ -1,6 +1,7 @@
|
|
package com.txz.mall.task;
|
|
package com.txz.mall.task;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
+import com.txz.mall.service.StoreOrderService;
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -23,15 +24,28 @@ import java.util.List;
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
public class GeneralJob {
|
|
public class GeneralJob {
|
|
|
|
+
|
|
private static Logger logger = LoggerFactory.getLogger(GeneralJob.class);
|
|
private static Logger logger = LoggerFactory.getLogger(GeneralJob.class);
|
|
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private StoreOrderService storeOrderService;
|
|
/**
|
|
/**
|
|
* 1、简单任务示例(Bean模式)
|
|
* 1、简单任务示例(Bean模式)
|
|
*/
|
|
*/
|
|
- @XxlJob("generalReportJob")
|
|
|
|
- public ReturnT<String> generalReportJob(String param) throws Exception {
|
|
|
|
- //do things
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @XxlJob("newOrderTimeoutAutomaticCancel")
|
|
|
|
+ public ReturnT<String> newOrderTimeoutAutomaticCancel(String param) throws Exception {
|
|
|
|
+ try {
|
|
|
|
+ logger.info("【新的订单支付超时定时关单任务】开始");
|
|
|
|
+ storeOrderService.orderTimeoutAutomaticCancel();
|
|
|
|
+ logger.info("【新的订单支付超时定时关单任务】完成");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ logger.error("【新的订单支付超时定时关单任务】异常:e{}", e);
|
|
|
|
+ return ReturnT.FAIL;
|
|
|
|
+ }
|
|
return ReturnT.SUCCESS;
|
|
return ReturnT.SUCCESS;
|
|
}
|
|
}
|
|
|
|
|