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

import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtEnumUtil;
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 javax.persistence.Transient;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description:
 * @Author: xiangming.liao
 * @Date: 2021/01/18 15:44
 * @Modify:
 */
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_PROCESS_TORQUE_MANAGE_TASK_DETAIL")
@Api("MES_工序扭矩管理任务明细")
public class MesProcessTorqueManageTaskDetail extends BaseBean implements Serializable {

    private static final long serialVersionUID = -5545553227344055268L;

    @Column(name="ORDER_JOB_NO")
    @ApiParam("作业单据号")
    private String orderJobNo;

    //@Column(name="ORDER_STATUS")
    //@ApiParam(value ="单据状态")
    //private Integer orderStatus;

    @Column(name="WORK_ORDER_NO")
    @ApiParam("工单号")
    private String workOrderNo;

    @Column(name="WORK_CENTER_CODE")
    @ApiParam("产线代码")
    private String workCenterCode;

    @Column(name="WORK_CENTER_NAME")
    @ApiParam("产线名称")
    private String workCenterName;

    @Column(name="WORK_CELL_CODE")
    @ApiParam("工位代码")
    private String workCellCode;

    @Column(name="WORK_CELL_NAME")
    @ApiParam("工位名称")
    private String workCellName;

    @Column(name="SHIFT_CODE")
    @ApiParam("班次代码")
    private String shiftCode;

    @Column(name="SHIFT_NAME")
    @ApiParam("班次名称")
    private String shiftName;

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

    @Column(name="PART_NAME")
    @ApiParam("零件名称")
    private String partName;

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

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

    @Column(name = "FASTENING_POSITION")
    @ApiParam("紧固部位")
    private String fasteningPosition;

    @Column(name = "SPECIFICATION")
    @ApiParam("规格")
    private String specification;

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

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

    @Column(name = "SCREWDRIVER_NO")
    @ApiParam("螺丝刀NO")
    private String screwdriverNo;

    @Column(name = "TORQUE_VALUE1")
    @ApiParam("扭矩值1")
    private String torqueValue1;

    @Column(name = "TORQUE_VALUE2")
    @ApiParam("扭矩值2")
    private String torqueValue2;

    @Column(name = "TORQUE_VALUE3")
    @ApiParam("扭矩值3")
    private String torqueValue3;

    @Column(name = "TORQUE_VALUE4")
    @ApiParam("扭矩值4")
    private String torqueValue4;

    @Column(name = "TORQUE_VALUE5")
    @ApiParam("扭矩值5")
    private String torqueValue5;

    @Column(name = "ROTATION_NO_ABNORMAL")
    @ApiParam("回转时是否有异常声、振动和发热")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.CHECK_RESULT.class, refForeignKey = "value", value = "description")
    private Integer rotationNoAbnormal;

    @Column(name = "FASTENING_NO_ABNORMAL")
    @ApiParam("紧固后状态确认：浮起、歪斜等")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.CHECK_RESULT.class, refForeignKey = "value", value = "description")
    private Integer fasteningNoAbnormal;

    @Column(name = "FASTENING_IS_STC")
    @ApiParam("紧固后是否有圆滑感")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.CHECK_RESULT.class, refForeignKey = "value", value = "description")
    private Integer fasteningIsStc;

    @Column(name = "TOOL_HEAD_NO_WEAR")
    @ApiParam("刀头是否无磨损")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.CHECK_RESULT.class, refForeignKey = "value", value = "description")
    private Integer toolHeadNoWear;

    @Column(name = "CHECK_RESULT")
    @ApiParam("点检结果")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.CHECK_RESULT.class, refForeignKey = "value", value = "description")
    private Integer checkResult;

    @Column(name = "CHECK_USER")
    @ApiParam("点检人员")
    private String checkUser;

    @Column(name = "CHECK_TIME")
    @ApiParam("点检时间")
    private String checkTime;

    @Column(name = "IS_TEAM_CONFIRM")
    @ApiParam("是否班组确认")
    @AnnoOutputColumn(refClass = MesPcnExtEnumUtil.CONFIRM_TYPE.class, refForeignKey = "value", value = "description")
    private Integer isTeamConfirm = 20;

    @Column(name = "TEAM_CONFIRM_USER")
    @ApiParam("班组确认人")
    private String teamConfirmUser;

    @Column(name = "TEAM_CONFIRM_TIME")
    @ApiParam("班组确认时间")
    private String teamConfirmTime;

    @Column(name = "TORQUE_SPEC_VALUE")
    @ApiParam("扭矩规格值")
    private String torqueSpecValue;

    @Transient
    @ApiParam("扭矩规格值")
    private String torqueSpecValueDesc;

    @Transient
    @ApiParam("扭矩规格值")
    private List<String> torqueSpecValueList = new ArrayList<>();

    @Column(name = "TORQUE_MANAGE_NO1")
    @ApiParam("扭矩螺丝刀-扭矩管理NO1")
    private String torqueManageNo1;

    @Transient
    @ApiParam("扭矩螺丝刀-扭矩管理NO1")
    private String torqueManageNo1Full;

    @Column(name = "TORQUE_MANAGE_NO2")
    @ApiParam("扭矩螺丝刀-扭矩管理NO2")
    private String torqueManageNo2;

    @Transient
    @ApiParam("全称扭矩螺丝刀-扭矩管理NO2")
    private String torqueManageNo2Full;

    @Column(name = "TORQUE_MANAGE_NO3")
    @ApiParam("扭矩螺丝刀-扭矩管理NO3")
    private String torqueManageNo3;

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

    @Transient
    @ApiParam("全称扭矩螺丝刀-扭矩管理NO3")
    private String torqueManageNo3Full;

    @Column(name = "REMARK")
    @ApiParam(value = "备注")
    public String remark;

}
