package cn.estsh.i3plus.pojo.model.wms;

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
import cn.estsh.i3plus.pojo.wms.bean.WmsASNMaster;
import cn.estsh.i3plus.pojo.wms.bean.WmsDocMovementMaster;
import cn.estsh.i3plus.pojo.wms.bean.WmsPOMaster;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import javax.persistence.Transient;
import java.io.Serializable;

/**
 * @Description : 订单打印数据封装model
 * @Reference :
 * @Author : siliter
 * @CreateDate : 2019-03-18 11:50
 * @Modify:
 **/
@Data
public class PrintOrderDataModel implements Serializable {

    private static final long serialVersionUID = 7658636310926230309L;
    @ApiParam("业务数据类型")
    public Integer busiDataType;

    @ApiParam("单号")
    public String orderNo;

    @ApiParam("工厂代码")
    public String organizeCode;

    @ApiParam(value = "PO主表")
    public WmsPOMaster poMaster;

    @ApiParam(value = "ASN主表")
    public WmsASNMaster asnMaster;

    @ApiParam(value = "移库单主表")
    public WmsDocMovementMaster movementMaster;

    @ApiParam(value = "状态")
    @Transient
    @AnnoOutputColumn(refClass = WmsEnumUtil.MASTER_ORDER_STATUS.class, refForeignKey = "value", value = "description")
    public Integer orderStatus;

    @ApiParam(value = "供应商名称")
    @Transient
    public String vendorName;

    @ApiParam(value = "供应商编码")
    @Transient
    public String vendorNo;

    @ApiParam(value = "客户编码")
    @Transient
    public String custNo;

    @ApiParam(value = "ERP编号")
    @Transient
    public String erpSrcNo;

    @ApiParam(value = "联系人")
    @Transient
    public String vendorOwner;

    @ApiParam(value = "供应商邮箱")
    @Transient
    public String vendorEmail;

    @ApiParam(value = "集装箱号")
    @Transient
    public String containerNo;

    @ApiParam("道口")
    @Transient
    public String dock;

    @ApiParam("泊位")
    @Transient
    public String zdoc;

    @Transient
    @ApiParam("计划交货日期")
    private String planDate;

    @Transient
    @ApiParam("计划交货时间")
    private String planTime;

    @Transient
    @ApiParam(value = "创建日期查询用，查询起始日期", example = "2018-01-01 01:00:00")
    @AnnoOutputColumn(hidden = true)
    public String createDateTimeStart;

    @Transient
    @ApiParam(value = "创建日期查询用，查询结束日期", example = "2018-12-31 23:59:59")
    @AnnoOutputColumn(hidden = true)
    public String createDateTimeEnd;

    @Transient
    public String createDateTime;

    @Transient
    public String receiveDateTime;

    @Transient
    @ApiParam("类型名称")
    public String busiTypeName;

    @Transient
    @ApiParam("物料编号")
    public String partNo;

    @ApiParam(value = "标题")
    @Transient
    public String title;

    @Transient
    @ApiParam(value = "客户简称")
    private String custName;

    @Transient
    @ApiParam(value = "客户全称")
    private String custDesc;

    @Transient
    @ApiParam(value = "客户地址")
    private String custAddr;

    @Transient
    @ApiParam(value = "联系人")
    private String custOwner;

    @Transient
    @ApiParam(value = "电话号码")
    private String custTel;

    @Transient
    @ApiParam("业务类型")
    public Integer busiType;

    @Transient
    @ApiParam("源存储区代码")
    public String srcZoneNo;

    @Transient
    @ApiParam(value = "生产小组")
    private String productionGroup;

    @Transient
    @ApiParam(value="修改日期查询用，查询起始日期")
    public String modifyDateTimeStart;

    @Transient
    @ApiParam(value = "修改日期查询用，查询结束日期")
    public String modifyDateTimeEnd;

    public int getBusiDataType() {
        if (busiDataType != null) {
            return busiDataType.intValue();
        }
        return 0;
    }
}
