From 1b35365d019f89927ed5f68b568f6f7de998278d Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Mon, 29 Jan 2024 23:26:32 +0800
Subject: [PATCH] fix

---
 src/main/java/cc/mrbird/febs/pay/controller/XcxPayController.java               |    2 +-
 src/main/java/cc/mrbird/febs/vip/service/impl/VipCommonServiceImpl.java         |    4 ++++
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java |    4 +---
 src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java    |    2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
index 1e4ab20..1cdb4e1 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -725,7 +725,7 @@
         }
 
         List<MallVipConfig> configs = mallVipConfigMapper.selectVipConfigList();
-        if (CollUtil.isNotEmpty(configs)) {
+        if (StrUtil.isBlank(mallMember.getLevel()) && CollUtil.isNotEmpty(configs)) {
             MallVipConfig mallVipConfig = configs.get(0);
             mallMember.setLevel(mallVipConfig.getCode());
         }
diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
index 872c1e5..e7aa9be 100644
--- a/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallOrderInfoServiceImpl.java
@@ -453,7 +453,6 @@
                 mallMoneyFlowService.addMoneyFlow(member.getId(), orderInfo.getAmount().negate(), MoneyFlowTypeEnum.PAY.getValue(), orderInfo.getOrderNo(), FlowTypeEnum.BALANCE.getValue(),"余额支付",2);
 
                 agentProducer.sendOrderCoupon(orderInfo.getId());
-                agentProducer.sendGetScoreMsg(orderInfo.getId());
                 break;
             case "4":
                 if (orderInfo.getOrderType() != 2) {
@@ -583,8 +582,7 @@
         orderInfo.setReceivingTime(new Date());
         this.baseMapper.updateById(orderInfo);
 
-        agentProducer.sendVipLevelUp(orderInfo.getId());
-
+        agentProducer.sendGetScoreMsg(orderInfo.getId());
         //生成一条团长提成记录
 //        Long orderInfoId = orderInfo.getId();
 //        List<MallOrderItem> mallOrderItemList = mallOrderItemMapper.selectListByOrderId(orderInfoId);
diff --git a/src/main/java/cc/mrbird/febs/pay/controller/XcxPayController.java b/src/main/java/cc/mrbird/febs/pay/controller/XcxPayController.java
index 719288a..5629e7b 100644
--- a/src/main/java/cc/mrbird/febs/pay/controller/XcxPayController.java
+++ b/src/main/java/cc/mrbird/febs/pay/controller/XcxPayController.java
@@ -327,7 +327,7 @@
                             mallOrderInfoMapper.updateById(order);
 
                             agentProducer.sendOrderCoupon(order.getId());
-                            agentProducer.sendGetScoreMsg(order.getId());
+//                            agentProducer.sendGetScoreMsg(order.getId());
 
                             mallMoneyFlowService.addMoneyFlow(
                                     order.getMemberId(),
diff --git a/src/main/java/cc/mrbird/febs/vip/service/impl/VipCommonServiceImpl.java b/src/main/java/cc/mrbird/febs/vip/service/impl/VipCommonServiceImpl.java
index cd15ede..02c7c50 100644
--- a/src/main/java/cc/mrbird/febs/vip/service/impl/VipCommonServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/vip/service/impl/VipCommonServiceImpl.java
@@ -11,6 +11,7 @@
 import cc.mrbird.febs.mall.service.IApiMallMemberWalletService;
 import cc.mrbird.febs.mall.service.IApiMallOrderInfoService;
 import cc.mrbird.febs.mall.service.IMallMoneyFlowService;
+import cc.mrbird.febs.rabbit.producter.AgentProducer;
 import cc.mrbird.febs.vip.entity.MallVipBenefits;
 import cc.mrbird.febs.vip.entity.MallVipConfig;
 import cc.mrbird.febs.vip.mapper.MallVipConfigMapper;
@@ -41,6 +42,7 @@
     private final IApiMallMemberWalletService mallMemberWalletService;
     private final MallMemberMapper mallMemberMapper;
     private final MallVipConfigMapper mallVipConfigMapper;
+    private final AgentProducer agentProducer;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -67,6 +69,8 @@
 
         mallMoneyFlowService.addMoneyFlow(memberId, new BigDecimal(score), ScoreFlowTypeEnum.BUY.getValue(), mallOrderInfo.getOrderNo(), FlowTypeEnum.PRIZE_SCORE.getValue(), CollUtil.join(skuNames, ","), 2);
         mallMemberWalletService.add(new BigDecimal(score), memberId, "prizeScore");
+
+        agentProducer.sendVipLevelUp(orderId);
     }
 
     @Override

--
Gitblit v1.9.1