From 33a603f2c8abe311fae3c84b0e54067580cc088c Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期五, 24 四月 2020 16:26:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div
---
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java
index 783f355..2b7c83d 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java
@@ -18,6 +18,7 @@
import org.yeshi.utils.JsonUtil;
import org.yeshi.utils.NumberUtil;
+import com.yeshi.fanli.dto.order.UserTeamLevel;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.HongBaoV2;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -39,6 +40,7 @@
import com.yeshi.fanli.service.inter.order.CommonOrderService;
import com.yeshi.fanli.service.inter.order.ESOrderService;
import com.yeshi.fanli.service.inter.order.HongBaoOrderService;
+import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMapService;
import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
import com.yeshi.fanli.service.inter.order.tb.TaoBaoWeiQuanOrderService;
@@ -97,6 +99,9 @@
@Resource
private UserVIPInfoService userVIPInfoService;
+ @Resource
+ private HongBaoV2Service hongBaoV2Service;
+
@Resource
private HongBaoOrderService hongBaoOrderService;
@@ -565,15 +570,23 @@
}
}
-
+ // 绾㈠寘鑾峰緱鑰�
HongBaoV2 hongBaoV2 = hoList.get(0).getHongBaoV2();
UserLevelEnum userLevel = UserLevelUtil.getByOrderRank(hongBaoV2.getUrank());
if (userLevel == null)
userLevel = UserLevelEnum.daRen;
UserLevelEnum upperLevel = UserLevelEnum.superVIP;
+ // 璁㈠崟璐拱鑰�
CommonOrder commonOrder1 = hoList.get(0).getCommonOrder();
Date downTime = commonOrder1.getThirdCreateTime();
+ UserLevelEnum buyer = UserLevelUtil.getByOrderRank(commonOrder1.getUrank());
+ if (buyer == null) {
+ buyer = UserLevelEnum.daRen;
+ }
+
+
+
BigDecimal upperTotalMoney = new BigDecimal(0);
List<GoodsRebateVO> voList = new ArrayList<>();
@@ -602,6 +615,7 @@
// 鍩虹浣i噾
BigDecimal commission = orderHongBaoMoneyComputeService.computeBaseFanliMoney(commonOrder);
goodsVO.setCommision("楼" +commission.setScale(2, BigDecimal.ROUND_DOWN));
+
// 骞冲彴琛ヨ创 = 杩斿埄 - 鍩虹浣i噾
goodsVO.setSubsidy("楼" + fanli.subtract(commission).setScale(2, BigDecimal.ROUND_DOWN));
// 杈句汉琛ヨ创
@@ -621,13 +635,28 @@
} else if (type == 2) {
upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeShareMoney(commonOrder, upperLevel));
} else if (type == 3) {
- upperTotalMoney = upperTotalMoney.add(hongBao);
+ List<UserTeamLevel> bossLevelList = new ArrayList<>();
+ if (hongBaoV2.getType() == HongBaoV2.TYPE_YIJI || hongBaoV2.getType() == HongBaoV2.TYPE_SHARE_YIJI) {
+ bossLevelList.add(new UserTeamLevel(null, UserLevelEnum.superVIP));
+ upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeFirstInviteMoney(commonOrder,
+ buyer, bossLevelList));
+ } else {
+ Integer bRank = hongBaoV2Service.getDirectBossUrankByPid(hongBaoOrder.getHongBaoV2().getParent().getId());
+ UserLevelEnum directBoss = UserLevelUtil.getByOrderRank(bRank);
+ if (directBoss == null) {
+ directBoss = UserLevelEnum.daRen;
+ }
+ bossLevelList.add(new UserTeamLevel(null, directBoss));
+ bossLevelList.add(new UserTeamLevel(null, UserLevelEnum.superVIP));
+ upperTotalMoney = upperTotalMoney.add(orderHongBaoMoneyComputeService.computeSecondInviteMoney(commonOrder,
+ buyer, bossLevelList));
+ }
}
}
+
orderRebateVO.setFanLiDesc(predictDesc + typeName);
orderRebateVO.setFanLi("楼" + hongBao.setScale(2, BigDecimal.ROUND_DOWN));
-
orderRebateVO.setType(type);
orderRebateVO.setStateDesc(stateDesc);
orderRebateVO.setListGoods(voList);
--
Gitblit v1.8.0