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

import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
import cn.estsh.i3plus.pojo.base.annotation.AnnoOutputColumn;
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.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description:
 * @Author: xiangming.liao
 * @Date: 2021/01/18 15:44
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PROCESS_Q_MANAGE")
@Api("MES_工序Q管理项目")
public class MesProcessQManage extends BaseBean implements Serializable {

    private static final long serialVersionUID = -2297793151238705774L;

    @Column(name="PART_NO")
    @ApiParam("零件编号")
    private String partNo;

    @Column(name = "PROCESS_CODE")
    @ApiParam(value = "工序编号")
    public String processCode;

    @Column(name="PROCESS_NAME")
    @ApiParam(value ="工序名称")
    private String processName;

    @Column(name = "MANAGE_PROJECTS")
    @ApiParam("管理项目")
    private String manageProjects;

    @Column(name = "SCREW_TYPE")
    @ApiParam("螺钉型号(管理内容)")
    private String screwType;

    @Column(name = "SCREW_CUTTER_NO")
    @ApiParam("螺批刀编号")
    private String screwCutterNo;

    @Column(name = "QTY", columnDefinition = "decimal(18,8)")
    @ColumnDefault("0")
    @ApiParam(value ="打枪数量")
    private Double qty = 0d;

    @Column(name = "TIGHTENING_TORQUE")
    @ApiParam("拧紧扭矩")
    private String tighteningTorque;

    @Column(name = "UP_LIMIT")
    @ApiParam("上限值")
    private String upLimit;

    @Column(name = "DOWN_LIMIT")
    @ApiParam("下限值")
    private String downLimit;

    @Column(name = "CHECK_TYPE")
    @AnnoOutputColumn(refClass = MesExtEnumUtil.MES_Q_MANAGER_CHECK_TYPE.class, refForeignKey = "value", value = "description")
    @ApiParam("点检类型")
    private String checkType;
}
