姜友瑶
2022-08-09 c423224dbe37ea69c1a36c696f85490343e68c4c
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java
@@ -1,6 +1,7 @@
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.bean.BusParameterSettings;
@@ -23,12 +24,13 @@
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
/**
 * 订单创建积分事件处理
 */
@Component
public class ScoreOrderTask implements DeliverCallback {
public class ScoreOrderTask implements MessageHandler {
    @Autowired
@@ -50,9 +52,19 @@
    SysVipInfoDao sysVipInfoDao;
    @Override
    public void handle(String consumerTag, Delivery message) throws IOException {
    public String getName() {
        return "订单创建积分事件";
    }
        String orderId = new String(message.getBody(), "UTF-8");
    @Override
    public String getRouteKey() {
        return AsyncMessageRouting.CREATE_ORDER;
    }
    @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));