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

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 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;

/**
 * @Description :工作中心
 * @Reference :
 * @Author : amy
 * @CreateDate : 2019-06-11 14:56
 * @Modify:
 **/
@Data
@Entity
@Table(name="WMS_WORK_CENTER")
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Api(value="工作中心",description = "工作中心")
public class WmsWorkCenter extends BaseBean {

    private static final long serialVersionUID = 415180808859365167L;
    @Column(name = "WORK_CENTER_CODE")
    @ApiParam(value = "工作中心代码")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String workCenterCode;

    @Column(name = "WORK_CENTER_NAME")
    @ApiParam(value = "工作中心名称")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT)
    private String workCenterName;

    @Column(name = "ERP_WORK_CENTER")
    @ApiParam(value = "ERP_工作中心")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String erpWorkCenter;

    @Column(name = "WORK_VER")
    @ApiParam(value = "生产版本")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.TEXT, isRequire = 2)
    private String workVer;

    @Column(name = "SRC_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 srcZoneNo;

    @Column(name = "DESC_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 descZoneNo;

    @Column(name = "DESC_LOCATION_CODE")
    @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 = "zoneNo,locateNo,locateName", listColumnName = "locateNo,locateName", explicitColumnName = "locateNo")
    private String descLocationCode;

    @Column(name = "PRE_WO_MINUTE", columnDefinition = "int default 600")
    @ApiParam(value = "计算未完成工单的提前时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Integer preWoMinute;

    @Column(name = "PRE_READY_MINUTE", columnDefinition = "int default 180")
    @ApiParam(value = "提前拉动时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Integer preReadyMinute;

    @Column(name = "PULL_RANGE_MINUTE", columnDefinition = "int default 180")
    @ApiParam(value = "拉动区间时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private Integer pullRangeMinute;

    @Column(name = "NEXT_PULL_TIME", columnDefinition = "varchar(50) default '' ")
    @ApiParam(value = "下次拉动时间")
    @DynamicField(webFieldType = CommonEnumUtil.FIELD_TYPE.NUMBER, isRequire = 2)
    private String nextPullTime;
}
