From 744594ef1a2f530fc3e86ea9dc48b62247f79420 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 19 五月 2020 17:13:23 +0800
Subject: [PATCH] 饿了么绘图,添加口碑

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java |  268 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 250 insertions(+), 18 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java
index a4d8747..50619da 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java
@@ -1,38 +1,270 @@
 package com.yeshi.fanli.util.factory.msg;
 
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
-import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
+import com.google.gson.Gson;
 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.util.TimeUtil;
+import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
+import com.yeshi.fanli.vo.msg.CommonMsgItemVO;
+import com.yeshi.fanli.vo.msg.CommonMsgItemVOFactory;
 
 public class MsgOtherDetailFactory {
-
+	
+	
 	/**
-	 * 杩斿埄璁㈠崟
-	 * 
+	 *  鍏嶅崟鍒哥浉鍏虫彁閱�
 	 * @param uid
-	 * @param orderId
-	 * @param goodsCount
-	 * @param orderState
-	 * @param payMoney
-	 * @param money
-	 * @param state
-	 * @param beiZhu
+	 * @param name
+	 * @param source
+	 * @param num
+	 * @param stateDesc
+	 * @param startTime
+	 * @param endTime
+	 * @param days
 	 * @return
 	 */
-	public static MsgOtherDetail createFanLiOrder(Long uid, MsgOtherCouponContentDTO content, MsgTypeOtherTypeEnum type,
-			String beiZhu) {
-		if (uid == null)
-			return null;
+	public static MsgOtherDetail freeCouponMsg(Long uid, String name, String source, int num, String stateDesc,
+			Date startTime, Date endTime) {
+		Integer days = null;
+		if (endTime != null) {
+			int cha = TimeUtil.getDayDifferenceCount(new Date(), endTime);
+			if (cha < 0)
+				days = 0;
+			else
+				days = cha + 1;
+		}
+		
+		List<CommonMsgItemVO> listMsg = new ArrayList<>();
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(name, ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(source, ClientTextStyleVO.COLOR_CONTENT)));
+		List<ClientTextStyleVO> contentList = new ArrayList<>();
+		contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+		contentList.add(new ClientTextStyleVO("寮�", ClientTextStyleVO.COLOR_CONTENT));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList));
+		
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鐘舵��", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(stateDesc, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)));
+		
+		if (days != null) {
+			List<ClientTextStyleVO> contentList2 = new ArrayList<>();
+			contentList2.add(new ClientTextStyleVO(TimeUtil.formatDateDot(startTime) + "-" + TimeUtil.formatDateDot(endTime) + "-浜�", ClientTextStyleVO.COLOR_CONTENT));
+			contentList2.add(new ClientTextStyleVO(days +"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+			contentList2.add(new ClientTextStyleVO("澶╁悗杩囨湡", ClientTextStyleVO.COLOR_CONTENT));
+			listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏈夋晥鏈�", ClientTextStyleVO.COLOR_TITLE),contentList2));
+			
+			listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE),
+					new ClientTextStyleVO("\"棣栭〉-鍏嶅崟鍟嗗搧\"涓撻涓殑鍏ㄩ儴鍟嗗搧鍙厤鍗曡喘涔�", ClientTextStyleVO.COLOR_CONTENT)));
+		}
+		
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT)));
+		
 		MsgOtherDetail detail = new MsgOtherDetail();
-		detail.setBeiZhu(beiZhu);
 		detail.setCreateTime(new Date());
 		detail.setRead(false);
 		detail.setUser(new UserInfo(uid));
-		detail.setCoupnContent(content);
+		detail.setType(MsgTypeOtherTypeEnum.couponMianDan);
+		detail.setExtraInfo(new Gson().toJson(listMsg));
 		return detail;
 	}
