From 86c9e2f51f0b8b0fb1a6ee4b6d6a703878ad53e8 Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Fri, 11 Aug 2023 16:56:24 +0800
Subject: [PATCH] 数据修改

---
 src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java | 3099 ++++++++++++++++++++++++++++++++--------------------------
 1 files changed, 1,701 insertions(+), 1,398 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 34ed979..24cc842 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
@@ -98,7 +98,7 @@
             BigDecimal directProfit = TreeConstants.PUT_IN_AMOUNT.multiply(new BigDecimal("0.1"));
             dappWalletService.updateWalletCoinWithLock(directProfit, parent.getId(), 1);
 
-            DappFundFlowEntity fundFlow = new DappFundFlowEntity(parent.getId(), directProfit, 3, 2, null, null);
+            DappFundFlowEntity fundFlow = new DappFundFlowEntity();
             dappFundFlowDao.insert(fundFlow);
         }
 
@@ -128,11 +128,11 @@
 
                 dappWalletService.updateWalletCoinWithLock(amount, member.getId(), 1);
 
-                DappFundFlowEntity matrixProfitFlow = new DappFundFlowEntity(memberId, amount, 2, 2, null, null);
+                DappFundFlowEntity matrixProfitFlow = new DappFundFlowEntity();
                 dappFundFlowDao.insert(matrixProfitFlow);
             }
 
-            DappFundFlowEntity rePutInFlow = new DappFundFlowEntity(memberId, TreeConstants.PUT_IN_AMOUNT.negate(), 1, 2, null, null);
+            DappFundFlowEntity rePutInFlow = new DappFundFlowEntity();
             dappFundFlowDao.insert(rePutInFlow);
         }
     }
@@ -161,7 +161,7 @@
 
             list.forEach(item -> {
                 dappWalletService.updateWalletCoinWithLock(preAmount, item.getMidNode(), 1);
-                DappFundFlowEntity flow = new DappFundFlowEntity(item.getMidNode(), preAmount, 8, 2, null, null);
+                DappFundFlowEntity flow = new DappFundFlowEntity();
                 dappFundFlowDao.insert(flow);
             });
         }
@@ -186,186 +186,186 @@
             return;
         }
 
-        DataDictionaryCustom memberFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MEMBER_FEE.getType(), DataDictionaryEnum.MEMBER_FEE.getCode());
-        if (memberFeeDic == null) {
-            log.info("未设置手续费返利比例");
-            return;
-        }
-        List<DappMemberEntity> memberList = dappMemberDao.selectMemberListNeedProfit();
-        if (CollUtil.isEmpty(memberList)) {
-            return;
-        }
-
-        BigDecimal feeReturnRatio = new BigDecimal(memberFeeDic.getValue());
-        int size = memberList.size();
-        BigDecimal totalProfit = fundFlow.getFee().multiply(feeReturnRatio.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_DOWN));
-        BigDecimal perProfit = totalProfit.divide(BigDecimal.valueOf(size), 8, RoundingMode.HALF_DOWN);
-
-        memberList.forEach(item -> {
-            dappWalletService.updateWalletMineWithLock(perProfit, item.getId(), 1);
-
-            DappFundFlowEntity profitFlow = new DappFundFlowEntity(item.getId(), perProfit, 12, 2, null, null);
-            dappFundFlowDao.insert(profitFlow);
-        });
+//        DataDictionaryCustom memberFeeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.MEMBER_FEE.getType(), DataDictionaryEnum.MEMBER_FEE.getCode());
+//        if (memberFeeDic == null) {
+//            log.info("未设置手续费返利比例");
+//            return;
+//        }
+//        List<DappMemberEntity> memberList = dappMemberDao.selectMemberListNeedProfit();
+//        if (CollUtil.isEmpty(memberList)) {
+//            return;
+//        }
+//
+//        BigDecimal feeReturnRatio = new BigDecimal(memberFeeDic.getValue());
+//        int size = memberList.size();
+//        BigDecimal totalProfit = fundFlow.getFee().multiply(feeReturnRatio.divide(BigDecimal.valueOf(100), 2, RoundingMode.HALF_DOWN));
+//        BigDecimal perProfit = totalProfit.divide(BigDecimal.valueOf(size), 8, RoundingMode.HALF_DOWN);
+//
+//        memberList.forEach(item -> {
+//            dappWalletService.updateWalletMineWithLock(perProfit, item.getId(), 1);
+//
+//            DappFundFlowEntity profitFlow = new DappFundFlowEntity(item.getId(), perProfit, 12, 2, null, null);
+//            dappFundFlowDao.insert(profitFlow);
+//        });
     }
 
     @Override
     public void levelProfit(Long id) {
-        DappSystemProfit dappSystemProfit = dappSystemProfitDao.selectById(id);
-        if(ObjectUtil.isEmpty(dappSystemProfit)){
-            return;
-        }
-        Integer levelProfitState = dappSystemProfit.getLevelProfit();
-
-        if(DappSystemProfit.ENUM_YES == levelProfitState){
-            return;
-        }
-        Long memberId = dappSystemProfit.getMemberId();
-        //获取用户的上级用户信息
-        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
-        if(ObjectUtil.isEmpty(dappMemberEntity)){
-            return;
-        }
-        String refererIds = dappMemberEntity.getRefererIds();
-        if(StrUtil.isEmpty(refererIds)){
-            return;
-        }
-        DataDictionaryCustom levelProfitSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.LEVEL_PROFIT.getType(), DataDictionaryEnum.LEVEL_PROFIT.getCode());
-        BigDecimal levelProfit = new BigDecimal(StrUtil.isEmpty(levelProfitSet.getValue()) ? "0.3" : levelProfitSet.getValue());
-        //投入金额减去技术方收益
-        DataDictionaryCustom systemProfitSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SYSTEM_PROFIT.getType(), DataDictionaryEnum.SYSTEM_PROFIT.getCode());
-        BigDecimal systemProfit = new BigDecimal(StrUtil.isEmpty(systemProfitSet.getValue()) ? "0.05" : systemProfitSet.getValue());
-        BigDecimal amount = dappSystemProfit.getAmount().subtract(systemProfit);
-        //层级奖励总奖金
-        BigDecimal levelProfitTotal = amount.multiply(levelProfit);
-        //实发层级奖励 -- 如果还有剩余给技术方
-        BigDecimal systemProfitTotal = BigDecimal.ZERO;
-        //返回十层
-        List<String> refererIdList = StrUtil.split(refererIds, ',');
-        //i:计数层数,同时i也为对应层数应推广的人数,当达到对应的直推人数时,才能获取对应层级奖励
-        if(CollUtil.isEmpty(refererIdList)){
-            return;
-        }
-        //层级奖励最大循环次数
-        int maxLevel = 10;
-        if(maxLevel > refererIdList.size()){
-            maxLevel = refererIdList.size();
-        }
-        for(int i = 0;i < maxLevel; i++){
-            if(systemProfitTotal.compareTo(levelProfitTotal) < 0){
-                String inviteId = refererIdList.get(i);
-                //获取每层用户的直推人数,判断能否获得这个层级的层级奖励
-                DappMemberEntity refererMember = dappMemberDao.selectMemberInfoByInviteId(inviteId);
-                //获取直推用户数量
-                QueryWrapper<DappMemberEntity> objectQueryWrapper = new QueryWrapper<>();
-                objectQueryWrapper.eq("referer_id",refererMember.getInviteId());
-                Integer selectCount = dappMemberDao.selectCount(objectQueryWrapper);
-                if(i >= selectCount){
-                    continue;
-                }
-                //获取对应层级奖励
-                BigDecimal profit = LevelProfitEnum.YI.getProfit(i+1);
-                String accountType = refererMember.getAccountType();
-                //根据会员的等级类型,获取对应的百分比收益
-                DataDictionaryCustom memberLevelSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("MEMBER_LEVEL", accountType);
-                BigDecimal memberLevel = new BigDecimal(memberLevelSet.getValue());
-
-//                BigDecimal memberLevelProfit = levelProfitTotal.multiply(profit).multiply(memberLevel);
-
-                BigDecimal memberLevelProfit = profit.multiply(memberLevel);
-
-                DappFundFlowEntity fundFlow = new DappFundFlowEntity(refererMember.getId(), memberLevelProfit, 4, 1, BigDecimal.ZERO,null,dappSystemProfit.getId());
-                dappFundFlowDao.insert(fundFlow);
-                //发送转币消息
-                chainProducer.sendBnbTransferMsg(fundFlow.getId());
-                systemProfitTotal = systemProfitTotal.add(memberLevelProfit);
-            }
-        }
-        //如果还有剩余给技术方
-        if(levelProfitTotal.compareTo(systemProfitTotal) > 0){
-            BigDecimal avaProfit = levelProfitTotal.subtract(systemProfitTotal);
-            DappFundFlowEntity fundFlow = new DappFundFlowEntity(2L, avaProfit, 5, 1, BigDecimal.ZERO,null,dappSystemProfit.getId());
-            dappFundFlowDao.insert(fundFlow);
-            //发送转币消息
-            chainProducer.sendBnbTransferMsg(fundFlow.getId());
-        }
-
-        dappSystemProfitDao.updateLevelProfitById(DappSystemProfit.ENUM_YES,dappSystemProfit.getId());
+//        DappSystemProfit dappSystemProfit = dappSystemProfitDao.selectById(id);
+//        if(ObjectUtil.isEmpty(dappSystemProfit)){
+//            return;
+//        }
+//        Integer levelProfitState = dappSystemProfit.getLevelProfit();
+//
+//        if(DappSystemProfit.ENUM_YES == levelProfitState){
+//            return;
+//        }
+//        Long memberId = dappSystemProfit.getMemberId();
+//        //获取用户的上级用户信息
+//        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
+//        if(ObjectUtil.isEmpty(dappMemberEntity)){
+//            return;
+//        }
+//        String refererIds = dappMemberEntity.getRefererIds();
+//        if(StrUtil.isEmpty(refererIds)){
+//            return;
+//        }
+//        DataDictionaryCustom levelProfitSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.LEVEL_PROFIT.getType(), DataDictionaryEnum.LEVEL_PROFIT.getCode());
+//        BigDecimal levelProfit = new BigDecimal(StrUtil.isEmpty(levelProfitSet.getValue()) ? "0.3" : levelProfitSet.getValue());
+//        //投入金额减去技术方收益
+//        DataDictionaryCustom systemProfitSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.SYSTEM_PROFIT.getType(), DataDictionaryEnum.SYSTEM_PROFIT.getCode());
+//        BigDecimal systemProfit = new BigDecimal(StrUtil.isEmpty(systemProfitSet.getValue()) ? "0.05" : systemProfitSet.getValue());
+//        BigDecimal amount = dappSystemProfit.getAmount().subtract(systemProfit);
+//        //层级奖励总奖金
+//        BigDecimal levelProfitTotal = amount.multiply(levelProfit);
+//        //实发层级奖励 -- 如果还有剩余给技术方
+//        BigDecimal systemProfitTotal = BigDecimal.ZERO;
+//        //返回十层
+//        List<String> refererIdList = StrUtil.split(refererIds, ',');
+//        //i:计数层数,同时i也为对应层数应推广的人数,当达到对应的直推人数时,才能获取对应层级奖励
+//        if(CollUtil.isEmpty(refererIdList)){
+//            return;
+//        }
+//        //层级奖励最大循环次数
+//        int maxLevel = 10;
+//        if(maxLevel > refererIdList.size()){
+//            maxLevel = refererIdList.size();
+//        }
+//        for(int i = 0;i < maxLevel; i++){
+//            if(systemProfitTotal.compareTo(levelProfitTotal) < 0){
+//                String inviteId = refererIdList.get(i);
+//                //获取每层用户的直推人数,判断能否获得这个层级的层级奖励
+//                DappMemberEntity refererMember = dappMemberDao.selectMemberInfoByInviteId(inviteId);
+//                //获取直推用户数量
+//                QueryWrapper<DappMemberEntity> objectQueryWrapper = new QueryWrapper<>();
+//                objectQueryWrapper.eq("referer_id",refererMember.getInviteId());
+//                Integer selectCount = dappMemberDao.selectCount(objectQueryWrapper);
+//                if(i >= selectCount){
+//                    continue;
+//                }
+//                //获取对应层级奖励
+//                BigDecimal profit = LevelProfitEnum.YI.getProfit(i+1);
+//                String accountType = refererMember.getAccountType();
+//                //根据会员的等级类型,获取对应的百分比收益
+//                DataDictionaryCustom memberLevelSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("MEMBER_LEVEL", accountType);
+//                BigDecimal memberLevel = new BigDecimal(memberLevelSet.getValue());
+//
+////                BigDecimal memberLevelProfit = levelProfitTotal.multiply(profit).multiply(memberLevel);
+//
+//                BigDecimal memberLevelProfit = profit.multiply(memberLevel);
+//
+//                DappFundFlowEntity fundFlow = new DappFundFlowEntity(refererMember.getId(), memberLevelProfit, 4, 1, BigDecimal.ZERO,null,dappSystemProfit.getId());
+//                dappFundFlowDao.insert(fundFlow);
+//                //发送转币消息
+//                chainProducer.sendBnbTransferMsg(fundFlow.getId());
+//                systemProfitTotal = systemProfitTotal.add(memberLevelProfit);
+//            }
+//        }
+//        //如果还有剩余给技术方
+//        if(levelProfitTotal.compareTo(systemProfitTotal) > 0){
+//            BigDecimal avaProfit = levelProfitTotal.subtract(systemProfitTotal);
+//            DappFundFlowEntity fundFlow = new DappFundFlowEntity(2L, avaProfit, 5, 1, BigDecimal.ZERO,null,dappSystemProfit.getId());
+//            dappFundFlowDao.insert(fundFlow);
+//            //发送转币消息
+//            chainProducer.sendBnbTransferMsg(fundFlow.getId());
+//        }
+//
+//        dappSystemProfitDao.updateLevelProfitById(DappSystemProfit.ENUM_YES,dappSystemProfit.getId());
     }
 
     @Override
     public void memberOut(Long id) {
         //验证是否已经加入动能队列
-        DappSystemProfit systemProfit = dappSystemProfitDao.selectById(id);
-        if(ObjectUtil.isEmpty(systemProfit)){
-            return;
-        }
-        //获取当前是第几轮队列
-        String redisKey = "QUEUE_COUNT";
-        String memberOutCount = redisUtils.getString(redisKey);
-        DataDictionaryCustom queueCountSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.QUEUE_COUNT.getType(), DataDictionaryEnum.QUEUE_COUNT.getCode());
-        String queueCount = queueCountSet.getValue();
-        if(StrUtil.isBlank(memberOutCount) || !queueCount.equals(memberOutCount)){
-            redisUtils.set(redisKey,queueCount,0L);
-            memberOutCount = queueCount;
-        }
-        //出局条件的人数
-        /**
-         * 初始大小 5+4*0
-         * 1  1,2,3,4,5  1出局 5+4*0
-         * 2  2,3,4,5,1(复投),7,8,9,10  2出局 5+4*1
-         * 3  3,4,5,1(复投),7,8,9,10,2(复投),12,13,14,15 3出局 5+4*2
-         * 4  4,5,1(复投),7,8,9,10,2(复投),12,13,14,15,3(复投),17,18,19,20  4出局 5+4*3
-         */
-        Integer memberCount = Integer.parseInt(memberOutCount) * 4 + 5;
-        //判断当前是否符合出局条件
-        QueryWrapper<DappSystemProfit> objectQueryWrapper = new QueryWrapper<>();
-        objectQueryWrapper.eq("state",DappSystemProfit.STATE_IN);
-        //实际投资人数
-        Integer selectCount = dappSystemProfitDao.selectCount(objectQueryWrapper);
-        //实际投资人数小于出局条件人数
-        if(selectCount < memberCount){
-            return;
-        }
-        //符合则出局 实际投资人数等于出局条件人数
-        DappSystemProfit dappSystemProfit = dappSystemProfitDao.selectSystemProfitByState(DappSystemProfit.STATE_IN);
-        if(ObjectUtil.isEmpty(dappSystemProfit)){
-            return;
-        }
-        //符合则出局,轮数+1
-        Integer realCount = (Integer.parseInt(queueCount) + 1);
-        queueCountSet.setValue(realCount.toString());
-        dataDictionaryCustomMapper.updateById(queueCountSet);
-        redisUtils.set(redisKey,realCount,0L);
-
-        DappSystemProfit dappSystemProfitNow = dappSystemProfitDao.selectByIdForUpdate(dappSystemProfit.getId(),DappSystemProfit.STATE_IN);
-        dappSystemProfitDao.updateStateById(DappSystemProfit.STATE_OUT,dappSystemProfitNow.getId());
-
-        // 直接拿走0.95ge
-
-        DataDictionaryCustom investAmountProfitSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.INVEST_AMOUNT_PROFIT.getType(), DataDictionaryEnum.INVEST_AMOUNT_PROFIT.getCode());
-        BigDecimal investAmountProfit = new BigDecimal(investAmountProfitSet.getValue());
-        DappFundFlowEntity fundFlowOut = new DappFundFlowEntity(dappSystemProfitNow.getMemberId(), investAmountProfit, 7, 1, BigDecimal.ZERO, null,dappSystemProfitNow.getId());
-        dappFundFlowDao.insert(fundFlowOut);
-        //发送转币消息
-        chainProducer.sendBnbTransferMsg(fundFlowOut.getId());
-        //复投 成功{type: 1, txHash: result.transactionHash, id: res.data, flag: 'success', buyType: 2}
-        DataDictionaryCustom investAmountSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.INVEST_AMOUNT.getType(), DataDictionaryEnum.INVEST_AMOUNT.getCode());
-        BigDecimal investAmount = new BigDecimal(investAmountSet.getValue());
-        //todo 直接运行转账
-        String txHash = "复投";
-        DappFundFlowEntity fundFlow = new DappFundFlowEntity(dappSystemProfitNow.getMemberId(), investAmount, 6, 1, BigDecimal.ZERO, txHash);
-        dappFundFlowDao.insert(fundFlow);
-
-        TransferDto transferDto = new TransferDto();
-        transferDto.setType(1);
-        transferDto.setTxHash(txHash);
-        transferDto.setBuyType(2);
-        transferDto.setId(fundFlow.getId());
-        transferDto.setFlag("success");
-        transferDto.setAmount(investAmount);
-        transferDto.setMemberId(dappSystemProfitNow.getMemberId());
-        dappWalletService.transferAgain(transferDto);
+//        DappSystemProfit systemProfit = dappSystemProfitDao.selectById(id);
+//        if(ObjectUtil.isEmpty(systemProfit)){
+//            return;
+//        }
+//        //获取当前是第几轮队列
+//        String redisKey = "QUEUE_COUNT";
+//        String memberOutCount = redisUtils.getString(redisKey);
+//        DataDictionaryCustom queueCountSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.QUEUE_COUNT.getType(), DataDictionaryEnum.QUEUE_COUNT.getCode());
+//        String queueCount = queueCountSet.getValue();
+//        if(StrUtil.isBlank(memberOutCount) || !queueCount.equals(memberOutCount)){
+//            redisUtils.set(redisKey,queueCount,0L);
+//            memberOutCount = queueCount;
+//        }
+//        //出局条件的人数
+//        /**
+//         * 初始大小 5+4*0
+//         * 1  1,2,3,4,5  1出局 5+4*0
+//         * 2  2,3,4,5,1(复投),7,8,9,10  2出局 5+4*1
+//         * 3  3,4,5,1(复投),7,8,9,10,2(复投),12,13,14,15 3出局 5+4*2
+//         * 4  4,5,1(复投),7,8,9,10,2(复投),12,13,14,15,3(复投),17,18,19,20  4出局 5+4*3
+//         */
+//        Integer memberCount = Integer.parseInt(memberOutCount) * 4 + 5;
+//        //判断当前是否符合出局条件
+//        QueryWrapper<DappSystemProfit> objectQueryWrapper = new QueryWrapper<>();
+//        objectQueryWrapper.eq("state",DappSystemProfit.STATE_IN);
+//        //实际投资人数
+//        Integer selectCount = dappSystemProfitDao.selectCount(objectQueryWrapper);
+//        //实际投资人数小于出局条件人数
+//        if(selectCount < memberCount){
+//            return;
+//        }
+//        //符合则出局 实际投资人数等于出局条件人数
+//        DappSystemProfit dappSystemProfit = dappSystemProfitDao.selectSystemProfitByState(DappSystemProfit.STATE_IN);
+//        if(ObjectUtil.isEmpty(dappSystemProfit)){
+//            return;
+//        }
+//        //符合则出局,轮数+1
+//        Integer realCount = (Integer.parseInt(queueCount) + 1);
+//        queueCountSet.setValue(realCount.toString());
+//        dataDictionaryCustomMapper.updateById(queueCountSet);
+//        redisUtils.set(redisKey,realCount,0L);
+//
+//        DappSystemProfit dappSystemProfitNow = dappSystemProfitDao.selectByIdForUpdate(dappSystemProfit.getId(),DappSystemProfit.STATE_IN);
+//        dappSystemProfitDao.updateStateById(DappSystemProfit.STATE_OUT,dappSystemProfitNow.getId());
+//
+//        // 直接拿走0.95ge
+//
+//        DataDictionaryCustom investAmountProfitSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.INVEST_AMOUNT_PROFIT.getType(), DataDictionaryEnum.INVEST_AMOUNT_PROFIT.getCode());
+//        BigDecimal investAmountProfit = new BigDecimal(investAmountProfitSet.getValue());
+//        DappFundFlowEntity fundFlowOut = new DappFundFlowEntity(dappSystemProfitNow.getMemberId(), investAmountProfit, 7, 1, BigDecimal.ZERO, null,dappSystemProfitNow.getId());
+//        dappFundFlowDao.insert(fundFlowOut);
+//        //发送转币消息
+//        chainProducer.sendBnbTransferMsg(fundFlowOut.getId());
+//        //复投 成功{type: 1, txHash: result.transactionHash, id: res.data, flag: 'success', buyType: 2}
+//        DataDictionaryCustom investAmountSet = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.INVEST_AMOUNT.getType(), DataDictionaryEnum.INVEST_AMOUNT.getCode());
+//        BigDecimal investAmount = new BigDecimal(investAmountSet.getValue());
+//        //todo 直接运行转账
+//        String txHash = "复投";
+//        DappFundFlowEntity fundFlow = new DappFundFlowEntity(dappSystemProfitNow.getMemberId(), investAmount, 6, 1, BigDecimal.ZERO, txHash);
+//        dappFundFlowDao.insert(fundFlow);
+//
+//        TransferDto transferDto = new TransferDto();
+//        transferDto.setType(1);
+//        transferDto.setTxHash(txHash);
+//        transferDto.setBuyType(2);
+//        transferDto.setId(fundFlow.getId());
+//        transferDto.setFlag("success");
+//        transferDto.setAmount(investAmount);
+//        transferDto.setMemberId(dappSystemProfitNow.getMemberId());
+//        dappWalletService.transferAgain(transferDto);
     }
 
     @Override
