From 7a29e50e7e2eefe6c0e6e1deb53690147184e078 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期四, 29 八月 2019 18:00:12 +0800
Subject: [PATCH] 队员首单 奖励上级金币

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java
index e63e0cb..c1040fa 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java
@@ -218,12 +218,13 @@
 		String thing = "";
 		String thingNum = "";
 		int couponNews = 0;
+		boolean once = false; // 鍏戞崲涓�娆℃槸鍚︽秷澶�
 		try {
 			if (ExchangeTypeEnum.freeCouponBuy == type) {
 				thing = "鑷喘鍏嶅崟鍒�";
 				thingNum = "1寮�";
 				userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
-				
+				once = true; 
 				couponNews = 1;
 			} else if (ExchangeTypeEnum.freeCouponGive == type) {
 				thing = "璧犻�佸厤鍗曞埜";
@@ -231,7 +232,7 @@
 				userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
 				couponNews = 1;
 			} else if (ExchangeTypeEnum.rebatePercentCoupon == type) {
-				thing = "濂栧姳鍏嶅崟鍒�";
+				thing = "杩斿埄濂栧姳鍒�";
 				thingNum = "3澶�";
 				String percent = configService.get("exchange_rebate_percent");
 				userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, new BigDecimal(percent));
@@ -242,6 +243,9 @@
 				if(codePublishRecordService.countValidRecord(uid) > 0)
 					throw new IntegralExchangeException(1, "涓夊ぉ涔嬪唴涓嶅彲閲嶅鍏戞崲");
 				codePublishRecordService.publishInviteCode(uid);
+				
+				exchange.setNeedJump(true);
+				exchange.setBtnName("鍘绘煡鐪�");
 			} else if (ExchangeTypeEnum.taoLiJin == type) {
 				thing = "鎺ㄥ箍绾㈠寘";
 				thingNum = exchange.getAmount() + "鍏�";
@@ -317,6 +321,9 @@
 				}
 			});
 			
+			if (once) // 鍏戞崲涔嬪悗娑堝け
+				exchange = null;
+			
 			return exchange;
 		} catch (Exception e) {
 			LogHelper.errorDetailInfo(e);
@@ -367,7 +374,7 @@
 	
 	
 	@Override
-	public void exchangeInviteCode(Long uid, Long id) throws IntegralExchangeException {
+	public String exchangeInviteCode(Long uid, Long id) throws IntegralExchangeException {
 		if (uid == null || uid <= 0)
 			throw new IntegralExchangeException(1, "鐢ㄦ埛鏈櫥褰�");
 
@@ -401,7 +408,6 @@
 				throw new IntegralExchangeException(1, "鍏戞崲澶辫触锛岃鐢ㄦ埛閭�璇风爜涓嶅瓨鍦�");
 			
 			String inviteCode = inviteExtra.getInviteCode();
-			userInfoExtraService.activateInviteCode(uid, inviteExtra.getInviteCode());
 			
 			// 鍓╀綑閲戝竵
 			int surplus = goldCoinHas.intValue() - goldCoin.intValue();
@@ -442,11 +448,11 @@
 					userOtherMsgNotificationService.exchangeMsg(uid, beizu, msgOther);
 				}
 			});
+			
+			return inviteCode;
 		} catch (Exception e) {
 			LogHelper.errorDetailInfo(e);
 			throw new IntegralExchangeException(1, "鍏戞崲澶辫触");
 		}
-		
-		
 	}
 }

--
Gitblit v1.8.0