| @@ -0,0 +1,41 @@ | |||||
| package com.iformall.schedule; | |||||
| import com.iformall.domain.po.TtOrderPushError; | |||||
| import com.iformall.mapper.TtOrderPushErrorMapper; | |||||
| import com.iformall.service.WxOrderService; | |||||
| import org.slf4j.Logger; | |||||
| import org.slf4j.LoggerFactory; | |||||
| import org.springframework.beans.factory.annotation.Autowired; | |||||
| import org.springframework.scheduling.annotation.Async; | |||||
| import org.springframework.scheduling.annotation.Scheduled; | |||||
| import org.springframework.stereotype.Component; | |||||
| import java.util.List; | |||||
| @Component | |||||
| public class TtOrderPushErrorSchedule { | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||||
| @Autowired | |||||
| private TtOrderPushErrorMapper ttOrderPushErrorMapper; | |||||
| @Autowired | |||||
| private WxOrderService wxOrderService; | |||||
| @Async | |||||
| @Scheduled(cron = "0 0 1 * * ?") | |||||
| public void OrderPushErrorTaskSchedule() { | |||||
| List<TtOrderPushError> orderPushErrors = ttOrderPushErrorMapper.findList(new TtOrderPushError()); | |||||
| if(orderPushErrors != null && orderPushErrors.size() > 0){ | |||||
| for (TtOrderPushError error:orderPushErrors) { | |||||
| try{ | |||||
| wxOrderService.sendInsideOrderPushMsg(error,error.getId()); | |||||
| }catch(Exception e){ | |||||
| logger.error("订单同步重试error"); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||