| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | |
| | | public void sendOrderReturn(Long id) { |
| | | log.info("发送消息:{}", id); |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(ExchangeConstants.EXCHANGE_DEFAULT, RouteKeyConstants.ROUTE_KEY_DEFAULT, id, correlationData); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.ORDER_RETURN_MONEY.getExchange(), RabbitQueueEnum.ORDER_RETURN_MONEY.getRoute(), id, correlationData); |
| | | } |
| | | |
| | | public void sendOrderCancelDelayMsg(Long id, Long times) { |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 发送代理自动升级消息 |
| | | * |
| | | * @param memberId |
| | | */ |
| | | public void sendAutoLevelUpMsg(@NotNull Long memberId) { |
| | | log.info("发送代理自动升级消息:{}", memberId); |
| | | rabbitTemplate.convertAndSend(ExchangeConstants.EXCHANGE_DEFAULT, RouteKeyConstants.ROUTE_KEY_DEFAULT, memberId); |
| | | } |
| | | |
| | | public void sendReturnMoneyMsg(Long orderId) { |
| | | log.info("发送返利消息:{}", orderId); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.AGENT_REUTRN_MONEY.getExchange(), RabbitQueueEnum.AGENT_REUTRN_MONEY.getRoute(), orderId); |
| | | } |
| | | |
| | | |
| | | public void sendOrderCoupon(Long id) { |
| | | log.info("发送使用优惠卷消息:{}", id); |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.ORDER_COUPON.getExchange(), RabbitQueueEnum.ORDER_COUPON.getRoute(), id, correlationData); |
| | | } |
| | | |
| | | public void sendGetScoreMsg(Long orderId) { |
| | | log.info("发送获得积分消息:{}", orderId); |
| | | |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.GET_SCORE_MSG.getExchange(), RabbitQueueEnum.GET_SCORE_MSG.getRoute(), orderId, correlationData); |
| | | } |
| | | |
| | | public void sendVipLevelUp(Long orderId) { |
| | | log.info("发送会员升级消息:{}", orderId); |
| | | |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.VIP_LEVEL_UP.getExchange(), RabbitQueueEnum.VIP_LEVEL_UP.getRoute(), orderId, correlationData); |
| | | } |
| | | |
| | | public void sendCheckActivityItem(Long orderId) { |
| | | log.info("核销活动门票:{}", orderId); |
| | | |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(RabbitQueueEnum.ACTIVITY_ORDER_ITEM_CHECK.getExchange(), RabbitQueueEnum.ACTIVITY_ORDER_ITEM_CHECK.getRoute(), orderId, correlationData); |
| | | } |
| | | } |