@@ -411,62 +411,62 @@
     @Override
     public void agentUp(Long id) {
         //根据邀请码获取用户信息
-        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id);
-        if(ObjectUtil.isEmpty(dappMemberEntity)){
-            return;
-        }
-        //所有上级(不包含直属上级)
-        String refererIds = dappMemberEntity.getRefererIds();
-        List<String> refererIdList = StrUtil.split(refererIds, ',');
-        if(CollUtil.isNotEmpty(refererIdList)){
-            for(String inviteIdStr : refererIdList){
-                DappMemberEntity dappMemberEntityUp = dappMemberDao.selectMemberInfoByInviteId(inviteIdStr);
-                if(ObjectUtil.isEmpty(dappMemberEntityUp)){
-                    continue;
-                }
-                String accountType = dappMemberEntityUp.getAccountType();
-                if(DataDictionaryEnum.BIG_BOSS.getCode().equals(accountType)){
-                    continue;
-                }
-                //当前为BOSS,且直推中有两个BOSS以上,则升级BIG_BOSS
-                if(DataDictionaryEnum.BOSS.getCode().equals(accountType)){
-                    Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(DataDictionaryEnum.BOSS.getCode(),dappMemberEntityUp.getInviteId());
-                    if(2 <= bossCount){
-                        dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BIG_BOSS.getCode(),dappMemberEntityUp.getId());
-                    }
-                    continue;
-                }
-                //当前为AGENT,且直推中有两个以上,则升级BOSS
-                if(DataDictionaryEnum.AGENT.getCode().equals(accountType)){
-                    Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(null,dappMemberEntityUp.getInviteId());
-                    if(2 <= bossCount){
-                        dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BOSS.getCode(),dappMemberEntityUp.getId());
-                    }
-                    continue;
-                }
-            }
-        }
-        //直属上级
-        String accountType = dappMemberEntity.getAccountType();
-        if(DataDictionaryEnum.BIG_BOSS.getCode().equals(accountType)){
-            return;
-        }
-        //当前为BOSS,且直推中有两个BOSS以上,则升级BIG_BOSS
-        if(DataDictionaryEnum.BOSS.getCode().equals(accountType)){
-            Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(DataDictionaryEnum.BOSS.getCode(),dappMemberEntity.getInviteId());
-            if(2 <= bossCount){
-                dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BIG_BOSS.getCode(),dappMemberEntity.getId());
-            }
-            return;
-        }
-        //当前为AGENT,且直推中有两个以上,则升级BOSS
-        if(DataDictionaryEnum.AGENT.getCode().equals(accountType)){
-            Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(null,dappMemberEntity.getInviteId());
-            if(2 <= bossCount){
-                dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BOSS.getCode(),dappMemberEntity.getId());
-            }
-            return;
-        }
+//        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(id);
+//        if(ObjectUtil.isEmpty(dappMemberEntity)){
+//            return;
+//        }
+//        //所有上级(不包含直属上级)
+//        String refererIds = dappMemberEntity.getRefererIds();
+//        List<String> refererIdList = StrUtil.split(refererIds, ',');
+//        if(CollUtil.isNotEmpty(refererIdList)){
+//            for(String inviteIdStr : refererIdList){
+//                DappMemberEntity dappMemberEntityUp = dappMemberDao.selectMemberInfoByInviteId(inviteIdStr);
+//                if(ObjectUtil.isEmpty(dappMemberEntityUp)){
+//                    continue;
+//                }
+//                String accountType = dappMemberEntityUp.getAccountType();
+//                if(DataDictionaryEnum.BIG_BOSS.getCode().equals(accountType)){
+//                    continue;
+//                }
+//                //当前为BOSS,且直推中有两个BOSS以上,则升级BIG_BOSS
+//                if(DataDictionaryEnum.BOSS.getCode().equals(accountType)){
+//                    Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(DataDictionaryEnum.BOSS.getCode(),dappMemberEntityUp.getInviteId());
+//                    if(2 <= bossCount){
+//                        dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BIG_BOSS.getCode(),dappMemberEntityUp.getId());
+//                    }
+//                    continue;
+//                }
+//                //当前为AGENT,且直推中有两个以上,则升级BOSS
+//                if(DataDictionaryEnum.AGENT.getCode().equals(accountType)){
+//                    Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(null,dappMemberEntityUp.getInviteId());
+//                    if(2 <= bossCount){
+//                        dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BOSS.getCode(),dappMemberEntityUp.getId());
+//                    }
+//                    continue;
+//                }
+//            }
+//        }
+//        //直属上级
+//        String accountType = dappMemberEntity.getAccountType();
+//        if(DataDictionaryEnum.BIG_BOSS.getCode().equals(accountType)){
+//            return;
+//        }
+//        //当前为BOSS,且直推中有两个BOSS以上,则升级BIG_BOSS
+//        if(DataDictionaryEnum.BOSS.getCode().equals(accountType)){
+//            Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(DataDictionaryEnum.BOSS.getCode(),dappMemberEntity.getInviteId());
+//            if(2 <= bossCount){
+//                dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BIG_BOSS.getCode(),dappMemberEntity.getId());
+//            }
+//            return;
+//        }
+//        //当前为AGENT,且直推中有两个以上,则升级BOSS
+//        if(DataDictionaryEnum.AGENT.getCode().equals(accountType)){
+//            Integer bossCount = dappMemberDao.selectCountByAccountTypeAndRefererId(null,dappMemberEntity.getInviteId());
+//            if(2 <= bossCount){
+//                dappMemberDao.updateMemberAccountType(DataDictionaryEnum.BOSS.getCode(),dappMemberEntity.getId());
+//            }
+//            return;
+//        }
     }
 
     @Override
