| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.integral.CodePublishRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralExchangeRecordService;
|
| | | import com.yeshi.fanli.service.inter.integral.IntegralExchangeService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | |
| | |
|
| | | @Resource
|
| | | private CodePublishRecordService codePublishRecordService;
|
| | | |
| | | @Resource
|
| | | private IntegralExchangeRecordService integralExchangeRecordService;
|
| | |
|
| | |
|
| | |
|
| | |
| | | exchangeTip.setType(type.name());
|
| | | return exchangeTip;
|
| | | }
|
| | | |
| | | int upperLimit = exchange.getUpperLimit();
|
| | | // 今日兑换情况
|
| | | long exchangeCount = integralExchangeRecordService.countRecordByUid(id, uid);
|
| | | if (exchangeCount >= upperLimit) {
|
| | | throw new IntegralExchangeException(1, "今日兑换已达上限");
|
| | | }
|
| | | |
| | |
|
| | | Integer goldCoinHas = extraVO.getGoldCoin();
|
| | | if (goldCoin.intValue() > goldCoinHas.intValue()) {
|
| | |
| | | if (exchange == null)
|
| | | throw new IntegralExchangeException(1, "兑换方式不存在");
|
| | |
|
| | | int upperLimit = exchange.getUpperLimit();
|
| | | // 今日兑换情况
|
| | | long exchangeCount = integralExchangeRecordService.countRecordByUid(id, uid);
|
| | | if (exchangeCount >= upperLimit) {
|
| | | throw new IntegralExchangeException(1, "今日兑换已达上限");
|
| | | }
|
| | | |
| | | Integer goldCoin = exchange.getGoldCoin();
|
| | | Integer goldCoinHas = extraVO.getGoldCoin();
|
| | | if (goldCoin.intValue() > goldCoinHas.intValue()) {
|
| | |
| | | throw new IntegralExchangeException(1, "兑换方式不存在");
|
| | | }
|
| | |
|
| | | exchangeCount ++;
|
| | | String progress = exchange.getProgress();
|
| | | if (!StringUtil.isNullOrEmpty(progress))
|
| | | progress = progress.replace("{已兑换}", 1 + "").replace("{上限数}", exchange.getUpperLimit() + "");
|
| | | progress = progress.replace("{已兑换}",exchangeCount + "").replace("{上限数}", exchange.getUpperLimit() + "");
|
| | | exchange.setProgress(progress);
|
| | |
|
| | | // 更新金币
|