|
@@ -1,9 +1,11 @@
|
|
|
package com.txz.mall.task;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import com.txz.mall.service.StoreFlashActivityService;
|
|
|
import com.txz.mall.service.StoreOrderService;
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Component;
|
|
@@ -23,30 +25,76 @@ import java.util.List;
|
|
|
* @author xuxueli 2019-12-11 21:52:51
|
|
|
*/
|
|
|
@Component
|
|
|
+@Slf4j
|
|
|
public class GeneralJob {
|
|
|
|
|
|
- private static Logger logger = LoggerFactory.getLogger(GeneralJob.class);
|
|
|
-
|
|
|
+// private static Logger logger = LoggerFactory.getLogger(GeneralJob.class);
|
|
|
|
|
|
@Resource
|
|
|
private StoreOrderService storeOrderService;
|
|
|
+
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private StoreFlashActivityService storeFlashActivityService;
|
|
|
+
|
|
|
/**
|
|
|
* 1、简单任务示例(Bean模式)
|
|
|
*/
|
|
|
|
|
|
+ @XxlJob("newScheduledTaskStorePinkSummaryClose")
|
|
|
+ public ReturnT<String> newsScheduledTaskStorePinkSummaryClose(String param) throws Exception {
|
|
|
+ try {
|
|
|
+ log.info("newScheduledTaskStorePinkSummaryClose start");
|
|
|
+ storeOrderService.scheduledTaskStorePinkSummaryClose();
|
|
|
+ log.info("newsScheduledTaskStorePinkSummaryClose end");
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("newScheduledTaskStorePinkSummaryCloseError:e{}", e);
|
|
|
+ return ReturnT.FAIL;
|
|
|
+ }
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+
|
|
|
+ @XxlJob("newScheduledTaskBatchSigning")
|
|
|
+ public ReturnT<String> newScheduledTaskBatchSigning(String param) throws Exception {
|
|
|
+ try {
|
|
|
+ log.info("newScheduledTaskBatchSigning start");
|
|
|
+ storeOrderService.batchSigning();
|
|
|
+ log.info("newScheduledTaskBatchSigning end");
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("newScheduledTaskBatchSigningError:e{}", e);
|
|
|
+ return ReturnT.FAIL;
|
|
|
+ }
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
@XxlJob("newOrderTimeoutAutomaticCancel")
|
|
|
public ReturnT<String> newOrderTimeoutAutomaticCancel(String param) throws Exception {
|
|
|
try {
|
|
|
- logger.info("【新的订单支付超时定时关单任务】开始");
|
|
|
+ log.info("newOrderTimeoutAutomaticCancel start");
|
|
|
storeOrderService.orderTimeoutAutomaticCancel();
|
|
|
- logger.info("【新的订单支付超时定时关单任务】完成");
|
|
|
+ log.info("newOrderTimeoutAutomaticCancel end");
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("newOrderTimeoutAutomaticCancelError:e{}", e);
|
|
|
+ return ReturnT.FAIL;
|
|
|
+ }
|
|
|
+ return ReturnT.SUCCESS;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @XxlJob("newActivityStatusJudgmentTimedTask")
|
|
|
+ public ReturnT<String> newActivityStatusJudgmentTimedTask(String param) throws Exception {
|
|
|
+ try {
|
|
|
+ log.info("newActivityStatusJudgmentTimedTask start");
|
|
|
+ storeFlashActivityService.activityStatusJudgmentTimedTask();
|
|
|
+ log.info("newActivityStatusJudgmentTimedTask end");
|
|
|
} catch (Exception e) {
|
|
|
- logger.error("【新的订单支付超时定时关单任务】异常:e{}", e);
|
|
|
+ log.error("newActivityStatusJudgmentTimedTaskError:e{}", e);
|
|
|
return ReturnT.FAIL;
|
|
|
}
|
|
|
return ReturnT.SUCCESS;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
}
|