xiaoyong931011
2023-04-12 b9a0620107ef818b98a51d65470b1a60e7c143bd
src/main/java/cc/mrbird/febs/mall/service/impl/ApiMallMemberServiceImpl.java
@@ -391,13 +391,24 @@
        if (!loginMember.getTradePassword().equals(SecureUtil.md5(transferDto.getTradePwd()))) {
            throw new FebsException("支付密码错误");
        }
        if(1 == transferDto.getType()){
            walletService.reduceBalance(transferDto.getAmount(), memberId);
            String orderNo = MallUtils.getOrderNum("T");
            this.addMoneyFlow(memberId, transferDto.getAmount().negate(), MoneyFlowTypeEnum.TRANSFER.getValue(), orderNo, null, null, mallMember.getId(), null, FlowTypeEnum.BALANCE.getValue());
        walletService.reduceBalance(transferDto.getAmount(), memberId);
        String orderNo = MallUtils.getOrderNum("T");
        this.addMoneyFlow(memberId, transferDto.getAmount().negate(), MoneyFlowTypeEnum.TRANSFER.getValue(), orderNo, null, null, mallMember.getId(), null, FlowTypeEnum.BALANCE.getValue());
            walletService.addBalance(transferDto.getAmount(), mallMember.getId());
            this.addMoneyFlow(mallMember.getId(), transferDto.getAmount(), MoneyFlowTypeEnum.TRANSFER.getValue(), orderNo, null, null, memberId, null, FlowTypeEnum.BALANCE.getValue());
        }
        if(2 == transferDto.getType()){
            walletService.reduce(transferDto.getAmount(), memberId, "score");
            String orderNo = MallUtils.getOrderNum("T");
            this.addMoneyFlow(memberId, transferDto.getAmount().negate(), MoneyFlowTypeEnum.TRANSFER.getValue(), orderNo, null, null, mallMember.getId(), null, FlowTypeEnum.SCORE.getValue());
        walletService.addBalance(transferDto.getAmount(), mallMember.getId());
        this.addMoneyFlow(mallMember.getId(), transferDto.getAmount(), MoneyFlowTypeEnum.TRANSFER.getValue(), orderNo, null, null, memberId, null, FlowTypeEnum.BALANCE.getValue());
            walletService.add(transferDto.getAmount(), mallMember.getId(), "score");
            this.addMoneyFlow(mallMember.getId(), transferDto.getAmount(), MoneyFlowTypeEnum.TRANSFER.getValue(), orderNo, null, null, memberId, null, FlowTypeEnum.SCORE.getValue());
        }
    }
    @Override
@@ -486,6 +497,7 @@
        MallMemberWallet wallet = mallMemberWalletMapper.selectWalletByMemberId(id);
        commissionVo.setCommissionBalance(wallet.getBalance());
        commissionVo.setCommissionScore(wallet.getScore());
        commissionVo.setCommission(wallet.getCommission());
        commissionVo.setTodayBalance(mallMoneyFlowMapper.selectCommissionIncome(1,1, new Date(), id));
        commissionVo.setMonthBalance(mallMoneyFlowMapper.selectCommissionIncome(1,2, new Date(), id));
        commissionVo.setTotalBalance(mallMoneyFlowMapper.selectCommissionIncome(1, null,null, id));