From 6f6c93d0cee6898fc1d3fa9d639b8273121b821d Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 28 四月 2020 09:46:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java
index 07f35d7..e0e5edc 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/order/OrderHongBaoMoneyComputeServiceImpl.java
@@ -9,6 +9,7 @@
 
 import org.springframework.stereotype.Service;
 
+import com.yeshi.fanli.dto.ConfigParamsDTO;
 import com.yeshi.fanli.dto.order.UserTeamLevel;
 import com.yeshi.fanli.dto.order.UserTeamRate;
 import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
@@ -17,6 +18,7 @@
 import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
 import com.yeshi.fanli.util.Constant;
 import com.yeshi.fanli.util.MoneyBigDecimalUtil;
+import com.yeshi.fanli.util.VersionUtil;
 import com.yeshi.fanli.util.user.UserLevelUtil;
 
 @Service
@@ -73,6 +75,10 @@
 		BigDecimal rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime())
 				.add(getOfficialSubsidyRate(order.getThirdCreateTime(),
 						getCommonUserLevel(order.getThirdCreateTime(), userLevel), false));
+		if (userLevel == UserLevelEnum.normalVIP) {
+			rate = new BigDecimal("61");
+		}
+
 		if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ)
 			return MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(rate, order.geteIncome()), new BigDecimal(100));
 		else if (order.getEstimate() != null)
@@ -86,6 +92,11 @@
 		BigDecimal rate = hongBaoManageService.getBaseFanliRate(order.getThirdCreateTime().getTime())
 				.add(getOfficialSubsidyRate(order.getThirdCreateTime(),
 						getCommonUserLevel(order.getThirdCreateTime(), userLevel), true));
+
+		if (userLevel == UserLevelEnum.normalVIP) {
+			rate = new BigDecimal("61");
+		}
+
 		if (order.getState() == CommonOrder.STATE_JS || order.getState() == CommonOrder.STATE_WQ)
 			return MoneyBigDecimalUtil.div(MoneyBigDecimalUtil.mul(rate, order.geteIncome()), new BigDecimal(100));
 		else if (order.getEstimate() != null)
@@ -217,6 +228,12 @@
 					rate = null;
 				}
 			} else if (buyerLevel == UserLevelEnum.normalVIP && firstBoss.getLevel() == UserLevelEnum.normalVIP) {
+				if (boss.getLevel() == UserLevelEnum.normalVIP)
+					rate = hongBaoManageService.getByKeyAndMaxTime("new_invite_daren_7", date.getTime());
+				else {
+					rate = null;
+				}
+			} else if (buyerLevel == UserLevelEnum.daRen && firstBoss.getLevel() == UserLevelEnum.normalVIP) {
 				if (boss.getLevel() == UserLevelEnum.normalVIP)
 					rate = hongBaoManageService.getByKeyAndMaxTime("new_invite_daren_7", date.getTime());
 				else {
@@ -361,4 +378,30 @@
 		return null;
 	}
 
+	private BigDecimal getFanliRate(Date time, UserLevelEnum userLevel) {
+		BigDecimal rate = hongBaoManageService.getBaseFanliRate(time.getTime())
+				.add(getOfficialSubsidyRate(time, getCommonUserLevel(time, userLevel), false));
+
+		if (userLevel == UserLevelEnum.normalVIP)
+			rate = new BigDecimal("61");
+		return rate;
+	}
+
+	@Override
+	public ConfigParamsDTO getShowComputeRate(String platform, String version, UserLevelEnum userLevel) {
+		BigDecimal fanLiRate = getFanliRate(new Date(), userLevel);
+		BigDecimal shareRate = fanLiRate;
+		ConfigParamsDTO paramsDTO = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
+				getFanliRate(new Date(), UserLevelEnum.superVIP));
+		if (VersionUtil.greaterThan_2_0_5(platform, version)) {
+			paramsDTO.setMaxRewardRate(null);
+		}
+		return paramsDTO;
+	}
+
+	@Override
+	public ConfigParamsDTO getShowComputeRate(String platform, String version) {
+		return getShowComputeRate(platform, version, UserLevelEnum.daRen);
+	}
+
 }

--
Gitblit v1.8.0