From 75b9f225c0fb0bbd429d542d4e20337f3c0e13f1 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 21 八月 2019 18:39:41 +0800
Subject: [PATCH] 金币获取服务修改

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
index 57dbc70..e1afd50 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/TokenRecordServiceImpl.java
@@ -102,10 +102,14 @@
 		if (StringUtil.isNullOrEmpty(parseToken)) 
 			throw new TokenRecordException(1, "鏈彂鐜板彛浠�");
 		
-		TokenRecord rokenRecord = tokenRecordMapper.getByToken(token);
+		TokenRecord rokenRecord = tokenRecordMapper.getByToken(parseToken);
 		if (rokenRecord == null)
 			throw new TokenRecordException(1, "鍙d护涓嶅瓨鍦�");
 
+		Long uidToken = rokenRecord.getUid();
+		if (uid != null && uidToken != null && uid.longValue() == uidToken.longValue())
+			throw new TokenRecordException(1, "涓嶈兘鑷繁璧犻�佺粰鑷繁");
+		
 		Date now = new Date();
 		Date endTimeToken = rokenRecord.getEndTime();
 		Integer stateTtoken = rokenRecord.getState();
@@ -252,7 +256,7 @@
 		
 		TokenVO tokenVO = new TokenVO();
 		tokenVO.setAmount(num);
-		tokenVO.setToken(token);
+		tokenVO.setToken(parseToken);
 		tokenVO.setNickName(nickName + "璧犻��");
 		tokenVO.setPortrait(portrait);
 		tokenVO.setTips(tips);
@@ -274,7 +278,11 @@
 		TokenRecord rokenRecord = tokenRecordMapper.getByToken(token);
 		if (rokenRecord == null)
 			throw new TokenRecordException(1, "鍙d护宸插け鏁�");
-
+		
+		Long uidToken = rokenRecord.getUid();
+		if (uidToken != null && uid.longValue() == uidToken.longValue())
+			throw new TokenRecordException(1, "涓嶈兘鑷繁璧犻�佺粰鑷繁");
+		
 		Date now = new Date();
 		Date endTimeToken = rokenRecord.getEndTime();
 		if (endTimeToken != null && endTimeToken.getTime() < now.getTime())

--
Gitblit v1.8.0