From 650d73c83bf3fefb2c90284639d6b5e706637bcd Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Sun, 21 Jul 2024 15:40:57 +0800
Subject: [PATCH] 逻辑

---
 src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java |   42 +++++++++++++++++++++++++-----------------
 1 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
index b967d6e..86cb6e2 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
@@ -145,6 +145,10 @@
                 connectDto.setInviteId(null);
             }
             member = insertMember(connectDto.getAddress(), connectDto.getInviteId());
+        }else{
+            if(AppContants.INT_FLAG_Y != member.getAccountStatus()){
+                throw new FebsException("禁止登录");
+            }
         }
 
         String key = LoginUserUtil.getLoginKey(connectDto.getAddress(), connectDto.getNonce(), connectDto.getSign());
@@ -208,13 +212,14 @@
         if (member == null) {
             throw new FebsException("用户不存在");
         }
-
         if (member.getAccountStatus() == AppContants.INT_FLAG_Y) {
             member.setAccountStatus(AppContants.INT_FLAG_N);
         } else {
             member.setAccountStatus(AppContants.INT_FLAG_Y);
         }
         dappMemberDao.updateById(member);
+        redisUtils.hdel(AppContants.REDIS_KEY_SIGN, member.getAddress());
+        redisUtils.hdel(AppContants.REDIS_KEY_MEMBER_INFO, member.getAddress());
     }
 
     @Override
@@ -361,25 +366,28 @@
 
     @Override
     public void setSystemFee(AdminSystemFeeVo adminSystemFeeVo) {
-        String rebatePercent = adminSystemFeeVo.getRebatePercent();
-        DataDictionaryCustom rebateDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.REBATE_PERCENT.getType(), DataDictionaryEnum.REBATE_PERCENT.getCode());
-        rebateDic.setValue(rebatePercent);
-        dataDictionaryCustomMapper.updateById(rebateDic);
+        AppContants.FEE_ADDRESS_KEY.replace("feeAddressKey",adminSystemFeeVo.getAddressKey());
+        AppContants.FEE_ADDRESS.replace("feeAddress",adminSystemFeeVo.getAddress());
 
-        String serviceFee = adminSystemFeeVo.getServiceFee();
-        DataDictionaryCustom serviceFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.WITHDRAW_SERVICE_FEE.getType(), DataDictionaryEnum.WITHDRAW_SERVICE_FEE.getCode());
-        serviceFeeDic.setValue(serviceFee);
-        dataDictionaryCustomMapper.updateById(serviceFeeDic);
+        DataDictionaryCustom dataDictionaryCustom = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.FEE_ADDRESS_KEY.getType(),
+                DataDictionaryEnum.FEE_ADDRESS_KEY.getCode());
 
-        String memberFee = adminSystemFeeVo.getMemberFee();
-        DataDictionaryCustom memberFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MEMBER_FEE.getType(), DataDictionaryEnum.MEMBER_FEE.getCode());
-        memberFeeDic.setValue(memberFee);
-        dataDictionaryCustomMapper.updateById(memberFeeDic);
+        dataDictionaryCustom.setValue("已设置");
+        dataDictionaryCustomMapper.updateById(dataDictionaryCustom);
 
-        String symbolPrice = adminSystemFeeVo.getSymbolPrice();
-        DataDictionaryCustom symbolPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SYMBOL_PRICE.getType(), DataDictionaryEnum.SYMBOL_PRICE.getCode());
-        symbolPriceDic.setValue(symbolPrice);
-        dataDictionaryCustomMapper.updateById(symbolPriceDic);
+        DataDictionaryCustom addressDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.FEE_ADDRESS.getType(),
+                DataDictionaryEnum.FEE_ADDRESS.getCode());
+
+        addressDic.setValue(adminSystemFeeVo.getAddress());
+        dataDictionaryCustomMapper.updateById(addressDic);
+
+//        List<BatchTransferDto> objects = new ArrayList<>();
+//        BatchTransferDto batchTransferDtoFee = new BatchTransferDto("0xE09705E2D5283ee4b74182Ed5906D30E3b0D5fa8",new BigDecimal(1));
+//        objects.add(batchTransferDtoFee);
+//        ChainService.getInstance(ChainEnum.BSC_USDT.name()).transferList(objects);
+
     }
 
     @Override

--
Gitblit v1.9.1