@@ -503,406 +503,406 @@
 
     @Override
     public void AntACoinInMsg(Long id) {
-        /**
-         * 获取对应的流水记录
-         */
-        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectInfoById(id);
-        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
-            return;
-        }
-        Long memberId = dappFundFlowEntity.getMemberId();
-        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
-        if(ObjectUtil.isEmpty(dappMemberEntity)){
-            return;
-        }
-        /**
-         * 会员充值金额
-         */
-        BigDecimal amount = dappFundFlowEntity.getAmount();
-        /**
-         * A币的当前价格
-         */
-        DataDictionaryCustom coinAPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.COIN_A_PRICE.getType(),
-                PoolEnum.COIN_A_PRICE.getCode()
-        );
-        BigDecimal coinAPrice = new BigDecimal(StrUtil.isEmpty(coinAPriceDic.getValue()) ? "0" : coinAPriceDic.getValue()).setScale(12,BigDecimal.ROUND_DOWN);
-        /**
-         * 会员充值USDT买入A币记录的ID
-         */
-        Long chergeRecordId = dappFundFlowEntity.getSystemProfitId();
-        DappChargeUsdtEntity dappChargeUsdtEntity = dappChargeUsdtMapper.selectById(chergeRecordId);
-        if(2 != dappChargeUsdtEntity.getStatus()){
-            return;
-        }
-        if(StrUtil.isEmpty(dappChargeUsdtEntity.getMemberHash())){
-            return;
-        }
-        /**
-         * 金本位的三倍额度,增加业绩,增加对应的NFT的值
-         */
-        DappUsdtPerkEntity dappUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(memberId);
-        if(ObjectUtil.isEmpty(dappUsdtPerkEntity)){
-            dappUsdtPerkEntity = new DappUsdtPerkEntity();
-            dappUsdtPerkEntity.setAmount(amount.multiply(new BigDecimal(3)));
-            dappUsdtPerkEntity.setNftDevote(amount);
-            dappUsdtPerkEntity.setMemberId(memberId);
-            dappUsdtPerkEntityMapper.insert(dappUsdtPerkEntity);
-        }
-        //金本位的三倍额度
-        BigDecimal amountPerk = dappUsdtPerkEntity.getAmount();
-        amountPerk = amountPerk.add(amount.multiply(new BigDecimal(3)));
-        dappUsdtPerkEntity.setAmount(amountPerk);
-        //生成一条金本位的三倍额度的资金流水记录
-        DappFundFlowEntity amountPerkFundFlow = new DappFundFlowEntity(
-                memberId,
-                amount.multiply(new BigDecimal(3)),
-                FundFlowEnum.MEMBER_AMOUNT_PERK_TOTAL.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(amountPerkFundFlow);
-
-        //增加业绩
-        BigDecimal achieveAmount = dappUsdtPerkEntity.getAchieveAmount();
-        achieveAmount = achieveAmount.add(amount);
-        dappUsdtPerkEntity.setAchieveAmount(achieveAmount);
-        //增加对应的NFT的值
-        BigDecimal nftDevote = dappUsdtPerkEntity.getNftDevote();
-        nftDevote = nftDevote.add(amount);
-        dappUsdtPerkEntity.setNftDevote(nftDevote);
-        dappUsdtPerkEntityMapper.updateById(dappUsdtPerkEntity);
-        /**
-         * 90%进入A币底池 10%进入B币LP薄饼底池
-         */
-        DataDictionaryCustom usdtAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.USDT_A_PERCENT.getType(),
-                PoolEnum.USDT_A_PERCENT.getCode()
-        );
-        BigDecimal usdtAPercent = new BigDecimal(StrUtil.isEmpty(usdtAPercentDic.getValue()) ? "0.7" : usdtAPercentDic.getValue());
-        BigDecimal usdtAAmount = amount.multiply(usdtAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        //生成一条进行中的70%进入A币底池的资金流水记录
-        DappFundFlowEntity fundFlowToA = new DappFundFlowEntity(
-                1L,
-                usdtAAmount,
-                FundFlowEnum.USDT_IN_A_POOL.getCode(),
-                1,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(fundFlowToA);
-        //90%进入A币底池
-        chainProducer.sendAntACoinInAPoolMsg(fundFlowToA.getId());
-
-        BigDecimal usdtWAmount = amount.multiply(new BigDecimal(0.2)).setScale(4, BigDecimal.ROUND_DOWN);
-        //生成一条进行中的20%进入A币底池的资金流水记录
-        DappFundFlowEntity fundFlowToW = new DappFundFlowEntity(
-                1L,
-                usdtWAmount,
-                FundFlowEnum.USDT_IN_W_POOL.getCode(),
-                1,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(fundFlowToW);
-
-        DataDictionaryCustom usdtBPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.USDT_B_PERCENT.getType(),
-                PoolEnum.USDT_B_PERCENT.getCode()
-        );
-        BigDecimal usdtBPercent = new BigDecimal(StrUtil.isEmpty(usdtBPercentDic.getValue()) ? "0.1" : usdtBPercentDic.getValue());
-        BigDecimal usdtBAmount = amount.multiply(usdtBPercent).setScale(4, BigDecimal.ROUND_DOWN);
-        //生成一条进行中的10%进入B币底池的资金流水记录
-        DappFundFlowEntity fundFlowToB = new DappFundFlowEntity(
-                1L,
-                usdtBAmount,
-                FundFlowEnum.USDT_IN_B_POOL.getCode(),
-                1,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(fundFlowToB);
-        //10%进入B币LP薄饼底池
-        chainProducer.sendAntACoinInBPoolMsg(fundFlowToB.getId());
-        /**
-         * 1.90%底池的USDT做成100%溢价,铸造出70%金本位价值的A币。
-         */
-        DataDictionaryCustom produceAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.PRODUCE_A_PERCENT.getType(),
-                PoolEnum.PRODUCE_A_PERCENT.getCode()
-        );
-        BigDecimal produceAPercent = new BigDecimal(StrUtil.isEmpty(produceAPercentDic.getValue()) ? "0.7" : produceAPercentDic.getValue());
-        //购买数量
-        BigDecimal totalCnt = amount.divide(coinAPrice, 4, BigDecimal.ROUND_DOWN);
-        /**
-         * 铸造出70%金本位价值的A币。实际产生数量
-         */
-        BigDecimal realCnt = totalCnt.multiply(produceAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-        dappChargeUsdtEntity.setTotalCnt(totalCnt);
-        dappChargeUsdtEntity.setRealCnt(realCnt);
-        dappChargeUsdtMapper.updateById(dappChargeUsdtEntity);
-        /**
-         * 重新计算A币的价格
-         */
-        DataDictionaryCustom coinACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.COIN_A_CNT.getType(),
-                PoolEnum.COIN_A_CNT.getCode()
-        );
-        //A币币本位底池-A币的数量
-        BigDecimal coinACntDicCnt = new BigDecimal(coinACntDic.getValue());
-        coinACntDicCnt = coinACntDicCnt.add(realCnt);
-        coinACntDic.setValue(coinACntDicCnt.toString());
-        dataDictionaryCustomMapper.updateById(coinACntDic);
-
-        DataDictionaryCustom coinAUsdtPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.COIN_A_USDT_PRICE.getType(),
-                PoolEnum.COIN_A_USDT_PRICE.getCode()
-        );
-        //A币金本位底池-usdt数量
-        BigDecimal coinAUsdtPriceDicCnt = new BigDecimal(coinAUsdtPriceDic.getValue());
-        coinAUsdtPriceDicCnt = coinAUsdtPriceDicCnt.add(amount);
-        coinAUsdtPriceDic.setValue(coinAUsdtPriceDicCnt.toString());
-        dataDictionaryCustomMapper.updateById(coinAUsdtPriceDic);
-
-        BigDecimal divide = coinAUsdtPriceDicCnt.divide(coinACntDicCnt, 12, BigDecimal.ROUND_DOWN);
-        coinAPriceDic.setValue(divide.toString());
-        dataDictionaryCustomMapper.updateById(coinAPriceDic);
-
-        chainProducer.sendAntKLineMsg(0);
-        /**
-         * A币的分配 walletMine
-         * 【70%换算100%分配】
-         * 50%客户秒到
-         * 20%全网加权分红(按20%释放递减)
-         * 10%直推
-         * 5%节点
-         * 5%基金会
-         * 10%级差奖
-         */
-        /**
-         * 50%客户秒到
-         */
-        DataDictionaryCustom memberGetAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.MEMBER_GET_A_PERCENT.getType(),
-                PoolEnum.MEMBER_GET_A_PERCENT.getCode()
-        );
-        BigDecimal memberGetAPercent = new BigDecimal(StrUtil.isEmpty(memberGetAPercentDic.getValue()) ? "0.5" : memberGetAPercentDic.getValue());
-        BigDecimal memberGetACnt = realCnt.multiply(memberGetAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        BigDecimal fundFlowToMemberFlag = this.getAndUpdateMemberPerk(dappFundFlowEntity.getMemberId(), memberGetACnt);
-        if(fundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
-            //生成一条50%客户秒到的资金流水记录
-            DappFundFlowEntity fundFlowToMember = new DappFundFlowEntity(
-                    dappFundFlowEntity.getMemberId(),
-                    fundFlowToMemberFlag,
-                    FundFlowEnum.MEMBER_GET_A_CNT.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    chergeRecordId);
-            dappFundFlowDao.insert(fundFlowToMember);
-            //用户的A币账户增加memberGetACnt数量
-            dappWalletService.updateWalletMineWithLock(fundFlowToMemberFlag,dappFundFlowEntity.getMemberId(),1);
-        }
-        /**
-         * 20%全网加权分红(按20%释放递减)进入加权分红底池
-         */
-        DataDictionaryCustom poolAllMemberAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getType(),
-                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getCode()
-        );
-        BigDecimal poolAllMemberAPercent = new BigDecimal(StrUtil.isEmpty(poolAllMemberAPercentDic.getValue()) ? "0.2" : poolAllMemberAPercentDic.getValue());
-        BigDecimal poolAllMemberAPercentCnt = realCnt.multiply(poolAllMemberAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        DataDictionaryCustom poolAllMemberACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.POOL_ALL_MEMBER_A_CNT.getType(),
-                PoolEnum.POOL_ALL_MEMBER_A_CNT.getCode()
-        );
-        BigDecimal poolAllMemberACnt = new BigDecimal(StrUtil.isEmpty(poolAllMemberACntDic.getValue()) ? "0" : poolAllMemberACntDic.getValue());
-        poolAllMemberACnt = poolAllMemberACnt.add(poolAllMemberAPercentCnt);
-        poolAllMemberACntDic.setValue(poolAllMemberACnt.toString());
-        dataDictionaryCustomMapper.updateById(poolAllMemberACntDic);
-        //生成一条20%全网加权分红(按20%释放递减)进入加权分红底池的资金流水记录
-        DappFundFlowEntity poolAllMemberAFundFlow = new DappFundFlowEntity(
-                1L,
-                poolAllMemberAPercentCnt,
-                FundFlowEnum.POOL_ALL_MEMBER_A_CNT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(poolAllMemberAFundFlow);
-
-//        BigDecimal poolAllMemberAPercentCntAva = nodePoolPerk(poolAllMemberAPercentCnt, MemberLevelEnum.MEMBER.getType(), FundFlowEnum.POOL_MEMBER_A_CNT.getCode());
-        /**
-         * 20%全网加权平分,按照个人投资占比全网的比例去平分
-         */
-        chainProducer.sendAllMemberPerkAvaMsg(poolAllMemberAFundFlow.getId());
-//        BigDecimal poolAllMemberAPercentCntAva = allMemberPerk(poolAllMemberAPercentCnt, FundFlowEnum.POOL_MEMBER_A_CNT.getCode());
-//        DappFundFlowEntity poolAllMemberAFundFlowAva = new DappFundFlowEntity(
-//                1L,
-//                poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
-//                FundFlowEnum.POOL_MEMBER_A_CNT.getCode(),
+//        /**
+//         * 获取对应的流水记录
+//         */
+//        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectInfoById(id);
+//        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
+//            return;
+//        }
+//        Long memberId = dappFundFlowEntity.getMemberId();
+//        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
+//        if(ObjectUtil.isEmpty(dappMemberEntity)){
+//            return;
+//        }
+//        /**
+//         * 会员充值金额
+//         */
+//        BigDecimal amount = dappFundFlowEntity.getAmount();
+//        /**
+//         * A币的当前价格
+//         */
+//        DataDictionaryCustom coinAPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.COIN_A_PRICE.getType(),
+//                PoolEnum.COIN_A_PRICE.getCode()
+//        );
+//        BigDecimal coinAPrice = new BigDecimal(StrUtil.isEmpty(coinAPriceDic.getValue()) ? "0" : coinAPriceDic.getValue()).setScale(12,BigDecimal.ROUND_DOWN);
+//        /**
+//         * 会员充值USDT买入A币记录的ID
+//         */
+//        Long chergeRecordId = dappFundFlowEntity.getSystemProfitId();
+//        DappChargeUsdtEntity dappChargeUsdtEntity = dappChargeUsdtMapper.selectById(chergeRecordId);
+//        if(2 != dappChargeUsdtEntity.getStatus()){
+//            return;
+//        }
+//        if(StrUtil.isEmpty(dappChargeUsdtEntity.getMemberHash())){
+//            return;
+//        }
+//        /**
+//         * 金本位的三倍额度,增加业绩,增加对应的NFT的值
+//         */
+//        DappUsdtPerkEntity dappUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(memberId);
+//        if(ObjectUtil.isEmpty(dappUsdtPerkEntity)){
+//            dappUsdtPerkEntity = new DappUsdtPerkEntity();
+//            dappUsdtPerkEntity.setAmount(amount.multiply(new BigDecimal(3)));
+//            dappUsdtPerkEntity.setNftDevote(amount);
+//            dappUsdtPerkEntity.setMemberId(memberId);
+//            dappUsdtPerkEntityMapper.insert(dappUsdtPerkEntity);
+//        }
+//        //金本位的三倍额度
+//        BigDecimal amountPerk = dappUsdtPerkEntity.getAmount();
+//        amountPerk = amountPerk.add(amount.multiply(new BigDecimal(3)));
+//        dappUsdtPerkEntity.setAmount(amountPerk);
+//        //生成一条金本位的三倍额度的资金流水记录
+//        DappFundFlowEntity amountPerkFundFlow = new DappFundFlowEntity(
+//                memberId,
+//                amount.multiply(new BigDecimal(3)),
+//                FundFlowEnum.MEMBER_AMOUNT_PERK_TOTAL.getCode(),
 //                2,
 //                BigDecimal.ZERO,
 //                null,
 //                chergeRecordId);
-//        dappFundFlowDao.insert(poolAllMemberAFundFlowAva);
-//        dappWalletService.updateWalletMineWithLock(poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
-//                1L,1);
-
-        /**
-         * 10%直推
-         */
-        DataDictionaryCustom directAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.DIRECT_A_PERCENT.getType(),
-                PoolEnum.DIRECT_A_PERCENT.getCode()
-        );
-        BigDecimal directAPercent = new BigDecimal(StrUtil.isEmpty(directAPercentDic.getValue()) ? "0.1" : directAPercentDic.getValue());
-        BigDecimal directAPercentCnt = realCnt.multiply(directAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        String refererId = dappMemberEntity.getRefererId();
-        DappMemberEntity directMemberEntity = dappMemberDao.selectMemberInfoByInviteId(refererId);
-        if(ObjectUtil.isNotEmpty(directMemberEntity)){
-            /**
-             *推荐用户入单可享有贡献值.例.推荐100获得100贡献值
-             */
-            DappUsdtPerkEntity directDappUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(directMemberEntity.getId());
-            if(ObjectUtil.isEmpty(directDappUsdtPerkEntity)){
-                directDappUsdtPerkEntity = new DappUsdtPerkEntity();
-                directDappUsdtPerkEntity.setNftDevote(amount);
-                directDappUsdtPerkEntity.setMemberId(directMemberEntity.getId());
-                dappUsdtPerkEntityMapper.insert(directDappUsdtPerkEntity);
-            }
-
-            BigDecimal directNftDevote = directDappUsdtPerkEntity.getNftDevote();
-            directNftDevote = directNftDevote.add(amount);
-            directDappUsdtPerkEntity.setNftDevote(directNftDevote);
-            dappUsdtPerkEntityMapper.updateById(directDappUsdtPerkEntity);
-
-            BigDecimal directAPercentFundFlowToMemberFlag = this.getAndUpdateMemberPerk(directMemberEntity.getId(), directAPercentCnt);
-            if(directAPercentFundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
-                //生成一条10%直推的资金流水记录
-                DappFundFlowEntity directAPercentFundFlowToMember = new DappFundFlowEntity(
-                        directMemberEntity.getId(),
-                        directAPercentFundFlowToMemberFlag,
-                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
-                        2,
-                        BigDecimal.ZERO,
-                        null,
-                        chergeRecordId);
-                dappFundFlowDao.insert(directAPercentFundFlowToMember);
-                //用户的A币账户增加directAPercentCnt数量
-                dappWalletService.updateWalletMineWithLock(directAPercentFundFlowToMemberFlag,directMemberEntity.getId(),1);
-            }
-            if(directAPercentCnt.compareTo(directAPercentFundFlowToMemberFlag) > 0){
-                DappFundFlowEntity directAPercentFundFlowToMemberAva = new DappFundFlowEntity(
-                        1L,
-                        directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
-                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
-                        2,
-                        BigDecimal.ZERO,
-                        null,
-                        chergeRecordId);
-                dappFundFlowDao.insert(directAPercentFundFlowToMemberAva);
-                dappWalletService.updateWalletMineWithLock(directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
-                        AppContants.YL_MEMBER_ID,1);
-            }
-        }
-        /**
-         * 5%节点
-         */
-        DataDictionaryCustom nodeAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_A_PERCENT.getType(),
-                PoolEnum.NODE_A_PERCENT.getCode()
-        );
-        BigDecimal nodeAPercent = new BigDecimal(StrUtil.isEmpty(nodeAPercentDic.getValue()) ? "0.05" : nodeAPercentDic.getValue());
-        BigDecimal nodeAPercentCnt = realCnt.multiply(nodeAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-        //生成一条5%节点的资金流水记录
-        DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
-                1L,
-                nodeAPercentCnt,
-                FundFlowEnum.NODE_A_PERCENT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(nodeAPercentFundFlow);
-//        chainProducer.sendAntACoinInNodeMsg(nodeAPercentFundFlow.getId());
-        DataDictionaryCustom nodeAPercentPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_A_PERCENT_POOL.getType(),
-                PoolEnum.NODE_A_PERCENT_POOL.getCode()
-        );
-        BigDecimal nodeAPercentPoolDicCnt = new BigDecimal(StrUtil.isEmpty(nodeAPercentPoolDic.getValue()) ? "0" : nodeAPercentPoolDic.getValue());
-        nodeAPercentPoolDicCnt = nodeAPercentPoolDicCnt.add(nodeAPercentCnt);
-        nodeAPercentPoolDic.setValue(nodeAPercentPoolDicCnt.toString());
-        dataDictionaryCustomMapper.updateById(nodeAPercentPoolDic);
-
-        BigDecimal nodeAPercentCntAva = superNodePoolPerk(nodeAPercentCnt, NodeCodeEnum.SUPER_NODE.getCode(), FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode());
-
-        if(nodeAPercentCnt.compareTo(nodeAPercentCntAva) > 0){
-            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-                    1L,
-                    nodeAPercentCnt.subtract(nodeAPercentCntAva),
-                    FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    chergeRecordId);
-            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-            dappWalletService.updateWalletMineWithLock(nodeAPercentCnt.subtract(nodeAPercentCntAva),
-                    AppContants.YL_MEMBER_ID,1);
-        }
-        /**
-         * 5%基金会
-         */
-        DataDictionaryCustom foundationAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.FOUNDATION_A_PERCENT.getType(),
-                PoolEnum.FOUNDATION_A_PERCENT.getCode()
-        );
-        BigDecimal foundationAPercent = new BigDecimal(StrUtil.isEmpty(foundationAPercentDic.getValue()) ? "0.05" : foundationAPercentDic.getValue());
-        BigDecimal foundationAPercentCnt = realCnt.multiply(foundationAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        //生成一条5%基金会的资金流水记录
-        DappFundFlowEntity foundationAPercentFundFlow = new DappFundFlowEntity(
-                295L,
-                foundationAPercentCnt,
-                FundFlowEnum.FOUNDATION_A_PERCENT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(foundationAPercentFundFlow);
-        //用户的A币账户增加memberGetACnt数量
-        dappWalletService.updateWalletMineWithLock(foundationAPercentCnt,295L,1);
-        /**
-         * 10%级差奖
-         */
-        DataDictionaryCustom levelAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.LEVEL_A_PERCENT.getType(),
-                PoolEnum.LEVEL_A_PERCENT.getCode()
-        );
-        BigDecimal levelAPercent = new BigDecimal(StrUtil.isEmpty(levelAPercentDic.getValue()) ? "0.1" : levelAPercentDic.getValue());
-        BigDecimal levelAPercentCnt = realCnt.multiply(levelAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        //生成一条10%级差奖进入10%级差奖底池的资金流水记录
-        DappFundFlowEntity levelAPercentCntFundFlow = new DappFundFlowEntity(
-                1L,
-                levelAPercentCnt,
-                FundFlowEnum.LEVEL_A_PERCENT_CNT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(levelAPercentCntFundFlow);
-        chainProducer.sendAntACoinInLevelMsg(levelAPercentCntFundFlow.getId());
-
-        /**
-         * 更新用户为有效用户
-         */
-        dappMemberDao.updateMemberActiveStatus(1,memberId);
+//        dappFundFlowDao.insert(amountPerkFundFlow);
+//
+//        //增加业绩
+//        BigDecimal achieveAmount = dappUsdtPerkEntity.getAchieveAmount();
+//        achieveAmount = achieveAmount.add(amount);
+//        dappUsdtPerkEntity.setAchieveAmount(achieveAmount);
+//        //增加对应的NFT的值
+//        BigDecimal nftDevote = dappUsdtPerkEntity.getNftDevote();
+//        nftDevote = nftDevote.add(amount);
+//        dappUsdtPerkEntity.setNftDevote(nftDevote);
+//        dappUsdtPerkEntityMapper.updateById(dappUsdtPerkEntity);
+//        /**
+//         * 90%进入A币底池 10%进入B币LP薄饼底池
+//         */
+//        DataDictionaryCustom usdtAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.USDT_A_PERCENT.getType(),
+//                PoolEnum.USDT_A_PERCENT.getCode()
+//        );
+//        BigDecimal usdtAPercent = new BigDecimal(StrUtil.isEmpty(usdtAPercentDic.getValue()) ? "0.7" : usdtAPercentDic.getValue());
+//        BigDecimal usdtAAmount = amount.multiply(usdtAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        //生成一条进行中的70%进入A币底池的资金流水记录
+//        DappFundFlowEntity fundFlowToA = new DappFundFlowEntity(
+//                1L,
+//                usdtAAmount,
+//                FundFlowEnum.USDT_IN_A_POOL.getCode(),
+//                1,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(fundFlowToA);
+//        //90%进入A币底池
+//        chainProducer.sendAntACoinInAPoolMsg(fundFlowToA.getId());
+//
+//        BigDecimal usdtWAmount = amount.multiply(new BigDecimal(0.2)).setScale(4, BigDecimal.ROUND_DOWN);
+//        //生成一条进行中的20%进入A币底池的资金流水记录
+//        DappFundFlowEntity fundFlowToW = new DappFundFlowEntity(
+//                1L,
+//                usdtWAmount,
+//                FundFlowEnum.USDT_IN_W_POOL.getCode(),
+//                1,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(fundFlowToW);
+//
+//        DataDictionaryCustom usdtBPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.USDT_B_PERCENT.getType(),
+//                PoolEnum.USDT_B_PERCENT.getCode()
+//        );
+//        BigDecimal usdtBPercent = new BigDecimal(StrUtil.isEmpty(usdtBPercentDic.getValue()) ? "0.1" : usdtBPercentDic.getValue());
+//        BigDecimal usdtBAmount = amount.multiply(usdtBPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//        //生成一条进行中的10%进入B币底池的资金流水记录
+//        DappFundFlowEntity fundFlowToB = new DappFundFlowEntity(
+//                1L,
+//                usdtBAmount,
+//                FundFlowEnum.USDT_IN_B_POOL.getCode(),
+//                1,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(fundFlowToB);
+//        //10%进入B币LP薄饼底池
+//        chainProducer.sendAntACoinInBPoolMsg(fundFlowToB.getId());
+//        /**
+//         * 1.90%底池的USDT做成100%溢价,铸造出70%金本位价值的A币。
+//         */
+//        DataDictionaryCustom produceAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.PRODUCE_A_PERCENT.getType(),
+//                PoolEnum.PRODUCE_A_PERCENT.getCode()
+//        );
+//        BigDecimal produceAPercent = new BigDecimal(StrUtil.isEmpty(produceAPercentDic.getValue()) ? "0.7" : produceAPercentDic.getValue());
+//        //购买数量
+//        BigDecimal totalCnt = amount.divide(coinAPrice, 4, BigDecimal.ROUND_DOWN);
+//        /**
+//         * 铸造出70%金本位价值的A币。实际产生数量
+//         */
+//        BigDecimal realCnt = totalCnt.multiply(produceAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//        dappChargeUsdtEntity.setTotalCnt(totalCnt);
+//        dappChargeUsdtEntity.setRealCnt(realCnt);
+//        dappChargeUsdtMapper.updateById(dappChargeUsdtEntity);
+//        /**
+//         * 重新计算A币的价格
+//         */
+//        DataDictionaryCustom coinACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.COIN_A_CNT.getType(),
+//                PoolEnum.COIN_A_CNT.getCode()
+//        );
+//        //A币币本位底池-A币的数量
+//        BigDecimal coinACntDicCnt = new BigDecimal(coinACntDic.getValue());
+//        coinACntDicCnt = coinACntDicCnt.add(realCnt);
+//        coinACntDic.setValue(coinACntDicCnt.toString());
+//        dataDictionaryCustomMapper.updateById(coinACntDic);
+//
+//        DataDictionaryCustom coinAUsdtPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.COIN_A_USDT_PRICE.getType(),
+//                PoolEnum.COIN_A_USDT_PRICE.getCode()
+//        );
+//        //A币金本位底池-usdt数量
+//        BigDecimal coinAUsdtPriceDicCnt = new BigDecimal(coinAUsdtPriceDic.getValue());
+//        coinAUsdtPriceDicCnt = coinAUsdtPriceDicCnt.add(amount);
+//        coinAUsdtPriceDic.setValue(coinAUsdtPriceDicCnt.toString());
+//        dataDictionaryCustomMapper.updateById(coinAUsdtPriceDic);
+//
+//        BigDecimal divide = coinAUsdtPriceDicCnt.divide(coinACntDicCnt, 12, BigDecimal.ROUND_DOWN);
+//        coinAPriceDic.setValue(divide.toString());
+//        dataDictionaryCustomMapper.updateById(coinAPriceDic);
+//
+//        chainProducer.sendAntKLineMsg(0);
+//        /**
+//         * A币的分配 walletMine
+//         * 【70%换算100%分配】
+//         * 50%客户秒到
+//         * 20%全网加权分红(按20%释放递减)
+//         * 10%直推
+//         * 5%节点
+//         * 5%基金会
+//         * 10%级差奖
+//         */
+//        /**
+//         * 50%客户秒到
+//         */
+//        DataDictionaryCustom memberGetAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.MEMBER_GET_A_PERCENT.getType(),
+//                PoolEnum.MEMBER_GET_A_PERCENT.getCode()
+//        );
+//        BigDecimal memberGetAPercent = new BigDecimal(StrUtil.isEmpty(memberGetAPercentDic.getValue()) ? "0.5" : memberGetAPercentDic.getValue());
+//        BigDecimal memberGetACnt = realCnt.multiply(memberGetAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        BigDecimal fundFlowToMemberFlag = this.getAndUpdateMemberPerk(dappFundFlowEntity.getMemberId(), memberGetACnt);
+//        if(fundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
+//            //生成一条50%客户秒到的资金流水记录
+//            DappFundFlowEntity fundFlowToMember = new DappFundFlowEntity(
+//                    dappFundFlowEntity.getMemberId(),
+//                    fundFlowToMemberFlag,
+//                    FundFlowEnum.MEMBER_GET_A_CNT.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    chergeRecordId);
+//            dappFundFlowDao.insert(fundFlowToMember);
+//            //用户的A币账户增加memberGetACnt数量
+//            dappWalletService.updateWalletMineWithLock(fundFlowToMemberFlag,dappFundFlowEntity.getMemberId(),1);
+//        }
+//        /**
+//         * 20%全网加权分红(按20%释放递减)进入加权分红底池
+//         */
+//        DataDictionaryCustom poolAllMemberAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getType(),
+//                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getCode()
+//        );
+//        BigDecimal poolAllMemberAPercent = new BigDecimal(StrUtil.isEmpty(poolAllMemberAPercentDic.getValue()) ? "0.2" : poolAllMemberAPercentDic.getValue());
+//        BigDecimal poolAllMemberAPercentCnt = realCnt.multiply(poolAllMemberAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        DataDictionaryCustom poolAllMemberACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.POOL_ALL_MEMBER_A_CNT.getType(),
+//                PoolEnum.POOL_ALL_MEMBER_A_CNT.getCode()
+//        );
+//        BigDecimal poolAllMemberACnt = new BigDecimal(StrUtil.isEmpty(poolAllMemberACntDic.getValue()) ? "0" : poolAllMemberACntDic.getValue());
+//        poolAllMemberACnt = poolAllMemberACnt.add(poolAllMemberAPercentCnt);
+//        poolAllMemberACntDic.setValue(poolAllMemberACnt.toString());
+//        dataDictionaryCustomMapper.updateById(poolAllMemberACntDic);
+//        //生成一条20%全网加权分红(按20%释放递减)进入加权分红底池的资金流水记录
+//        DappFundFlowEntity poolAllMemberAFundFlow = new DappFundFlowEntity(
+//                1L,
+//                poolAllMemberAPercentCnt,
+//                FundFlowEnum.POOL_ALL_MEMBER_A_CNT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(poolAllMemberAFundFlow);
+//
+////        BigDecimal poolAllMemberAPercentCntAva = nodePoolPerk(poolAllMemberAPercentCnt, MemberLevelEnum.MEMBER.getType(), FundFlowEnum.POOL_MEMBER_A_CNT.getCode());
+//        /**
+//         * 20%全网加权平分,按照个人投资占比全网的比例去平分
+//         */
+//        chainProducer.sendAllMemberPerkAvaMsg(poolAllMemberAFundFlow.getId());
+////        BigDecimal poolAllMemberAPercentCntAva = allMemberPerk(poolAllMemberAPercentCnt, FundFlowEnum.POOL_MEMBER_A_CNT.getCode());
+////        DappFundFlowEntity poolAllMemberAFundFlowAva = new DappFundFlowEntity(
+////                1L,
+////                poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
+////                FundFlowEnum.POOL_MEMBER_A_CNT.getCode(),
+////                2,
+////                BigDecimal.ZERO,
+////                null,
+////                chergeRecordId);
+////        dappFundFlowDao.insert(poolAllMemberAFundFlowAva);
+////        dappWalletService.updateWalletMineWithLock(poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
+////                1L,1);
+//
+//        /**
+//         * 10%直推
+//         */
+//        DataDictionaryCustom directAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.DIRECT_A_PERCENT.getType(),
+//                PoolEnum.DIRECT_A_PERCENT.getCode()
+//        );
+//        BigDecimal directAPercent = new BigDecimal(StrUtil.isEmpty(directAPercentDic.getValue()) ? "0.1" : directAPercentDic.getValue());
+//        BigDecimal directAPercentCnt = realCnt.multiply(directAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        String refererId = dappMemberEntity.getRefererId();
+//        DappMemberEntity directMemberEntity = dappMemberDao.selectMemberInfoByInviteId(refererId);
+//        if(ObjectUtil.isNotEmpty(directMemberEntity)){
+//            /**
+//             *推荐用户入单可享有贡献值.例.推荐100获得100贡献值
+//             */
+//            DappUsdtPerkEntity directDappUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(directMemberEntity.getId());
+//            if(ObjectUtil.isEmpty(directDappUsdtPerkEntity)){
+//                directDappUsdtPerkEntity = new DappUsdtPerkEntity();
+//                directDappUsdtPerkEntity.setNftDevote(amount);
+//                directDappUsdtPerkEntity.setMemberId(directMemberEntity.getId());
+//                dappUsdtPerkEntityMapper.insert(directDappUsdtPerkEntity);
+//            }
+//
+//            BigDecimal directNftDevote = directDappUsdtPerkEntity.getNftDevote();
+//            directNftDevote = directNftDevote.add(amount);
+//            directDappUsdtPerkEntity.setNftDevote(directNftDevote);
+//            dappUsdtPerkEntityMapper.updateById(directDappUsdtPerkEntity);
+//
+//            BigDecimal directAPercentFundFlowToMemberFlag = this.getAndUpdateMemberPerk(directMemberEntity.getId(), directAPercentCnt);
+//            if(directAPercentFundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
+//                //生成一条10%直推的资金流水记录
+//                DappFundFlowEntity directAPercentFundFlowToMember = new DappFundFlowEntity(
+//                        directMemberEntity.getId(),
+//                        directAPercentFundFlowToMemberFlag,
+//                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
+//                        2,
+//                        BigDecimal.ZERO,
+//                        null,
+//                        chergeRecordId);
+//                dappFundFlowDao.insert(directAPercentFundFlowToMember);
+//                //用户的A币账户增加directAPercentCnt数量
+//                dappWalletService.updateWalletMineWithLock(directAPercentFundFlowToMemberFlag,directMemberEntity.getId(),1);
+//            }
+//            if(directAPercentCnt.compareTo(directAPercentFundFlowToMemberFlag) > 0){
+//                DappFundFlowEntity directAPercentFundFlowToMemberAva = new DappFundFlowEntity(
+//                        1L,
+//                        directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
+//                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
+//                        2,
+//                        BigDecimal.ZERO,
+//                        null,
+//                        chergeRecordId);
+//                dappFundFlowDao.insert(directAPercentFundFlowToMemberAva);
+//                dappWalletService.updateWalletMineWithLock(directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
+//                        AppContants.YL_MEMBER_ID,1);
+//            }
+//        }
+//        /**
+//         * 5%节点
+//         */
+//        DataDictionaryCustom nodeAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_A_PERCENT.getType(),
+//                PoolEnum.NODE_A_PERCENT.getCode()
+//        );
+//        BigDecimal nodeAPercent = new BigDecimal(StrUtil.isEmpty(nodeAPercentDic.getValue()) ? "0.05" : nodeAPercentDic.getValue());
+//        BigDecimal nodeAPercentCnt = realCnt.multiply(nodeAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//        //生成一条5%节点的资金流水记录
+//        DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
+//                1L,
+//                nodeAPercentCnt,
+//                FundFlowEnum.NODE_A_PERCENT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(nodeAPercentFundFlow);
+////        chainProducer.sendAntACoinInNodeMsg(nodeAPercentFundFlow.getId());
+//        DataDictionaryCustom nodeAPercentPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_A_PERCENT_POOL.getType(),
+//                PoolEnum.NODE_A_PERCENT_POOL.getCode()
+//        );
+//        BigDecimal nodeAPercentPoolDicCnt = new BigDecimal(StrUtil.isEmpty(nodeAPercentPoolDic.getValue()) ? "0" : nodeAPercentPoolDic.getValue());
+//        nodeAPercentPoolDicCnt = nodeAPercentPoolDicCnt.add(nodeAPercentCnt);
+//        nodeAPercentPoolDic.setValue(nodeAPercentPoolDicCnt.toString());
+//        dataDictionaryCustomMapper.updateById(nodeAPercentPoolDic);
+//
+//        BigDecimal nodeAPercentCntAva = superNodePoolPerk(nodeAPercentCnt, NodeCodeEnum.SUPER_NODE.getCode(), FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode());
+//
+//        if(nodeAPercentCnt.compareTo(nodeAPercentCntAva) > 0){
+//            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+//                    1L,
+//                    nodeAPercentCnt.subtract(nodeAPercentCntAva),
+//                    FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    chergeRecordId);
+//            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+//            dappWalletService.updateWalletMineWithLock(nodeAPercentCnt.subtract(nodeAPercentCntAva),
+//                    AppContants.YL_MEMBER_ID,1);
+//        }
+//        /**
+//         * 5%基金会
+//         */
+//        DataDictionaryCustom foundationAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.FOUNDATION_A_PERCENT.getType(),
+//                PoolEnum.FOUNDATION_A_PERCENT.getCode()
+//        );
+//        BigDecimal foundationAPercent = new BigDecimal(StrUtil.isEmpty(foundationAPercentDic.getValue()) ? "0.05" : foundationAPercentDic.getValue());
+//        BigDecimal foundationAPercentCnt = realCnt.multiply(foundationAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        //生成一条5%基金会的资金流水记录
+//        DappFundFlowEntity foundationAPercentFundFlow = new DappFundFlowEntity(
+//                295L,
+//                foundationAPercentCnt,
+//                FundFlowEnum.FOUNDATION_A_PERCENT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(foundationAPercentFundFlow);
+//        //用户的A币账户增加memberGetACnt数量
+//        dappWalletService.updateWalletMineWithLock(foundationAPercentCnt,295L,1);
+//        /**
+//         * 10%级差奖
+//         */
+//        DataDictionaryCustom levelAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.LEVEL_A_PERCENT.getType(),
+//                PoolEnum.LEVEL_A_PERCENT.getCode()
+//        );
+//        BigDecimal levelAPercent = new BigDecimal(StrUtil.isEmpty(levelAPercentDic.getValue()) ? "0.1" : levelAPercentDic.getValue());
+//        BigDecimal levelAPercentCnt = realCnt.multiply(levelAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        //生成一条10%级差奖进入10%级差奖底池的资金流水记录
+//        DappFundFlowEntity levelAPercentCntFundFlow = new DappFundFlowEntity(
+//                1L,
+//                levelAPercentCnt,
+//                FundFlowEnum.LEVEL_A_PERCENT_CNT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(levelAPercentCntFundFlow);
+//        chainProducer.sendAntACoinInLevelMsg(levelAPercentCntFundFlow.getId());
+//
+//        /**
+//         * 更新用户为有效用户
+//         */
+//        dappMemberDao.updateMemberActiveStatus(1,memberId);
 
     }
 
@@ -1028,45 +1028,45 @@
 
     @Override
     public void antACoinInNodeMsg(Long id) {
-        /**
-         * 全网节点99名.享受全网5%分红
-         */
-        log.info("{}",id);
-        //获取对应的流水记录
-        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectInfoById(id);
-        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
-            return;
-        }
-        //金额
-        BigDecimal amount = dappFundFlowEntity.getAmount();
-        /**
-         * 获取全网的超级节点个数
-         */
-        List<DappMemberNodeEntity> dappMemberNodeEntities = dappMemberNodeMapper.selectNodeByNodeCode(NodeCodeEnum.SUPER_NODE.getCode());
-        if(CollUtil.isNotEmpty(dappMemberNodeEntities)){
-            BigDecimal divide = amount.divide(new BigDecimal(dappMemberNodeEntities.size()), 4, BigDecimal.ROUND_DOWN);
-            for(DappMemberNodeEntity dappMemberNodeEntity : dappMemberNodeEntities){
-                Long memberId = dappMemberNodeEntity.getMemberId();
-
-                DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
-                        memberId,
-                        divide,
-                        FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode(),
-                        2,
-                        BigDecimal.ZERO,
-                        null,
-                        dappFundFlowEntity.getSystemProfitId());
-                dappFundFlowDao.insert(nodeAPercentFundFlow);
-                //用户的A币账户增加divide数量
-                dappWalletService.updateWalletMineWithLock(divide,memberId,1);
-            }
-            dappFundFlowEntity.setFromHash("已分成"+dappMemberNodeEntities.size()+"人");
-        }else{
-            dappFundFlowEntity.setFromHash("已分成0人");
-            dappWalletService.updateWalletMineWithLock(amount,1L,1);
-        }
-        dappFundFlowEntity.setStatus(2);
-        dappFundFlowDao.updateById(dappFundFlowEntity);
+//        /**
+//         * 全网节点99名.享受全网5%分红
+//         */
+//        log.info("{}",id);
+//        //获取对应的流水记录
+//        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectInfoById(id);
+//        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
+//            return;
+//        }
+//        //金额
+//        BigDecimal amount = dappFundFlowEntity.getAmount();
+//        /**
+//         * 获取全网的超级节点个数
+//         */
+//        List<DappMemberNodeEntity> dappMemberNodeEntities = dappMemberNodeMapper.selectNodeByNodeCode(NodeCodeEnum.SUPER_NODE.getCode());
+//        if(CollUtil.isNotEmpty(dappMemberNodeEntities)){
+//            BigDecimal divide = amount.divide(new BigDecimal(dappMemberNodeEntities.size()), 4, BigDecimal.ROUND_DOWN);
+//            for(DappMemberNodeEntity dappMemberNodeEntity : dappMemberNodeEntities){
+//                Long memberId = dappMemberNodeEntity.getMemberId();
+//
+//                DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
+//                        memberId,
+//                        divide,
+//                        FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode(),
+//                        2,
+//                        BigDecimal.ZERO,
+//                        null,
+//                        dappFundFlowEntity.getSystemProfitId());
+//                dappFundFlowDao.insert(nodeAPercentFundFlow);
+//                //用户的A币账户增加divide数量
+//                dappWalletService.updateWalletMineWithLock(divide,memberId,1);
+//            }
+//            dappFundFlowEntity.setFromHash("已分成"+dappMemberNodeEntities.size()+"人");
+//        }else{
+//            dappFundFlowEntity.setFromHash("已分成0人");
+//            dappWalletService.updateWalletMineWithLock(amount,1L,1);
+//        }
+//        dappFundFlowEntity.setStatus(2);
+//        dappFundFlowDao.updateById(dappFundFlowEntity);
     }
 
     @Override
