AuctionOrderBean.java 5.2 KB
package com.glsx.usedcar.export;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.glsx.usedcar.export.converter.AuctionOrderStateConverter;
import com.glsx.usedcar.export.converter.BooleanConverter;
import com.glsx.usedcar.module.account.entity.Account;
import com.glsx.usedcar.module.auction.entity.Auction;
import com.glsx.usedcar.module.auction.entity.AuctionOrder;
import com.glsx.usedcar.module.auction.entity.Contract;
import com.glsx.usedcar.module.vehicle.entity.Vehicle;
import lombok.Data;
import org.summerframework.storage.domain.FileInfo;

import java.time.LocalDateTime;
import java.util.List;

@Data
public class AuctionOrderBean {


    @ExcelIgnore
    private int orderId;


    @ExcelProperty("订单编号")
    @ColumnWidth(20)
    private String orderCode;

    @ExcelProperty("场次名称")
    private String auctionName;


    @ExcelProperty("中拍人姓名")
    private String accountName;


    @ExcelProperty("中拍人电话")
    private String mobile;

    @ExcelProperty("车源号")
    @ColumnWidth(30)
    private String sourceNo;

    @ExcelProperty("车系名字")
    @ColumnWidth(15)
    private String carSeriesName;

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

    @ExcelProperty("原车牌号")
    private String licensePlate;
    
    @ExcelProperty("所属门店")
    @ColumnWidth(30)
    private String venueName;


    @ExcelIgnore
    @ExcelProperty("机动车登记证书")
    private List<FileInfo> registrationCertificate;

    @ExcelIgnore
    @ExcelProperty("新的机动车行驶证")
    private List<FileInfo> vehicleLicense;


    @ExcelProperty("成交价")
    private double orderPrice;


    @ExcelProperty("佣金")
    private double commissionPrice;

    @ExcelProperty("买家应付车款")
    private double totalPrice;


    @ExcelIgnore
    @ExcelProperty("支付凭证")
    private List<FileInfo> payVouchers;

    @ExcelIgnore
    @ExcelProperty(value = "是否结算", converter = BooleanConverter.class)
    private boolean settlement;

    /**
     * 拍卖合同
     */
    @ExcelIgnore
    private Contract contract;

    /**
     * 交付合同
     */
    @ExcelIgnore
    private Contract deliveryContract;


//    @ExcelProperty(value = "审核状态", converter = AuditStateConverter.class)
//    private AuditState auditState;

    @ExcelProperty(value = "订单状态", converter = AuctionOrderStateConverter.class)
    private AuctionOrder.OrderState orderState;
    @ExcelProperty("负责人")
    private String realName;
    @ExcelProperty("新车牌号")
    private String newPlateNumber;
    @ExcelProperty("过户时间")
    private LocalDateTime transferredTime;

    @ExcelProperty("中拍时间")
    private LocalDateTime createTime;

    @ExcelProperty("订单更新时间")
    private LocalDateTime updateTime;


    @ExcelProperty(value = "是否在申诉中", converter = BooleanConverter.class)
    private boolean onAppeal;


    @ExcelProperty("优惠券名称")
    private String couponName;

    @ExcelProperty("优惠券抵扣金额")
    private String couponDeductionAmount;


    public AuctionOrderBean(AuctionOrder auctionOrder) {
        Account account = auctionOrder.getAccount();
        Vehicle vehicle = auctionOrder.getVehicle();
        Auction auction = auctionOrder.getAuction();

        this.orderId = auctionOrder.getOrderId();
        this.orderCode = auctionOrder.getOrderCode();
        this.auctionName = auction.getAuctionName();
        this.accountName = account.getAccountName();
        this.mobile = account.getMobile();
        this.sourceNo = vehicle.getBaseInfo().getSourceNo();
        this.carSeriesName = vehicle.getBaseInfo().getCarSeriesName();
        this.carTypeName = vehicle.getBaseInfo().getCarTypeName();
        this.newPlateNumber = auctionOrder.getNewPlateNumber();
        this.registrationCertificate = auctionOrder.getRegistrationCertificate();
        this.vehicleLicense = auctionOrder.getVehicleLicense();
        this.orderPrice = auctionOrder.getOrderPrice();
        this.commissionPrice = auctionOrder.getCommissionPrice();
        this.payVouchers = auctionOrder.getPayVouchers();
        this.settlement = auctionOrder.isSettlement();
        this.contract = auctionOrder.getContract();
        this.deliveryContract = auctionOrder.getDeliveryContract();
        this.orderState = auctionOrder.getOrderState();
        this.transferredTime = auctionOrder.getTransferredTime();
        this.onAppeal = auctionOrder.isOnAppeal();
        this.couponName = auctionOrder.getCouponName() == null ? "" : auctionOrder.getCouponName();
        this.couponDeductionAmount = auctionOrder.getCouponDeduction() == null ? "" : String.valueOf(auctionOrder.getCouponDeduction().doubleValue());

        this.realName = auction.getUser().getRealName();
        this.createTime = auctionOrder.getCreateTime();
        this.updateTime = auctionOrder.getUpdateTime();
        this.totalPrice = auctionOrder.getOrderPrice() + auctionOrder.getCommissionPrice();
        this.licensePlate = vehicle.getBaseInfo().getLicensePlate();
        this.venueName = vehicle.getVenue().getVenueName();
    }

}