From 427737a79fe272fc0d54911fdf9d0e75a17d61a7 Mon Sep 17 00:00:00 2001
From: yujian <yujian@123.com>
Date: 星期四, 22 八月 2019 10:26:15 +0800
Subject: [PATCH] 消息

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinOriginServiceImpl.java |   26 ++++++++++++++++++++++++--
 1 files changed, 24 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 5b1d3dc..72fc286 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;
@@ -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