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

import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
import cn.estsh.i3plus.pojo.base.annotation.DynamicField;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @Description :责任区域分配信息
 * @Reference :
 * @Author : silliter.yuan
 * @CreateDate : 2018-11-06 17:16
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_AREA_OWNER")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="责任区域分配信息",description = "责任区域分配信息")
public class WmsAreaOwner extends BaseBean {

    private static final long serialVersionUID = -5772266802563087135L;
    @Column(name = "WH_NO")
    @ApiParam(value = "仓库代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WareHouse",
            searchColumnName = "code,name", listColumnName = "code,name", explicitColumnName = "code")
    private String whNo;

    @Column(name = "ZONE_NO")
    @ApiParam(value = "存储区编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsZones",
            searchColumnName = "zoneNo,zoneName", listColumnName = "zoneNo,zoneName", explicitColumnName = "zoneNo")
    private String zoneNo;

    @Column(name = "LOCATE_NO")
    @ApiParam(value = "库位编号")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2, getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsLocate",
            searchColumnName = "locateNo,locateName", listColumnName = "locateNo,locateName", explicitColumnName = "locateNo")
    private String locateNo;

    @Column(name="PART_NO")
    @ApiParam("物料编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPart",
            searchColumnName = "partNo,partName", listColumnName = "partNo,partName", explicitColumnName = "partNo")
    public String partNo;

    @Column(name="PART_NAME_RDD")
    @ApiParam("物料名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsPart",
            searchColumnName = "partNo,partName", listColumnName = "partNo,partName", explicitColumnName = "partName")
    public String partNameRdd;

    @Column(name = "VENDOR_NO")
    @ApiParam(value = "供应商编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.BasVendor",
            searchColumnName = "vendorNo,vendorName", listColumnName = "vendorNo,vendorName", explicitColumnName = "vendorNo")
    private String vendorNo;

    @Column(name = "OWNER_USER_NO")
    @ApiParam(value = "负责人")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.URL,
            dataSrc = "/impp/operate/sys-user/query-user-by-pager",
            searchColumnName = "userName",listColumnName = "userLoginName,userName", explicitColumnName = "userName")
    private String ownerUserNo;

    @Column(name = "IS_PRE_ASSIGN")
    @ApiParam(value = "是否预分配人员")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.SELECT, isRequire = 2, dataSrc = "TRUE_OR_FALSE")
    @AnnoOutputColumn(refClass = WmsEnumUtil.TRUE_OR_FALSE.class, refForeignKey = "value", value = "description", hidden = true)
    private Integer isPreAssign;

    @Column(name="SHIFT_NO")
    @ApiParam("班次编码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.LIST, isRequire = 2,  getValWay = CommonEnumUtil.DYNAMIC_FIELD_GET_WAY.OBJ,
            dataSrc = "cn.estsh.i3plus.pojo.wms.bean.WmsShift",
            searchColumnName = "shiftNo,shiftName", listColumnName = "shiftNo,shiftName", explicitColumnName = "shiftNo")
    private String shiftNo;

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

    @Transient
    @ApiParam(value = "仓库名称")
    private String whName;

    @Transient
    @ApiParam(value = "存储区名称")
    private String zoneName;

    @Transient
    @ApiParam(value = "库位名称")
    private String locateName;

    @Column(name = "CUST_NO")
    @ApiParam(value = "客户编号")
    private String custNo;

    @Transient
    @ApiParam(value = "分配次数")
    private Integer count;
}
