From 573c491b4a1ba60e12a5678a01c1546c0077c1ee Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 30 七月 2019 09:07:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java |   49 ++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 38 insertions(+), 11 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
index d7d9bb2..21bc604 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -1,14 +1,17 @@
 package com.yeshi.fanli.service.impl.msg;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.Date;
 
 import javax.annotation.Resource;
 
-import org.omg.CORBA.PERSIST_STORE;
 import org.springframework.stereotype.Service;
 
+import com.google.gson.Gson;
 import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
+import com.yeshi.fanli.dto.msg.MsgOtherTaoLiJinContentDTO;
+import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail;
 import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
 import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
@@ -111,10 +114,12 @@
 		if (coupon == null || coupon.getUid() == null)
 			return;
 		MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
-				.createWelfareCouponAlreadyOutOfDate(coupon.getSource(),coupon.getStartTime(), coupon.getEndTime());
+				.createWelfareCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
 		try {
-			msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
-					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "鍙備笌鍏朵粬娲诲姩鍙幏寰楁洿澶氬厤鍗曞埜"));
+			MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto,
+					MsgTypeOtherTypeEnum.couponWelfareMianDan, "鍙備笌鍏朵粬娲诲姩鍙幏寰楁洿澶氬厤鍗曞埜");
+			detail.setCreateTime(coupon.getEndTime());
+			msgOtherDetailService.addMsgOtherDetail(detail);
 		} catch (MsgOtherDetailException e) {
 			e.printStackTrace();
 		}
@@ -195,10 +200,13 @@
 		if (coupon == null || coupon.getUid() == null)
 			return;
 		MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
-				.createWelfareCouponAlreadyOutOfDate(coupon.getSource(),coupon.getStartTime(), coupon.getEndTime());
+				.createWelfareCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
 		try {
-			msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
-					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, "鍙備笌鍏朵粬娲诲姩鍙幏寰楁洿澶氬厤鍗曞埜"));
+			MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto,
+					MsgTypeOtherTypeEnum.couponMianDan, "鍙備笌鍏朵粬娲诲姩鍙幏寰楁洿澶氬厤鍗曞埜");
+			detail.setCreateTime(coupon.getEndTime());
+
+			msgOtherDetailService.addMsgOtherDetail(detail);
 		} catch (MsgOtherDetailException e) {
 			e.printStackTrace();
 		}
@@ -226,7 +234,7 @@
 				coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
 		try {
 			msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
-					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "杩斿埄宸插埌璐﹀悗鍐嶅鍔辫繑鍒�" + percent + "%"));
+					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "杩斿埄宸插埌璐﹀悗鍐嶅鍔辫繑鍒╃殑" + percent + "%"));
 		} catch (MsgOtherDetailException e) {
 			e.printStackTrace();
 		}
@@ -255,7 +263,7 @@
 				getLeftDay(coupon), coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
 		try {
 			msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
-					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "杩斿埄宸插埌璐﹀悗鍐嶅鍔辫繑鍒�" + percent + "%"));
+					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "杩斿埄宸插埌璐﹀悗鍐嶅鍔辫繑鍒╃殑" + percent + "%"));
 		} catch (MsgOtherDetailException e) {
 			e.printStackTrace();
 		}
@@ -268,8 +276,27 @@
 		MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
 				.createRewardCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
 		try {
-			msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
-					coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, "鍙備笌娲诲姩鍙幏鍙栨洿澶氬鍔卞埜"));
+			MsgOtherDetail detail = MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), coupon.getId(), dto,
+					MsgTypeOtherTypeEnum.couponReward, "鍙備笌娲诲姩鍙幏鍙栨洿澶氬鍔卞埜");
+			detail.setCreateTime(coupon.getEndTime());
+			msgOtherDetailService.addMsgOtherDetail(detail);
+		} catch (MsgOtherDetailException e) {
+			e.printStackTrace();
+		}
+	}
+
+	
+	@Override
+	public void taoLiJinMsg(Long uid, String beiZhu, MsgOtherTaoLiJinContentDTO content) {
+		try {
+			MsgOtherDetail detail = new MsgOtherDetail();
+			detail.setBeiZhu(beiZhu);
+			detail.setCreateTime(new Date());
+			detail.setRead(false);
+			detail.setUser(new UserInfo(uid));
+			detail.setContent(new Gson().toJson(content));
+			detail.setType(MsgTypeOtherTypeEnum.taoLiJin);
+			msgOtherDetailService.addMsgOtherDetail(detail);
 		} catch (MsgOtherDetailException e) {
 			e.printStackTrace();
 		}

--
Gitblit v1.8.0