From 207dc8655711cddac2653e18b51e58a88dba2084 Mon Sep 17 00:00:00 2001
From: yj <Administrator@192>
Date: 星期五, 06 三月 2020 18:14:36 +0800
Subject: [PATCH] 发圈处理

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java
index 9ecc6b9..efb2880 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java
@@ -4,6 +4,7 @@
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.List;
 
 import javax.annotation.Resource;
 
@@ -287,7 +288,11 @@
 		UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
 		if (userInfoExtra == null || userInfoExtra.getFirstLoginTime() == null)
 			throw new UserTaoLiJinNewbiesException(1001, "浣犱笉鏄�滄柊鐢ㄦ埛鈥濇棤娉曚娇鐢ㄦ柊浜虹孩鍖�0鍏冭喘涔般��");
-			
+		
+		// 楠岃瘉鏄惁婵�娲�
+		if (StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
+			throw new UserTaoLiJinNewbiesException(1002, "閭�璇风爜鏈縺娲伙紝鏃犳硶浣跨敤鏂颁汉绾㈠寘0鍏冭喘涔般��");
+		
 		// 楠岃瘉鏄惁宸茶秴鍑烘柊鐢ㄦ埛瀹氫箟
 		try {
 			int days = DateUtil.daysBetween2(userInfoExtra.getFirstLoginTime(), new Date());
@@ -296,7 +301,7 @@
 		} catch (ParseException e1) {
 			throw new UserTaoLiJinNewbiesException(1, "鏃ユ湡淇℃伅璁$畻澶辫触");
 		}
-			
+		
 		// 楠岃瘉浣欓
 		UserTaoLiJinNewbies taoLiJinNewbies = userTaoLiJinNewbiesMapper.selectForUpdate(uid);
 		if (taoLiJinNewbies == null || taoLiJinNewbies.getMoney() == null ||
@@ -341,7 +346,7 @@
 	}
 	
 	
-	@Transactional
+	@Transactional(rollbackFor=Exception.class)
 	private String createTaoLiJin(Long auctionId, BigDecimal perface, int totalNum, String pid) throws UserTaoLiJinNewbiesException {
 		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
 		SimpleDateFormat formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@@ -402,4 +407,14 @@
 		return userTaoLiJinNewbiesMapper.selectByPrimaryKey(uid);
 	}
 
+	
+	@Override
+	public long count(String key) {
+		return userTaoLiJinNewbiesMapper.count(key);
+	}
+	
+	@Override
+	public List<UserTaoLiJinNewbies> query(int page, int count, String key,Integer order) {
+		return userTaoLiJinNewbiesMapper.query((page -1)* count, count, key, order);
+	}
 }

--
Gitblit v1.8.0