From f4a0f2acc63d7785eab108419a4e16f5f688cb95 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期六, 18 一月 2020 12:06:27 +0800
Subject: [PATCH] 用户注册信息

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java
index aaa96ed..711eee3 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgAccountDetailFactory.java
@@ -7,6 +7,9 @@
 import com.yeshi.fanli.entity.bus.user.UserInfo;
 import com.yeshi.fanli.util.StringUtil;
 
+import net.sf.json.JSONArray;
+import net.sf.json.JSONObject;
+
 public class MsgAccountDetailFactory {
 	public final static int TYPE_WX = 1;// 寰俊
 	public final static int TYPE_TB = 2;// 娣樺疂
@@ -22,11 +25,11 @@
 	public static MsgAccountDetail createBindingAccount(Long uid, int type) {
 		String msg = "";
 		if (type == TYPE_PHONE) {
-			msg = "<red>鎭枩浣犳墜鏈哄彿缁戝畾鎴愬姛<red>";
+			msg = "<highlight>鎭枩浣犳墜鏈哄彿缁戝畾鎴愬姛</highlight>";
 		} else if (type == TYPE_TB) {
-			msg = "<red>鎭枩浣犳窐瀹濈粦瀹氭垚鍔�<red>";
+			msg = "<highlight>鎭枩浣犳窐瀹濈粦瀹氭垚鍔�</highlight>";
 		} else if (type == TYPE_WX) {
-			msg = "<red>鎭枩浣犲井淇$粦瀹氭垚鍔�<red>";
+			msg = "<highlight>鎭枩浣犲井淇$粦瀹氭垚鍔�</highlight>";
 		}
 		if (StringUtil.isNullOrEmpty(msg))
 			return null;
@@ -122,6 +125,50 @@
 		return detail;
 	}
 
-	// TODO 璐﹀彿绛夌骇
+	// 璐﹀彿绛夌骇
+	public static MsgAccountDetail createUserRank(Long uid, String orderType, int orderCount, String rankName) {
+		if (uid == null || rankName == null)
+			return null;
+
+		String msg = String.format(
+				"鎭枩浣狅紝涓婃湀<highlight>%s</highlight>璁㈠崟杈惧埌<highlight>%s</highlight>鍗曪紝宸蹭负浣犲崌绾т负<highlight>%s</highlight>鐢ㄦ埛锛屽皢浼氳幏寰楀搴旂殑绂忓埄鍜岀壒鏉冦��",
+				orderType, orderCount + "", rankName);
+		MsgAccountDetail detail = new MsgAccountDetail();
+		detail.setBeiZhu("鏃�");
+		detail.setContent(msg);
+		detail.setTitle("璐﹀彿绛夌骇");
+		detail.setType(MsgTypeAccountTypeEnum.level);
+		detail.setUser(new UserInfo(uid));
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		return detail;
+	}
+
+	// 娣樺疂鎺堟潈澶辫触
+	public static MsgAccountDetail createTaoBaoAuthFail(Long uid, String taoBaoNickName, String reason) {
+		if (uid == null || reason == null)
+			return null;
+
+		JSONArray msg = new JSONArray();
+		JSONObject item = new JSONObject();
+		item.put("name", "璐﹀彿");
+		item.put("content", String.format("娣樺疂鏄电О[%s]", taoBaoNickName));
+		msg.add(item);
+
+		item = new JSONObject();
+		item.put("name", "鍘熷洜");
+		item.put("content", reason);
+		msg.add(item);
+
+		MsgAccountDetail detail = new MsgAccountDetail();
+		detail.setBeiZhu("鏃�");
+		detail.setContent(msg.toString());
+		detail.setTitle("娣樺疂璐﹀彿鎺堟潈澶辫触");
+		detail.setType(MsgTypeAccountTypeEnum.taoBaoAuthFail);
+		detail.setUser(new UserInfo(uid));
+		detail.setCreateTime(new Date());
+		detail.setRead(false);
+		return detail;
+	}
 
 }

--
Gitblit v1.8.0