| | |
| | | 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;
|
| | |
|
| | |
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 新人奖励
|
| | | * @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;
|
| | | }
|
| | | |
| | |
|
| | | }
|