From 8c66e480d8a3c129a9032a90d39688e875f45ee5 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期一, 25 二月 2019 14:50:02 +0800
Subject: [PATCH] 奖励订单到账逻辑添加

---
 fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java |   37 ++++++++++++++++++++++++++++++++++---
 1 files changed, 34 insertions(+), 3 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 de3fc4f..3c34806 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
@@ -24,7 +24,7 @@
 	 * @param hongBaoList
 	 * @return
 	 */
-	public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType,Long hbId, BigDecimal money)
+	public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType, Long hbId, BigDecimal money)
 			throws UserMoneyDetailException {
 
 		if (StringUtil.isNullOrEmpty(orderId))
@@ -38,8 +38,8 @@
 
 		UserMoneyDetail detail = new UserMoneyDetail();
 		detail.setCreateTime(new Date());
-		detail.setIdentifyCode(
-				StringUtil.Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId+"-"+hbId));
+		detail.setIdentifyCode(StringUtil
+				.Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbId));
 		detail.setMoney(money);
 		detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
 		detail.setType(UserMoneyDetailTypeEnum.fanli);
@@ -590,4 +590,35 @@
 		return detail;
 	}
 
+	/**
+	 * 杩斿埄濂栧姳
+	 * 
+	 * @param orderId
+	 * @param money
+	 * @param user
+	 * @return
+	 * @throws UserMoneyDetailException
+	 */
+	public static UserMoneyDetail createOrderReward(String orderId, BigDecimal money, UserInfo user)
+			throws UserMoneyDetailException {
+		if (StringUtil.isNullOrEmpty(orderId))
+			throw new UserMoneyDetailException(1, "璁㈠崟鍙蜂笉鑳戒负绌�");
+		if (user == null)
+			throw new UserMoneyDetailException(1, "UID涓嶈兘涓虹┖");
+		if (money == null)
+			throw new UserMoneyDetailException(1, "閲戦涓嶈兘涓虹┖");
+
+		UserMoneyDetail detail = new UserMoneyDetail();
+		detail.setCreateTime(new Date());
+		detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.hongbao.name() + "-" + "鑰佺増鏈�" + "-" + orderId));
+		detail.setMoney(money);
+		detail.setTitle(UserMoneyDetailTypeEnum.hongbao.getDesc());
+		detail.setSubTitle("杩斿埄濂栧姳");
+		detail.setType(UserMoneyDetailTypeEnum.hongbao);
+		detail.setUpdateTime(new Date());
+		detail.setUserInfo(user);
+		detail.setDescInfo("璁㈠崟鍙�:" + orderId);
+		return detail;
+	}
+
 }

--
Gitblit v1.8.0