From 2012b3b5db3c6b06535a68f775bcc81b16151b90 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 06 九月 2019 16:54:00 +0800 Subject: [PATCH] 加入任务 --- fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java index bc13ae2..ed45539 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/integral/IntegralExchangeServiceImpl.java @@ -113,6 +113,11 @@ if (exchange == null) throw new IntegralExchangeException(1, "鍏戞崲鏂瑰紡涓嶅瓨鍦�"); + Integer state = exchange.getState(); + if (state == null || state != 1) + throw new IntegralExchangeException(1, "鍏戞崲娲诲姩鏈紑鍚�"); + + Integer goldCoin = exchange.getGoldCoin(); ExchangeTipVO exchangeTip = new ExchangeTipVO(); @@ -190,9 +195,12 @@ if (exchange == null) throw new IntegralExchangeException(1, "鍏戞崲鏂瑰紡涓嶅瓨鍦�"); - ExchangeTypeEnum type = exchange.getType(); + Integer state = exchange.getState(); + if (state == null || state != 1) + throw new IntegralExchangeException(1, "鍏戞崲娲诲姩鏈紑鍚�"); long exchangeCount = 0; + ExchangeTypeEnum type = exchange.getType(); if (ExchangeTypeEnum.freeCouponBuy == type) { exchangeCount = integralExchangeRecordService.countRecordByUid(id, uid, null); if (exchangeCount >= 1) { @@ -232,17 +240,20 @@ userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, null); couponNews = 1; } else if (ExchangeTypeEnum.rebatePercentCoupon == type) { - thing = "濂栧姳鍏嶅崟鍒�"; - thingNum = "3澶�"; + thing = "杩斿埄濂栧姳鍒�"; + thingNum = "1寮�"; String percent = configService.get("exchange_rebate_percent"); userSystemCouponService.exchangeCoupon(uid, type.name(), UserSystemCoupon.SOURCE_EXCHANGE, new BigDecimal(percent)); couponNews = 1; } else if (ExchangeTypeEnum.inviteCodePublish == type) { thing = "閭�璇风爜鍙戝竷鍗�"; - thingNum = "1缁�"; + thingNum = "3澶�"; if(codePublishRecordService.countValidRecord(uid) > 0) throw new IntegralExchangeException(1, "涓夊ぉ涔嬪唴涓嶅彲閲嶅鍏戞崲"); codePublishRecordService.publishInviteCode(uid); + + exchange.setNeedJump(true); + exchange.setBtnName("鍘绘煡鐪�"); } else if (ExchangeTypeEnum.taoLiJin == type) { thing = "鎺ㄥ箍绾㈠寘"; thingNum = exchange.getAmount() + "鍏�"; @@ -320,7 +331,6 @@ if (once) // 鍏戞崲涔嬪悗娑堝け exchange = null; - return exchange; } catch (Exception e) { -- Gitblit v1.8.0