DepositRefundBean.java 4.14 KB
package com.glsx.usedcar.export;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.glsx.usedcar.export.converter.RefundStateConverter;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.finance.entity.Deposit;
import com.glsx.usedcar.module.vehicle.entity.BaseInfo;
import jakarta.persistence.Column;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Objects;

@Data
public class DepositRefundBean {

    @ExcelProperty("用户ID")
    @ColumnWidth(10)
    private int accountId;
    @ExcelProperty("用户手机号")
    @ColumnWidth(20)
    private String mobile;
    @ExcelProperty("用户昵称")
    @ColumnWidth(20)
    private String nickName;
    @ExcelProperty("拍场ID")
    @ColumnWidth(10)
    private int auctionId;
    @ExcelProperty("拍场名称")
    @ColumnWidth(30)
    private String auctionName;

    @ExcelProperty("参拍车源号")
    @ColumnWidth(20)
    private String sourceNo;


    @ExcelProperty("参拍车型名称")
    @ColumnWidth(30)
    private String carTypeName;


    @ExcelProperty("商户订单号")
    @ColumnWidth(25)
    private String outTradeNo;


    @ExcelProperty("微信支付订单号")
    @ColumnWidth(25)
    private String transactionId;

    @ExcelProperty("支付金额(元)")
    @ColumnWidth(15)
    private double transactionAmount;

    @ExcelProperty("支付状态")
    @ColumnWidth(15)
    private String paymentState;

    @ExcelProperty("支付时间")
    @ColumnWidth(20)
    private LocalDateTime paymentTime;

    @ExcelProperty("支付渠道")
    @ColumnWidth(15)
    private String paymentType;

    @ExcelProperty("是否中拍")
    @ColumnWidth(15)
    private String orderState;

    @ExcelProperty(value = "退款状态",converter = RefundStateConverter.class)
    @ColumnWidth(15)
    private Deposit.RefundState refundState;

    @ExcelProperty("退款类型")
    @ColumnWidth(15)
    private String refundType;

    @ExcelProperty("退款金额(元)")
    @ColumnWidth(15)
    private double refundAmount;


    @ExcelProperty("微信退款订单号")
    @ColumnWidth(25)
    private String outRefundNo;

    @ExcelProperty("退款申请时间")
    @ColumnWidth(20)
    private LocalDateTime refundTime;

    @ExcelProperty("退款成功时间")
    @ColumnWidth(20)
    private LocalDateTime refundSuccessTime;

    @ExcelProperty("手动退款备注")
    @ColumnWidth(35)
    private String refundRemark;
    @ExcelProperty("退款操作人")
    @ColumnWidth(15)
    private String refundOperator;

    public DepositRefundBean(Deposit deposit) {
        Account account = deposit.getAccount();
        this.accountId = account.getAccountId();
        this.mobile = account.getMobile();
        this.nickName = account.getNickName();
        this.auctionId = deposit.getAuctionVehicle().getAuction().getAuctionId();
        this.auctionName = deposit.getAuctionVehicle().getAuction().getAuctionName();
        BaseInfo baseInfo = deposit.getAuctionVehicle().getVehicle().getBaseInfo();
        this.sourceNo = baseInfo.getSourceNo();
        this.carTypeName = baseInfo.getCarSeriesName() + " "+baseInfo.getCarTypeName();
//        this.outTradeNo = deposit.getOutTradeNo();
//        this.transactionId = deposit.getTransactionId();
//        this.transactionAmount = Math.abs(deposit.getTransaction().getAmount());
//        this.paymentState = Objects.nonNull(deposit.getPaymentTime()) ? "已支付" : "已关闭";
//        this.paymentTime = deposit.getPaymentTime();
//        this.paymentType = "微信支付";
//        this.orderState = Objects.nonNull(deposit.getAuctionOrder()) ? "是" : "否";
//        this.refundType = deposit.getRefundType();
//        this.refundAmount = Objects.nonNull(deposit.getRefundSuccessTime()) ? deposit.getAmount() : 0;
//        this.outRefundNo = deposit.getOutRefundNo();
//        this.refundTime = deposit.getRefundTime();
//        this.refundSuccessTime = deposit.getRefundSuccessTime();
//        this.refundState = deposit.getRefundState();
//        this.refundRemark = deposit.getRefundRemark();
//        this.refundOperator = deposit.getRefundOperator();
    }


}