From b56c7f8fa63e0150f621b02f425053ce0d48c2f1 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期五, 01 十一月 2019 11:40:05 +0800 Subject: [PATCH] Merge branch 'div' of ssh://193.112.35.168:29418/fanli-server into div --- fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 94 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java b/fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java index 2ae0aaa..cd5d896 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/factory/RedPackDetailFactory.java @@ -7,6 +7,7 @@ import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum; import com.yeshi.fanli.entity.redpack.RedPackExchange; import com.yeshi.fanli.entity.redpack.RedPackGiveRecord; +import com.yeshi.fanli.entity.redpack.RedPackWinInvite; import com.yeshi.fanli.exception.redpack.RedPackDetailException; import com.yeshi.fanli.util.StringUtil; @@ -167,5 +168,98 @@ } + /** + * 鏂颁汉濂栧姳 + * @param winInvite + * @return + * @throws RedPackDetailException + */ + public static RedPackDetail createNewUserReward(RedPackWinInvite winInvite) throws RedPackDetailException { + if (winInvite == null) + throw new RedPackDetailException(1, "鑾峰緱璁板綍涓嶈兘涓虹┖"); + + // 绾㈠寘鏄庣粏- 閫�鍥炵孩鍖� + RedPackDetail detail = new RedPackDetail(); + detail.setDisplay(true); + detail.setUid(winInvite.getUid()); + detail.setMoney(winInvite.getMoney()); + detail.setDesc("瀹屾垚棣栫瑪璁㈠崟"); + detail.setTitle(RedPackDetailTypeEnum.newUserReward.getDesc()); + detail.setType(RedPackDetailTypeEnum.newUserReward); + detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.newUserReward.name() + ":" + winInvite.getId())); + detail.setCreateTime(new Date()); + return detail; + } + + /** + * 绔嬪緱鐜伴噾 + * @param winInvite + * @return + * @throws RedPackDetailException + */ + public static RedPackDetail createInvite(RedPackWinInvite winInvite) throws RedPackDetailException { + if (winInvite == null) + throw new RedPackDetailException(1, "鑾峰緱璁板綍涓嶈兘涓虹┖"); + + // 绾㈠寘鏄庣粏- 閫�鍥炵孩鍖� + RedPackDetail detail = new RedPackDetail(); + detail.setDisplay(true); + detail.setUid(winInvite.getUid()); + detail.setMoney(winInvite.getMoney()); + detail.setDesc("鎴愬姛閭�璇峰ソ鍙�"); + detail.setTitle(RedPackDetailTypeEnum.invite.getDesc()); + detail.setType(RedPackDetailTypeEnum.invite); + detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.invite.name() + ":" + winInvite.getId())); + detail.setCreateTime(new Date()); + return detail; + } + + /** + * 閫掑濂栧姳 + 濂藉弸瀹屾垚鍒嗕韩璁㈠崟 + * @param winInvite + * @return + * @throws RedPackDetailException + */ + public static RedPackDetail createIncreaseReward(RedPackWinInvite winInvite) throws RedPackDetailException { + if (winInvite == null) + throw new RedPackDetailException(1, "鑾峰緱璁板綍涓嶈兘涓虹┖"); + + // 绾㈠寘鏄庣粏- 閫�鍥炵孩鍖� + RedPackDetail detail = new RedPackDetail(); + detail.setDisplay(true); + detail.setUid(winInvite.getUid()); + detail.setMoney(winInvite.getMoney()); + detail.setDesc("濂藉弸瀹屾垚璁㈠崟"); + detail.setTitle(RedPackDetailTypeEnum.increaseReward.getDesc()); + detail.setType(RedPackDetailTypeEnum.increaseReward); + detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.increaseReward.name() + ":" + winInvite.getId())); + detail.setCreateTime(new Date()); + return detail; + } + + + /** + * 杩炵画濂栧姳 + 濂藉弸瀹屾垚鍒嗕韩璁㈠崟 + * @param winInvite + * @return + * @throws RedPackDetailException + */ + public static RedPackDetail createSeriesReward(RedPackWinInvite winInvite) throws RedPackDetailException { + if (winInvite == null) + throw new RedPackDetailException(1, "鑾峰緱璁板綍涓嶈兘涓虹┖"); + + // 绾㈠寘鏄庣粏- 閫�鍥炵孩鍖� + RedPackDetail detail = new RedPackDetail(); + detail.setDisplay(true); + detail.setUid(winInvite.getUid()); + detail.setMoney(winInvite.getMoney()); + detail.setDesc("濂藉弸瀹屾垚璁㈠崟"); + detail.setTitle(RedPackDetailTypeEnum.seriesReward.getDesc()); + detail.setType(RedPackDetailTypeEnum.seriesReward); + detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.seriesReward.name() + ":" + winInvite.getId())); + detail.setCreateTime(new Date()); + return detail; + } + } -- Gitblit v1.8.0