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

import cn.estsh.i3plus.pojo.mes.bean.MesPart;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.ColumnDefault;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description:
 * @Author: xiangming.liao
 * @Date: 2021/01/22 15:47
 * @Modify:
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "MES_PART_EXT", indexes = {
        @Index(columnList = "LOT_NO"),
        @Index(columnList = "PART_NO_EXT"),
        @Index(columnList = "SYSTEM_SYNC_STATUS_EXT"),
        @Index(columnList = "ORGANIZE_CODE_EXT"),
        @Index(columnList = "CREATE_DATE_TIME_EXT"),
        @Index(columnList = "MODIFY_DATE_TIME_EXT")
})
@PrimaryKeyJoinColumn(name = "PID", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
@Api("物料信息拓展表")
public class MesPartExt extends MesPart implements Serializable {

    private static final long serialVersionUID = 5652666085256657801L;

    @Column(name = "FILE_ID")
    @ApiParam("文件编号")
    private Long fileId;

    @Column(name = "IS_CREATE_SN")
    @ColumnDefault("2")
    @ApiParam("是否生成条码")
    private Integer isCreateSn;

    @Column(name = "IDENTIFY_CODE")
    @ApiParam("物料识别码")
    private String identifyCode;

    @Column(name = "SN_LAST_CODE")
    @ApiParam("条码末位数")
    private String snLastCode;

    @Column(name = "JAPAN_DESC")
    @ApiParam("日文描述")
    private String japanDesc;

    @Column(name = "GOODS_CODE")
    @ApiParam("商品码")
    private String goodsCode;

    @Column(name = "PREFIX")
    @ApiParam("前缀")
    private String prefix;

    @Column(name = "QUALITY_ASSURE_CODE")
    @ApiParam("质保书码")
    private String qualityAssureCode;

    @Column(name = "IS_PS_PARTS")
    @ApiParam("是否PS部件")
    private Integer isPSParts = 2;

    @Column(name = "STANDARD_WORK", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam("标准工数")
    private Double standardWork;

    @Column(name = "IS_OQC")
    @ApiParam("是否出货检验")
    private Integer isOqc = 1;

    @Column(name = "SALES_TO")
    @ApiParam("销售向")
    private String salesTo;

    @Column(name = "LOT_NO")
    @ApiParam("批次号")
    private String lotNo;

    @Column(name = "FILE_ORIGIN_NAME")
    @ApiParam("文件原名")
    private String fileOriginName;

    @Column(name = "UPLOAD_DATE_TIME")
    @ApiParam("上传时间")
    private String uploadDatetime;

    @Column(name = "PART_NO_EXT")
    @ApiParam("零件号")
    private String partNoExt;

    @Column(name = "PACK_NO_PRINT_TIMES")
    @ApiParam("包装条码打印张数")
    private Integer packNoPrintTimes;

    @Column(name = "SN_PRINT_TIMES")
    @ApiParam("本体条码打印张数")
    private Integer snPrintTimes;

    @Column(name = "BIG_PROCESS_MATCH_TYPE")
    @ApiParam("大本体条码匹配类型")
    private Integer bigProcessMatchType = 0;

    @Column(name = "SN_PRINT_COLUMN_NUMBER")
    @ApiParam("本体条码打印列数")
    public Integer snPrintColumnNumber;

    @Column(name = "MODIFY_USER_EXT")
    @ApiParam(value = "修改人")
    public String modifyUserExt;

    //EP专用
    @Column(name = "PART_LOT_NO_LENGTH")
    @ApiParam("成品批次号长度")
    public Integer partLotNoLength;

    @Column(name = "CUSTOMS_PART_NO")
    @ApiParam("海关物料号")
    public String customsPartNo;

    @Column(name = "IS_PRINT_QUALITY_ASSURE_INDIA")
    @ApiParam("是否打印质保书")
    public Integer isPrintQualityAssureIndia;

    @Column(name="ORGANIZE_CODE_EXT")
    @ApiParam(value ="组织代码")
    public String organizeCodeExt;

    @Column(name="IS_VALID_EXT")
    @ApiParam(value = "有效性")
    public Integer isValidExt;

    @Column(name="IS_DELETED_EXT")
    @ApiParam(value = "是否已删除")
    public Integer isDeletedExt;

    @Column(name="CREATE_USER_EXT")
    @ApiParam(value = "创建用户")
    public String createUserExt;

    @Column(name = "CREATE_DATE_TIME_EXT")
    @ApiParam(value = "创建日期")
    public String createDatetimeExt;
    @Column(name = "MODIFY_DATE_TIME_EXT")
    @ApiParam(value = "修改日期")
    public String modifyDatetimeExt;

    @Column(name = "SYSTEM_SYNC_STATUS_EXT")
    @ColumnDefault("2")
    @ApiParam(value = "系统同步标志")
    public Integer systemSyncStatusExt = 2;

    @Column(name = "SHI_XIANG_DI_CODE")
    @ApiParam(value = "仕向地代码")
    public String shiXiangDiCode;

    @Column(name = "model")
    @ApiParam(value = "型号")
    public String model;

    @Column(name = "PRODUCT_NUMBER")
    @ApiParam(value = "品番")
    public String productNumber;

    @Column(name = "SN_PACKAGE_PRINT_COLUMN_NUMBER")
    @ApiParam("大包装条码张数")
    public Integer snPackagePrintColumnNumber;

    @Column(name = "BIG_PACKAGE_MATCH_TYPE")
    @ApiParam("大包装条码匹配类型")
    private Integer bigPackageMatchType = 0;

    @Column(name = "IS_REPAIR_WORK_REPORT")
    @ColumnDefault("10")
    @ApiParam("补件是否报工")
    private Integer isRepairWorkReport = 10;

    @Column(name = "IS_MANUAL_REPORT")
    @ColumnDefault("20")
    @ApiParam("是否可手动报工")
    private Integer isManualReport = 20;

}
