From 433c5abadf47a785f2a2042b4be2b3ab97190685 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 26 Aug 2022 17:56:49 +0800
Subject: [PATCH] 20220822
---
src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java | 36 +++++++++++++++++++++++++++++++++---
1 files changed, 33 insertions(+), 3 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 4569e1a..46c50a1 100644
--- a/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java
+++ b/src/main/java/cc/mrbird/febs/rabbit/consumer/AgentConsumer.java
@@ -2,6 +2,7 @@
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.rabbit.constants.QueueConstants;
import cc.mrbird.febs.rabbit.enumerates.RabbitQueueEnum;
import com.rabbitmq.client.Channel;
@@ -25,6 +26,8 @@
private IApiMallOrderInfoService orderInfoService;
@Autowired
private IAgentService agentService;
+ @Autowired
+ private IMemberProfitService memberProfitService;
@RabbitListener(queues = QueueConstants.QUEUE_DEFAULT)
public void agentReturn(Message message, Channel channel) {
@@ -33,13 +36,40 @@
@RabbitListener(queues = "queue_order_delay")
public void orderCancelDelay(String id) {
- log.info("订单超时支付自动取消:{}", id);
- orderInfoService.autoCancelOrder(Long.parseLong(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);
- agentService.autoUpAgentLevel(Long.parseLong(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);
+ }
}
}
--
Gitblit v1.9.1