From b70ac86f95acd31985d6c335b5ecb3b9578876d5 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Sun, 20 Nov 2022 00:31:56 +0800
Subject: [PATCH] 20221117

---
 src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
index ddaf3f7..9233f6e 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -611,7 +611,7 @@
             BigDecimal divide = totalProfitOut.divide(totalAmount,4,BigDecimal.ROUND_DOWN);
             //提现条件收益率
             DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode());
-            BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue());
+            BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue()).multiply(new BigDecimal(0.01));
             if(divide.compareTo(outAccountProfit) < 0){
                 return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_004"));
             }
@@ -697,8 +697,13 @@
                 || ObjectUtil.isEmpty(apiTransferPasswordDto.getNewTransferPasswordAgain())){
             return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_008"));
         }
+
+        //RSA解密
+        RSA rsa = new RSA(AppContants.PRIVATE_KEY, null);
         String newTransferPassword = apiTransferPasswordDto.getNewTransferPassword();
+        newTransferPassword = rsa.decryptStr(newTransferPassword, KeyType.PrivateKey);
         String newTransferPasswordAgain = apiTransferPasswordDto.getNewTransferPasswordAgain();
+        newTransferPasswordAgain = rsa.decryptStr(newTransferPasswordAgain, KeyType.PrivateKey);
         if(!newTransferPassword.equals(newTransferPasswordAgain)){
             return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_009"));
         }
@@ -706,7 +711,7 @@
         DappMemberEntity dappMemberEntity = LoginUserUtil.getAppUser();
         Long memberId = dappMemberEntity.getId();
         DappMemberEntity memberEntity = dappMemberDao.selectById(memberId);
-        memberEntity.setTransferCode(SecureUtil.md5(apiTransferPasswordDto.getNewTransferPassword()));
+        memberEntity.setTransferCode(SecureUtil.md5(newTransferPassword));
         dappMemberDao.updateById(memberEntity);
 
         return new FebsResponse().success().message(MessageSourceUtils.getString("Operation_001"));
@@ -771,7 +776,7 @@
             BigDecimal divide = totalProfit.divide(totalAmount,4,BigDecimal.ROUND_DOWN);
             //提现条件收益率
             DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode());
-            BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue());
+            BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue()).multiply(new BigDecimal(0.01));
             if(divide.compareTo(outAccountProfit) < 0){
                 return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_004"));
             }

--
Gitblit v1.9.1