From e3155bdcb11ca4e22d2bc9e54f96a1aa00c7ad4a Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Tue, 26 Mar 2024 12:28:45 +0800
Subject: [PATCH] 抽奖
---
src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java | 179 +++++++++++++++++++++++++++++++++++++----------------------
1 files changed, 112 insertions(+), 67 deletions(-)
diff --git a/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java b/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java
index 927279a..ec3b19a 100644
--- a/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java
+++ b/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java
@@ -29,71 +29,116 @@
@Autowired
private IMemberProfitService memberProfitService;
-// @RabbitListener(queues = QueueConstants.QUEUE_DEFAULT)
-// public void agentReturn(Message message, Channel channel) {
-// log.info("消费者:{}", new String(message.getBody()));
-// }
-//
-// @RabbitListener(queues = "hlm_queue_order_delay")
-// public void orderCancelDelay(String id) {
-// try {
-// orderInfoService.autoCancelOrder(Long.parseLong(id));
-// } catch (Exception e) {
-// log.error("订单超时支付异常", e);
-// }
-// }
-//
-// @RabbitListener(queues = QueueConstants.AGENT_AUTO_LEVEL_UP)
-// public void agentAutoLevelUp(String id) {
-// log.info("收到合伙人自动升级消息:{}", id);
-// try {
-// agentService.autoUpAgentLevel(Long.parseLong(id));
-// } catch (Exception e) {
-// log.error("合伙人自动升级异常", e);
-// }
-// }
-//
-// @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);
-// try {
-// memberProfitService.dynamicProfit(Long.parseLong(orderId));
-// } catch (Exception e) {
-// log.error("订单返利异常:", e);
-// }
-// }
-//
-// @RabbitListener(queues = QueueConstants.PERK_MONEY)
-// public void perkMoneyConsumer(String id) {
-// log.info("收到补贴消息:{}", id);
-// try {
-// agentService.perkMoneyConsumer(Long.parseLong(id));
-// } catch (Exception e) {
-// log.error("用户补贴异常", e);
-// // todo 更新表
-//
-// }
-// }
-//
-// @RabbitListener(queues = QueueConstants.FORCE_VOUCHER_SALE)
-// public void forceVoucherSaleConsumer(String price) {
-// log.info("收到强制卖出消息,价格:{}",price);
-// try {
-// memberProfitService.selaHalfVoucher(price);
-// } catch (Exception e) {
-// log.error("强制卖出异常", e);
-// // todo 更新表
-//
-// }
-// }
+ @RabbitListener(queues = QueueConstants.QUEUE_DEFAULT)
+ public void agentReturn(Message message, Channel channel) {
+ log.info("消费者:{}", new String(message.getBody()));
+ }
+
+ @RabbitListener(queues = "hlm_queue_order_delay")
+ public void orderCancelDelay(String id) {
+ try {
+ orderInfoService.autoCancelOrder(Long.parseLong(id));
+ } catch (Exception e) {
+ log.error("订单超时支付异常", e);
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.AGENT_AUTO_LEVEL_UP)
+ public void agentAutoLevelUp(String id) {
+ log.info("收到合伙人自动升级消息:{}", id);
+ try {
+ agentService.autoUpAgentLevel(Long.parseLong(id));
+ } catch (Exception e) {
+ log.error("合伙人自动升级异常", e);
+ }
+ }
+
+ @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);
+ try {
+ memberProfitService.dynamicProfit(Long.parseLong(orderId));
+ } catch (Exception e) {
+ log.error("订单返利异常:", e);
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.PERK_MONEY)
+ public void perkMoneyConsumer(String id) {
+ log.info("收到补贴消息:{}", id);
+ try {
+ agentService.perkMoneyConsumer(Long.parseLong(id));
+ } catch (Exception e) {
+ log.error("用户补贴异常", e);
+ // todo 更新表
+
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.FORCE_VOUCHER_SALE)
+ public void forceVoucherSaleConsumer(String price) {
+ log.info("收到强制卖出消息,价格:{}",price);
+ try {
+ memberProfitService.selaHalfVoucher(price);
+ } catch (Exception e) {
+ log.error("强制卖出异常", e);
+ // todo 更新表
+
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.QUEUE_FCM_NFT_EXCHANGE)
+ public void fcmNFTExchangeMsg(String cnt) {
+ log.info("收到FCM实时兑换销毁数量:{}",cnt);
+ try {
+ memberProfitService.fcmNFTExchangeMsg(cnt);
+ } catch (Exception e) {
+ log.error("收到FCM实时兑换销毁数量异常", e);
+ // todo 更新表
+
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.QUEUE_FCM_ORDER_SELL_INSURE)
+ public void fcmOrderSellInsureMsg(Long sellRecordId) {
+ log.info("收到卖单用户确认:{}",sellRecordId);
+ try {
+ memberProfitService.fcmOrderSellInsureMsg(sellRecordId);
+ } catch (Exception e) {
+ log.error("收到卖单用户确认异常", e);
+ // todo 更新表
+
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.QUEUE_FCM_ORDER_BUY_CANCEL)
+ public void fcmOrderBuyCancelMsg(Long buyRecordId) {
+ log.info("收到买单取消确认:{}",buyRecordId);
+ try {
+ memberProfitService.fcmOrderBuyCancelMsg(buyRecordId);
+ } catch (Exception e) {
+ log.error("收到买单取消确认异常", e);
+ // todo 更新表
+
+ }
+ }
+
+ @RabbitListener(queues = QueueConstants.QUEUE_FCMPAY_BUY_TIME)
+ public void fcmPayBuyTimeTTLMsg(Long id) {
+ try {
+ orderInfoService.fcmPayBuyTimeTTLMsg(id);
+ } catch (Exception e) {
+ log.error("订单待收款异常", e);
+ }
+ }
}
--
Gitblit v1.9.1