From dd5b15229cb15459fa7c31ccea77dac28cbfafbd Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 13 四月 2020 10:04:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div

---
 fanli/src/main/java/com/yeshi/fanli/service/manger/order/HongBaoV2AddManager.java |   80 +++++++++++++++-------------------------
 1 files changed, 30 insertions(+), 50 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/manger/order/HongBaoV2AddManager.java b/fanli/src/main/java/com/yeshi/fanli/service/manger/order/HongBaoV2AddManager.java
index b8ff19b..02d8abe 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/manger/order/HongBaoV2AddManager.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/manger/order/HongBaoV2AddManager.java
@@ -134,59 +134,42 @@
 						switch (t) {
 						case HongBaoV2.TYPE_ZIGOU:
 							userOrderMsgNotificationService.orderFanLiStatistic(uid, orderId, orderType,
-									commonOrder.getPayment(), money, goodsCount, state);
+									commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
+									commonOrder.getThirdCreateTime());
+
 							break;
 						case HongBaoV2.TYPE_SHARE_GOODS:
+
 							userOrderMsgNotificationService.orderShareStatistic(uid, orderId, orderType,
-									commonOrder.getPayment(), money, goodsCount, state);
+									commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
+									commonOrder.getThirdCreateTime());
+
 							break;
 						case HongBaoV2.TYPE_YIJI:
 							userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
-									commonOrder.getPayment(), money, goodsCount, state);
+									commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
+									commonOrder.getThirdCreateTime());
+
 							break;
 						case HongBaoV2.TYPE_ERJI:
+						
+							userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType, 	commonOrder.getPayment(), money,
+									goodsCount,  commonOrder.getState(), commonOrder.getThirdCreateTime());
+
+							break;
+
+						case HongBaoV2.TYPE_SHARE_YIJI:
 							userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType,
-									commonOrder.getPayment(), money, goodsCount, state);
+									commonOrder.getPayment(), money, goodsCount, commonOrder.getState(),
+									commonOrder.getThirdCreateTime());
 							break;
-						case HongBaoV2.TYPE_SHARE_YIJI:
-							userOrderMsgNotificationService.orderShareFirstLevelStatistic(uid, orderId, orderType,
-									commonOrder.getPayment(), money, goodsCount, state, notify.getBeizhu());
-							break;
-						}
-					}
-				}
+						case HongBaoV2.TYPE_SHARE_ERJI:
+						
+							userOrderMsgNotificationService.orderInviteStatistic(uid, orderId, orderType, 	commonOrder.getPayment(), money,
+									goodsCount,  commonOrder.getState(), commonOrder.getThirdCreateTime());
 
-				// 娣诲姞鏂扮増鏈�氱煡
-
-				if (!hasAdd) {
-					Iterator<Integer> its = notificationMap.keySet().iterator();
-					while (its.hasNext()) {
-						Integer t = its.next();
-						HongBaoV2 notify = notificationMap.get(t).getHongBaoV2();
-						CommonOrder commonOrder = notificationMap.get(t).getCommonOrder();
-						String orderId = commonOrderList.get(0).getOrderNo();
-						Long uid = notify.getUserInfo().getId();
-						BigDecimal money = notify.getMoney();
-						switch (t) {
-						case HongBaoV2.TYPE_ZIGOU:
-							userOrderMsgNotificationService.orderFanLiStateChanged(uid, orderId, orderType,
-									commonOrder.getPayment(), money, state);
-							break;
-						case HongBaoV2.TYPE_SHARE_GOODS:
-							userOrderMsgNotificationService.orderShareStateChanged(uid, orderId, orderType,
-									commonOrder.getPayment(), money, state);
-							break;
-						case HongBaoV2.TYPE_YIJI:
-							userOrderMsgNotificationService.orderInviteStateChanged(uid, orderId, orderType,
-									commonOrder.getPayment(), money, state);
-							break;
-						case HongBaoV2.TYPE_ERJI:
-							userOrderMsgNotificationService.orderInviteStateChanged(uid, orderId, orderType,
-									commonOrder.getPayment(), money, state);
-							break;
-						case HongBaoV2.TYPE_SHARE_YIJI:
-							userOrderMsgNotificationService.orderShareFirstLevelStateChanged(uid, orderId, orderType,
-									commonOrder.getPayment(), money, state);
+							break;	
+							
 						}
 					}
 				}
@@ -476,7 +459,7 @@
 				}
 			}
 
-			HongBaoV2 hongBao = createFanLiHongBao(commonOrder, fanliRate, mianDanMoney, vip);
+			HongBaoV2 hongBao = createFanLiHongBao(commonOrder, fanliRate, mianDanMoney);
 			if (hongBao == null)
 				return;
 			addFanLiOrShareHongBao(hongBao, commonOrder, notificationMap);
@@ -635,7 +618,8 @@
 		UserInfo user = userInfoService.selectAvailableByPrimaryKey(uid);
 		if (user == null)
 			return null;
-		boolean isVIP = userVIPInfoService.isVIP(uid);
+
+		UserLevelEnum level = userLevelManager.getUserLevel(uid);
 
 		HongBaoV2 child = new HongBaoV2();
 		child.setParent(parent);
@@ -654,13 +638,11 @@
 		}
 
 		child.setUserInfo(user);
-		child.setUrank(user.getRank());
+		child.setUrank(level.getOrderRank());
 		child.setVersion(2);
 		child.setCreateTime(new Date());
 		child.setOrderType(commonOrder.getSourceType());
 		if (child.getMoney() == null)
-			return null;
-		if (child.getMoney().compareTo(new BigDecimal(0)) <= 0 && !isVIP)
 			return null;
 		return child;
 	}
@@ -673,13 +655,11 @@
 	 *            -杩斿埄姣斾緥
 	 * @param mianDanMoney
 	 *            鍏嶅崟閲戦
-	 * @param isVIP-鏄惁涓篤IP璁㈠崟
 	 * @return
 	 * @throws HongBaoException
 	 * @throws UserAccountException
 	 */
-	private HongBaoV2 createFanLiHongBao(CommonOrder commonOrder, BigDecimal fanliRate, BigDecimal mianDanMoney,
-			boolean isVIP) throws HongBaoException, UserAccountException {
+	private HongBaoV2 createFanLiHongBao(CommonOrder commonOrder, BigDecimal fanliRate, BigDecimal mianDanMoney) throws HongBaoException, UserAccountException {
 		HongBaoV2 hongBao = new HongBaoV2();
 		hongBao.setUserInfo(commonOrder.getUserInfo());
 		hongBao.setCreateTime(new Date());

--
Gitblit v1.8.0