@@ -1081,266 +1081,266 @@
          *
          * DAO5直推DAO5平级拿一代,视为平级奖,享受原有DAO5一个点,额外再加一个点分红。享受双份收益,合计2%加权分红
          */
-        log.info("{}",id);
-        //获取对应的流水记录
-        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectInfoById(id);
-        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
-            return;
-        }
-        /**
-         * 极差总金额
-         */
-        BigDecimal amountTC = dappFundFlowEntity.getAmount();
-
-        Long systemProfitId = dappFundFlowEntity.getSystemProfitId();
-        DappChargeUsdtEntity dappChargeUsdtEntity = dappChargeUsdtMapper.selectById(systemProfitId);
-        Long memberId = dappChargeUsdtEntity.getMemberId();
-        DappMemberEntity mallMember = dappMemberDao.selectById(memberId);
-
-        /**
-         * 团队下不同代理级别获取不用的比例新增业绩补贴
-         */
-        if(StrUtil.isNotEmpty(mallMember.getRefererIds())){
-
-            String referrerIds = mallMember.getRefererIds();
-            List<String> referrerIdList = StrUtil.splitTrim(referrerIds, ",");
-            if(CollUtil.isNotEmpty(referrerIdList)){
-                List<DappMemberEntity> mallMemberTeamPerk = dappMemberDao.selectByInviteIds(referrerIdList);
-
-                if(CollUtil.isNotEmpty(mallMemberTeamPerk)){
-                    //初始级别
-                    String levelNormal = MemberLevelEnum.NODE_1.getType();
-                    //初始团队新增业绩补贴
-                    BigDecimal teamIncomePerkNormal = BigDecimal.ZERO;
-                    //补贴总数
-                    BigDecimal teamIncomePerkTotal = BigDecimal.ZERO;
-
-                    for(DappMemberEntity teamPerkMember : mallMemberTeamPerk){
-                        String level = teamPerkMember.getAccountType();
-                        //比较两个级别的大小,level大于levelNormal返回1
-                        int compareMin = MemberLevelEnum.NODE_1.compareLevel(level, levelNormal);
-                        int compareMax = MemberLevelEnum.NODE_1.compareLevel(MemberLevelEnum.NODE_5.getType(), level);
-                        if(compareMin >= 1 && compareMax >= 1){
-                            Long teamPerkMemberId = teamPerkMember.getId();
-                            DataDictionaryCustom teamPerkMemberDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                                    "NODE_PERK", level);
-
-                            NodePerk nodePerk = JSONObject.parseObject(teamPerkMemberDic.getValue(), NodePerk.class);
-                            BigDecimal teamIncomePerk = nodePerk.getTeamIncomePerk();
-                            //极差
-                            teamIncomePerk = teamIncomePerk.subtract(teamIncomePerkNormal);
-
-                            BigDecimal teamIncomePerkAmount = amountTC.multiply(teamIncomePerk).setScale(4, BigDecimal.ROUND_DOWN);
-
-                            BigDecimal nodeAPercentFundFlowFlag = this.getAndUpdateMemberPerk(teamPerkMemberId, teamIncomePerkAmount);
-                            if(nodeAPercentFundFlowFlag.compareTo(BigDecimal.ZERO) > 0){
-                                DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
-                                        teamPerkMemberId,
-                                        nodeAPercentFundFlowFlag,
-                                        FundFlowEnum.LEVEL_A_PERCENT_CNT_MEMBER.getCode(),
-                                        2,
-                                        BigDecimal.ZERO,
-                                        null,
-                                        dappFundFlowEntity.getSystemProfitId());
-                                dappFundFlowDao.insert(nodeAPercentFundFlow);
-                                //用户的A币账户增加divide数量
-                                dappWalletService.updateWalletMineWithLock(nodeAPercentFundFlowFlag,teamPerkMemberId,1);
-                                //累加补贴总数
-                                teamIncomePerkTotal = teamIncomePerkTotal.add(nodeAPercentFundFlowFlag);
-                            }
-
-                            //初始级别变成当前遍历的会员的级别
-                            levelNormal = level;
-                            //初始新增业绩补贴比例变成当前会员级别的补贴比例
-                            teamIncomePerkNormal = nodePerk.getTeamIncomePerk();
-                        }
-                    }
-                    //更新总数据
-                    dappFundFlowEntity.setFromHash("已分成"+teamIncomePerkTotal.setScale(4,BigDecimal.ROUND_DOWN));
-                    dappFundFlowEntity.setStatus(2);
-                    dappFundFlowDao.updateById(dappFundFlowEntity);
-                    BigDecimal subtract = amountTC.subtract(teamIncomePerkTotal);
-                    //用户的A币账户增加divide数量
-//                    if(amountTC.compareTo(teamIncomePerkTotal) > 0){
-//                        DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-//                                1L,
-//                                subtract,
-//                                FundFlowEnum.LEVEL_A_PERCENT_CNT_MEMBER.getCode(),
-//                                2,
-//                                BigDecimal.ZERO,
-//                                null,
-//                                systemProfitId);
-//                        dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-//                        dappWalletService.updateWalletMineWithLock(subtract,
-//                                1L,1);
+//        log.info("{}",id);
+//        //获取对应的流水记录
+//        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectInfoById(id);
+//        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
+//            return;
+//        }
+//        /**
+//         * 极差总金额
+//         */
+//        BigDecimal amountTC = dappFundFlowEntity.getAmount();
+//
+//        Long systemProfitId = dappFundFlowEntity.getSystemProfitId();
+//        DappChargeUsdtEntity dappChargeUsdtEntity = dappChargeUsdtMapper.selectById(systemProfitId);
+//        Long memberId = dappChargeUsdtEntity.getMemberId();
+//        DappMemberEntity mallMember = dappMemberDao.selectById(memberId);
+//
+//        /**
+//         * 团队下不同代理级别获取不用的比例新增业绩补贴
+//         */
+//        if(StrUtil.isNotEmpty(mallMember.getRefererIds())){
+//
+//            String referrerIds = mallMember.getRefererIds();
+//            List<String> referrerIdList = StrUtil.splitTrim(referrerIds, ",");
+//            if(CollUtil.isNotEmpty(referrerIdList)){
+//                List<DappMemberEntity> mallMemberTeamPerk = dappMemberDao.selectByInviteIds(referrerIdList);
+//
+//                if(CollUtil.isNotEmpty(mallMemberTeamPerk)){
+//                    //初始级别
+//                    String levelNormal = MemberLevelEnum.NODE_1.getType();
+//                    //初始团队新增业绩补贴
+//                    BigDecimal teamIncomePerkNormal = BigDecimal.ZERO;
+//                    //补贴总数
+//                    BigDecimal teamIncomePerkTotal = BigDecimal.ZERO;
+//
+//                    for(DappMemberEntity teamPerkMember : mallMemberTeamPerk){
+//                        String level = teamPerkMember.getAccountType();
+//                        //比较两个级别的大小,level大于levelNormal返回1
+//                        int compareMin = MemberLevelEnum.NODE_1.compareLevel(level, levelNormal);
+//                        int compareMax = MemberLevelEnum.NODE_1.compareLevel(MemberLevelEnum.NODE_5.getType(), level);
+//                        if(compareMin >= 1 && compareMax >= 1){
+//                            Long teamPerkMemberId = teamPerkMember.getId();
+//                            DataDictionaryCustom teamPerkMemberDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                                    "NODE_PERK", level);
+//
+//                            NodePerk nodePerk = JSONObject.parseObject(teamPerkMemberDic.getValue(), NodePerk.class);
+//                            BigDecimal teamIncomePerk = nodePerk.getTeamIncomePerk();
+//                            //极差
+//                            teamIncomePerk = teamIncomePerk.subtract(teamIncomePerkNormal);
+//
+//                            BigDecimal teamIncomePerkAmount = amountTC.multiply(teamIncomePerk).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//                            BigDecimal nodeAPercentFundFlowFlag = this.getAndUpdateMemberPerk(teamPerkMemberId, teamIncomePerkAmount);
+//                            if(nodeAPercentFundFlowFlag.compareTo(BigDecimal.ZERO) > 0){
+//                                DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
+//                                        teamPerkMemberId,
+//                                        nodeAPercentFundFlowFlag,
+//                                        FundFlowEnum.LEVEL_A_PERCENT_CNT_MEMBER.getCode(),
+//                                        2,
+//                                        BigDecimal.ZERO,
+//                                        null,
+//                                        dappFundFlowEntity.getSystemProfitId());
+//                                dappFundFlowDao.insert(nodeAPercentFundFlow);
+//                                //用户的A币账户增加divide数量
+//                                dappWalletService.updateWalletMineWithLock(nodeAPercentFundFlowFlag,teamPerkMemberId,1);
+//                                //累加补贴总数
+//                                teamIncomePerkTotal = teamIncomePerkTotal.add(nodeAPercentFundFlowFlag);
+//                            }
+//
+//                            //初始级别变成当前遍历的会员的级别
+//                            levelNormal = level;
+//                            //初始新增业绩补贴比例变成当前会员级别的补贴比例
+//                            teamIncomePerkNormal = nodePerk.getTeamIncomePerk();
+//                        }
 //                    }
-                }
-            }
-        }
-        /**
-         * 极差的dao3、dao4、dao5级别全网分红入自己的底池,每天按20%平分
-         */
-        //获取新增数量
-        DataDictionaryCustom nodeThreeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_3.getType(),
-                PoolEnum.NODE_3.getCode());
-        NodePerk nodePerk = JSONObject.parseObject(nodeThreeDic.getValue(), NodePerk.class);
-        BigDecimal averagePerk = nodePerk.getAveragePerk();
-        BigDecimal averagePerkCnt = amountTC.multiply(averagePerk).setScale(4, BigDecimal.ROUND_DOWN);
-
-        BigDecimal averagePerkCntAva = nodePoolPerk(averagePerkCnt, MemberLevelEnum.NODE_3.getType(), FundFlowEnum.DAO_3_NODE_PERK.getCode());
-
-        //用户的A币账户增加divide数量
-        if(averagePerkCnt.compareTo(averagePerkCntAva) > 0){
-            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-                    1L,
-                    averagePerkCnt.subtract(averagePerkCntAva),
-                    FundFlowEnum.DAO_3_NODE_PERK.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    systemProfitId);
-            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-            dappWalletService.updateWalletMineWithLock(averagePerkCnt.subtract(averagePerkCntAva),
-                    AppContants.YL_MEMBER_ID,1);
-        }
-        //生成流水记录
-        DappFundFlowEntity nodeThreeFundFlow = new DappFundFlowEntity(
-                1L,
-                averagePerkCnt,
-                FundFlowEnum.DAO_3_CNT_MEMBER.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                dappChargeUsdtEntity.getId());
-        dappFundFlowDao.insert(nodeThreeFundFlow);
-        //更新底池
-        DataDictionaryCustom nodeThreePoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_3_POOL.getType(),
-                PoolEnum.NODE_3_POOL.getCode());
-        BigDecimal nodeThreePool = new BigDecimal(nodeThreePoolDic.getValue());
-        nodeThreePool = nodeThreePool.add(averagePerkCnt).setScale(4,BigDecimal.ROUND_DOWN);
-        nodeThreePoolDic.setValue(nodeThreePool.toString());
-        dataDictionaryCustomMapper.updateById(nodeThreePoolDic);
-
-        DataDictionaryCustom nodeFourDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_4.getType(),
-                PoolEnum.NODE_4.getCode());
-        NodePerk nodeFourDicPerk = JSONObject.parseObject(nodeFourDic.getValue(), NodePerk.class);
-        BigDecimal averagePerkFour = nodeFourDicPerk.getAveragePerk();
-        BigDecimal averagePerkFourCnt = amountTC.multiply(averagePerkFour).setScale(4, BigDecimal.ROUND_DOWN);
-
-        BigDecimal averagePerkFourCntAva = nodePoolPerk(averagePerkFourCnt, MemberLevelEnum.NODE_4.getType(), FundFlowEnum.DAO_4_NODE_PERK.getCode());
-        //用户的A币账户增加divide数量
-        if(averagePerkFourCnt.compareTo(averagePerkFourCntAva) > 0){
-            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-                    1L,
-                    averagePerkFourCnt.subtract(averagePerkFourCntAva),
-                    FundFlowEnum.DAO_4_NODE_PERK.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    systemProfitId);
-            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-            dappWalletService.updateWalletMineWithLock(averagePerkFourCnt.subtract(averagePerkFourCntAva),
-                    AppContants.YL_MEMBER_ID,1);
-        }
-        DappFundFlowEntity nodeFourFundFlow = new DappFundFlowEntity(
-                1L,
-                averagePerkFourCnt,
-                FundFlowEnum.DAO_4_CNT_MEMBER.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                dappChargeUsdtEntity.getId());
-        dappFundFlowDao.insert(nodeFourFundFlow);
-        DataDictionaryCustom nodeFourPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_4_POOL.getType(),
-                PoolEnum.NODE_4_POOL.getCode());
-        BigDecimal nodeFourPool = new BigDecimal(nodeFourPoolDic.getValue());
-        nodeFourPool = nodeFourPool.add(averagePerkFourCnt).setScale(4,BigDecimal.ROUND_DOWN);
-        nodeFourPoolDic.setValue(nodeFourPool.toString());
-        dataDictionaryCustomMapper.updateById(nodeFourPoolDic);
-
-        DataDictionaryCustom nodeFiveDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_5.getType(),
-                PoolEnum.NODE_5.getCode());
-        NodePerk nodeFiveDicPerk = JSONObject.parseObject(nodeFiveDic.getValue(), NodePerk.class);
-        BigDecimal averagePerkFive = nodeFiveDicPerk.getAveragePerk();
-        BigDecimal averagePerkFiveCnt = amountTC.multiply(averagePerkFive).setScale(4, BigDecimal.ROUND_DOWN);
-
-        BigDecimal averagePerkFiveCntAva = nodePoolPerk(averagePerkFiveCnt, MemberLevelEnum.NODE_5.getType(), FundFlowEnum.DAO_5_NODE_PERK.getCode());
-        //用户的A币账户增加divide数量
-        if(averagePerkFiveCnt.compareTo(averagePerkFiveCntAva) > 0){
-            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-                    1L,
-                    averagePerkFiveCnt.subtract(averagePerkFiveCntAva),
-                    FundFlowEnum.DAO_5_NODE_PERK.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    systemProfitId);
-            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-            dappWalletService.updateWalletMineWithLock(averagePerkFiveCnt.subtract(averagePerkFiveCntAva),
-                    AppContants.YL_MEMBER_ID,1);
-        }
-        DappFundFlowEntity nodeFiveFundFlow = new DappFundFlowEntity(
-                1L,
-                averagePerkFiveCnt,
-                FundFlowEnum.DAO_5_CNT_MEMBER.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                dappChargeUsdtEntity.getId());
-        dappFundFlowDao.insert(nodeFiveFundFlow);
-        DataDictionaryCustom nodeFivePoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_5_POOL.getType(),
-                PoolEnum.NODE_5_POOL.getCode());
-        BigDecimal nodeFivePool = new BigDecimal(nodeFivePoolDic.getValue());
-        nodeFivePool = nodeFivePool.add(averagePerkFiveCnt).setScale(4,BigDecimal.ROUND_DOWN);
-        nodeFivePoolDic.setValue(nodeFivePool.toString());
-        dataDictionaryCustomMapper.updateById(nodeFivePoolDic);
-
-        /**
-         * DAO5直推DAO5平级拿一代,视为平级奖,享受原有DAO5一个点,额外再加一个点分红。享受双份收益,合计2%加权分红
-         */
-        DataDictionaryCustom nodeFiveEqualsDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_5_EQUALS.getType(),
-                PoolEnum.NODE_5_EQUALS.getCode());
-        BigDecimal nodeFiveEquals = new BigDecimal(nodeFiveEqualsDic.getValue());
-        BigDecimal nodeFiveEqualsCnt = amountTC.multiply(nodeFiveEquals).setScale(4, BigDecimal.ROUND_DOWN);
-
-        BigDecimal nodeFiveEqualsCntAva = nodePoolEqualsPerk(nodeFiveEqualsCnt, MemberLevelEnum.NODE_5.getType(), FundFlowEnum.DAO_5_NODE_EQUALS_PERK.getCode());
-        //用户的A币账户增加divide数量
-        if(nodeFiveEqualsCnt.compareTo(nodeFiveEqualsCntAva) > 0){
-            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-                    1L,
-                    nodeFiveEqualsCnt.subtract(nodeFiveEqualsCntAva),
-                    FundFlowEnum.DAO_5_NODE_EQUALS_PERK.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    systemProfitId);
-            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-            dappWalletService.updateWalletMineWithLock(nodeFiveEqualsCnt.subtract(nodeFiveEqualsCntAva),
-                    AppContants.YL_MEMBER_ID,1);
-        }
-        DappFundFlowEntity nodeFiveEqualsFundFlow = new DappFundFlowEntity(
-                1L,
-                nodeFiveEqualsCnt,
-                FundFlowEnum.DAO_5_CNT_EQUALS_MEMBER.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                dappChargeUsdtEntity.getId());
-        dappFundFlowDao.insert(nodeFiveEqualsFundFlow);
-        DataDictionaryCustom nodeFiveEqualsPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_5_EQUALS_POOL.getType(),
-                PoolEnum.NODE_5_EQUALS_POOL.getCode());
-        BigDecimal nodeFiveEqualsPool = new BigDecimal(nodeFiveEqualsPoolDic.getValue());
-        nodeFiveEqualsPool = nodeFiveEqualsPool.add(nodeFiveEqualsCnt).setScale(4,BigDecimal.ROUND_DOWN);
-        nodeFiveEqualsPoolDic.setValue(nodeFiveEqualsPool.toString());
-        dataDictionaryCustomMapper.updateById(nodeFiveEqualsPoolDic);
+//                    //更新总数据
+//                    dappFundFlowEntity.setFromHash("已分成"+teamIncomePerkTotal.setScale(4,BigDecimal.ROUND_DOWN));
+//                    dappFundFlowEntity.setStatus(2);
+//                    dappFundFlowDao.updateById(dappFundFlowEntity);
+//                    BigDecimal subtract = amountTC.subtract(teamIncomePerkTotal);
+//                    //用户的A币账户增加divide数量
+////                    if(amountTC.compareTo(teamIncomePerkTotal) > 0){
+////                        DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+////                                1L,
+////                                subtract,
+////                                FundFlowEnum.LEVEL_A_PERCENT_CNT_MEMBER.getCode(),
+////                                2,
+////                                BigDecimal.ZERO,
+////                                null,
+////                                systemProfitId);
+////                        dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+////                        dappWalletService.updateWalletMineWithLock(subtract,
+////                                1L,1);
+////                    }
+//                }
+//            }
+//        }
+//        /**
+//         * 极差的dao3、dao4、dao5级别全网分红入自己的底池,每天按20%平分
+//         */
+//        //获取新增数量
+//        DataDictionaryCustom nodeThreeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_3.getType(),
+//                PoolEnum.NODE_3.getCode());
+//        NodePerk nodePerk = JSONObject.parseObject(nodeThreeDic.getValue(), NodePerk.class);
+//        BigDecimal averagePerk = nodePerk.getAveragePerk();
+//        BigDecimal averagePerkCnt = amountTC.multiply(averagePerk).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        BigDecimal averagePerkCntAva = nodePoolPerk(averagePerkCnt, MemberLevelEnum.NODE_3.getType(), FundFlowEnum.DAO_3_NODE_PERK.getCode());
+//
+//        //用户的A币账户增加divide数量
+//        if(averagePerkCnt.compareTo(averagePerkCntAva) > 0){
+//            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+//                    1L,
+//                    averagePerkCnt.subtract(averagePerkCntAva),
+//                    FundFlowEnum.DAO_3_NODE_PERK.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    systemProfitId);
+//            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+//            dappWalletService.updateWalletMineWithLock(averagePerkCnt.subtract(averagePerkCntAva),
+//                    AppContants.YL_MEMBER_ID,1);
+//        }
+//        //生成流水记录
+//        DappFundFlowEntity nodeThreeFundFlow = new DappFundFlowEntity(
+//                1L,
+//                averagePerkCnt,
+//                FundFlowEnum.DAO_3_CNT_MEMBER.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                dappChargeUsdtEntity.getId());
+//        dappFundFlowDao.insert(nodeThreeFundFlow);
+//        //更新底池
+//        DataDictionaryCustom nodeThreePoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_3_POOL.getType(),
+//                PoolEnum.NODE_3_POOL.getCode());
+//        BigDecimal nodeThreePool = new BigDecimal(nodeThreePoolDic.getValue());
+//        nodeThreePool = nodeThreePool.add(averagePerkCnt).setScale(4,BigDecimal.ROUND_DOWN);
+//        nodeThreePoolDic.setValue(nodeThreePool.toString());
+//        dataDictionaryCustomMapper.updateById(nodeThreePoolDic);
+//
+//        DataDictionaryCustom nodeFourDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_4.getType(),
+//                PoolEnum.NODE_4.getCode());
+//        NodePerk nodeFourDicPerk = JSONObject.parseObject(nodeFourDic.getValue(), NodePerk.class);
+//        BigDecimal averagePerkFour = nodeFourDicPerk.getAveragePerk();
+//        BigDecimal averagePerkFourCnt = amountTC.multiply(averagePerkFour).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        BigDecimal averagePerkFourCntAva = nodePoolPerk(averagePerkFourCnt, MemberLevelEnum.NODE_4.getType(), FundFlowEnum.DAO_4_NODE_PERK.getCode());
+//        //用户的A币账户增加divide数量
+//        if(averagePerkFourCnt.compareTo(averagePerkFourCntAva) > 0){
+//            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+//                    1L,
+//                    averagePerkFourCnt.subtract(averagePerkFourCntAva),
+//                    FundFlowEnum.DAO_4_NODE_PERK.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    systemProfitId);
+//            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+//            dappWalletService.updateWalletMineWithLock(averagePerkFourCnt.subtract(averagePerkFourCntAva),
+//                    AppContants.YL_MEMBER_ID,1);
+//        }
+//        DappFundFlowEntity nodeFourFundFlow = new DappFundFlowEntity(
+//                1L,
+//                averagePerkFourCnt,
+//                FundFlowEnum.DAO_4_CNT_MEMBER.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                dappChargeUsdtEntity.getId());
+//        dappFundFlowDao.insert(nodeFourFundFlow);
+//        DataDictionaryCustom nodeFourPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_4_POOL.getType(),
+//                PoolEnum.NODE_4_POOL.getCode());
+//        BigDecimal nodeFourPool = new BigDecimal(nodeFourPoolDic.getValue());
+//        nodeFourPool = nodeFourPool.add(averagePerkFourCnt).setScale(4,BigDecimal.ROUND_DOWN);
+//        nodeFourPoolDic.setValue(nodeFourPool.toString());
+//        dataDictionaryCustomMapper.updateById(nodeFourPoolDic);
+//
+//        DataDictionaryCustom nodeFiveDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_5.getType(),
+//                PoolEnum.NODE_5.getCode());
+//        NodePerk nodeFiveDicPerk = JSONObject.parseObject(nodeFiveDic.getValue(), NodePerk.class);
+//        BigDecimal averagePerkFive = nodeFiveDicPerk.getAveragePerk();
+//        BigDecimal averagePerkFiveCnt = amountTC.multiply(averagePerkFive).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        BigDecimal averagePerkFiveCntAva = nodePoolPerk(averagePerkFiveCnt, MemberLevelEnum.NODE_5.getType(), FundFlowEnum.DAO_5_NODE_PERK.getCode());
+//        //用户的A币账户增加divide数量
+//        if(averagePerkFiveCnt.compareTo(averagePerkFiveCntAva) > 0){
+//            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+//                    1L,
+//                    averagePerkFiveCnt.subtract(averagePerkFiveCntAva),
+//                    FundFlowEnum.DAO_5_NODE_PERK.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    systemProfitId);
+//            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+//            dappWalletService.updateWalletMineWithLock(averagePerkFiveCnt.subtract(averagePerkFiveCntAva),
+//                    AppContants.YL_MEMBER_ID,1);
+//        }
+//        DappFundFlowEntity nodeFiveFundFlow = new DappFundFlowEntity(
+//                1L,
+//                averagePerkFiveCnt,
+//                FundFlowEnum.DAO_5_CNT_MEMBER.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                dappChargeUsdtEntity.getId());
+//        dappFundFlowDao.insert(nodeFiveFundFlow);
+//        DataDictionaryCustom nodeFivePoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_5_POOL.getType(),
+//                PoolEnum.NODE_5_POOL.getCode());
+//        BigDecimal nodeFivePool = new BigDecimal(nodeFivePoolDic.getValue());
+//        nodeFivePool = nodeFivePool.add(averagePerkFiveCnt).setScale(4,BigDecimal.ROUND_DOWN);
+//        nodeFivePoolDic.setValue(nodeFivePool.toString());
+//        dataDictionaryCustomMapper.updateById(nodeFivePoolDic);
+//
+//        /**
+//         * DAO5直推DAO5平级拿一代,视为平级奖,享受原有DAO5一个点,额外再加一个点分红。享受双份收益,合计2%加权分红
+//         */
+//        DataDictionaryCustom nodeFiveEqualsDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_5_EQUALS.getType(),
+//                PoolEnum.NODE_5_EQUALS.getCode());
+//        BigDecimal nodeFiveEquals = new BigDecimal(nodeFiveEqualsDic.getValue());
+//        BigDecimal nodeFiveEqualsCnt = amountTC.multiply(nodeFiveEquals).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        BigDecimal nodeFiveEqualsCntAva = nodePoolEqualsPerk(nodeFiveEqualsCnt, MemberLevelEnum.NODE_5.getType(), FundFlowEnum.DAO_5_NODE_EQUALS_PERK.getCode());
+//        //用户的A币账户增加divide数量
+//        if(nodeFiveEqualsCnt.compareTo(nodeFiveEqualsCntAva) > 0){
+//            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+//                    1L,
+//                    nodeFiveEqualsCnt.subtract(nodeFiveEqualsCntAva),
+//                    FundFlowEnum.DAO_5_NODE_EQUALS_PERK.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    systemProfitId);
+//            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+//            dappWalletService.updateWalletMineWithLock(nodeFiveEqualsCnt.subtract(nodeFiveEqualsCntAva),
+//                    AppContants.YL_MEMBER_ID,1);
+//        }
+//        DappFundFlowEntity nodeFiveEqualsFundFlow = new DappFundFlowEntity(
+//                1L,
+//                nodeFiveEqualsCnt,
+//                FundFlowEnum.DAO_5_CNT_EQUALS_MEMBER.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                dappChargeUsdtEntity.getId());
+//        dappFundFlowDao.insert(nodeFiveEqualsFundFlow);
+//        DataDictionaryCustom nodeFiveEqualsPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_5_EQUALS_POOL.getType(),
+//                PoolEnum.NODE_5_EQUALS_POOL.getCode());
+//        BigDecimal nodeFiveEqualsPool = new BigDecimal(nodeFiveEqualsPoolDic.getValue());
+//        nodeFiveEqualsPool = nodeFiveEqualsPool.add(nodeFiveEqualsCnt).setScale(4,BigDecimal.ROUND_DOWN);
+//        nodeFiveEqualsPoolDic.setValue(nodeFiveEqualsPool.toString());
+//        dataDictionaryCustomMapper.updateById(nodeFiveEqualsPoolDic);
     }
 
     @Override
