package com.sckw.transport.model.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * 贸易订单运输信息响应。
 *
 * @author system
 * @date 2026-05-08
 */
@Data
@Schema(description = "贸易订单运输信息响应")
public class TradeOrderTransportInfoResp implements Serializable {

    @Serial
    private static final long serialVersionUID = 2825054269070244593L;

    @Schema(description = "贸易订单号")
    private String tradeOrderNo;

    @Schema(description = "供应企业名称")
    private String supplierName;

    @Schema(description = "客户名称")
    private String customerName;

    @Schema(description = "任务信息列表")
    private List<TaskInfo> tasks = new ArrayList<>();

    @Schema(description = "地磅编号")
    private Long weighbridgeId;

    /**
     * 单车任务信息。
     */
    @Data
    @Schema(description = "单车任务信息")
    public static class TaskInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = 4264229244065846224L;

        @Schema(description = "任务编号")
        private String taskNo;

        @Schema(description = "接单时间")
        private String acceptTime;

        @Schema(description = "完成时间")
        private String finishTime;

        @Schema(description = "计重人")
        private String weigherName;

        @Schema(description = "司机信息")
        private DriverInfo driverInfo;

        @Schema(description = "货物信息")
        private GoodsInfo goodsInfo;

        @Schema(description = "车辆信息")
        private TruckInfo truckInfo;

        @Schema(description = "目的地")
        private String destination;

        @Schema(description = "打印信息")
        private PrintInfo printInfo;
    }

    /**
     * 司机信息。
     */
    @Data
    @Schema(description = "司机信息")
    public static class DriverInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = 4681187619812752711L;

        @Schema(description = "姓名")
        private String name;

        @Schema(description = "手机号")
        private String phone;

        @Schema(description = "脱敏身份证号")
        private String idCard;
    }

    /**
     * 任务货物信息。
     */
    @Data
    @Schema(description = "任务货物信息")
    public static class GoodsInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = 7576326426794710595L;

        @Schema(description = "物料")
        private String materialName;

        @Schema(description = "规格")
        private String specification;

        @Schema(description = "任务量")
        private BigDecimal taskAmount;

        @Schema(description = "皮重")
        private BigDecimal tareWeight;

        @Schema(description = "毛重")
        private BigDecimal grossWeight;

        @Schema(description = "净重")
        private BigDecimal netWeight;

        @Schema(description = "单位")
        private String unit;
    }

    /**
     * 车辆信息。
     */
    @Data
    @Schema(description = "车辆信息")
    public static class TruckInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = 4193011453340089506L;

        @Schema(description = "车牌号")
        private String truckNo;

        @Schema(description = "车辆轴数")
        private String truckAxle;
    }

    /**
     * 打印信息。
     */
    @Data
    @Schema(description = "打印信息")
    public static class PrintInfo implements Serializable {

        @Serial
        private static final long serialVersionUID = -6068786676826461870L;

        @Schema(description = "打印时间")
        private String printTime;

        @Schema(description = "打印次数")
        private Integer printCount;
    }
}
