| | |
| | | import com.yeshi.fanli.entity.redpack.RedPackWinInvite;
|
| | | import com.yeshi.fanli.exception.redpack.RedPackDetailException;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | public class RedPackDetailFactory {
|
| | |
|
| | |
| | | RedPackDetail detail = new RedPackDetail();
|
| | | detail.setId(id);
|
| | | detail.setDisplay(true);
|
| | | detail.setDescInfo("领取人ID:" + giveRecord.getReceiveUid());
|
| | | detail.setRemark("领取人ID:" + giveRecord.getReceiveUid());
|
| | | detail.setType(RedPackDetailTypeEnum.giveOthersSucceed);
|
| | | detail.setTitle(RedPackDetailTypeEnum.giveOthersSucceed.getDesc());
|
| | | detail.setIdentifyCode(
|
| | |
| | | return detail;
|
| | | }
|
| | |
|
| | | /**
|
| | | * |
| | | * @param uid
|
| | | * @param money
|
| | | * @param date
|
| | | * @return
|
| | | * @throws RedPackDetailException
|
| | | */
|
| | | public static RedPackDetail createByMonth(Long uid, BigDecimal money, Date date) throws RedPackDetailException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd");
|
| | | String time = sdf.format(date);
|
| | | |
| | | String title = sdf.format(date) + "邀请红包";
|
| | | RedPackDetail detail = new RedPackDetail();
|
| | | detail.setDisplay(true);
|
| | | detail.setUid(uid);
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(title);
|
| | | detail.setType(RedPackDetailTypeEnum.redMonthly);
|
| | | detail.setIdentifyCode(StringUtil.Md5(RedPackDetailTypeEnum.redMonthly.name() + ":" + time));
|
| | | detail.setCreateTime(new Date());
|
| | | return detail;
|
| | | }
|
| | | }
|