
package com.tmerclub.cloud.multishop.listener;

import com.tmerclub.cloud.api.multishop.bo.OrderChangeShopWalletAmountBO;
import com.tmerclub.cloud.common.rocketmq.config.RocketMqConstant;
import com.tmerclub.cloud.multishop.service.ShopWalletService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author lhd
 */
@Component
@RocketMQMessageListener(topic = RocketMqConstant.ORDER_PRE_SALE_FAIL_SETTLEMENT_TOPIC, consumerGroup = RocketMqConstant.ORDER_PRE_SALE_FAIL_SETTLEMENT_TOPIC)
public class OrderPreSaleSettlementShopConsumer implements RocketMQListener<OrderChangeShopWalletAmountBO> {

    @Autowired
    private ShopWalletService shopWalletService;

    /**
     * 订单超时未支付尾款 商家结算操作
     */
    @Override
    public void onMessage(OrderChangeShopWalletAmountBO orderChangeShopWalletAmountBO) {
        shopWalletService.settlementShopAmountByPreSaleFail(orderChangeShopWalletAmountBO);
    }
}
