From e845f2033e1be42896f891ee12b866d174214529 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 16 Jul 2021 10:13:39 +0800
Subject: [PATCH] Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop

---
 gc-order/src/main/java/com/xzx/gc/order/service/DistribService.java |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gc-order/src/main/java/com/xzx/gc/order/service/DistribService.java b/gc-order/src/main/java/com/xzx/gc/order/service/DistribService.java
index 8dc3aca..ba7bf1f 100644
--- a/gc-order/src/main/java/com/xzx/gc/order/service/DistribService.java
+++ b/gc-order/src/main/java/com/xzx/gc/order/service/DistribService.java
@@ -55,8 +55,13 @@
         }
 
         Integer count = userHeadDetailsMapper.selectDetailsCount(userId);
-        UserInfo userInfo = userMapper.selectByPrimaryKey(userId);
-        AccountInfo accountInfo = accountMapper.selectAccountInfoByUserId(userId);
+//        UserInfo userInfo = userMapper.selectByPrimaryKey(userId);
+        AccountInfo accountInfo = accountMapper.selectAccountInfoByUserId(userHeadRelate.getHeadUserId());
+
+        if (AccountInfo.IS_PROHIBIT_Y.equals(accountInfo.getIsProhibit())) {
+            return;
+        }
+
         List<String> remark = new ArrayList<>();
         BigDecimal totalReturnScore = BigDecimal.ZERO;
         BigDecimal totalReturnCoin = BigDecimal.ZERO;
@@ -128,7 +133,7 @@
         accountInfo.setAccountId(accountInfo.getAccountId());
         accountInfo.setMoney(new BigDecimal(accountInfo.getMoney()).add(totalReturnCoin).setScale(2, BigDecimal.ROUND_DOWN).toString());
         BigDecimal collectScore = StrUtil.isNotBlank(accountInfo.getCollectScore()) ? new BigDecimal(accountInfo.getCollectScore()) : BigDecimal.ZERO;
-        accountInfo.setCollectScore(collectScore.add(totalReturnScore).setScale(2, BigDecimal.ROUND_DOWN).toString());
+        accountInfo.setCollectScore(collectScore.add(totalReturnScore).setScale(0, BigDecimal.ROUND_DOWN).toString());
         accountMapper.updateByPrimaryKey(accountInfo);
 
         SysMessage sysMessage = new SysMessage();
@@ -137,7 +142,7 @@
         sysMessage.setUserId(userHeadRelate.getHeadUserId());
         sysMessage.setMessageType("4");
         sysMessage.setMessageSubTypeName("返利消息");
-        sysMessage.setMessage("收到用户:" + userInfo.getMobilePhone().replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2") + "的订单返利, 积分:" + totalReturnScore +", 环保币:" + totalReturnCoin);
+        sysMessage.setMessage("收到用户:" + accountInfo.getAccountName().replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2") + "的订单返利, 积分:" + totalReturnScore +", 环保币:" + totalReturnCoin);
         sysMessage.setFlag("2");
         sysMessageMapper.insert(sysMessage);
     }

--
Gitblit v1.9.1