package com.sckw.transport.model.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.sckw.core.model.constant.Global;
import com.sckw.excel.annotation.ExcelContext;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author zk
 * @desc 车辆运单列表
 * @date 2024/3/11 0011
 */
@Data
@Accessors(chain = true)
@ExcelContext(fileName = "运单信息", sheetName = "运单信息")
public class WaybillOrderExportVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 4526063761808958350L;

    /**
     * 运单号
     */
    @ExcelProperty(value = "运单号")
    @JsonProperty(value="wOrderNo")
    private String wOrderNo;

    /**
     * 物流订单编号
     */
    @ExcelProperty(value = "物流订单编号")
    private String lOrderNo;

    /**
     * 车辆牌照
     */
    @ExcelProperty(value = "车辆牌照")
    private String truckNo;

    /**
     * 司机
     */
    @ExcelProperty(value = "司机")
    private String driverName;

    /**
     * 司机手机号
     */
    @ExcelProperty(value = "司机手机号")
    private String driverPhone;

    /**
     * 运单类型字符
     */
    @ExcelIgnore
    private Integer type;

    /**
     * 运单类型字符
     */
    @ExcelProperty(value = "运单类型字符")
    private String typeLabel;

    /**
     * 采购企业名称
     */
    @ExcelProperty(value = "采购企业名称")
    private String procureFirmName;

    /**
     * 供应企业名称
     */
    @ExcelProperty(value = "供应企业名称")
    private String supplyFirmName;

    /**
     * 计划开始时间
     */
    @ExcelProperty(value = "计划开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    /**
     * 计划结束时间
     */
    @ExcelProperty(value = "计划结束时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    /**
     * 派单量/吨
     */
    @ExcelProperty(value = "派单量")
    private String entrustAmount;

    /**
     * 装货地点名称
     */
    @ExcelProperty(value = "装货地点名称")
    private String loadName;

    /**
     * 装货地点
     */
    @ExcelProperty(value = "装货地点")
    private String loadAddress;

    /**
     * 卸货地点点名称
     */
    @ExcelProperty(value = "卸货地点点名称")
    private String unloadName;

    /**
     * 卸货地点
     */
    @ExcelProperty(value = "卸货地点")
    private String unloadAddress;

    /**
     * 实装量/吨
     */
    @ExcelProperty(value = "实装量")
    private String loadAmount;

    /**
     * 实卸量/吨
     */
    @ExcelProperty(value = "实卸量")
    private String unloadAmount;

    /**
     * 亏吨重量
     */
    @ExcelProperty(value = "亏吨重量")
    private String deficitAmount;

    /**
     * 扣亏量(合理损耗-(实装-实卸))-单位
     */
    @ExcelProperty(value = "扣亏量")
    private String deficitRealAmount;

    /**
     * 派车时间
     */
    @ExcelProperty(value = "派车时间")
    private String sendCarTime;

    /**
     * 运单状态字符
     */
    @ExcelProperty(value = "运单状态")
    private String  statusLabel;

    /**
     * 装载量
     */
    @ExcelProperty(value = "装载量")
    private Double actualWeight;

    public String getTypeLabel() {
        return type != null && type == Global.NUMERICAL_ONE ? "趟次" : "循环";
    }

}
