From d8359ddb48dab5cc797a9d552e11fde571f4920c Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期二, 27 八月 2019 12:32:46 +0800
Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java |   28 +++++++++++++++++++++++++---
 1 files changed, 25 insertions(+), 3 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 5b1d3dc..89e088c 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
@@ -14,9 +14,11 @@
 import org.yeshi.utils.DateUtil;
 
 import com.yeshi.fanli.dao.mybatis.tlj.UserTaoLiJinOriginMapper;
+import com.yeshi.fanli.dto.msg.MsgOtherGiveContentDTO;
 import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
 import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
 import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail;
+import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinGiveRecord;
 import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinDetail.TaoLiJinDetailTypeEnum;
 import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin;
 import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinOrigin.TaoLiJinOriginEnum;
@@ -433,7 +435,7 @@
 
 		BigDecimal total = new BigDecimal(0);
 		for (UserTaoLiJinOrigin userTaoLiJinOrigin : list) {
-			SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH.mm");
+			SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
 			String time = sd.format(userTaoLiJinOrigin.getCreateTime());
 
 			BigDecimal moneySurplus = userTaoLiJinOrigin.getMoneySurplus();
@@ -614,10 +616,12 @@
 	
 	@Override
 	@Transactional
-	public void  giveSendBack(Long uid, BigDecimal money) throws UserTaoLiJinOriginException{
-		if (uid == null || money == null) {
+	public void  giveSendBack(Long uid, UserTaoLiJinGiveRecord record) throws UserTaoLiJinOriginException{
+		if (uid == null || record == null) {
 			throw new UserTaoLiJinOriginException(1, "鍙傛暟涓嶈兘涓虹┖");
 		}
+		
+		BigDecimal money = record.getAmount();
 		
 		// 娣诲姞绾㈠寘浣欓
 		userMoneyExtraService.addTaoLiJin(uid, money, false);
@@ -632,6 +636,24 @@
 		detail.setTitle(TaoLiJinDetailTypeEnum.giveBack.getDesc());
 		detail.setCreateTime(new Date());
 		userTaoLiJinDetailService.insertSelective(detail);
+		
+		
+		executor.execute(new Runnable() {
+			@Override
+			public void run() {
+				// 閫�鍥炴秷鎭�
+				String beiZhu = "璇峰埌鎴戠殑-鎺ㄥ箍绾㈠寘鏌ョ湅";
+				SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd HH:mm");
+				MsgOtherGiveContentDTO msgOther = new MsgOtherGiveContentDTO();
+				msgOther.setType(MsgOtherGiveContentDTO.TYEP_TLJ);
+				msgOther.setTitle("璧犻�佹帹骞跨孩鍖呴��鍥�");
+				msgOther.setGiveType("浣犺禒閫佺殑"+ money + "鎺ㄥ箍绾㈠寘鏈鎴愬姛棰嗗彇");
+				msgOther.setGiveTime(sd.format(record.getGiveTime()));
+				msgOther.setReturnTime(sd.format(new Date()));
+				userOtherMsgNotificationService.tokenGiveMsg(record.getGiveUid(), beiZhu, msgOther);
+			}
+		});
+		
 	}
 	
 }

--
Gitblit v1.8.0