陶杰
2024-10-28 66f57ebef36c03353609ad3b2b6623396b5061a4
src/main/java/com/mzl/flower/service/impl/wallet/WalletBillRecordServiceImpl.java
@@ -1,8 +1,11 @@
package com.mzl.flower.service.impl.wallet;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.constant.Constants;
import com.mzl.flower.dto.request.wallet.CreateWalletBillRecordDTO;
import com.mzl.flower.dto.request.wallet.QueryWalletBillDTO;
import com.mzl.flower.dto.response.wallet.WalletBillRecordVO;
import com.mzl.flower.entity.payment.Transfer;
import com.mzl.flower.entity.payment.TransferDetail;
import com.mzl.flower.entity.wallet.WalletBillRecordDO;
@@ -21,6 +24,7 @@
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
/**
 * <p>
@@ -75,7 +79,7 @@
                walletBillRecordDO.update("sys");
                walletBillRecordMapper.updateById(walletBillRecordDO);
                //更新钱包
                WalletDO walletDO = walletService.getBySupplierId(walletBillRecordDO.getWalletId());
                WalletDO walletDO = walletService.getOrCreateBySupplierId(walletBillRecordDO.getWalletId());
                if(!ObjectUtils.isEmpty(walletDO)){
                    //提现中金额:减少提现中金额
                    walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(walletBillRecordDO.getChangeAmount()));
@@ -94,7 +98,7 @@
                walletBillRecordDO.setTransferState(Constants.SETTLEMENT_STATUS.FAILED.name());
                walletBillRecordDO.update("sys");
                walletBillRecordMapper.updateById(walletBillRecordDO);
                WalletDO walletDO = walletService.getBySupplierId(walletBillRecordDO.getWalletId());
                WalletDO walletDO = walletService.getOrCreateBySupplierId(walletBillRecordDO.getWalletId());
                if(!ObjectUtils.isEmpty(walletDO)){
                    //提现中金额:减少提现中金额
                    walletDO.setWithdrawingAmount(walletDO.getWithdrawingAmount().subtract(walletBillRecordDO.getChangeAmount()));
@@ -111,4 +115,11 @@
            }
        }
    }
    @Override
    public Page<WalletBillRecordVO> getPage(Page page, QueryWalletBillDTO dto) {
        List<WalletBillRecordVO> list = walletBillRecordMapper.getPage(page,dto);
        page.setRecords(list);
        return page;
    }
}