|
@@ -1,46 +1,46 @@
|
|
-package com.caimei365.order.task;
|
|
|
|
-
|
|
|
|
-import com.caimei365.order.components.WeChatService;
|
|
|
|
-import com.caimei365.order.service.ReceiptService;
|
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
-import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
|
-
|
|
|
|
-import javax.annotation.Resource;
|
|
|
|
-
|
|
|
|
-/**
|
|
|
|
- * 线下收款推送模板消息
|
|
|
|
- *
|
|
|
|
- * @author : Charles
|
|
|
|
- * @date : 2022/2/25
|
|
|
|
- */
|
|
|
|
-@Slf4j
|
|
|
|
-@Component
|
|
|
|
-@EnableScheduling
|
|
|
|
-public class ReceiptMsgTask {
|
|
|
|
- @Resource
|
|
|
|
- private ReceiptService receiptService;
|
|
|
|
- @Resource
|
|
|
|
- private WeChatService weChatService;
|
|
|
|
- /**
|
|
|
|
- * 微信收款信息推送
|
|
|
|
- * 每天九点钟推送
|
|
|
|
- */
|
|
|
|
- @Scheduled(cron = "0 0 09 * * ?")
|
|
|
|
- public void sendWechatMsgTask() {
|
|
|
|
- log.info("-------->微信收款信息定时推送--start<--------------");
|
|
|
|
- try {
|
|
|
|
- String accessToken = weChatService.getAccessToken();
|
|
|
|
- // 待确认超时
|
|
|
|
- receiptService.sendWechatMsgConfirmTimeout(accessToken);
|
|
|
|
- // 待审核超时
|
|
|
|
- receiptService.sendWechatMsgAuditTimeout(accessToken);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- log.error("获取微信公众号access_token异常!", e);
|
|
|
|
- }
|
|
|
|
- log.info("-------->微信收款信息定时推送--end<--------------");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-}
|
|
|
|
|
|
+//package com.caimei365.order.task;
|
|
|
|
+//
|
|
|
|
+//import com.caimei365.order.components.WeChatService;
|
|
|
|
+//import com.caimei365.order.service.ReceiptService;
|
|
|
|
+//import lombok.extern.slf4j.Slf4j;
|
|
|
|
+//import org.apache.commons.lang3.StringUtils;
|
|
|
|
+//import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
+//import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
+//import org.springframework.stereotype.Component;
|
|
|
|
+//
|
|
|
|
+//import javax.annotation.Resource;
|
|
|
|
+//
|
|
|
|
+///**
|
|
|
|
+// * 线下收款推送模板消息
|
|
|
|
+// *
|
|
|
|
+// * @author : Charles
|
|
|
|
+// * @date : 2022/2/25
|
|
|
|
+// */
|
|
|
|
+//@Slf4j
|
|
|
|
+//@Component
|
|
|
|
+//@EnableScheduling
|
|
|
|
+//public class ReceiptMsgTask {
|
|
|
|
+// @Resource
|
|
|
|
+// private ReceiptService receiptService;
|
|
|
|
+// @Resource
|
|
|
|
+// private WeChatService weChatService;
|
|
|
|
+// /**
|
|
|
|
+// * 微信收款信息推送
|
|
|
|
+// * 每天九点钟推送
|
|
|
|
+// */
|
|
|
|
+// @Scheduled(cron = "0 0 09 * * ?")
|
|
|
|
+// public void sendWechatMsgTask() {
|
|
|
|
+// log.info("-------->微信收款信息定时推送--start<--------------");
|
|
|
|
+// try {
|
|
|
|
+// String accessToken = weChatService.getAccessToken();
|
|
|
|
+// // 待确认超时
|
|
|
|
+// receiptService.sendWechatMsgConfirmTimeout(accessToken);
|
|
|
|
+// // 待审核超时
|
|
|
|
+// receiptService.sendWechatMsgAuditTimeout(accessToken);
|
|
|
|
+// } catch (Exception e) {
|
|
|
|
+// log.error("获取微信公众号access_token异常!", e);
|
|
|
|
+// }
|
|
|
|
+// log.info("-------->微信收款信息定时推送--end<--------------");
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+//}
|