xiaoyong931011
2023-08-17 b22a9106fe358c891fe446343a3ccb106674a802
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -712,6 +712,38 @@
        memberCoinWithdrawEntity.setStatus(MemberCoinWithdrawEntity.STATUS_YES);
        memberCoinWithdrawEntity.setIsInside(MemberCoinWithdrawEntity.ISINSIDE_NO);
        memberCoinWithdrawDao.updateById(memberCoinWithdrawEntity);
        /**
         * 提现手续费10%进入资产管理池
         * USDT_ORDER_PERCENT
         */
        BigDecimal withdrawFee = dappFundFlowEntity.getFee();
        if(BigDecimal.ZERO.compareTo(withdrawFee) < 0){
            BigDecimal addPoor = withdrawFee;
            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);
        }
        return new FebsResponse().success();
    }
@@ -756,4 +788,12 @@
        IPage<DappAccountMoneyChangeEntity> memberMoneyFlowVos = dappAccountMoneyChangeDao.getChangeInPageInPage(page,changeInPageDto);
        return new FebsResponse().success().data(memberMoneyFlowVos);
    }
    @Override
    public FebsResponse changeInToday() {
        DappMemberEntity member = LoginUserUtil.getAppUser();
        Long memberId = member.getId();
        DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = dappAccountMoneyChangeDao.selectNewOneByMemberId(memberId);
        return new FebsResponse().success().data(dappAccountMoneyChangeEntity);
    }
}