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

import cn.estsh.i3plus.pojo.base.bean.BaseBean;
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/14 20:03
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_ON_SITE_ORDER_DETAIL", indexes = {
        @Index(columnList = "ORDER_NO")
})
@Api("MES_巡检单明细数据")
public class MesOnSiteOrderDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = 7654475809174434963L;

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

    @Column(name = "ORDER_NO")
    @ApiParam(value = "单号")
    private String orderNo;

    @Column(name = "PROJECT_SORT_NO")
    @ApiParam(value = "项目分类编号")
    public String projectSortNo;

    @Column(name = "PROJECT_CODE")
    @ApiParam(value = "项目代码")
    public String projectCode;

    @Column(name = "PROJECT_NAME")
    @ApiParam(value = "项目名称")
    public String projectName;

    @Column(name = "CHECK_RESULT")
    @ApiParam(value = "点检结果")
    public String checkResult;

    @Column(name = "SPOT_CHECK_USER")
    @ApiParam(value = "点检人员")
    public String spotCheckUser;

    @Column(name = "SPOT_CHECK_TIME")
    @ApiParam(value = "点检时间")
    public String spotCheckTime;

    @Column(name = "MAINTAIN_STRATEGY")
    @ApiParam(value = "维护策略")
    public String maintainStrategy;

    @Column(name = "OPERATE_USER")
    @ApiParam(value = "编辑人员")
    public String operateUser;

    @Column(name = "OPERATE_TIME")
    @ApiParam(value = "编辑时间")
    public String operateTime;

    @Column(name = "MEMO")
    @ApiParam(value = "备注")
    public String memo;

    @Transient
    @ApiParam(value = "生产线")
    public String workCenterCode;

    @Transient
    @ApiParam(value = "生产工单号")
    public String workOrderNo;

    @Transient
    @ApiParam(value = "物料编码")
    public String partNo;

    @Transient
    @ApiParam("点检开始时间")
    public String spotCheckTimeStart;

    @Transient
    @ApiParam("点检结束时间")
    public String spotCheckTimeEnd;

    @Transient
    @ApiParam(value = "单据状态")
    public Integer orderStatus;

    @Transient
    @ApiParam(value = "修改人")
    public String modifyUser;

    @Transient
    @ApiParam(value = "修改时间")
    public String modifyDatetime;

    @Transient
    @ApiParam("点检结果名称")
    private String checkResultName;

    @Transient
    @ApiParam(value = "单据状态名称")
    public String orderStatusName;

    public MesOnSiteOrderDetail(){}

    public MesOnSiteOrderDetail(Long id, String workCenterCode, String workOrderNo, String partNo, String projectSortNo, String projectCode,
                                String projectName, String orderNo, String createDatetime, String memo, String checkResult, String spotCheckUser,
                                String spotCheckTime, String maintainStrategy, String operateUser, String operateTime,
                                Integer orderStatus, String modifyUser, String modifyDatetime){

        this.id = id;
        this.workCenterCode = workCenterCode;
        this.workOrderNo = workOrderNo;
        this.partNo = partNo;
        this.projectSortNo = projectSortNo;
        this.projectCode = projectCode;
        this.projectName = projectName;
        this.orderNo = orderNo;
        this.createDatetime = createDatetime;
        this.memo = memo;
        this.checkResult = checkResult;
        this.spotCheckUser = spotCheckUser;
        this.spotCheckTime = spotCheckTime;
        this.maintainStrategy = maintainStrategy;
        this.operateUser = operateUser;
        this.operateTime = operateTime;
        this.orderStatus = orderStatus;
        this.modifyUser = modifyUser;
        this.modifyDatetime = modifyDatetime;

    }
}
