| | |
| | | |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.mall.service.IApiMallOrderInfoService; |
| | | import cc.mrbird.febs.mall.service.IMatrixTreeNodeService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.rabbit.constants.QueueConstants; |
| | | import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum; |
| | |
| | | @Autowired |
| | | private IMemberProfitService memberProfitService; |
| | | |
| | | @RabbitListener(queues = QueueConstants.QUEUE_DEFAULT) |
| | | public void agentReturn(Message message, Channel channel) { |
| | | log.info("消费者:{}", new String(message.getBody())); |
| | | } |
| | | @Autowired |
| | | private IMatrixTreeNodeService matrixTreeNodeService; |
| | | |
| | | @RabbitListener(queues = "meye_queue_order_delay") |
| | | public void orderCancelDelay(String id) { |
| | |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.AGENT_RETURN_MONEY) |
| | | public void agentReturnMoney(String orderId) { |
| | | log.info("收到返利消息:{}", orderId); |
| | | try { |
| | | agentService.returnMoneyToAgent(Long.parseLong(orderId)); |
| | | } catch (Exception e) { |
| | | log.error("返利异常", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.ORDER_RETURN_MONEY) |
| | | public void orderReturnMoney(String orderId) { |
| | | log.info("收到订单返利消息:{}", orderId); |
| | |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.PERK_MONEY) |
| | | public void perkMoneyConsumer(String id) { |
| | | log.info("收到补贴消息:{}", id); |
| | | @RabbitListener(queues = QueueConstants.ORDER_BONUS) |
| | | public void calOrderBonus(String orderId) { |
| | | log.info("收到订单分红消息:{}", orderId); |
| | | try { |
| | | agentService.perkMoneyConsumer(Long.parseLong(id)); |
| | | memberProfitService.orderBonus(Long.parseLong(orderId)); |
| | | } catch (Exception e) { |
| | | log.error("用户补贴异常", e); |
| | | // todo 更新表 |
| | | |
| | | log.error("订单分红消息异常:", e); |
| | | } |
| | | } |
| | | |
| | | @RabbitListener(queues = QueueConstants.FORCE_VOUCHER_SALE) |
| | | public void forceVoucherSaleConsumer(String price) { |
| | | log.info("收到强制卖出消息,价格:{}",price); |
| | | try { |
| | | // memberProfitService.selaHalfVoucher(prisce); |
| | | } catch (Exception e) { |
| | | log.error("强制卖出异常", e); |
| | | // todo 更新表 |
| | | |
| | | } |
| | | @RabbitListener(queues = QueueConstants.MATRIX_TREE) |
| | | public void matrixTree(Long memberId) { |
| | | log.info("矩阵节点消息:{}", memberId); |
| | | matrixTreeNodeService.addTreeNode(memberId); |
| | | } |
| | | |
| | | } |