From dce20aaab9d06c21fe51d5a9efcc2542f82bb6cb Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期三, 08 一月 2020 18:05:35 +0800
Subject: [PATCH] 去掉无关引入
---
fanli/src/main/java/com/yeshi/fanli/util/factory/UserMoneyDetailFactory.java | 101 ++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 93 insertions(+), 8 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 8a1651c..009cf13 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
@@ -63,7 +98,8 @@
* @return
* @throws UserMoneyDetailException
*/
- public static UserMoneyDetail createShare(Long uid, int orderType, int validCount, int weiQuanCount, BigDecimal money, Date time) throws UserMoneyDetailException {
+ public static UserMoneyDetail createShare(Long uid, int orderType, int validCount, int weiQuanCount,
+ BigDecimal money, Date time) throws UserMoneyDetailException {
if (money == null)
throw new UserMoneyDetailException(1, "杩斿埄閲戦涓虹┖");
@@ -81,7 +117,8 @@
UserMoneyDetail detail = new UserMoneyDetail();
detail.setCreateTime(new Date());
- detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.share.name() + "-" + uid + "-" + timeF));
+ detail.setIdentifyCode(
+ StringUtil.Md5(UserMoneyDetailTypeEnum.share.name() + "-" + orderType + "-" + uid + "-" + timeF));
detail.setMoney(money);
detail.setTitle(timeF + UserMoneyDetailTypeEnum.share.getDesc());
detail.setType(UserMoneyDetailTypeEnum.share);
@@ -104,7 +141,8 @@
* @return
* @throws UserMoneyDetailException
*/
- public static UserMoneyDetail createInvite(Long uid, int orderType, int validCount, int weiQuanCount, BigDecimal money, Date time) throws UserMoneyDetailException {
+ public static UserMoneyDetail createInvite(Long uid, int orderType, int validCount, int weiQuanCount,
+ BigDecimal money, Date time) throws UserMoneyDetailException {
if (money == null)
throw new UserMoneyDetailException(1, "杩斿埄閲戦涓虹┖");
@@ -122,7 +160,8 @@
UserMoneyDetail detail = new UserMoneyDetail();
detail.setCreateTime(new Date());
- detail.setIdentifyCode(StringUtil.Md5(UserMoneyDetailTypeEnum.invite.name() + "-" + uid + "-" + timeF));
+ detail.setIdentifyCode(
+ StringUtil.Md5(UserMoneyDetailTypeEnum.invite.name() + "-" + orderType + "-" + uid + "-" + timeF));
detail.setMoney(money);
detail.setTitle(timeF + UserMoneyDetailTypeEnum.invite.getDesc());
detail.setType(UserMoneyDetailTypeEnum.invite);
@@ -164,7 +203,7 @@
.Md5(UserMoneyDetailTypeEnum.fanliWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
detail.setMoney(new BigDecimal("0").subtract(money));
detail.setTitle(UserMoneyDetailTypeEnum.fanliWeiQuan.getDesc());
- detail.setSubTitle("璁㈠崟缁存潈");
+ detail.setSubTitle("璁㈠崟鍞悗");
detail.setType(UserMoneyDetailTypeEnum.fanliWeiQuan);
detail.setSourceIdentifyId(drawBack.getId());
detail.setDescInfo("璁㈠崟鍙凤細" + drawBack.getOrderId());
@@ -204,7 +243,7 @@
.Md5(UserMoneyDetailTypeEnum.shareWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
detail.setMoney(new BigDecimal("0").subtract(money));
detail.setTitle(UserMoneyDetailTypeEnum.shareWeiQuan.getDesc());
- detail.setSubTitle("璁㈠崟缁存潈");
+ detail.setSubTitle("璁㈠崟鍞悗");
detail.setType(UserMoneyDetailTypeEnum.shareWeiQuan);
detail.setSourceIdentifyId(drawBack.getId());
detail.setDescInfo("璁㈠崟鍙凤細" + UserUtil.filterOrderId(drawBack.getOrderId()));
@@ -244,7 +283,7 @@
.Md5(UserMoneyDetailTypeEnum.inviteWeiQuan.name() + "-" + uid + "-" + drawBack.getOrderItemId()));
detail.setMoney(new BigDecimal("0").subtract(money));
detail.setTitle(UserMoneyDetailTypeEnum.inviteWeiQuan.getDesc());
- detail.setSubTitle("璁㈠崟缁存潈");
+ detail.setSubTitle("璁㈠崟鍞悗");
detail.setType(UserMoneyDetailTypeEnum.inviteWeiQuan);
detail.setSourceIdentifyId(drawBack.getId());
detail.setDescInfo("璁㈠崟鍙凤細" + UserUtil.filterOrderId(drawBack.getOrderId()));
@@ -279,6 +318,7 @@
detail.setType(UserMoneyDetailTypeEnum.extract);
detail.setUpdateTime(new Date());
detail.setUserInfo(extract.getUserInfo());
+ detail.setShow(false);
return detail;
}
@@ -338,6 +378,7 @@
detail.setType(UserMoneyDetailTypeEnum.extractReject);
detail.setUpdateTime(new Date());
detail.setUserInfo(extract.getUserInfo());
+ detail.setShow(false);// 闅愯棌鎻愮幇澶辫触璁板綍
return detail;
}
@@ -439,7 +480,7 @@
detail.setUpdateTime(new Date());
detail.setUserInfo(user);
detail.setOrderType(orderType);
- // detail.setDescInfo("璁㈠崟鍙�:" + orderId);
+ detail.setDescInfo("璁㈠崟鍙�:" + orderId);
return detail;
}
@@ -516,4 +557,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