From 8f5ca1d337950be2a20cdb1a91a29a86fde1b07d Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期二, 12 十一月 2019 09:39:36 +0800 Subject: [PATCH] 红包封禁功能 --- fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java index d295c05..5f5ede2 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/redpack/RedPackGiveRecordServiceImpl.java @@ -20,6 +20,7 @@ import com.yeshi.fanli.entity.redpack.RedPackDetail; import com.yeshi.fanli.entity.redpack.RedPackDetail.RedPackDetailTypeEnum; import com.yeshi.fanli.entity.redpack.RedPackGiveRecord; +import com.yeshi.fanli.exception.redpack.RedPackBalanceException; import com.yeshi.fanli.exception.redpack.RedPackGiveRecordException; import com.yeshi.fanli.service.inter.money.msg.UserMoneyMsgNotificationService; import com.yeshi.fanli.service.inter.redpack.RedPackBalanceService; @@ -110,7 +111,13 @@ if (amount.compareTo(new BigDecimal(giveMin)) < 0 || amount.compareTo(new BigDecimal(giveMax)) > 0) throw new RedPackGiveRecordException(1, "璧犻�侀噾棰濊嚦灏�" + giveMin + "鍏冭嚦澶�" + giveMax + "鍏�"); - BigDecimal balance = redPackBalanceService.getBalance(uid); + BigDecimal balance = null; + try { + balance = redPackBalanceService.getBalance(uid); + } catch (RedPackBalanceException e1) { + throw new RedPackGiveRecordException(1, e1.getMsg()); + } + if (balance == null || amount.compareTo(balance) > 0) throw new RedPackGiveRecordException(1, "浣欓涓嶈冻"); -- Gitblit v1.8.0