| | |
| | | package com.matrix.system.shopXcx.mqTask; |
| | | |
| | | |
| | | import com.matrix.component.asyncmessage.MessageHandler; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.rabbitmq.client.DeliverCallback; |
| | | import com.rabbitmq.client.Delivery; |
| | | import org.apache.logging.log4j.message.Message; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 微商城订单同步到erp系统 |
| | | */ |
| | | @Component |
| | | public class OrderTask implements DeliverCallback { |
| | | public class OrderTask implements MessageHandler { |
| | | |
| | | |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public String getName() { |
| | | return "微商城订单同步到erp系统"; |
| | | } |
| | | |
| | | @Override |
| | | public void handle(String consumerTag, Delivery message) throws IOException { |
| | | public String getRouteKey() { |
| | | return AsyncMessageRouting.CREATE_ORDER; |
| | | } |
| | | |
| | | String orderId = new String(message.getBody(), "UTF-8"); |
| | | @Override |
| | | public void handle(Map<String,Object> param) { |
| | | |
| | | String orderId = (String) param.get("orderId"); |
| | | LogUtil.debug("收到创建订单任务orderId={}", orderId); |
| | | //获取订单信息 |
| | | ShopOrder order = shopOrderDao.selectById(Integer.valueOf(orderId)); |