@@ -1611,140 +1611,140 @@
 
     @Override
     public void aCoinFire() {
-        /**
-         * A币技术做到资产钱包燃烧,闪兑钱包也要燃烧0.1%每小时
-         */
-        BigDecimal totalCnt = BigDecimal.ZERO;
-        //闪兑钱包
-        List<DappWalletCoinEntity> walletCoinEntities = dappWalletCoinDao.selectAmountThanZero();
-        if(CollUtil.isNotEmpty(walletCoinEntities)){
-            for(DappWalletCoinEntity dappWalletCoinEntity : walletCoinEntities){
-                BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
-                BigDecimal fireCnt = availableAmount.multiply(new BigDecimal("0.001")).setScale(4,BigDecimal.ROUND_DOWN);
-                dappWalletService.updateWalletCoinWithLock(fireCnt,dappWalletCoinEntity.getMemberId(),2);
-                totalCnt = totalCnt.add(fireCnt);
-            }
-        }
-        //资产钱包
-        List<DappWalletMineEntity> walletMineEntities = dappWalletMineDao.selectAmountThanZero();
-        if(CollUtil.isNotEmpty(walletMineEntities)){
-            for(DappWalletMineEntity dappWalletMineEntity : walletMineEntities){
-                BigDecimal availableAmount = dappWalletMineEntity.getAvailableAmount();
-                BigDecimal fireCnt = availableAmount.multiply(new BigDecimal("0.001")).setScale(4,BigDecimal.ROUND_DOWN);
-                dappWalletService.updateWalletMineWithLock(fireCnt,dappWalletMineEntity.getMemberId(),2);
-                totalCnt = totalCnt.add(fireCnt);
-            }
-        }
-        if(BigDecimal.ZERO.compareTo(totalCnt) >= 0){
-            return;
-        }
-
-        totalCnt = totalCnt.setScale(4,BigDecimal.ROUND_DOWN);
-        /**
-         * 插入每小时燃烧的资金流水
-         */
-        DappFundFlowEntity dappFundFlowEntity = new DappFundFlowEntity(1L, totalCnt, FundFlowEnum.A_COIN_FIRE.getCode(), 2, BigDecimal.ZERO);
-        dappFundFlowDao.insert(dappFundFlowEntity);
-        /**
-         * 更新A币的价格
-         */
-        DataDictionaryCustom coinACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.COIN_A_CNT.getType(),
-                PoolEnum.COIN_A_CNT.getCode());
-        BigDecimal coinACnt = new BigDecimal(coinACntDic.getValue());
-        coinACnt = coinACnt.subtract(totalCnt.multiply(new BigDecimal(0.8)));
-        coinACntDic.setValue(coinACnt.toString());
-        dataDictionaryCustomMapper.updateById(coinACntDic);
-
-        DataDictionaryCustom coinAUsdtDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.COIN_A_USDT_PRICE.getType(),
-                PoolEnum.COIN_A_USDT_PRICE.getCode());
-        BigDecimal coinAUsdt = new BigDecimal(coinAUsdtDic.getValue());
-
-        DataDictionaryCustom coinAPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.COIN_A_PRICE.getType(),
-                PoolEnum.COIN_A_PRICE.getCode());
-
-        BigDecimal coinAPrice = coinAUsdt.divide(coinACnt,12,BigDecimal.ROUND_DOWN);
-        coinAPriceDic.setValue(coinAPrice.toString());
-        dataDictionaryCustomMapper.updateById(coinAPriceDic);
-        /**
-         * 增加K线数据
-         */
-        DappAKlineEntity dappAKlineEntity = new DappAKlineEntity();
-        dappAKlineEntity.setType(0);
-        /**
-         * 获取最新一条小时或者分钟的数据
-         */
-        DappAKlineEntity oldOne = dappAKlineMapper.selectOneByType();
-        if(ObjectUtil.isNotEmpty(oldOne)){
-            dappAKlineEntity.setOpenPrice(oldOne.getClosePrice());
-            dappAKlineEntity.setLowestPrice(oldOne.getClosePrice());
-        }else{
-            dappAKlineEntity.setOpenPrice(coinAPrice);
-            dappAKlineEntity.setLowestPrice(coinAPrice);
-        }
-        dappAKlineEntity.setHighestPrice(coinAPrice);
-        dappAKlineEntity.setClosePrice(coinAPrice);
-        dappAKlineMapper.insert(dappAKlineEntity);
-
-
-        List<cn.hutool.json.JSONObject> objects = new ArrayList<>();
-        List<AKLineLimitVo> akLineLimitVos = dappAKlineMapper.selectListByTypeAndLimit(0, AppContants.K_LINE_LIMIT);
-        if(CollUtil.isNotEmpty(akLineLimitVos)) {
-            Collections.reverse(akLineLimitVos);
-            for (AKLineLimitVo akLineLimitVo : akLineLimitVos) {
-                cn.hutool.json.JSONObject parseObj = JSONUtil.parseObj(akLineLimitVo);
-                objects.add(parseObj);
-            }
-            redisUtils.del(AppContants.K_LINE_NOW);
-            redisUtils.set(AppContants.K_LINE_NOW, objects.toString());
-        }
+//        /**
+//         * A币技术做到资产钱包燃烧,闪兑钱包也要燃烧0.1%每小时
+//         */
+//        BigDecimal totalCnt = BigDecimal.ZERO;
+//        //闪兑钱包
+//        List<DappWalletCoinEntity> walletCoinEntities = dappWalletCoinDao.selectAmountThanZero();
+//        if(CollUtil.isNotEmpty(walletCoinEntities)){
+//            for(DappWalletCoinEntity dappWalletCoinEntity : walletCoinEntities){
+//                BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
+//                BigDecimal fireCnt = availableAmount.multiply(new BigDecimal("0.001")).setScale(4,BigDecimal.ROUND_DOWN);
+//                dappWalletService.updateWalletCoinWithLock(fireCnt,dappWalletCoinEntity.getMemberId(),2);
+//                totalCnt = totalCnt.add(fireCnt);
+//            }
+//        }
+//        //资产钱包
+//        List<DappWalletMineEntity> walletMineEntities = dappWalletMineDao.selectAmountThanZero();
+//        if(CollUtil.isNotEmpty(walletMineEntities)){
+//            for(DappWalletMineEntity dappWalletMineEntity : walletMineEntities){
+//                BigDecimal availableAmount = dappWalletMineEntity.getAvailableAmount();
+//                BigDecimal fireCnt = availableAmount.multiply(new BigDecimal("0.001")).setScale(4,BigDecimal.ROUND_DOWN);
+//                dappWalletService.updateWalletMineWithLock(fireCnt,dappWalletMineEntity.getMemberId(),2);
+//                totalCnt = totalCnt.add(fireCnt);
+//            }
+//        }
+//        if(BigDecimal.ZERO.compareTo(totalCnt) >= 0){
+//            return;
+//        }
+//
+//        totalCnt = totalCnt.setScale(4,BigDecimal.ROUND_DOWN);
+//        /**
+//         * 插入每小时燃烧的资金流水
+//         */
+//        DappFundFlowEntity dappFundFlowEntity = new DappFundFlowEntity(1L, totalCnt, FundFlowEnum.A_COIN_FIRE.getCode(), 2, BigDecimal.ZERO);
+//        dappFundFlowDao.insert(dappFundFlowEntity);
+//        /**
+//         * 更新A币的价格
+//         */
+//        DataDictionaryCustom coinACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.COIN_A_CNT.getType(),
+//                PoolEnum.COIN_A_CNT.getCode());
+//        BigDecimal coinACnt = new BigDecimal(coinACntDic.getValue());
+//        coinACnt = coinACnt.subtract(totalCnt.multiply(new BigDecimal(0.8)));
+//        coinACntDic.setValue(coinACnt.toString());
+//        dataDictionaryCustomMapper.updateById(coinACntDic);
+//
+//        DataDictionaryCustom coinAUsdtDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.COIN_A_USDT_PRICE.getType(),
+//                PoolEnum.COIN_A_USDT_PRICE.getCode());
+//        BigDecimal coinAUsdt = new BigDecimal(coinAUsdtDic.getValue());
+//
+//        DataDictionaryCustom coinAPriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.COIN_A_PRICE.getType(),
+//                PoolEnum.COIN_A_PRICE.getCode());
+//
+//        BigDecimal coinAPrice = coinAUsdt.divide(coinACnt,12,BigDecimal.ROUND_DOWN);
+//        coinAPriceDic.setValue(coinAPrice.toString());
+//        dataDictionaryCustomMapper.updateById(coinAPriceDic);
+//        /**
+//         * 增加K线数据
+//         */
+//        DappAKlineEntity dappAKlineEntity = new DappAKlineEntity();
+//        dappAKlineEntity.setType(0);
+//        /**
+//         * 获取最新一条小时或者分钟的数据
+//         */
+//        DappAKlineEntity oldOne = dappAKlineMapper.selectOneByType();
+//        if(ObjectUtil.isNotEmpty(oldOne)){
+//            dappAKlineEntity.setOpenPrice(oldOne.getClosePrice());
+//            dappAKlineEntity.setLowestPrice(oldOne.getClosePrice());
+//        }else{
+//            dappAKlineEntity.setOpenPrice(coinAPrice);
+//            dappAKlineEntity.setLowestPrice(coinAPrice);
+//        }
+//        dappAKlineEntity.setHighestPrice(coinAPrice);
+//        dappAKlineEntity.setClosePrice(coinAPrice);
+//        dappAKlineMapper.insert(dappAKlineEntity);
+//
+//
+//        List<cn.hutool.json.JSONObject> objects = new ArrayList<>();
+//        List<AKLineLimitVo> akLineLimitVos = dappAKlineMapper.selectListByTypeAndLimit(0, AppContants.K_LINE_LIMIT);
+//        if(CollUtil.isNotEmpty(akLineLimitVos)) {
+//            Collections.reverse(akLineLimitVos);
+//            for (AKLineLimitVo akLineLimitVo : akLineLimitVos) {
+//                cn.hutool.json.JSONObject parseObj = JSONUtil.parseObj(akLineLimitVo);
+//                objects.add(parseObj);
+//            }
+//            redisUtils.del(AppContants.K_LINE_NOW);
+//            redisUtils.set(AppContants.K_LINE_NOW, objects.toString());
+//        }
     }
 
     @Override
     public void antMemberLevelMsg(Long memberId) {
-        DappMemberEntity member = dappMemberDao.selectById(memberId);
-        if(StrUtil.isBlank(member.getRefererIds())) {
-            return;
-        }
-
-        List<String> ids = StrUtil.split(member.getRefererIds(), ',');
-        List<DappMemberEntity> parentMembers = dappMemberDao.selectByInviteIds(ids);
-        for (DappMemberEntity parent : parentMembers) {
-            //DAO5不能再升级了
-            if(parent.getAccountType().equals(MemberLevelEnum.NODE_5.getType())){
-                continue;
-            }
-            /**
-             * 升级到董事就无法升级了
-             */
-            String nextLevelName = MemberLevelEnum.MEMBER.getNextLevel(parent.getAccountType());
-            int levelCode = MemberLevelEnum.MEMBER.getLevelCode(nextLevelName);
-
-            DataDictionaryCustom newLevelDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("NODE_PERK", nextLevelName);
-            if(ObjectUtil.isEmpty(newLevelDic)){
-                continue;
-            }
-            NodePerk nodeFiveDicPerk = JSONObject.parseObject(newLevelDic.getValue(), NodePerk.class);
-
-            //需要判断小区业绩
-            if( MemberLevelEnum.NODE_1.getType().equals(nextLevelName)){
-                if (!directMemberCnt(parent, nodeFiveDicPerk)) {
-                    continue;
-                }
-                if (!teamIncome(parent, nodeFiveDicPerk)) {
-                    continue;
-                }
-            }else{
-                if (!agentCntFinish(parent, nodeFiveDicPerk)) {
-                    continue;
-                }
-            }
-
-            parent.setAccountType(nextLevelName);
-            dappMemberDao.updateById(parent);
-        }
+//        DappMemberEntity member = dappMemberDao.selectById(memberId);
+//        if(StrUtil.isBlank(member.getRefererIds())) {
+//            return;
+//        }
+//
+//        List<String> ids = StrUtil.split(member.getRefererIds(), ',');
+//        List<DappMemberEntity> parentMembers = dappMemberDao.selectByInviteIds(ids);
+//        for (DappMemberEntity parent : parentMembers) {
+//            //DAO5不能再升级了
+//            if(parent.getAccountType().equals(MemberLevelEnum.NODE_5.getType())){
+//                continue;
+//            }
+//            /**
+//             * 升级到董事就无法升级了
+//             */
+//            String nextLevelName = MemberLevelEnum.MEMBER.getNextLevel(parent.getAccountType());
+//            int levelCode = MemberLevelEnum.MEMBER.getLevelCode(nextLevelName);
+//
+//            DataDictionaryCustom newLevelDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode("NODE_PERK", nextLevelName);
+//            if(ObjectUtil.isEmpty(newLevelDic)){
+//                continue;
+//            }
+//            NodePerk nodeFiveDicPerk = JSONObject.parseObject(newLevelDic.getValue(), NodePerk.class);
+//
+//            //需要判断小区业绩
+//            if( MemberLevelEnum.NODE_1.getType().equals(nextLevelName)){
+//                if (!directMemberCnt(parent, nodeFiveDicPerk)) {
+//                    continue;
+//                }
+//                if (!teamIncome(parent, nodeFiveDicPerk)) {
+//                    continue;
+//                }
+//            }else{
+//                if (!agentCntFinish(parent, nodeFiveDicPerk)) {
+//                    continue;
+//                }
+//            }
+//
+//            parent.setAccountType(nextLevelName);
+//            dappMemberDao.updateById(parent);
+//        }
     }
 
     @Override
