| | |
| | | package cc.mrbird.febs.rabbit.consumer; |
| | | |
| | | import cc.mrbird.febs.mall.service.HappyActivityService; |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.mall.service.IApiMallOrderInfoService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.rabbit.constants.QueueConstants; |
| | | import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum; |
| | | import cc.mrbird.febs.vip.service.IVipCommonService; |
| | |
| | | import org.springframework.amqp.core.Message; |
| | | import org.springframework.amqp.rabbit.annotation.RabbitListener; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | |
| | | **/ |
| | | @Slf4j |
| | | @Component |
| | | @ConditionalOnProperty(prefix = "system", name = "job", havingValue = "true") |
| | | public class AgentConsumer { |
| | | |
| | | @Autowired |
| | | private IApiMallOrderInfoService orderInfoService; |
| | | |
| | | @Autowired |
| | | private ApiClothesOrderService apiClothesOrderService; |
| | | @Autowired |
| | | private IAgentService agentService; |
| | | @Autowired |
| | |
| | | @RabbitListener(queues = QueueConstants.QUEUE_DEFAULT) |
| | | public void agentReturn(Message message, Channel channel) { |
| | | log.info("消费者:{}", new String(message.getBody())); |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.CLOTHES_ORDER_CANCEL_DELAY) |
| | | public void orderCancelDelayClothes(String id) { |
| | | try { |
| | | apiClothesOrderService.orderCancelDelayClothes(Long.parseLong(id)); |
| | | } catch (Exception e) { |
| | | log.error("订单超时支付异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = "queue_order_delay_qay") |
| | |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.SALE_LEVEL_UP) |
| | | public void saleLevelUp(Long orderId) { |
| | | log.info("收到团长升级:{}", orderId); |
| | | try { |
| | | vipCommonService.saleLevelUp(orderId); |
| | | } catch (Exception e) { |
| | | log.error("团长升级消息异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.ACTIVITY_ORDER_ITEM_CHECK) |
| | | public void checkActivityItem(Long orderId) { |
| | | log.info("收到核销活动门票:{}", orderId); |
| | |
| | | log.error("核销活动门票异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.CLOTHES_ADD_LIKE) |
| | | public void getAddLike(Long socialId) { |
| | | log.info("点赞:{}", socialId); |
| | | try { |
| | | happyActivityService.getAddLike(socialId); |
| | | } catch (Exception e) { |
| | | log.error("点赞异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.CLOTHES_ADD_COLLECT) |
| | | public void getAddCollect(Long socialId) { |
| | | log.info("收藏:{}", socialId); |
| | | try { |
| | | happyActivityService.getAddCollect(socialId); |
| | | } catch (Exception e) { |
| | | log.error("收藏异常", e); |
| | | } |
| | | } |
| | | } |