From b9f8ef2c4737b6e6be4b12fc8f7bafb033bfcfe5 Mon Sep 17 00:00:00 2001
From: admin <2780501319@qq.com>
Date: 星期日, 22 九月 2019 16:47:33 +0800
Subject: [PATCH] 金币BUG修改

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java |  112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 112 insertions(+), 0 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java
index e702166..f35c8e7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgInviteDetailFactory.java
@@ -1,5 +1,117 @@
 package com.yeshi.fanli.util.factory.msg;
 
+import java.util.Date;
+
+import com.google.gson.Gson;
+import com.yeshi.fanli.dto.msg.MsgInviteContentDTO;
+import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail;
+import com.yeshi.fanli.entity.bus.msg.MsgInviteDetail.MsgTypeInviteTypeEnum;
+import com.yeshi.fanli.entity.bus.user.ThreeSale;
+import com.yeshi.fanli.entity.bus.user.UserInfo;
+import com.yeshi.fanli.util.StringUtil;
+
 public class MsgInviteDetailFactory {
 
+	/**
+	 * 閭�璇锋垚鍔�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteSuccess(ThreeSale threeSale, Long uid, String beiZhu) {
+		if (threeSale == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		detail.setCreateTime(new Date());
+		detail.setDesc("鎭枩浣狅紝鎴愬姛閭�璇蜂竴涓槦鍛�");
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.invite);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+
+		return detail;
+	}
+
+	/**
+	 * 鎵弿閭�璇蜂簩缁寸爜鎴愬姛锛屼絾鏄湭鐧诲綍
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteScanSuccess(ThreeSale threeSale, Long uid, String beiZhu) {
+		if (threeSale == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		detail.setCreateTime(new Date());
+		detail.setDesc("鎭枩浣狅紝鏈夋柊闃熷憳鍔犲叆浣犵殑闃熷垪锛岃嫢瀵规柟60澶╁唴鏈縺娲诲皢浼氫笌浣犺劚绂婚個璇峰叧绯�");
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.invite);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		return detail;
+	}
+
+	/**
+	 * 閭�璇峰け璐�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail createInviteFail(ThreeSale threeSale, Long uid, String beiZhu) {
+		if (threeSale == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		detail.setCreateTime(new Date());
+		detail.setDesc("鎶辨瓑锛岃闃熷憳鍥�60澶╁唴鏈縺娲伙紝宸茶劚绂讳簡浣犵殑闃熷垪锛屽彲浠ヨ瘯鐫�閲嶆柊閭�璇�");
+		detail.setInviteUser(threeSale);
+		detail.setMsgType(MsgTypeInviteTypeEnum.invite);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		return detail;
+	}
+	
+	
+	/**
+	 *  棰嗗彇淇℃伅婵�娲婚個璇峰叧绯�
+	 * 
+	 * @param threeSale
+	 * @param uid
+	 * @return
+	 */
+	public static MsgInviteDetail receiveGift(Long uid, String beiZhu, MsgInviteContentDTO content) {
+		if (content == null || uid == null)
+			return null;
+
+		MsgInviteDetail detail = new MsgInviteDetail();
+		if (StringUtil.isNullOrEmpty(beiZhu))
+			detail.setBeiZhu("鏃�");
+		else
+			detail.setBeiZhu(beiZhu);
+		
+		detail.setCreateTime(new Date());
+		detail.setUpdateTime(new Date());
+		detail.setDesc(new Gson().toJson(content));
+		detail.setMsgType(MsgTypeInviteTypeEnum.receiveGift);
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		return detail;
+	}
 }

--
Gitblit v1.8.0