| | |
| | | import com.yeshi.fanli.util.Constant; |
| | | import com.yeshi.fanli.util.annotation.JobMonitor; |
| | | import com.yeshi.fanli.util.mq.cmq.order.OrdersCMQManager; |
| | | import com.yeshi.fanli.util.mq.rabbit.RabbitmqManager; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.xxl.job.core.biz.model.ReturnT; |
| | |
| | | |
| | | @Resource |
| | | private CommonOrderService commonOrderService; |
| | | |
| | | @Resource |
| | | private OrdersCMQManager ordersCMQManager; |
| | | |
| | | |
| | | /** |
| | |
| | | String result = redisManager.getCommonString(key); |
| | | // 判断 |
| | | if (StringUtil.isNullOrEmpty(result)) { |
| | | OrdersCMQManager.getInstance().addOrder(new CommonOrderMQMsg(order.getOrderId() + "", Constant.SOURCE_TYPE_JD)); |
| | | ordersCMQManager.addOrder(new CommonOrderMQMsg(order.getOrderId() + "", Constant.SOURCE_TYPE_JD)); |
| | | redisManager.cacheCommonString(key, "1", 60 * 60 * 2);// 2小时内不再更新 |
| | | } |
| | | } catch (JDOrderException e) { |
| | |
| | | orderIds.add(co.getOrderNo()); |
| | | } |
| | | for (String orderId : orderIds) { |
| | | OrdersCMQManager.getInstance().addOrder(new CommonOrderMQMsg(orderId, Constant.SOURCE_TYPE_JD)); |
| | | ordersCMQManager.addOrder(new CommonOrderMQMsg(orderId, Constant.SOURCE_TYPE_JD)); |
| | | } |
| | | return ReturnT.SUCCESS; |
| | | } |