xiaoyong931011
2022-11-02 0f2d9c88dd791ec907da14f49b3770aada24cee1
src/main/java/cc/mrbird/febs/dapp/service/impl/DappWalletServiceImpl.java
@@ -540,6 +540,11 @@
        DappMemberEntity dappMemberEntityOut = LoginUserUtil.getAppUser();
        Long memberIdOut = dappMemberEntityOut.getId();
        //判断账户是否限制
        Integer withdrawAble = dappMemberEntityOut.getWithdrawAble();
        if(2 == withdrawAble){
            return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_0017"));
        }
        //判断双方是否是会员
        if(ObjectUtil.isEmpty(dappMemberEntityOut.getInviteId())){
            return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_002"));
@@ -593,7 +598,7 @@
        if(balance.compareTo(totalProfitOut) > 0){
            BigDecimal totalAmount = dappWalletCoinEntityOut.getTotalAmount();
            //用户总收益率
            BigDecimal divide = totalProfitOut.divide(totalAmount);
            BigDecimal divide = totalProfitOut.divide(totalAmount,4,BigDecimal.ROUND_DOWN);
            //提现条件收益率
            DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode());
            BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue());
@@ -682,6 +687,12 @@
            return new FebsResponse().fail().message(MessageSourceUtils.getString("balance_err_002"));
        }
        DappMemberEntity dappMemberEntityOut = dappMemberDao.selectById(memberId);
        //判断账户是否限制
        Integer withdrawAble = dappMemberEntityOut.getWithdrawAble();
        if(2 == withdrawAble){
            return new FebsResponse().fail().message(MessageSourceUtils.getString("member_err_0017"));
        }
        //验证资金密码
        Boolean aBoolean = dappMemberService.validateTransferCode(apiTransferOutsideDto.getTransferCode(), memberId);
        if(!aBoolean){
@@ -697,7 +708,7 @@
        if(balance.compareTo(totalProfit) >= 0){
            BigDecimal totalAmount = dappWalletCoinEntity.getTotalAmount();
            //用户总收益率
            BigDecimal divide = totalProfit.divide(totalAmount);
            BigDecimal divide = totalProfit.divide(totalAmount,4,BigDecimal.ROUND_DOWN);
            //提现条件收益率
            DataDictionaryCustom outAccountProfitDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode(DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getType(), DataDictionaryEnum.OUT_ACCOUNT_PROFIT.getCode());
            BigDecimal outAccountProfit = outAccountProfitDic.getValue() == null ? new BigDecimal("0.3") : new BigDecimal(outAccountProfitDic.getValue());
@@ -717,7 +728,7 @@
        }
        //余额减少冻结增加
        Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(memberId, balance);
        Integer count = dappWalletCoinDao.addFrozenAndDelAvailableById(dappWalletCoinEntity.getId(), balance);
        if(1 != count){
            throw new FebsException(MessageSourceUtils.getString("balance_err_002"));
        }
@@ -875,6 +886,9 @@
    public BigDecimal updateLSYJYLFC(List<String> refererIdList,BigDecimal totalProfit) {
        //计算盈利分成
        BigDecimal profitSharingTotal = BigDecimal.ZERO;
        if(BigDecimal.ZERO.compareTo(totalProfit)>=0){
            return profitSharingTotal;
        }
        if(CollUtil.isNotEmpty(refererIdList)){
            String LEVEL_IB = isIdentity(refererIdList, DataDictionaryEnum.LEVEL_IB.getCode());
            if(!DataDictionaryEnum.LEVEL_IB.getCode().equals(LEVEL_IB)){
@@ -1111,8 +1125,11 @@
    @Override
    public BigDecimal updatePTFC(Long memberId, BigDecimal totalProfit) {
        if(BigDecimal.ZERO.compareTo(totalProfit)>=0){
            return BigDecimal.ZERO;
        }
        BigDecimal multiply = totalProfit.multiply(new BigDecimal(0.05));
        DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(
        DappAccountMoneyChangeEntity dappAccountMoneyChangeEntity = new DappAccountMoneyChangeEntity(65L,
                multiply.negate(), "系统", 9);
        dappAccountMoneyChangeDao.insert(dappAccountMoneyChangeEntity);
        return multiply;