From 46b5c6fe9ec89d25565b86f71ccfb299a9aafd40 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Sun, 28 Aug 2022 00:30:14 +0800
Subject: [PATCH] fix

---
 src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
index 1c7517e..44f099b 100644
--- a/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
+++ b/src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -765,7 +765,7 @@
         BigDecimal cardProfit = totalFee.multiply(new BigDecimal("0.5"));
         BigDecimal destroy = totalFee.subtract(cardProfit);
 
-        BigDecimal preFee = cardProfit.divide(BigDecimal.valueOf(5000), 2, RoundingMode.HALF_UP);
+        BigDecimal preFee = cardProfit.divide(BigDecimal.valueOf(5000), ChainService.getInstance(ChainEnum.BSC_TFC.name()).decimals(), RoundingMode.HALF_UP);
 
         Map<String, Integer> cardCntMap = nfcCardMap();
         if (!cardCntMap.isEmpty()) {
@@ -773,14 +773,13 @@
                 BigDecimal amount = preFee.multiply(new BigDecimal(entry.getValue()));
 
                 DappMemberEntity member = dappMemberDao.selectByAddress(entry.getKey(), "BSC");
+                if (member == null) {
+                    continue;
+                }
                 DappFundFlowEntity fundFlow = new DappFundFlowEntity(member.getId(), amount, 4, 1, null, null);
                 dappFundFlowDao.insert(fundFlow);
 
                 OnlineTransferUtil.addTransfer(entry.getKey(), amount, 5, 1, ChainEnum.BSC_TFC_FEE.name(), AppContants.SYMBOL_COIN, batchNo);
-
-                Map<String, Object> map = new HashMap<>();
-                map.put("batchNo", batchNo);
-                chainProducer.sendOnlineTransfer(JSONObject.toJSONString(map));
             }
         }
 
@@ -793,7 +792,7 @@
 
     private Map<String, Integer> nfcCardMap() {
         ContractChainService nftInstance = ChainService.getInstance(ChainEnum.BSC_NFT_SDC.name());
-        BigInteger totalNFT = nftInstance.totalSupply();
+        BigInteger totalNFT = nftInstance.totalSupplyNFT();
 
         Map<String, Integer> cardCntMap = new HashMap<>();
         for (int i = 0; i < totalNFT.intValue(); i++) {

--
Gitblit v1.9.1