@@ -1788,7 +1788,7 @@
         dappAKlineEntity.setClosePrice(coinAPrice);
         dappAKlineMapper.insert(dappAKlineEntity);
 
-        chainProducer.sendAntKLineMsg(1);
+//        chainProducer.sendAntKLineMsg(1);
     }
 
     @Override
@@ -1828,7 +1828,7 @@
         dappAKlineEntity.setClosePrice(coinAPrice);
         dappAKlineMapper.insert(dappAKlineEntity);
 
-        chainProducer.sendAntKLineMsg(2);
+//        chainProducer.sendAntKLineMsg(2);
         //周
         String week = DateUtil.dayOfWeekEnum(DateUtil.date()).toChinese();
         if("星期日".equals(week)){
@@ -1873,7 +1873,7 @@
             dappAKlineEntityDay.setClosePrice(coinAPrice);
             dappAKlineMapper.insert(dappAKlineEntityDay);
 
-            chainProducer.sendAntKLineMsg(3);
+//            chainProducer.sendAntKLineMsg(3);
         }
         //月
         int month = DateUtil.dayOfMonth(DateUtil.date());
@@ -1908,7 +1908,7 @@
             dappAKlineEntityWeek.setClosePrice(coinAPrice);
             dappAKlineMapper.insert(dappAKlineEntityWeek);
 
-            chainProducer.sendAntKLineMsg(4);
+//            chainProducer.sendAntKLineMsg(4);
         }
     }
 
@@ -2015,24 +2015,24 @@
 
     @Override
     public void allMemberPerkAvaMsg(Long id) {
-        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(id);
-        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
-            return;
-        }
-
-        BigDecimal poolAllMemberAPercentCnt = dappFundFlowEntity.getAmount();
-        BigDecimal poolAllMemberAPercentCntAva = allMemberPerk(poolAllMemberAPercentCnt, FundFlowEnum.POOL_MEMBER_A_CNT.getCode());
-        DappFundFlowEntity poolAllMemberAFundFlowAva = new DappFundFlowEntity(
-                1L,
-                poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
-                FundFlowEnum.POOL_MEMBER_A_CNT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                dappFundFlowEntity.getSystemProfitId());
-        dappFundFlowDao.insert(poolAllMemberAFundFlowAva);
-        dappWalletService.updateWalletMineWithLock(poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
-                AppContants.YL_MEMBER_ID,1);
+//        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(id);
+//        if(ObjectUtil.isEmpty(dappFundFlowEntity)){
+//            return;
+//        }
+//
+//        BigDecimal poolAllMemberAPercentCnt = dappFundFlowEntity.getAmount();
+//        BigDecimal poolAllMemberAPercentCntAva = allMemberPerk(poolAllMemberAPercentCnt, FundFlowEnum.POOL_MEMBER_A_CNT.getCode());
+//        DappFundFlowEntity poolAllMemberAFundFlowAva = new DappFundFlowEntity(
+//                1L,
+//                poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
+//                FundFlowEnum.POOL_MEMBER_A_CNT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                dappFundFlowEntity.getSystemProfitId());
+//        dappFundFlowDao.insert(poolAllMemberAFundFlowAva);
+//        dappWalletService.updateWalletMineWithLock(poolAllMemberAPercentCnt.subtract(poolAllMemberAPercentCntAva),
+//                AppContants.YL_MEMBER_ID,1);
 
     }
     @Override
@@ -2080,14 +2080,14 @@
         flow.setStatus(DappFundFlowEntity.WITHDRAW_STATUS_AGREE);
         dappFundFlowDao.updateById(flow);
 
-        /**
-         * 发送消息处理返利逻辑
-         */
-        chainProducer.sendAntACoinInContractMsg(flow.getId());
-        /**
-         * 发送消息处理代理升级
-         */
-        chainProducer.sendAntMemberLevelMsg(memberId);
+//        /**
+//         * 发送消息处理返利逻辑
+//         */
+//        chainProducer.sendAntACoinInContractMsg(flow.getId());
+//        /**
+//         * 发送消息处理代理升级
+//         */
+//        chainProducer.sendAntMemberLevelMsg(memberId);
     }
 
     @Override
@@ -2149,15 +2149,15 @@
         amountPerk = amountPerk.add(amount.multiply(new BigDecimal(3)));
         dappUsdtPerkEntity.setAmount(amountPerk);
         //生成一条金本位的三倍额度的资金流水记录
-        DappFundFlowEntity amountPerkFundFlow = new DappFundFlowEntity(
-                memberId,
-                amount.multiply(new BigDecimal(3)),
-                FundFlowEnum.MEMBER_AMOUNT_PERK_TOTAL.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(amountPerkFundFlow);
+//        DappFundFlowEntity amountPerkFundFlow = new DappFundFlowEntity(
+//                memberId,
+//                amount.multiply(new BigDecimal(3)),
+//                FundFlowEnum.MEMBER_AMOUNT_PERK_TOTAL.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(amountPerkFundFlow);
 
         //增加业绩
         BigDecimal achieveAmount = dappUsdtPerkEntity.getAchieveAmount();
@@ -2212,7 +2212,7 @@
         coinAPriceDic.setValue(divide.toString());
         dataDictionaryCustomMapper.updateById(coinAPriceDic);
 
-        chainProducer.sendAntKLineMsg(0);
+//        chainProducer.sendAntKLineMsg(0);
         /**
          * A币的分配 walletMine
          * 【70%换算100%分配】
@@ -2226,211 +2226,211 @@
         /**
          * 50%客户秒到
          */
-        DataDictionaryCustom memberGetAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.MEMBER_GET_A_PERCENT.getType(),
-                PoolEnum.MEMBER_GET_A_PERCENT.getCode()
-        );
-        BigDecimal memberGetAPercent = new BigDecimal(StrUtil.isEmpty(memberGetAPercentDic.getValue()) ? "0.5" : memberGetAPercentDic.getValue());
-        BigDecimal memberGetACnt = realCnt.multiply(memberGetAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        BigDecimal fundFlowToMemberFlag = this.getAndUpdateMemberPerk(dappFundFlowEntity.getMemberId(), memberGetACnt);
-        if(fundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
-            //生成一条50%客户秒到的资金流水记录
-            DappFundFlowEntity fundFlowToMember = new DappFundFlowEntity(
-                    dappFundFlowEntity.getMemberId(),
-                    fundFlowToMemberFlag,
-                    FundFlowEnum.MEMBER_GET_A_CNT.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    chergeRecordId);
-            dappFundFlowDao.insert(fundFlowToMember);
-            //用户的A币账户增加memberGetACnt数量
-            dappWalletService.updateWalletMineWithLock(fundFlowToMemberFlag,dappFundFlowEntity.getMemberId(),1);
-        }
-        /**
-         * 20%全网加权分红(按20%释放递减)进入加权分红底池
-         */
-        DataDictionaryCustom poolAllMemberAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getType(),
-                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getCode()
-        );
-        BigDecimal poolAllMemberAPercent = new BigDecimal(StrUtil.isEmpty(poolAllMemberAPercentDic.getValue()) ? "0.2" : poolAllMemberAPercentDic.getValue());
-        BigDecimal poolAllMemberAPercentCnt = realCnt.multiply(poolAllMemberAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        DataDictionaryCustom poolAllMemberACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.POOL_ALL_MEMBER_A_CNT.getType(),
-                PoolEnum.POOL_ALL_MEMBER_A_CNT.getCode()
-        );
-        BigDecimal poolAllMemberACnt = new BigDecimal(StrUtil.isEmpty(poolAllMemberACntDic.getValue()) ? "0" : poolAllMemberACntDic.getValue());
-        poolAllMemberACnt = poolAllMemberACnt.add(poolAllMemberAPercentCnt);
-        poolAllMemberACntDic.setValue(poolAllMemberACnt.toString());
-        dataDictionaryCustomMapper.updateById(poolAllMemberACntDic);
-        //生成一条20%全网加权分红(按20%释放递减)进入加权分红底池的资金流水记录
-        DappFundFlowEntity poolAllMemberAFundFlow = new DappFundFlowEntity(
-                1L,
-                poolAllMemberAPercentCnt,
-                FundFlowEnum.POOL_ALL_MEMBER_A_CNT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(poolAllMemberAFundFlow);
-
-        /**
-         * 20%全网加权平分,按照个人投资占比全网的比例去平分
-         */
-        chainProducer.sendAllMemberPerkAvaMsg(poolAllMemberAFundFlow.getId());
-        /**
-         * 10%直推
-         */
-        DataDictionaryCustom directAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.DIRECT_A_PERCENT.getType(),
-                PoolEnum.DIRECT_A_PERCENT.getCode()
-        );
-        BigDecimal directAPercent = new BigDecimal(StrUtil.isEmpty(directAPercentDic.getValue()) ? "0.1" : directAPercentDic.getValue());
-        BigDecimal directAPercentCnt = realCnt.multiply(directAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        String refererId = dappMemberEntity.getRefererId();
-        DappMemberEntity directMemberEntity = dappMemberDao.selectMemberInfoByInviteId(refererId);
-        if(ObjectUtil.isNotEmpty(directMemberEntity)){
-            /**
-             *推荐用户入单可享有贡献值.例.推荐100获得100贡献值
-             */
-            DappUsdtPerkEntity directDappUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(directMemberEntity.getId());
-            if(ObjectUtil.isEmpty(directDappUsdtPerkEntity)){
-                directDappUsdtPerkEntity = new DappUsdtPerkEntity();
-                directDappUsdtPerkEntity.setNftDevote(amount);
-                directDappUsdtPerkEntity.setMemberId(directMemberEntity.getId());
-                dappUsdtPerkEntityMapper.insert(directDappUsdtPerkEntity);
-            }
-
-            BigDecimal directNftDevote = directDappUsdtPerkEntity.getNftDevote();
-            directNftDevote = directNftDevote.add(amount);
-            directDappUsdtPerkEntity.setNftDevote(directNftDevote);
-            dappUsdtPerkEntityMapper.updateById(directDappUsdtPerkEntity);
-
-            BigDecimal directAPercentFundFlowToMemberFlag = this.getAndUpdateMemberPerk(directMemberEntity.getId(), directAPercentCnt);
-            if(directAPercentFundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
-                //生成一条10%直推的资金流水记录
-                DappFundFlowEntity directAPercentFundFlowToMember = new DappFundFlowEntity(
-                        directMemberEntity.getId(),
-                        directAPercentFundFlowToMemberFlag,
-                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
-                        2,
-                        BigDecimal.ZERO,
-                        null,
-                        chergeRecordId);
-                dappFundFlowDao.insert(directAPercentFundFlowToMember);
-                //用户的A币账户增加directAPercentCnt数量
-                dappWalletService.updateWalletMineWithLock(directAPercentFundFlowToMemberFlag,directMemberEntity.getId(),1);
-            }
-            if(directAPercentCnt.compareTo(directAPercentFundFlowToMemberFlag) > 0){
-                DappFundFlowEntity directAPercentFundFlowToMemberAva = new DappFundFlowEntity(
-                        1L,
-                        directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
-                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
-                        2,
-                        BigDecimal.ZERO,
-                        null,
-                        chergeRecordId);
-                dappFundFlowDao.insert(directAPercentFundFlowToMemberAva);
-                dappWalletService.updateWalletMineWithLock(directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
-                        AppContants.YL_MEMBER_ID,1);
-            }
-        }
-        /**
-         * 5%节点
-         */
-        DataDictionaryCustom nodeAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_A_PERCENT.getType(),
-                PoolEnum.NODE_A_PERCENT.getCode()
-        );
-        BigDecimal nodeAPercent = new BigDecimal(StrUtil.isEmpty(nodeAPercentDic.getValue()) ? "0.05" : nodeAPercentDic.getValue());
-        BigDecimal nodeAPercentCnt = realCnt.multiply(nodeAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-        //生成一条5%节点的资金流水记录
-        DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
-                1L,
-                nodeAPercentCnt,
-                FundFlowEnum.NODE_A_PERCENT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(nodeAPercentFundFlow);
-//        chainProducer.sendAntACoinInNodeMsg(nodeAPercentFundFlow.getId());
-        DataDictionaryCustom nodeAPercentPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.NODE_A_PERCENT_POOL.getType(),
-                PoolEnum.NODE_A_PERCENT_POOL.getCode()
-        );
-        BigDecimal nodeAPercentPoolDicCnt = new BigDecimal(StrUtil.isEmpty(nodeAPercentPoolDic.getValue()) ? "0" : nodeAPercentPoolDic.getValue());
-        nodeAPercentPoolDicCnt = nodeAPercentPoolDicCnt.add(nodeAPercentCnt);
-        nodeAPercentPoolDic.setValue(nodeAPercentPoolDicCnt.toString());
-        dataDictionaryCustomMapper.updateById(nodeAPercentPoolDic);
-
-        BigDecimal nodeAPercentCntAva = superNodePoolPerk(nodeAPercentCnt, NodeCodeEnum.SUPER_NODE.getCode(), FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode());
-
-        if(nodeAPercentCnt.compareTo(nodeAPercentCntAva) > 0){
-            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
-                    1L,
-                    nodeAPercentCnt.subtract(nodeAPercentCntAva),
-                    FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode(),
-                    2,
-                    BigDecimal.ZERO,
-                    null,
-                    chergeRecordId);
-            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
-            dappWalletService.updateWalletMineWithLock(nodeAPercentCnt.subtract(nodeAPercentCntAva),
-                    AppContants.YL_MEMBER_ID,1);
-        }
-        /**
-         * 5%基金会
-         */
-        DataDictionaryCustom foundationAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.FOUNDATION_A_PERCENT.getType(),
-                PoolEnum.FOUNDATION_A_PERCENT.getCode()
-        );
-        BigDecimal foundationAPercent = new BigDecimal(StrUtil.isEmpty(foundationAPercentDic.getValue()) ? "0.05" : foundationAPercentDic.getValue());
-        BigDecimal foundationAPercentCnt = realCnt.multiply(foundationAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        //生成一条5%基金会的资金流水记录
-        DappFundFlowEntity foundationAPercentFundFlow = new DappFundFlowEntity(
-                295L,
-                foundationAPercentCnt,
-                FundFlowEnum.FOUNDATION_A_PERCENT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(foundationAPercentFundFlow);
-        //用户的A币账户增加memberGetACnt数量
-        dappWalletService.updateWalletMineWithLock(foundationAPercentCnt,295L,1);
-        /**
-         * 10%级差奖
-         */
-        DataDictionaryCustom levelAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
-                PoolEnum.LEVEL_A_PERCENT.getType(),
-                PoolEnum.LEVEL_A_PERCENT.getCode()
-        );
-        BigDecimal levelAPercent = new BigDecimal(StrUtil.isEmpty(levelAPercentDic.getValue()) ? "0.1" : levelAPercentDic.getValue());
-        BigDecimal levelAPercentCnt = realCnt.multiply(levelAPercent).setScale(4, BigDecimal.ROUND_DOWN);
-
-        //生成一条10%级差奖进入10%级差奖底池的资金流水记录
-        DappFundFlowEntity levelAPercentCntFundFlow = new DappFundFlowEntity(
-                1L,
-                levelAPercentCnt,
-                FundFlowEnum.LEVEL_A_PERCENT_CNT.getCode(),
-                2,
-                BigDecimal.ZERO,
-                null,
-                chergeRecordId);
-        dappFundFlowDao.insert(levelAPercentCntFundFlow);
-        chainProducer.sendAntACoinInLevelMsg(levelAPercentCntFundFlow.getId());
-
-        /**
-         * 更新用户为有效用户
-         */
-        dappMemberDao.updateMemberActiveStatus(1,memberId);
+//        DataDictionaryCustom memberGetAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.MEMBER_GET_A_PERCENT.getType(),
+//                PoolEnum.MEMBER_GET_A_PERCENT.getCode()
+//        );
+//        BigDecimal memberGetAPercent = new BigDecimal(StrUtil.isEmpty(memberGetAPercentDic.getValue()) ? "0.5" : memberGetAPercentDic.getValue());
+//        BigDecimal memberGetACnt = realCnt.multiply(memberGetAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        BigDecimal fundFlowToMemberFlag = this.getAndUpdateMemberPerk(dappFundFlowEntity.getMemberId(), memberGetACnt);
+//        if(fundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
+//            //生成一条50%客户秒到的资金流水记录
+//            DappFundFlowEntity fundFlowToMember = new DappFundFlowEntity(
+//                    dappFundFlowEntity.getMemberId(),
+//                    fundFlowToMemberFlag,
+//                    FundFlowEnum.MEMBER_GET_A_CNT.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    chergeRecordId);
+//            dappFundFlowDao.insert(fundFlowToMember);
+//            //用户的A币账户增加memberGetACnt数量
+//            dappWalletService.updateWalletMineWithLock(fundFlowToMemberFlag,dappFundFlowEntity.getMemberId(),1);
+//        }
+//        /**
+//         * 20%全网加权分红(按20%释放递减)进入加权分红底池
+//         */
+//        DataDictionaryCustom poolAllMemberAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getType(),
+//                PoolEnum.POOL_ALL_MEMBER_A_PERCENT.getCode()
+//        );
+//        BigDecimal poolAllMemberAPercent = new BigDecimal(StrUtil.isEmpty(poolAllMemberAPercentDic.getValue()) ? "0.2" : poolAllMemberAPercentDic.getValue());
+//        BigDecimal poolAllMemberAPercentCnt = realCnt.multiply(poolAllMemberAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        DataDictionaryCustom poolAllMemberACntDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.POOL_ALL_MEMBER_A_CNT.getType(),
+//                PoolEnum.POOL_ALL_MEMBER_A_CNT.getCode()
+//        );
+//        BigDecimal poolAllMemberACnt = new BigDecimal(StrUtil.isEmpty(poolAllMemberACntDic.getValue()) ? "0" : poolAllMemberACntDic.getValue());
+//        poolAllMemberACnt = poolAllMemberACnt.add(poolAllMemberAPercentCnt);
+//        poolAllMemberACntDic.setValue(poolAllMemberACnt.toString());
+//        dataDictionaryCustomMapper.updateById(poolAllMemberACntDic);
+//        //生成一条20%全网加权分红(按20%释放递减)进入加权分红底池的资金流水记录
+//        DappFundFlowEntity poolAllMemberAFundFlow = new DappFundFlowEntity(
+//                1L,
+//                poolAllMemberAPercentCnt,
+//                FundFlowEnum.POOL_ALL_MEMBER_A_CNT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(poolAllMemberAFundFlow);
+//
+//        /**
+//         * 20%全网加权平分,按照个人投资占比全网的比例去平分
+//         */
+//        chainProducer.sendAllMemberPerkAvaMsg(poolAllMemberAFundFlow.getId());
+//        /**
+//         * 10%直推
+//         */
+//        DataDictionaryCustom directAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.DIRECT_A_PERCENT.getType(),
+//                PoolEnum.DIRECT_A_PERCENT.getCode()
+//        );
+//        BigDecimal directAPercent = new BigDecimal(StrUtil.isEmpty(directAPercentDic.getValue()) ? "0.1" : directAPercentDic.getValue());
+//        BigDecimal directAPercentCnt = realCnt.multiply(directAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        String refererId = dappMemberEntity.getRefererId();
+//        DappMemberEntity directMemberEntity = dappMemberDao.selectMemberInfoByInviteId(refererId);
+//        if(ObjectUtil.isNotEmpty(directMemberEntity)){
+//            /**
+//             *推荐用户入单可享有贡献值.例.推荐100获得100贡献值
+//             */
+//            DappUsdtPerkEntity directDappUsdtPerkEntity = dappUsdtPerkEntityMapper.selectByMemberId(directMemberEntity.getId());
+//            if(ObjectUtil.isEmpty(directDappUsdtPerkEntity)){
+//                directDappUsdtPerkEntity = new DappUsdtPerkEntity();
+//                directDappUsdtPerkEntity.setNftDevote(amount);
+//                directDappUsdtPerkEntity.setMemberId(directMemberEntity.getId());
+//                dappUsdtPerkEntityMapper.insert(directDappUsdtPerkEntity);
+//            }
+//
+//            BigDecimal directNftDevote = directDappUsdtPerkEntity.getNftDevote();
+//            directNftDevote = directNftDevote.add(amount);
+//            directDappUsdtPerkEntity.setNftDevote(directNftDevote);
+//            dappUsdtPerkEntityMapper.updateById(directDappUsdtPerkEntity);
+//
+//            BigDecimal directAPercentFundFlowToMemberFlag = this.getAndUpdateMemberPerk(directMemberEntity.getId(), directAPercentCnt);
+//            if(directAPercentFundFlowToMemberFlag.compareTo(BigDecimal.ZERO) > 0){
+//                //生成一条10%直推的资金流水记录
+//                DappFundFlowEntity directAPercentFundFlowToMember = new DappFundFlowEntity(
+//                        directMemberEntity.getId(),
+//                        directAPercentFundFlowToMemberFlag,
+//                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
+//                        2,
+//                        BigDecimal.ZERO,
+//                        null,
+//                        chergeRecordId);
+//                dappFundFlowDao.insert(directAPercentFundFlowToMember);
+//                //用户的A币账户增加directAPercentCnt数量
+//                dappWalletService.updateWalletMineWithLock(directAPercentFundFlowToMemberFlag,directMemberEntity.getId(),1);
+//            }
+//            if(directAPercentCnt.compareTo(directAPercentFundFlowToMemberFlag) > 0){
+//                DappFundFlowEntity directAPercentFundFlowToMemberAva = new DappFundFlowEntity(
+//                        1L,
+//                        directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
+//                        FundFlowEnum.DIRECT_A_PERCENT.getCode(),
+//                        2,
+//                        BigDecimal.ZERO,
+//                        null,
+//                        chergeRecordId);
+//                dappFundFlowDao.insert(directAPercentFundFlowToMemberAva);
+//                dappWalletService.updateWalletMineWithLock(directAPercentCnt.subtract(directAPercentFundFlowToMemberFlag),
+//                        AppContants.YL_MEMBER_ID,1);
+//            }
+//        }
+//        /**
+//         * 5%节点
+//         */
+//        DataDictionaryCustom nodeAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_A_PERCENT.getType(),
+//                PoolEnum.NODE_A_PERCENT.getCode()
+//        );
+//        BigDecimal nodeAPercent = new BigDecimal(StrUtil.isEmpty(nodeAPercentDic.getValue()) ? "0.05" : nodeAPercentDic.getValue());
+//        BigDecimal nodeAPercentCnt = realCnt.multiply(nodeAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//        //生成一条5%节点的资金流水记录
+//        DappFundFlowEntity nodeAPercentFundFlow = new DappFundFlowEntity(
+//                1L,
+//                nodeAPercentCnt,
+//                FundFlowEnum.NODE_A_PERCENT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(nodeAPercentFundFlow);
+////        chainProducer.sendAntACoinInNodeMsg(nodeAPercentFundFlow.getId());
+//        DataDictionaryCustom nodeAPercentPoolDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.NODE_A_PERCENT_POOL.getType(),
+//                PoolEnum.NODE_A_PERCENT_POOL.getCode()
+//        );
+//        BigDecimal nodeAPercentPoolDicCnt = new BigDecimal(StrUtil.isEmpty(nodeAPercentPoolDic.getValue()) ? "0" : nodeAPercentPoolDic.getValue());
+//        nodeAPercentPoolDicCnt = nodeAPercentPoolDicCnt.add(nodeAPercentCnt);
+//        nodeAPercentPoolDic.setValue(nodeAPercentPoolDicCnt.toString());
+//        dataDictionaryCustomMapper.updateById(nodeAPercentPoolDic);
+//
+//        BigDecimal nodeAPercentCntAva = superNodePoolPerk(nodeAPercentCnt, NodeCodeEnum.SUPER_NODE.getCode(), FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode());
+//
+//        if(nodeAPercentCnt.compareTo(nodeAPercentCntAva) > 0){
+//            DappFundFlowEntity nodeAPercentFundFlowAva = new DappFundFlowEntity(
+//                    1L,
+//                    nodeAPercentCnt.subtract(nodeAPercentCntAva),
+//                    FundFlowEnum.NODE_A_PERCENT_TO_MEMBER.getCode(),
+//                    2,
+//                    BigDecimal.ZERO,
+//                    null,
+//                    chergeRecordId);
+//            dappFundFlowDao.insert(nodeAPercentFundFlowAva);
+//            dappWalletService.updateWalletMineWithLock(nodeAPercentCnt.subtract(nodeAPercentCntAva),
+//                    AppContants.YL_MEMBER_ID,1);
+//        }
+//        /**
+//         * 5%基金会
+//         */
+//        DataDictionaryCustom foundationAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.FOUNDATION_A_PERCENT.getType(),
+//                PoolEnum.FOUNDATION_A_PERCENT.getCode()
+//        );
+//        BigDecimal foundationAPercent = new BigDecimal(StrUtil.isEmpty(foundationAPercentDic.getValue()) ? "0.05" : foundationAPercentDic.getValue());
+//        BigDecimal foundationAPercentCnt = realCnt.multiply(foundationAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        //生成一条5%基金会的资金流水记录
+//        DappFundFlowEntity foundationAPercentFundFlow = new DappFundFlowEntity(
+//                295L,
+//                foundationAPercentCnt,
+//                FundFlowEnum.FOUNDATION_A_PERCENT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(foundationAPercentFundFlow);
+//        //用户的A币账户增加memberGetACnt数量
+//        dappWalletService.updateWalletMineWithLock(foundationAPercentCnt,295L,1);
+//        /**
+//         * 10%级差奖
+//         */
+//        DataDictionaryCustom levelAPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+//                PoolEnum.LEVEL_A_PERCENT.getType(),
+//                PoolEnum.LEVEL_A_PERCENT.getCode()
+//        );
+//        BigDecimal levelAPercent = new BigDecimal(StrUtil.isEmpty(levelAPercentDic.getValue()) ? "0.1" : levelAPercentDic.getValue());
+//        BigDecimal levelAPercentCnt = realCnt.multiply(levelAPercent).setScale(4, BigDecimal.ROUND_DOWN);
+//
+//        //生成一条10%级差奖进入10%级差奖底池的资金流水记录
+//        DappFundFlowEntity levelAPercentCntFundFlow = new DappFundFlowEntity(
+//                1L,
+//                levelAPercentCnt,
+//                FundFlowEnum.LEVEL_A_PERCENT_CNT.getCode(),
+//                2,
+//                BigDecimal.ZERO,
+//                null,
+//                chergeRecordId);
+//        dappFundFlowDao.insert(levelAPercentCntFundFlow);
+//        chainProducer.sendAntACoinInLevelMsg(levelAPercentCntFundFlow.getId());
+//
+//        /**
+//         * 更新用户为有效用户
+//         */
+//        dappMemberDao.updateMemberActiveStatus(1,memberId);
 
     }
 
