| | |
| | | Long giveId = null;
|
| | | Date nowDate = new Date();
|
| | | try {
|
| | | String endDay = DateUtil.plusDay(Constant.GIVE_DAYS - 1, nowDate);
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
| | | Date endTime = format.parse(endDay);
|
| | | |
| | | // 赠送记录
|
| | | UserTaoLiJinGiveRecord giveRecord = new UserTaoLiJinGiveRecord();
|
| | | giveRecord.setAmount(amount);
|
| | | giveRecord.setGiveUid(uid);
|
| | | giveRecord.setState(UserTaoLiJinGiveRecord.STATE_INIT);
|
| | | giveRecord.setGiveTime(nowDate);
|
| | | giveRecord.setEndTime(endTime);
|
| | | giveRecord.setEndTime(DateUtil.plusDayDate(Constant.GIVE_DAYS, new Date()));
|
| | | userTaoLiJinGiveRecordService.insertSelective(giveRecord);
|
| | |
|
| | | giveId = giveRecord.getId();
|
| | |
| | | long num = 10000 + (long) (Math.random() * 10000);
|
| | | token = UserUtil.getInviteCode(num);
|
| | |
|
| | | String endDay = DateUtil.plusDay(Constant.TOKEN_DAYS - 1,nowDate);
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
| | | Date endTime = format.parse(endDay);
|
| | | |
| | | TokenRecord tokenRecord = new TokenRecord();
|
| | | tokenRecord.setUid(uid);
|
| | | tokenRecord.setIdentify(giveId + ""); // 记录id
|
| | | tokenRecord.setType(TokenTypeEnum.taoLiJin);
|
| | | tokenRecord.setStartTime(nowDate);
|
| | | tokenRecord.setEndTime(endTime);
|
| | | tokenRecord.setEndTime(DateUtil.plusDayDate(Constant.TOKEN_DAYS, new Date()));
|
| | | tokenRecord.setToken(token);
|
| | | tokenRecord.setState(0);
|
| | | tokenRecordService.insertSelective(tokenRecord);
|
| | |
| | | updateExtra.setUpdateTime(new Date());
|
| | | userMoneyExtraService.updateByPrimaryKeySelective(updateExtra);
|
| | |
|
| | | String tips = "送给你[%s]元推广红包快去领取吧,复制本条消息[&%s&],打开[返利券]App领取,用推广分享爆款商品,成单率更高哦。\r\n" |
| | | + "----------------------------\r\n"
|
| | | + "下载[返利券]App链接:%s\r\n"
|
| | | + "PS:口令将会24小时内失效,请及时领取。";
|
| | | |
| | | tips = String.format(tips, amount, token, configService.get("app_down_link"));
|
| | | String tips = configTaoLiJinService.getValueByKey("give_taolijin_tips");
|
| | | String projectChineseName = Constant.systemCommonConfig.getProjectChineseName();
|
| | | while(tips.contains("{APP名称}")) {
|
| | | tips = tips.replace("{APP名称}", projectChineseName);
|
| | | }
|
| | | tips = tips.replace("{口令}", token).replace("{下载链接}", configService.get("app_down_link"))
|
| | | .replace("{面额}", amount.setScale(0).toString());
|
| | |
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|