| | |
| | |
|
| | | try {
|
| | | ExchangeTypeEnum type = exchange.getType();
|
| | | if (ExchangeTypeEnum.freeCouponBuy == type) {
|
| | | // 自购免单券
|
| | | userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, false, null);
|
| | | } else if (ExchangeTypeEnum.freeCouponGive == type) {
|
| | | // 赠送免单券
|
| | | userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, true, null);
|
| | | if (ExchangeTypeEnum.freeCouponBuy == type || ExchangeTypeEnum.freeCouponGive == type) {
|
| | | // 自购免单券、赠送免单券
|
| | | userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null);
|
| | | } else if (ExchangeTypeEnum.rebatePercentCoupon == type) {
|
| | | // 奖励免单券
|
| | | userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, true,
|
| | | new BigDecimal(10));
|
| | | userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, new BigDecimal(10));
|
| | | } else if (ExchangeTypeEnum.inviteCodePublish == type) {
|
| | | // 邀请码发布
|
| | | if(codePublishRecordService.countValidRecord(uid) > 0)
|
| | |
| | | extraUpdate.setId(extraVO.getId());
|
| | | extraUpdate.setGoldCoin(goldCoinHas.intValue() - goldCoin.intValue());
|
| | | userInfoExtraService.saveUserInfoExtra(extraUpdate);
|
| | | |
| | | exchange.setUserGoldCoin(extraUpdate.getGoldCoin() + "枚");
|
| | | |
| | | return exchange;
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|