From b6be66a34281cc6a72d544a92244bcc876a2c773 Mon Sep 17 00:00:00 2001 From: KKSU <15274802129@163.com> Date: Thu, 29 Aug 2024 10:36:02 +0800 Subject: [PATCH] test和数据库连接 --- src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java b/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java index 69b3c72..cbdac3d 100644 --- a/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java +++ b/src/main/java/cc/mrbird/febs/mall/service/impl/MallMemberWithdrawServiceImpl.java @@ -189,6 +189,14 @@ if (!mallMember.getTradePassword().equals(SecureUtil.md5(withdrawalBalanceDto.getTradePwd()))) { throw new FebsException("支付密码错误"); } + DataDictionaryCustom coinWithdrawDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( + DataDictionaryEnum.COIN_WITHDRAW.getType(), + DataDictionaryEnum.COIN_WITHDRAW.getCode() + ); + if(!"1".equals(coinWithdrawDic.getValue())){ + throw new FebsException("暂未开放"); + } + DataDictionaryCustom withdrawAmountDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( DataDictionaryEnum.WITHDRAW_AMOUNT.getType(), @@ -199,7 +207,9 @@ if(withdrawAmount.compareTo(amount) > 0){ throw new FebsException("至少为"+withdrawAmount); } - boolean b = Integer.parseInt(amount.toString()) % Integer.parseInt(withdrawAmount.toString()) == 0; + +// boolean b = Integer.parseInt(amount.toString()) % Integer.parseInt(withdrawAmount.toString()) == 0; + boolean b = amount.remainder(withdrawAmount).compareTo(BigDecimal.ZERO) == 0; if(!b){ throw new FebsException("金额必须为"+withdrawAmount+"的整数倍"); } -- Gitblit v1.9.1