package com.xisc.pm.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.choerodon.mybatis.annotation.ModifyAudit;
import io.choerodon.mybatis.annotation.VersionAudit;
import io.choerodon.mybatis.domain.AuditDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Map;

/**
 * 组板履历表
 *
 * @author 曾俊 jun.zeng@hand-china.com 2024-07-31 08:01:11
 */
@Setter
@Getter
@ApiModel("组板履历表")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_PD_REC")
public class PmPdRec extends AuditDomain {

    public static final String FIELD_PPR_ID = "pprId";
    public static final String FIELD_TRACK_SEQ_NO = "trackSeqNo";
    public static final String FIELD_EVENT_CODE = "eventCode";
    public static final String FIELD_SYSTEM_CODE = "systemCode";
    public static final String FIELD_API_CODE = "apiCode";
    public static final String FIELD_EVENT_MAKER = "eventMaker";
    public static final String FIELD_ORDER_NO = "orderNo";
    public static final String FIELD_WHOLE_BACKLOG = "wholeBacklog";
    public static final String FIELD_WHOLE_BACKLOG_CODE = "wholeBacklogCode";
    public static final String FIELD_MAT_NO = "matNo";
    public static final String FIELD_WT = "wt";
    public static final String FIELD_QTY = "qty";
    public static final String FIELD_KEYVALUE_1_DESC = "keyvalue1Desc";
    public static final String FIELD_KEYVALUE_1 = "keyvalue1";
    public static final String FIELD_KEYVALUE_2_DESC = "keyvalue2Desc";
    public static final String FIELD_KEYVALUE_2 = "keyvalue2";
    public static final String FIELD_KEYVALUE_3_DESC = "keyvalue3Desc";
    public static final String FIELD_KEYVALUE_3 = "keyvalue3";
    public static final String FIELD_RETURN_ERROR_MSG = "returnErrorMsg";
    public static final String FIELD_MSC_LINE_NO = "mscLineNo";
    public static final String FIELD_TENANT_ID = "tenantId";
    public static final String FIELD_OBJECT_VERSION_NUMBER = "objectVersionNumber";
    public static final String FIELD_CREATION_DATE = "creationDate";
    public static final String FIELD_CREATED_BY = "createdBy";
    public static final String FIELD_LAST_UPDATED_BY = "lastUpdatedBy";
    public static final String FIELD_LAST_UPDATE_DATE = "lastUpdateDate";
    public static final String FIELD_ATTRIBUTE1 = "attribute1";
    public static final String FIELD_ATTRIBUTE2 = "attribute2";
    public static final String FIELD_ATTRIBUTE3 = "attribute3";
    public static final String FIELD_ATTRIBUTE4 = "attribute4";
    public static final String FIELD_ATTRIBUTE5 = "attribute5";

//
// 业务方法(按public protected private顺序排列)
// ------------------------------------------------------------------------------

//
// 数据库字段
// ------------------------------------------------------------------------------

    @ApiModelProperty("主键ID")
    @Id
    @GeneratedValue
    private Long pprId;
    @ApiModelProperty(value = "事件跟踪序列号", required = true)
    @NotBlank
    private String trackSeqNo;
    @ApiModelProperty(value = "事件标识", required = true)
    @NotBlank
    private String eventCode;
    @ApiModelProperty(value = "系统标识", required = true)
    @NotBlank
    private String systemCode;
    @ApiModelProperty(value = "功能标识", required = true)
    @NotBlank
    private String apiCode;
    @ApiModelProperty(value = "事件员工编号", required = true)
    @NotBlank
    private String eventMaker;
    @ApiModelProperty(value = "合同号", required = true)
    @NotBlank
    private String orderNo;
    @ApiModelProperty(value = "全程工序途径码")
    private String wholeBacklog;
    @ApiModelProperty(value = "全程工序代码")
    private String wholeBacklogCode;
    @ApiModelProperty(value = "材料号", required = true)
    @NotBlank
    private String matNo;
    @ApiModelProperty(value = "重量", required = true)
    @NotNull
    private BigDecimal wt;
    @ApiModelProperty(value = "件数", required = true)
    @NotNull
    private BigDecimal qty;
    @ApiModelProperty(value = "关键字串1说明", required = true)
    @NotBlank
    private String keyvalue1Desc;
    @ApiModelProperty(value = "关键字串1", required = true)
    @NotBlank
    private String keyvalue1;
    @ApiModelProperty(value = "关键字串2说明", required = true)
    @NotBlank
    private String keyvalue2Desc;
    @ApiModelProperty(value = "关键字串2", required = true)
    @NotBlank
    private String keyvalue2;
    @ApiModelProperty(value = "关键字串3说明", required = true)
    @NotBlank
    private String keyvalue3Desc;
    @ApiModelProperty(value = "关键字串3", required = true)
    @NotBlank
    private String keyvalue3;
    @ApiModelProperty(value = "返回出错信息")
    private String returnErrorMsg;
    @ApiModelProperty(value = "产线号", required = true)
    @NotBlank
    private String mscLineNo;
    
    @ApiModelProperty(value = "租户ID", required = true)
    @NotNull
    private Long tenantId;
    @ApiModelProperty(value = "行版本号，用来处理锁", required = true)
    @NotNull
    private Long objectVersionNumber;

    @ApiModelProperty(value = "")
    private String attribute1;
    @ApiModelProperty(value = "")
    private String attribute2;
    @ApiModelProperty(value = "")
    private String attribute3;
    @ApiModelProperty(value = "")
    private String attribute4;
    @ApiModelProperty(value = "")
    private String attribute5;
    
    @Transient
    @ApiModelProperty(value = "事件员工姓名", required = true)
    private String eventMakerName;
    @Transient
    @ApiModelProperty(value = "事件员工姓名", required = true)
    private String createdByName;
    @Transient
    @ApiModelProperty(value = "事件员工姓名", required = true)
    private String lastUpdatedByName;
    
    @Transient
    @ApiModelProperty("拓展参数")
    private Map<String , Object> params ;

}