-
+	
+	
+	
+	/**
+	 *  濂栧姳鍒哥浉鍏虫彁閱�
+	 * @param uid
+	 * @param name
+	 * @param source
+	 * @param num
+	 * @param stateDesc
+	 * @param startTime
+	 * @param endTime
+	 * @param days
+	 * @return
+	 */
+	public static MsgOtherDetail rewardCouponMsg(Long uid, String source, int num, String stateDesc,
+			Date startTime, Date endTime) {
+		Integer days = null;
+		if (endTime != null) {
+			int cha = TimeUtil.getDayDifferenceCount(new Date(), endTime);
+			if (cha < 0)
+				days = 0;
+			else
+				days = cha + 1;
+		}
+		
+		List<CommonMsgItemVO> listMsg = new ArrayList<>();
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(source, ClientTextStyleVO.COLOR_CONTENT)));
+		
+		List<ClientTextStyleVO> contentList = new ArrayList<>();
+		contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+		contentList.add(new ClientTextStyleVO("寮�", ClientTextStyleVO.COLOR_CONTENT));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList));
+		
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鐘舵��", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(stateDesc, ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT)));
+		
+		if (days != null) {
+			List<ClientTextStyleVO> contentList2 = new ArrayList<>();
+			contentList2.add(new ClientTextStyleVO(TimeUtil.formatDateDot(startTime) + "-" + TimeUtil.formatDateDot(endTime) + "-浜�", ClientTextStyleVO.COLOR_CONTENT));
+			contentList2.add(new ClientTextStyleVO(days +"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+			contentList2.add(new ClientTextStyleVO("澶╁悗杩囨湡", ClientTextStyleVO.COLOR_CONTENT));
+			listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏈夋晥鏈�", ClientTextStyleVO.COLOR_TITLE),contentList2));
+			listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE),
+					new ClientTextStyleVO("濂栧姳鍒稿彲鍦ㄣ�怽"鎴戠殑-绂忓埄涓績\"銆戣禒閫佷粬浜�", ClientTextStyleVO.COLOR_CONTENT)));
+		}
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT)));
+		
+		MsgOtherDetail detail = new MsgOtherDetail();
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		detail.setType(MsgTypeOtherTypeEnum.couponReward);
+		detail.setExtraInfo(new Gson().toJson(listMsg));
+		return detail;
+	}
+	
+	
+	/**
+	 * 绯荤粺璧犻�侀噾甯佹彁閱�
+	 * @param uid
+	 * @param num
+	 * @param banlce
+	 * @return
+	 */
+	public static MsgOtherDetail goldCoinSystemGiveMsg(Long uid, int num, int banlce) {
+		List<CommonMsgItemVO> listMsg = new ArrayList<>();
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("绯荤粺璧犻��", ClientTextStyleVO.COLOR_CONTENT)));
+		List<ClientTextStyleVO> contentList = new ArrayList<>();
+		contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+		contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鑾峰緱鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鍙湪\"鎴戠殑-閲戝竵\"鍏戞崲濂界ぜ", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("绯荤粺璧犻�侀噾甯佹棤闇�鎵嬪姩棰嗗彇锛屽凡鑷姩杩涘叆鍒伴噾甯佽处鎴蜂腑", ClientTextStyleVO.COLOR_CONTENT)));
+		
+		MsgOtherDetail detail = new MsgOtherDetail();
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		detail.setType(MsgTypeOtherTypeEnum.goldCoin);
+		detail.setExtraInfo(new Gson().toJson(listMsg));
+		return detail;
+	}
+	
+	/**
+	 * 閲戝竵濂栧姳鎻愰啋- 閭�璇锋垚鍔�
+	 * @param uid
+	 * @param num
+	 * @param banlce
+	 * @param directFans
+	 * @return
+	 */
+	public static MsgOtherDetail goldCoinRewardInviteSucceedMsg(Long uid, int num, int banlce, boolean directFans) {
+		List<CommonMsgItemVO> listMsg = new ArrayList<>();
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("閲戝竵濂栧姳", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鎴愬姛閭�璇�" + (directFans?"鐩存帴绮変笣":"闂存帴绮変笣"), ClientTextStyleVO.COLOR_CONTENT)));
+		List<ClientTextStyleVO> contentList = new ArrayList<>();
+		contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+		contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鑾峰緱鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鍙湪\"鎴戠殑-閲戝竵\"鍏戞崲濂界ぜ", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("绯荤粺璧犻�侀噾甯佹棤闇�鎵嬪姩棰嗗彇锛屽凡鑷姩杩涘叆鍒伴噾甯佽处鎴蜂腑", ClientTextStyleVO.COLOR_CONTENT)));
+		
+		MsgOtherDetail detail = new MsgOtherDetail();
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		detail.setType(MsgTypeOtherTypeEnum.goldCoin);
+		detail.setExtraInfo(new Gson().toJson(listMsg));
+		return detail;
+	}
+	
+	
+	/**
+	 * 閲戝竵濂栧姳鎻愰啋 - 璁㈠崟鍥㈤槦鏀剁泭涓嶈冻0.01鍏冧笉瓒�0.01鍏�
+	 * @param uid
+	 * @param num
+	 * @param banlce
+	 * @param directFans
+	 * @return
+	 */
+	public static MsgOtherDetail goldCoinOrderSubsidyMsg(Long uid, int num, int banlce, boolean directFans) {
+		List<CommonMsgItemVO> listMsg = new ArrayList<>();
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("閲戝竵濂栧姳", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鏉ユ簮", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO((directFans?"鐩存帴绮変笣":"闂存帴绮変笣") +"涓嬪崟浜х敓鐨勫洟闃熸敹鐩婁笉瓒�0.01鍏�", ClientTextStyleVO.COLOR_CONTENT)));
+		List<ClientTextStyleVO> contentList = new ArrayList<>();
+		contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+		contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鑾峰緱鏁伴噺", ClientTextStyleVO.COLOR_TITLE),contentList));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("浣跨敤鑼冨洿", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鍙湪\"鎴戠殑-閲戝竵\"鍏戞崲濂界ぜ", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("绯荤粺璧犻�侀噾甯佹棤闇�鎵嬪姩棰嗗彇锛屽凡鑷姩杩涘叆鍒伴噾甯佽处鎴蜂腑", ClientTextStyleVO.COLOR_CONTENT)));
+		
+		MsgOtherDetail detail = new MsgOtherDetail();
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		detail.setType(MsgTypeOtherTypeEnum.goldCoin);
+		detail.setExtraInfo(new Gson().toJson(listMsg));
+		return detail;
+	}
+	
+	
+	/**
+	 * 閲戝竵鍏戞崲鎻愰啋
+	 * @param uid
+	 * @param num
+	 * @param banlce
+	 * @param directFans
+	 * @return
+	 */
+	public static MsgOtherDetail goldCoinExChangeMsg(Long uid, int num, int banlce, String name, String exNum) {
+		List<CommonMsgItemVO> listMsg = new ArrayList<>();
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("绫诲埆", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("閲戝竵鍏戞崲", ClientTextStyleVO.COLOR_CONTENT)));
+		List<ClientTextStyleVO> contentList = new ArrayList<>();
+		contentList.add(new ClientTextStyleVO(num+"" ,ClientTextStyleVO.COLOR_HIGHLIGHT_CONTENT));
+		contentList.add(new ClientTextStyleVO("鏋�", ClientTextStyleVO.COLOR_CONTENT));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("娑堣�楁暟閲�", ClientTextStyleVO.COLOR_TITLE),contentList));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍓╀綑鎬绘暟", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(banlce + "鏋�", ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("鍏戞崲鐗╁搧", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO(String.format("绀煎搧:%s 鏁伴噺:%s",name, exNum), ClientTextStyleVO.COLOR_CONTENT)));
+		listMsg.add(CommonMsgItemVOFactory.createMsgItemVO(new ClientTextStyleVO("澶囨敞", ClientTextStyleVO.COLOR_TITLE),
+				new ClientTextStyleVO("鏃�", ClientTextStyleVO.COLOR_CONTENT)));
+		
+		MsgOtherDetail detail = new MsgOtherDetail();
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		detail.setUser(new UserInfo(uid));
+		detail.setType(MsgTypeOtherTypeEnum.goldCoin);
+		detail.setExtraInfo(new Gson().toJson(listMsg));
+		return detail;
+	}
+	
 }

--
Gitblit v1.8.0