package cn.estsh.i3plus.ext.mes.pcn.pojo.model;

import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.util.CollectionUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description : 重庆龙兴发运单MODEL
 **/
@Data
public class MesSortShippingPrintForCqLxModel implements Serializable {

    private static final long serialVersionUID = -4576439891171509409L;

    @ApiParam("打印单据的头部标题")
    private String titleName;

    @ApiParam("是否重打印")
    private String isRePrint = MesPcnExtConstWords.EMPTY;

    @ApiParam("重打印操作人")
    private String rePrintUser = MesPcnExtConstWords.EMPTY;

    @ApiParam("重打印时间")
    private String rePrintDatetime = MesPcnExtConstWords.EMPTY;

    @ApiParam("发运单号")
    private String shippingCode;

    @ApiParam("流水线")
    private String flowLine;

    @ApiParam("二维码")
    private String docNo;

    @ApiParam("拉动单号后四位")
    private String carsNo;

    @ApiParam("拉动单号除后四位")
    private String docNoOther;

    @ApiParam("零件类")
    private String partClassCode;

    @ApiParam("零件类名称")
    private String partClassName;

    @ApiParam("供应商代码")
    private String jisProviderCode;

    @ApiParam("线边库位")
    private String lineLocation;

    @ApiParam("DOCK")
    private String dock;

    @ApiParam("开始车号")
    private String beginNumber;

    @ApiParam("结束车号")
    private String endNumber;

    @ApiParam("单据生成时间")
    private String jisCreationtime;

    @ApiParam("挑选完成时间")
    private String pickingOverTime;

    @ApiParam("预计出发时间")
    private String goOutTime;

    @ApiParam("预计到达时间")
    private String goToTime;

    @ApiParam("第一个表格")
    private List<MesSortShippingPrintForCqLxModel> jisDetailList;

    @ApiParam("序号")
    private Integer xh;

    @ApiParam("物料编码")
    private String materielCode;

    @ApiParam("车型颜色")
    private String modelColor;

    @ApiParam("用量")
    private Double useQty;

    @ApiParam("流水号")
    private String serialNumber;

    @ApiParam("VIN码")
    private String vin;

    @ApiParam("厂家代码")
    private String factoryCode;

    @ApiParam("第二个表格")
    private List<MesSortShippingPrintForCqLxModel> amountList;

    @ApiParam("零件号")
    private String partNo;

    @ApiParam("数量")
    private Double amountQty;

    @ApiParam("单元格")
    private String appendRows;

    @ApiParam("物料名称")
    private String materielNames;

    public void addJisDetail(MesSortShippingPrintForCqLxModel jisDetail) {
        if (CollectionUtils.isEmpty(jisDetailList)) jisDetailList = new ArrayList<>();
        jisDetailList.add(jisDetail);
    }

    public void addAmount(MesSortShippingPrintForCqLxModel amount) {
        if (CollectionUtils.isEmpty(amountList)) amountList = new ArrayList<>();
        amountList.add(amount);
    }
}
