KKSU
2024-03-18 57ac3a35ac056f0a09d8a013e8f3da2ecfe8a7c6
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -493,7 +493,7 @@
        BigDecimal amount = transferDto.getAmount();
        int type = transferDto.getType();
        if(1 != type && 2 != type){
        if(1 != type && 2 != type && 3 != type){
            throw new FebsException("请选择互转类型");
        }
        Integer insideWith = loginMember.getInsideWith() == null ? 2 :loginMember.getInsideWith();
@@ -518,7 +518,6 @@
            throw new FebsException("交易密码错误");
        }
        BigDecimal avaAmount = transferDto.getAmount().setScale(2, BigDecimal.ROUND_DOWN);
        MallMemberAmount mallMemberAmountLogin = mallMemberAmountMapper.selectByMemberId(loginMember.getId());
        MallMemberAmount mallMemberAmount = mallMemberAmountMapper.selectByMemberId(mallMember.getId());
        if(1 == type){
@@ -573,6 +572,32 @@
                    FlowTypeNewEnum.TOKEN.getValue(),
                    MoneyFlowTypeNewEnum.TOKEN_INSIDE_IN.getDescrition());
        }
        if(3 == type){
            if (amount.compareTo(mallMemberAmountLogin.getTrendsNft()) > 0) {
                throw new FebsException("卡牌不足");
            }
            mallMemberAmountLogin.setTrendsNft(mallMemberAmountLogin.getTrendsNft().subtract(amount));
            mallMemberAmountMapper.updateTrendsNftById(mallMemberAmountLogin);
            String orderNo = MallUtils.getOrderNum("NFT");
            mallMoneyFlowService.addMoneyFlow(
                    loginMember.getId(),
                    amount.negate(),
                    MoneyFlowTypeNewEnum.NFT_TRANS_OUT.getValue(),
                    orderNo,
                    mallMember.getId(),
                    FlowTypeNewEnum.NFT.getValue(),
                    MoneyFlowTypeNewEnum.NFT_TRANS_OUT.getDescrition());
            mallMemberAmount.setTrendsNft(mallMemberAmount.getTrendsNft().add(amount));
            mallMemberAmountMapper.updateTrendsNftById(mallMemberAmount);
            mallMoneyFlowService.addMoneyFlow(
                    mallMember.getId(),
                    amount,
                    MoneyFlowTypeNewEnum.NFT_TRANS_IN.getValue(),
                    orderNo,
                    loginMember.getId(),
                    FlowTypeNewEnum.NFT.getValue(),
                    MoneyFlowTypeNewEnum.NFT_TRANS_IN.getDescrition());
        }
    }
    @Override