From df300df7832cc3d24f1b09297998e8bee8cfd126 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 20 八月 2019 18:06:43 +0800
Subject: [PATCH] 签到弹框bug

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java |   73 +++++++++++++++++++++++++++++++++++-
 1 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
index 55b62f9..5b1d3dc 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java
@@ -399,8 +399,6 @@
 		});
 	}
 	
-	
-	
 
 	@Override
 	public void overdueHongBao(Long uid) {
@@ -565,4 +563,75 @@
 		userTaoLiJinDetailService.insertSelective(detail);
 	}
 	
+	
+	@Override
+	@Transactional
+	public void exchangeMoney(Long uid, BigDecimal money) throws UserTaoLiJinOriginException{
+		if (uid == null || money == null) {
+			throw new UserTaoLiJinOriginException(1, "鍙傛暟涓嶈兘涓虹┖");
+		}
+		// 娣诲姞鐢ㄦ埛绾㈠寘
+		userMoneyExtraService.addTaoLiJin(uid, money, false);
+		// 娣诲姞鏂板璁板綍
+		UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.exchange);
+		// 绾㈠寘鏄庣粏
+		userTaoLiJinDetailService.createAddDetail(origin);
+	}
+	
+	
+	@Override
+	@Transactional
+	public UserTaoLiJinOrigin  receiveFriendsGive(Long uid, BigDecimal money) throws UserTaoLiJinOriginException{
+		if (uid == null || money == null) {
+			throw new UserTaoLiJinOriginException(1, "鍙傛暟涓嶈兘涓虹┖");
+		}
+		
+		// 娣诲姞绾㈠寘浣欓
+		userMoneyExtraService.addTaoLiJin(uid, money, false);
+		// 娣诲姞鏂板璁板綍
+		UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.friendsGive);
+		// 绾㈠寘鏄庣粏
+		userTaoLiJinDetailService.createAddDetail(origin);
+		// 娑堟伅
+		executor.execute(new Runnable() {
+			@Override
+			public void run() {
+				try {
+					MsgOtherTaoLiJinContentDTO content = new MsgOtherTaoLiJinContentDTO();
+					content.setState("绾㈠寘澧炲姞");
+					content.setSource("濂藉弸璧犻��");
+					content.setMoney(money);
+					userOtherMsgNotificationService.taoLiJinMsg(uid, "", content);
+				} catch (Exception e) {
+					LogHelper.errorDetailInfo(e);
+				}
+			}
+		});
+		return origin;
+	}
+	
+	
+	
+	@Override
+	@Transactional
+	public void  giveSendBack(Long uid, BigDecimal money) throws UserTaoLiJinOriginException{
+		if (uid == null || money == null) {
+			throw new UserTaoLiJinOriginException(1, "鍙傛暟涓嶈兘涓虹┖");
+		}
+		
+		// 娣诲姞绾㈠寘浣欓
+		userMoneyExtraService.addTaoLiJin(uid, money, false);
+		// 娣诲姞鏂板璁板綍
+		UserTaoLiJinOrigin origin = saveOrigin(uid, 1, money, TaoLiJinOriginEnum.giveSendBack);
+		// 绾㈠寘鏄庣粏
+		userTaoLiJinDetailService.createAddDetail(origin);
+		UserTaoLiJinDetail detail = new UserTaoLiJinDetail();
+		detail.setUid(uid);
+		detail.setMoney(money);
+		detail.setType(TaoLiJinDetailTypeEnum.giveBack);
+		detail.setTitle(TaoLiJinDetailTypeEnum.giveBack.getDesc());
+		detail.setCreateTime(new Date());
+		userTaoLiJinDetailService.insertSelective(detail);
+	}
+	
 }

--
Gitblit v1.8.0