1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package com.qtzl.alterSales.manager.quartz;
-
- import cn.com.taiji.common.manager.AbstractManager;
- import cn.com.taiji.common.manager.net.http.ServiceHandleException;
- import com.qtzl.alterSales.dao.entity.primary.AflApPayOrder;
- import com.qtzl.alterSales.manager.enums.AflApPayOrderStatus;
- import com.qtzl.alterSales.manager.service.AflApPayOrderService;
- import com.qtzl.alterSales.manager.service.ChoiceBillsOperationService;
- import org.slf4j.Logger;
- import org.slf4j.LoggerFactory;
- import org.springframework.scheduling.annotation.Scheduled;
- import org.springframework.stereotype.Component;
-
- import javax.annotation.Resource;
- import java.util.List;
-
-
- /**
- * 选装-补交微信支付订单定时任务
- */
- @Component
- public class AflApPayOrderTask extends AbstractManager {
-
- private static final Logger log = LoggerFactory.getLogger(AflApPayOrderTask.class);
-
- @Resource
- private AflApPayOrderService aflApPayOrderService;
-
- @Resource
- private ChoiceBillsOperationService choiceBillsOperationService;
-
- /**
- * 定时查询order_status为TO_BE_PAID的订单
- */
- @Scheduled(cron = "* */10 * * * ?")
- public void findByOrderStatus(){
- List<AflApPayOrder> aflApPayOrders = aflApPayOrderService.findByOrderStatus(AflApPayOrderStatus.TO_BE_PAID, log);
- log.info("本次查询结果为:{}",aflApPayOrders);
- if (aflApPayOrders==null||aflApPayOrders.size()<1){
- log.info("中国ETC小程序过户、取消订单本地订单处理没有需要处理的数据");
- }
- log.info("本次需要处理的订单集合为:{}",aflApPayOrders.toString());
- int indexSusses=0;
- int indexFail=0;
- for (AflApPayOrder aflApPayOrder : aflApPayOrders) {
- log.info("本次需要处理的订单为:{}",aflApPayOrder.toString());
- try {
- choiceBillsOperationService.choiceBillsPayQuery(aflApPayOrder.getId());
- } catch (ServiceHandleException e) {
- log.info("本次订单处理失败。订单为:{}",aflApPayOrder.toString());
- indexFail++;
- continue;
- }
- indexSusses++;
- }
- log.info("本次订单处理成功数为:"+indexSusses +";失败数为:"+indexFail);
- log.info("中国ETC小程序过户、取消订单本地订单处理完成");
- }
- }
|