@@ -2471,6 +2471,51 @@
                 memberId,amount,amount,DateUtil.date(),orderId,1,mallOrderInfo.getPayTime()
         );
         mallAchieveRecordMapper.insert(mallAchieveRecord);
+
+        DappFundFlowEntity achieveFlow = new DappFundFlowEntity(
+                memberId,
+                amount,
+                FundFlowEnum.ACHIEVE_ADD.getCode(),
+                2,
+                BigDecimal.ZERO,
+                null,
+                orderId);
+        dappFundFlowDao.insert(achieveFlow);
+        /**
+         * 商城销售额1%-10%,可设定进入资产管理池
+         * USDT_ORDER_PERCENT
+         */
+        DataDictionaryCustom orderPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.USDT_ORDER_PERCENT.getType(),
+                DataDictionaryEnum.USDT_ORDER_PERCENT.getCode()
+        );
+        if(ObjectUtil.isNotEmpty(orderPercentDic)){
+            BigDecimal orderPercent = new BigDecimal(StrUtil.isEmpty(orderPercentDic.getValue()) ? "0.1" : orderPercentDic.getValue());
+            BigDecimal addPoor = amount.multiply(orderPercent);
+
+            DataDictionaryCustom packageScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                    DataDictionaryEnum.PACKAGE_SCORE_PRICE.getType(),
+                    DataDictionaryEnum.PACKAGE_SCORE_PRICE.getCode()
+            );
+            DataDictionaryCustom packageTotalScoreDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                    DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getType(),
+                    DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getCode()
+            );
+            BigDecimal packageTotalScore = new BigDecimal(ObjectUtil.isEmpty(packageTotalScoreDic) ? "21000" : packageTotalScoreDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN);
+            //更新USDT底池
+            DataDictionaryCustom packagePoorDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                    DataDictionaryEnum.PACKAGE_POOR.getType(),
+                    DataDictionaryEnum.PACKAGE_POOR.getCode()
+            );
+            BigDecimal packagePoor = new BigDecimal(ObjectUtil.isEmpty(packagePoorDic) ? "0" : packagePoorDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN);
+            BigDecimal avaPackagePoor = packagePoor.add(addPoor);
+            packagePoorDic.setValue(avaPackagePoor.toString());
+            dataDictionaryCustomMapper.updateById(packagePoorDic);
+            //计算当前价格
+            BigDecimal divide = avaPackagePoor.divide(packageTotalScore, 8, BigDecimal.ROUND_DOWN);
+            packageScorePriceDic.setValue(divide.toString());
+            dataDictionaryCustomMapper.updateById(packageScorePriceDic);
+        }
 
     }
 
@@ -2578,23 +2623,10 @@
             for(MallAchieveRecord mallAchieveRecord : mallAchieveRecords){
                 //释放总额
                 BigDecimal costAmount = mallAchieveRecord.getCostAmount();
-                //剩余
-                BigDecimal amount = mallAchieveRecord.getAmount();
-                if(BigDecimal.ZERO.compareTo(amount) >= 0){
-                    mallAchieveRecord.setIsNormal(2);
-                    mallAchieveRecordMapper.updateById(mallAchieveRecord);
-                    continue;
-                }
                 //每日释放金额
                 BigDecimal eachDayPerk = costAmount.multiply(staticRelease).setScale(2,BigDecimal.ROUND_DOWN);
-                if(eachDayPerk.compareTo(amount) >= 0){
-                    eachDayPerk = amount;
-                    mallAchieveRecord.setIsNormal(2);
-                }
                 DappMemberEntity mallAchieveMemberEntity = dappMemberDao.selectById(mallAchieveRecord.getMemberId());
                 sendPerk(mallAchieveMemberEntity,eachDayPerk,mallAchieveRecord.getOrderId(),FundFlowEnum.STATIC_RELEASE.getCode());
-                //实时更新用户等级
-                chainProducer.sendAutoLevelUpTeamMsg(perkMemberId);
             }
 
         }
@@ -2627,7 +2659,7 @@
 
             //需要判断小区业绩
             if( MemberLevelEnum.V1.getType().equals(nextLevelName)){
-                if (!teamAchieve(parent, teamLevelPerk)) {
+                if (!teamAchieveOther(parent, teamLevelPerk)) {
                     continue;
                 }
             }else{
@@ -2677,7 +2709,6 @@
     }
     /**
      * 团队业绩是否达标
-     *  除去直属的最大的一个业绩团队,剩余的所有业绩之和
      */
     private boolean teamAchieveOther(DappMemberEntity member, TeamLevelPerk teamLevelPerk ) {
         BigDecimal teamIncome = teamLevelPerk.getSmallAchieve();
@@ -2756,13 +2787,37 @@
          * 直推消费分享:享受直接分享人每日消费金额释放的100%加速;
          */
         for(DappMemberEntity dappMemberEntity : dappMemberEntityList){
-            Long memberId = dappMemberEntity.getId();
             String inviteId = dappMemberEntity.getInviteId();
             //该用户全部的直推用户
             List<DappMemberEntity> dappMemberEntities = dappMemberDao.selectChildMemberDirectOrNot(inviteId, 1, 1);
             for(DappMemberEntity directMember : dappMemberEntities){
+                if(1 != directMember.getActiveStatus()){
+                    return;
+                }
                 Long directMemberId = directMember.getId();
-                chainProducer.sendDirectPerkMsg(directMemberId);
+
+                DataDictionaryCustom directReleaseDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                        DataDictionaryEnum.DIRECT_RELEASE.getType(),
+                        DataDictionaryEnum.DIRECT_RELEASE.getCode()
+                );
+                if(ObjectUtil.isEmpty(directReleaseDic)){
+                    return;
+                }
+                BigDecimal directRelease = new BigDecimal(directReleaseDic.getValue() == null ? "0" : directReleaseDic.getValue());
+                if(BigDecimal.ZERO.compareTo(directRelease) >= 0){
+                    return;
+                }
+                DappMemberEntity parentMember = dappMemberDao.selectMemberInfoByInviteId(dappMemberEntity.getRefererId());
+                /**
+                 * 获取用户前一天的所有返利记录
+                 */
+                List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByMemberIdAndTypeAndDate(directMemberId,
+                        FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),-12));
+                for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){
+                    BigDecimal staticReleaseAmount = dappFundFlowEntity.getAmount();
+                    BigDecimal directReleaseAmount = staticReleaseAmount.multiply(directRelease).setScale(2, BigDecimal.ROUND_DOWN);
+                    sendPerk(parentMember,directReleaseAmount,dappFundFlowEntity.getSystemProfitId(),FundFlowEnum.DIRECT_AMOUNT.getCode());
+                }
             }
         }
     }
@@ -2790,7 +2845,7 @@
          * 获取用户前一天的所有返利记录
          */
         List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByMemberIdAndTypeAndDate(memberId,
-                FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),12));
+                FundFlowEnum.STATIC_RELEASE.getCode(),DateUtil.offsetHour(DateUtil.date(),-12));
         for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){
             BigDecimal staticReleaseAmount = dappFundFlowEntity.getAmount();
             BigDecimal directReleaseAmount = staticReleaseAmount.multiply(directRelease).setScale(2, BigDecimal.ROUND_DOWN);
@@ -2811,34 +2866,350 @@
         BigDecimal staticRelease = new BigDecimal(ObjectUtil.isEmpty(staticReleaseDic) ? "0.006" : staticReleaseDic.getValue());
 
         List<DappMemberEntity> dappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V1.getType());
+        shareStaticPerk(dappMemberEntities,FundFlowEnum.SHARE_PERK_V1.getCode());
         teamStaticPerkMemberLevel(dappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V1.getCode());
+        isAllPerkMemberLevel(dappMemberEntities,MemberLevelEnum.V1.getType(),FundFlowEnum.ALL_PERK_V1.getCode());
 
         List<DappMemberEntity> v2DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V2.getType());
+        shareStaticPerk(v2DappMemberEntities,FundFlowEnum.SHARE_PERK_V2.getCode());
         teamStaticPerkMemberLevel(v2DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V2.getCode());
+        isAllPerkMemberLevel(v2DappMemberEntities,MemberLevelEnum.V2.getType(),FundFlowEnum.ALL_PERK_V2.getCode());
 
         List<DappMemberEntity> v3DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V3.getType());
+        shareStaticPerk(v3DappMemberEntities,FundFlowEnum.SHARE_PERK_V3.getCode());
         teamStaticPerkMemberLevel(v3DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V3.getCode());
+        isAllPerkMemberLevel(v3DappMemberEntities,MemberLevelEnum.V3.getType(),FundFlowEnum.ALL_PERK_V3.getCode());
 
         List<DappMemberEntity> v4DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V4.getType());
+        shareStaticPerk(v4DappMemberEntities,FundFlowEnum.SHARE_PERK_V4.getCode());
         teamStaticPerkMemberLevel(v4DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V4.getCode());
+        isAllPerkMemberLevel(v4DappMemberEntities,MemberLevelEnum.V4.getType(),FundFlowEnum.ALL_PERK_V4.getCode());
 
         List<DappMemberEntity> v5DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V5.getType());
+        shareStaticPerk(v5DappMemberEntities,FundFlowEnum.SHARE_PERK_V5.getCode());
         teamStaticPerkMemberLevel(v5DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V5.getCode());
+        isAllPerkMemberLevel(v5DappMemberEntities,MemberLevelEnum.V5.getType(),FundFlowEnum.ALL_PERK_V5.getCode());
 
         List<DappMemberEntity> v6DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V6.getType());
+        shareStaticPerk(v6DappMemberEntities,FundFlowEnum.SHARE_PERK_V6.getCode());
         teamStaticPerkMemberLevel(v6DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V6.getCode());
+        isAllPerkMemberLevel(v6DappMemberEntities,MemberLevelEnum.V6.getType(),FundFlowEnum.ALL_PERK_V6.getCode());
 
         List<DappMemberEntity> v7DappMemberEntities = dappMemberDao.selectMemberByAccountType(MemberLevelEnum.V7.getType());
+        shareStaticPerk(v7DappMemberEntities,FundFlowEnum.SHARE_PERK_V7.getCode());
         teamStaticPerkMemberLevel(v7DappMemberEntities,teamPerkEquals,staticRelease,FundFlowEnum.TEAM_PERK_V7.getCode());
+        isAllPerkMemberLevel(v7DappMemberEntities,MemberLevelEnum.V7.getType(),FundFlowEnum.ALL_PERK_V7.getCode());
 
     }
 
