From bea4cd8cceb220189fd1fed5c2c1ff22d3e8a9ed Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Thu, 15 Jul 2021 17:16:16 +0800
Subject: [PATCH] Merge branch 'score-shop' of http://120.27.238.55:7000/r/xzx into score-shop

---
 gc-user/src/main/java/com/xzx/gc/user/service/DistribService.java |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/gc-user/src/main/java/com/xzx/gc/user/service/DistribService.java b/gc-user/src/main/java/com/xzx/gc/user/service/DistribService.java
index 99d01ae..4767b5a 100644
--- a/gc-user/src/main/java/com/xzx/gc/user/service/DistribService.java
+++ b/gc-user/src/main/java/com/xzx/gc/user/service/DistribService.java
@@ -23,6 +23,7 @@
 import cn.hutool.core.util.StrUtil;
 import com.xzx.gc.model.JsonResult;
 import com.xzx.gc.user.mapper.RedPaperRuleMapper;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -37,6 +38,7 @@
 import java.util.List;
 import java.util.Map;
 
+@Slf4j
 @Service
 @Transactional
 public class DistribService {
@@ -76,7 +78,7 @@
                     viewSettingVo.setRegularPoint(StrUtil.isEmpty(shareRatios.get(2))?0:Integer.parseInt(shareRatios.get(2)));
                     viewSettingVo.setRegularMoneyPercent(StrUtil.isEmpty(shareRatios.get(3))?BigDecimal.ZERO:new BigDecimal(shareRatios.get(3)));
 //                    viewSettingVo.setFinishOrderNum(StrUtil.isEmpty(shareRatios.get(4))?0:Integer.parseInt(shareRatios.get(4)));
-                    viewSettingVo.setPointReward(StrUtil.isEmpty(shareRatios.get(5))?0:Integer.parseInt(shareRatios.get(5)));
+                    viewSettingVo.setPointReward(StrUtil.isEmpty(shareRatios.get(4))?0:Integer.parseInt(shareRatios.get(4)));
                     viewSettingVo.setStatus(redPaperRule.getStatus());
                 }
             }else{
@@ -95,6 +97,7 @@
 
 
     public void join(String headId, String userId) {
+        log.info("#加入团队:{}, {}#", headId, userId);
         AccountInfo headInfo = accountMapper.selectOneByUserId(headId);
         if (AccountInfo.IS_HEAD_N.equals(headInfo.getIsHead())) {
             throw new RestException(-3, "不是团长");
@@ -119,15 +122,18 @@
         userHeadRelate.setHeadUserId(headId);
         userHeadRelate.setUserId(userId);
         userHeadRelate.setScore(BigDecimal.ZERO);
+        userHeadRelate.setCreatedTime(new Date());
         userHeadRelate.setAmount(BigDecimal.ZERO);
         userHeadRelateMapper.insert(userHeadRelate);
 
         SysMessage sysMessage = new SysMessage();
         sysMessage.setCreateTime(DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"));
-        sysMessage.setCreateUserId(userId);
+        sysMessage.setCreateUserId(headId);
+        sysMessage.setUserId(headId);
         sysMessage.setMobilePhone(accountInfo.getAccountName());
         sysMessage.setMessageType("4");
-        sysMessage.setMessage("手机号:" + accountInfo.getAccountName() + "的用户, 成功加入您的团队");
+        sysMessage.setMessageSubTypeName("团队消息");
+        sysMessage.setMessage("手机号:" + accountInfo.getAccountName().replaceAll("(\\w{3})\\w*(\\w{4})", "$1****$2") + "的用户, 成功加入您的团队");
         sysMessage.setFlag("2");
         sysMessageMapper.insert(sysMessage);
     }
@@ -171,7 +177,7 @@
         stringBuffer.append(pointReward);
         redPaperRule.setStatus((short) 0);
         redPaperRule.setRuleName("分销规则");
-        redPaperRule.setSharingProfitType("frist_reward,order_num_frist,regular_point,regular_money_percent,finish_order_num,point_reward");
+        redPaperRule.setSharingProfitType("frist_reward,order_num_frist,regular_point,regular_money_percent,point_reward");
         redPaperRule.setShareRatio(stringBuffer.toString());
         redPaperRuleMapper.insert(redPaperRule);
     }
@@ -193,7 +199,7 @@
             int pointReward = ObjectUtil.isEmpty(model.getPointReward()) ? 0 : model.getPointReward();
             stringBuffer.append(pointReward);
             redPaperRule.setStatus(model.getStatus());
-            redPaperRule.setSharingProfitType("first_reward,order_num_first,regular_point,regular_money_percent,finish_order_num,point_reward");
+            redPaperRule.setSharingProfitType("first_reward,order_num_first,regular_point,regular_money_percent,point_reward");
             redPaperRule.setShareRatio(stringBuffer.toString());
             redPaperRuleMapper.updateByPrimaryKey(redPaperRule);
         }
@@ -322,6 +328,11 @@
         if(CollUtil.isNotEmpty(distribDataListVos)){
             for(DistribDataListVo distribDataListVo : distribDataListVos){
                 if(ObjectUtil.isNotEmpty(distribDataListVo)){
+                    String id = distribDataListVo.getId();
+                    String kg = accountMapper.selectOrderByHeadUserId(id);
+                    distribDataListVo.setKg(kg);
+                    String jdsl = accountMapper.selectJDSLByHeadUserId(id);
+                    distribDataListVo.setJdsl(jdsl);
                 }
             }
         }
@@ -333,4 +344,8 @@
         data.put("code", 0);
         return data;
     }
+
+    public DistribDataInfoVo distribDataInfo(DistribDataInfoDto distribDataInfoDto) {
+        return accountMapper.selectDistribDataInfoVo();
+    }
 }

--
Gitblit v1.9.1