From 8b2191df2f7d94aa299bd43dcbe97c94e5a61bbd Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 20 十一月 2019 14:53:34 +0800
Subject: [PATCH] RocketMQ的消息整改

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

diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
index d4c24bc..82be1f4 100644
--- a/fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
+++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java
@@ -52,6 +52,41 @@
 	}
 
 	/**
+	 * 楗夸簡涔堣繑鍒�
+	 * 
+	 * @param uid
+	 * @param orderId
+	 * @param hbId
+	 * @param money
+	 * @return
+	 * @throws UserMoneyDetailException
+	 */
+	public static UserMoneyDetail createElmeFanLi(Long uid, String orderId, Long hbId, BigDecimal money)
+			throws UserMoneyDetailException {
+
+		if (StringUtil.isNullOrEmpty(orderId))
+			throw new UserMoneyDetailException(1, "璁㈠崟鍙蜂负绌�");
+
+		if (money == null)
+			throw new UserMoneyDetailException(1, "杩斿埄閲戦涓虹┖");
+
+		if (uid == null)
+			throw new UserMoneyDetailException(1, "UID涓虹┖");
+
+		UserMoneyDetail detail = new UserMoneyDetail();
+		detail.setCreateTime(new Date());
+		detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.elmeFanli.name() + "-" + hbId));
+		detail.setMoney(money);
+		detail.setTitle(UserMoneyDetailTypeEnum.elmeFanli.getDesc());
+		detail.setType(UserMoneyDetailTypeEnum.elmeFanli);
+		detail.setDescInfo("璁㈠崟鍙凤細" + orderId);
+		detail.setUpdateTime(new Date());
+		detail.setUserInfo(new UserInfo(uid));
+		detail.setOrderType(Constant.SOURCE_TYPE_ELME);
+		return detail;
+	}
+
+	/**
 	 * 鍒嗕韩濂栭噾鍒拌处
 	 * 
 	 * @param uid
@@ -281,6 +316,7 @@
 		detail.setType(UserMoneyDetailTypeEnum.extract);
 		detail.setUpdateTime(new Date());
 		detail.setUserInfo(extract.getUserInfo());
+		detail.setShow(false);
 		return detail;
 	}
 
@@ -340,6 +376,7 @@
 		detail.setType(UserMoneyDetailTypeEnum.extractReject);
 		detail.setUpdateTime(new Date());
 		detail.setUserInfo(extract.getUserInfo());
+		detail.setShow(false);// 闅愯棌鎻愮幇澶辫触璁板綍
 		return detail;
 	}
 
@@ -518,4 +555,48 @@
 		return detail;
 	}
 
+	/**
+	 * 閭�璇峰閲戝埌璐�
+	 * 
+	 * @param uid
+	 * @param validCount
+	 * @param weiQuanCount
+	 * @param invalidCount
+	 * @param money
+	 * @param time
+	 * @return
+	 * @throws UserMoneyDetailException
+	 */
+	public static UserMoneyDetail createInviteSubsidy(Long uid, int orderType, BigDecimal money, Date time)
+			throws UserMoneyDetailException {
+		if (money == null)
+			throw new UserMoneyDetailException(1, "杩斿埄閲戦涓虹┖");
+
+		if (uid == null)
+			throw new UserMoneyDetailException(1, "UID涓虹┖");
+
+		if (time == null)
+			throw new UserMoneyDetailException(1, "鍙戠敓鏃堕棿涓虹┖");
+
+		Calendar ca = Calendar.getInstance();
+		ca.setTime(time);
+		ca.add(Calendar.MONTH, -1);
+
+		String timeF = TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy.M");
+
+		UserMoneyDetail detail = new UserMoneyDetail();
+		detail.setCreateTime(new Date());
+		detail.setIdentifyCode(
+				StringUtil.Md5(UserMoneyDetailTypeEnum.subsidy.name() + "-" + orderType + "-" + uid + "-" + timeF));
+		detail.setMoney(money);
+		detail.setTitle(
+				timeF + UserMoneyDetailTypeEnum.subsidy.getDesc() + "銆�" + Constant.getSourceName(orderType) + "銆�");
+		detail.setType(UserMoneyDetailTypeEnum.subsidy);
+		detail.setDescInfo("閭�璇疯鍗曡ˉ璐�");
+		detail.setUpdateTime(new Date());
+		detail.setUserInfo(new UserInfo(uid));
+		detail.setOrderType(orderType);
+		return detail;
+	}
+
 }

--
Gitblit v1.8.0