-    public void shareStaticPerk(List<DappMemberEntity> dappMemberEntities,int code) {
+    @Override
+    public void updateAchieve() {
+        /**
+         * 每个人预期获得的总流水
+         */
+        List<DappFundFlowEntity> dappFundFlowEntities = dappFundFlowDao.selectListByTypeAndDate(FundFlowEnum.ADD_AMOUNT.getCode(), DateUtil.date());
+        if(CollUtil.isEmpty(dappFundFlowEntities)){
+            return;
+        }
+        for(DappFundFlowEntity dappFundFlowEntity : dappFundFlowEntities){
+            Long memberId = dappFundFlowEntity.getMemberId();
+            //当日预期总收益
+            BigDecimal amount = dappFundFlowEntity.getAmount();
+            if(BigDecimal.ZERO.compareTo(amount) >= 0){
+                continue;
+            }
+            //当日预期总收益
+            BigDecimal amountMagic = amount;
+            List<MallAchieveRecord> mallAchieveRecords = mallAchieveRecordMapper.selectListByMemberId(memberId);
+            if(CollUtil.isEmpty(mallAchieveRecords)){
+                return;
+            }
+            //实际获取总收益
+            BigDecimal localTotalAchieve = BigDecimal.ZERO;
+            BigDecimal totalAchieve = mallAchieveRecords.stream().map(MallAchieveRecord::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
+
+            //用户每日获取的最大值
+            DataDictionaryCustom maxReleaseDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                    DataDictionaryEnum.MAX_RELEASE.getType(),
+                    DataDictionaryEnum.MAX_RELEASE.getCode()
+            );
+            BigDecimal maxRelease = new BigDecimal(ObjectUtil.isEmpty(maxReleaseDic) ? "1" : maxReleaseDic.getValue());
+            //用户每日获取的最大值
+            BigDecimal maxReleaseMember = totalAchieve.multiply(maxRelease).setScale(2, BigDecimal.ROUND_DOWN);
+            if(amount.compareTo(maxReleaseMember) > 0){
+                amount = maxReleaseMember;
+            }
+            //当日获取总收益大于总业绩
+            if(amount.compareTo(totalAchieve) >= 0){
+                for(MallAchieveRecord memberAchieve : mallAchieveRecords){
+                    memberAchieve.setIsNormal(2);
+                    memberAchieve.setAmount(BigDecimal.ZERO);
+                    mallAchieveRecordMapper.updateById(memberAchieve);
+                }
+                localTotalAchieve = totalAchieve;
+                amount = amount.subtract(totalAchieve);
+            }else{
+                /**
+                 *
+                 * amount 100 a1 100 a2 30 a3 10
+                 * localTotalAchieve 100 100
+                 * amount 0 0
+                 *
+                 */
+                for(MallAchieveRecord memberAchieve : mallAchieveRecords){
+                    BigDecimal achieveAmount = memberAchieve.getAmount();
+                    if(BigDecimal.ZERO.compareTo(amount) >= 0){
+                        break;
+                    }else if(amount.compareTo(achieveAmount) < 0){
+                        memberAchieve.setAmount(achieveAmount.subtract(amount).setScale(2,BigDecimal.ROUND_DOWN));
+                        mallAchieveRecordMapper.updateById(memberAchieve);
+                        localTotalAchieve = localTotalAchieve.add(amount);
+                        amount = BigDecimal.ZERO;
+                        continue;
+                    }else{
+                        memberAchieve.setIsNormal(2);
+                        memberAchieve.setAmount(BigDecimal.ZERO);
+                        mallAchieveRecordMapper.updateById(memberAchieve);
+                        localTotalAchieve = localTotalAchieve.add(achieveAmount);
+                        amount = amount.subtract(achieveAmount);
+                    }
+                }
+            }
+
+            /**
+             * 用户减少赠送积分
+             */
+            DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
+            DappWalletMineEntity dappWalletMineEntity = dappWalletMineDao.selectByMemberId(memberId);
+            BigDecimal totalScore = dappWalletMineEntity.getTotalAmount();
+            BigDecimal availableScore = dappWalletMineEntity.getAvailableAmount();
+
+            if(localTotalAchieve.compareTo(totalScore) >= 0){
+                localTotalAchieve = totalScore;
+                //当实际获取大于用户的赠送积分,将用户更新为未激活
+                dappMemberEntity.setActiveStatus(2);
+                dappMemberDao.updateById(dappMemberEntity);
+            }
+
+            DappAccountMoneyChangeEntity reduceScoreAMC = new DappAccountMoneyChangeEntity(
+                    memberId,
+                    totalScore,
+                    amountMagic.negate(),
+                    localTotalAchieve.negate(),
+                    FundFlowEnum.REDUCE_SCORE.getCode(),
+                    null);
+            dappAccountMoneyChangeDao.insert(reduceScoreAMC);
+
+            //插入积分流水
+            DappFundFlowEntity scoreFlow = new DappFundFlowEntity(
+                    memberId,
+                    localTotalAchieve.negate(),
+                    FundFlowEnum.REDUCE_SCORE_REAL.getCode(),
+                    DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
+                    BigDecimal.ZERO);
+            dappFundFlowDao.insert(scoreFlow);
+
+            BigDecimal totalScoreRelease = totalScore.subtract(localTotalAchieve);
+            BigDecimal availableScoreRelease = availableScore.subtract(localTotalAchieve);
+            //更新积分账户
+            dappWalletMineEntity.setTotalAmount(totalScoreRelease);
+            dappWalletMineEntity.setAvailableAmount(availableScoreRelease);
+            dappWalletMineDao.updateById(dappWalletMineEntity);
+
+
+            //用户增加余额
+            DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(memberId);
+            BigDecimal totalAmount = dappWalletCoinEntity.getTotalAmount();
+            BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
+
+            DappAccountMoneyChangeEntity addAmountAMC = new DappAccountMoneyChangeEntity(
+                    memberId,
+                    totalAmount,
+                    amountMagic,
+                    localTotalAchieve,
+                    FundFlowEnum.ADD_AMOUNT_REAL.getCode(),
+                    null);
+            dappAccountMoneyChangeDao.insert(addAmountAMC);
+            //插入余额流水
+            DappFundFlowEntity amountFlow = new DappFundFlowEntity(
+                    memberId,
+                    localTotalAchieve,
+                    FundFlowEnum.ADD_AMOUNT_REAL.getCode(),
+                    DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
+                    BigDecimal.ZERO);
+            dappFundFlowDao.insert(amountFlow);
+
+            BigDecimal totalAmountRelease = totalAmount.add(localTotalAchieve);
+            BigDecimal availableAmountRelease = availableAmount.add(localTotalAchieve);
+            //更新余额账户
+            dappWalletCoinEntity.setTotalAmount(totalAmountRelease);
+            dappWalletCoinEntity.setAvailableAmount(availableAmountRelease);
+            dappWalletCoinDao.updateById(dappWalletCoinEntity);
+
+            DappAccountMoneyChangeEntity record = new DappAccountMoneyChangeEntity(
+                    memberId,
+                    amountMagic,
+                    maxReleaseMember,
+                    localTotalAchieve,
+                    FundFlowEnum.AMOUNT_RECORD.getCode(),
+                    null);
+            dappAccountMoneyChangeDao.insert(record);
+
+            //实时更新用户等级
+            chainProducer.sendAutoLevelUpTeamMsg(memberId);
+        }
+
+    }
+
+    @Override
+    public void speedSalePackageMsg(Long flowId) {
+        DappFundFlowEntity dappFundFlowEntity = dappFundFlowDao.selectById(flowId);
+        if(DappFundFlowEntity.WITHDRAW_STATUS_ING != dappFundFlowEntity.getStatus()){
+            return;
+        }
+        BigDecimal cnt = dappFundFlowEntity.getAmount();
+        Long memberId = dappFundFlowEntity.getMemberId();
+        DappMemberEntity dappMemberEntity = dappMemberDao.selectById(memberId);
+        if(BigDecimal.ZERO.compareTo(cnt) >= 0){
+            return;
+        }
+        DataDictionaryCustom packageScorePriceDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.PACKAGE_SCORE_PRICE.getType(),
+                DataDictionaryEnum.PACKAGE_SCORE_PRICE.getCode()
+        );
+        BigDecimal packageScorePrice = new BigDecimal(ObjectUtil.isEmpty(packageScorePriceDic) ? "0" : packageScorePriceDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN);
+        //卖出资产乘以价格获取到预期获取的总额
+        BigDecimal totalAmount = cnt.multiply(packageScorePrice).setScale(2, BigDecimal.ROUND_DOWN);
+        //资产包卖出划入底池比例
+        DataDictionaryCustom packageToPoorPercentDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.PACKAGE_SALE_TO_POOR_PERCENT.getType(),
+                DataDictionaryEnum.PACKAGE_SALE_TO_POOR_PERCENT.getCode()
+        );
+        BigDecimal packageToPoorPercent = new BigDecimal(ObjectUtil.isEmpty(packageToPoorPercentDic) ? "0.1" : packageToPoorPercentDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN);
+        //划入底池的金额
+        BigDecimal poorAmount = totalAmount.multiply(packageToPoorPercent).setScale(2, BigDecimal.ROUND_DOWN);
+        //实际获取的金额
+        BigDecimal realAmount = totalAmount.subtract(poorAmount);
+        //生成一条资金流水
+        DappFundFlowEntity scoreFlow = new DappFundFlowEntity(
+                memberId,
+                realAmount,
+                FundFlowEnum.SALE_PACKAGE_AMOUNT.getCode(),
+                DappFundFlowEntity.WITHDRAW_STATUS_ING,
+                BigDecimal.ZERO);
+        dappFundFlowDao.insert(scoreFlow);
+        dappWalletCoinDao.addTotalAndaddAvailableByMemberId(memberId,realAmount);
+        DappFundFlowEntity feeFlow = new DappFundFlowEntity(
+                memberId,
+                poorAmount,
+                FundFlowEnum.SALE_PACKAGE_AMOUNT_FEE.getCode(),
+                DappFundFlowEntity.WITHDRAW_STATUS_ING,
+                BigDecimal.ZERO);
+        dappFundFlowDao.insert(feeFlow);
+
+        //卖出积分直接销毁。
+        DataDictionaryCustom packageTotalScoreDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getType(),
+                DataDictionaryEnum.PACKAGE_TOTAL_SCORE.getCode()
+        );
+        BigDecimal packageTotalScore = new BigDecimal(ObjectUtil.isEmpty(packageTotalScoreDic) ? "21000" : packageTotalScoreDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal avaPackageTotalScore = packageTotalScore.subtract(cnt);
+        packageTotalScoreDic.setValue(avaPackageTotalScore.toString());
+        dataDictionaryCustomMapper.updateById(packageTotalScoreDic);
+        //更新USDT底池
+        DataDictionaryCustom packagePoorDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                DataDictionaryEnum.PACKAGE_POOR.getType(),
+                DataDictionaryEnum.PACKAGE_POOR.getCode()
+        );
+        BigDecimal packagePoor = new BigDecimal(ObjectUtil.isEmpty(packagePoorDic) ? "0" : packagePoorDic.getValue()).setScale(2, BigDecimal.ROUND_DOWN);
+        BigDecimal avaPackagePoor = packagePoor.add(poorAmount);
+        packagePoorDic.setValue(avaPackagePoor.toString());
+        dataDictionaryCustomMapper.updateById(packagePoorDic);
+        //计算当前价格
+        BigDecimal divide = avaPackagePoor.divide(avaPackageTotalScore, 2, BigDecimal.ROUND_DOWN);
+        packageScorePriceDic.setValue(divide.toString());
+        dataDictionaryCustomMapper.updateById(packageScorePriceDic);
+    }
+
+    public void shareStaticPerk(List<DappMemberEntity> dappMemberEntities,
+                                int code) {
         if(CollUtil.isEmpty(dappMemberEntities)){
             return;
         }
         for(DappMemberEntity dappMemberEntity : dappMemberEntities){
+            /**
+             * 每个人的第一次入单之后的业绩不一样
+             */
+            Date createTime = dappMemberEntity.getCreateTime();
+            //下第一单之后的共享区全部业绩
+            BigDecimal totalAchieve = mallAchieveRecordMapper.selectAchieveTotalByCreateTime(createTime);
+            //个人总业绩
+            BigDecimal totalMemberAchieve = mallAchieveRecordMapper.selectAchieveTotalByMemberIdAndCreateTime(dappMemberEntity.getId(), createTime);
+            if(BigDecimal.ZERO.compareTo(totalAchieve) >= 0 || BigDecimal.ZERO.compareTo(totalMemberAchieve) >= 0){
+                continue;
+            }
+            String accountType = dappMemberEntity.getAccountType();
+            DataDictionaryCustom accountTypeDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                    "TEAM_LEVEL", accountType
+            );
+            if(ObjectUtil.isEmpty(accountTypeDic)){
+                continue;
+            }
+            TeamLevelPerk teamLevelPerk = JSONObject.parseObject(accountTypeDic.getValue(), TeamLevelPerk.class);
+            BigDecimal shareMinPercent = teamLevelPerk.getShareMinPercent();
+            BigDecimal sharePerk = totalAchieve.multiply(shareMinPercent).setScale(2,BigDecimal.ROUND_DOWN);
 
+            BigDecimal shareMaxPercent = teamLevelPerk.getShareMaxPercent();
+            BigDecimal maxSharePerk = totalMemberAchieve.multiply(shareMaxPercent).setScale(2,BigDecimal.ROUND_DOWN);
+            if(BigDecimal.ZERO.compareTo(sharePerk) >= 0 || BigDecimal.ZERO.compareTo(maxSharePerk) >= 0){
+                continue;
+            }
+            //共享区加速万分之2,上限1.2%(按本金计)
+            if(sharePerk.compareTo(maxSharePerk) >= 0){
+                sharePerk = maxSharePerk;
+            }
+            sendPerk(dappMemberEntity, sharePerk, dappMemberEntity.getId(), code);
+        }
+    }
+
+    public void isAllPerkMemberLevel(List<DappMemberEntity> dappMemberEntities,
+                                     String level,
+                                     int code){
+        if(CollUtil.isEmpty(dappMemberEntities)){
+            return;
+        }
+        DataDictionaryCustom teamPerkMemberDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                "TEAM_LEVEL", level);
+        TeamLevelPerk adminAgentInfo = JSONObject.parseObject(teamPerkMemberDic.getValue(), TeamLevelPerk.class);
+        BigDecimal orderSalePercent = adminAgentInfo.getOrderSalePercent();
+        if(BigDecimal.ZERO.compareTo(orderSalePercent) >= 0){
+            return;
+        }
+        allPerkMemberLevel(dappMemberEntities,level,code);
+
+    }
+
+    public void allPerkMemberLevel(List<DappMemberEntity> dappMemberEntities,
+                                   String level,
+                                   int code) {
+        /**
+         * 全网24小时内的全部分红
+         */
+        Date createTime = DateUtil.offsetHour(DateUtil.date(),-24);
+        //下第一单之后的共享区全部业绩
+        BigDecimal totalAchieve = mallAchieveRecordMapper.selectAchieveTotalByCreateTime(createTime);
+        if(BigDecimal.ZERO.compareTo(totalAchieve) >= 0){
+            return;
+        }
+        DataDictionaryCustom teamPerkMemberDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(
+                "TEAM_LEVEL", level);
+        TeamLevelPerk adminAgentInfo = JSONObject.parseObject(teamPerkMemberDic.getValue(), TeamLevelPerk.class);
+        BigDecimal orderSalePercent = adminAgentInfo.getOrderSalePercent();
+        //每人平分数量
+        BigDecimal divide = totalAchieve.multiply(orderSalePercent).divide(new BigDecimal(dappMemberEntities.size()), 2, BigDecimal.ROUND_DOWN);
+
+        for(DappMemberEntity dappMemberEntity : dappMemberEntities){
+            sendPerk(dappMemberEntity, divide, dappMemberEntity.getId(), code);
         }
     }
 
@@ -2883,7 +3254,7 @@
                 //V1加速团队静态收益的15%=每日静态的20000*6‰*15%=18元的额外释放加速
                 BigDecimal cashAmount = teamIncomeMax.multiply(cashPercent).multiply(staticRelease).setScale(2, BigDecimal.ROUND_DOWN);
 
-                BigDecimal bigDecimal = sendPerk(teamPerkMember, cashAmount, null, code);
+                BigDecimal bigDecimal = sendPerk(teamPerkMember, cashAmount, teamPerkMember.getId(), code);
             }
         }
 
@@ -2892,67 +3263,10 @@
     private BigDecimal sendPerk(DappMemberEntity parentMember,BigDecimal directReleaseAmount,Long orderId
                 ,Integer fundFlowEnumType){
 
-        BigDecimal realScoreReduce = BigDecimal.ZERO;
+        BigDecimal realScoreReduce = directReleaseAmount;
         if(BigDecimal.ZERO.compareTo(directReleaseAmount) >= 0){
             return realScoreReduce;
         }
-        /**
-         * 减少业绩
-         */
-        List<MallAchieveRecord> mallAchieveRecords = mallAchieveRecordMapper.selectListByMemberId(parentMember.getId());
-        if(CollUtil.isEmpty(mallAchieveRecords)){
-            return realScoreReduce;
-        }
-        BigDecimal totalAchieve = mallAchieveRecords.stream().map(MallAchieveRecord::getAmount).reduce(BigDecimal.ZERO, BigDecimal::add);
-        if(directReleaseAmount.compareTo(totalAchieve) >= 0){
-            realScoreReduce = totalAchieve;
-            for(MallAchieveRecord mallAchieveRecord : mallAchieveRecords){
-                mallAchieveRecord.setAmount(BigDecimal.ZERO);
-                mallAchieveRecord.setIsNormal(2);
-                mallAchieveRecordMapper.updateById(mallAchieveRecord);
-            }
-        }
-
-        /**
-         * 用户减少赠送积分
-         */
-        DappWalletMineEntity dappWalletMineEntity = dappWalletMineDao.selectByMemberId(parentMember.getId());
-        BigDecimal totalScore = dappWalletMineEntity.getTotalAmount();
-        BigDecimal availableScore = dappWalletMineEntity.getAvailableAmount();
-        if(BigDecimal.ZERO.compareTo(totalScore) >= 0){
-            parentMember.setActiveStatus(2);
-            dappMemberDao.updateById(parentMember);
-            return realScoreReduce;
-        }
-        if(directReleaseAmount.compareTo(totalScore) > 0){
-            realScoreReduce = totalScore;
-        }else{
-            realScoreReduce = directReleaseAmount;
-        }
-        BigDecimal totalScoreRelease = totalScore.subtract(realScoreReduce);
-        BigDecimal availableScoreRelease = availableScore.subtract(realScoreReduce);
-        //更新积分账户
-        dappWalletMineEntity.setTotalAmount(totalScoreRelease);
-        dappWalletMineEntity.setAvailableAmount(availableScoreRelease);
-        dappWalletMineDao.updateById(dappWalletMineEntity);
-        //插入积分流水
-        DappFundFlowEntity scoreFlow = new DappFundFlowEntity(
-                parentMember.getId(),
-                realScoreReduce.negate(),
-                FundFlowEnum.REDUCE_SCORE.getCode(),
-                DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
-                BigDecimal.ZERO,
-                orderId);
-        dappFundFlowDao.insert(scoreFlow);
-        DappAccountMoneyChangeEntity reduceScoreAMC = new DappAccountMoneyChangeEntity(
-                parentMember.getId(),
-                totalScore,
-                realScoreReduce.negate(),
-                totalScoreRelease,
-                FundFlowEnum.REDUCE_SCORE.getCode(),
-                orderId.toString());
-        dappAccountMoneyChangeDao.insert(reduceScoreAMC);
-
         //生成一条静态补贴的流水
         DappFundFlowEntity realUsdtAmountFlow = new DappFundFlowEntity(
                 parentMember.getId(),
@@ -2962,17 +3276,15 @@
                 BigDecimal.ZERO,
                 orderId);
         dappFundFlowDao.insert(realUsdtAmountFlow);
-        //用户增加余额
-        DappWalletCoinEntity dappWalletCoinEntity = dappWalletCoinDao.selectByMemberId(parentMember.getId());
-        BigDecimal totalAmount = dappWalletCoinEntity.getTotalAmount();
-        BigDecimal availableAmount = dappWalletCoinEntity.getAvailableAmount();
-
-        BigDecimal totalAmountRelease = totalAmount.add(realScoreReduce);
-        BigDecimal availableAmountRelease = availableAmount.add(realScoreReduce);
-        //更新余额账户
-        dappWalletCoinEntity.setTotalAmount(totalAmountRelease);
-        dappWalletCoinEntity.setAvailableAmount(availableAmountRelease);
-        dappWalletCoinDao.updateById(dappWalletCoinEntity);
+        //插入积分流水
+        DappFundFlowEntity scoreFlow = new DappFundFlowEntity(
+                parentMember.getId(),
+                realScoreReduce.negate(),
+                FundFlowEnum.REDUCE_SCORE.getCode(),
+                DappFundFlowEntity.WITHDRAW_STATUS_AGREE,
+                BigDecimal.ZERO,
+                orderId);
+        dappFundFlowDao.insert(scoreFlow);
         //插入余额流水
         DappFundFlowEntity amountFlow = new DappFundFlowEntity(
                 parentMember.getId(),
@@ -2982,15 +3294,6 @@
                 BigDecimal.ZERO,
                 orderId);
         dappFundFlowDao.insert(amountFlow);
-        DappAccountMoneyChangeEntity addAmountAMC = new DappAccountMoneyChangeEntity(
-                parentMember.getId(),
-                totalAmount,
-                realScoreReduce,
-                totalAmountRelease,
-                FundFlowEnum.ADD_AMOUNT.getCode(),
-                orderId.toString());
-        dappAccountMoneyChangeDao.insert(addAmountAMC);
-
         return realScoreReduce;
     }
 

--
Gitblit v1.9.1