package com.xisc.pm.domain.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.xisc.pm.infra.constant.Constants;
import com.xisc.pm.infra.util.Utils;
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.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;


/**
 * 炼钢连铸制造命令炉次表 (PmSteelCastHeat)实体类
 *
 * @author 纪文桃 wentao.ji01@hand-china.com
 * @since 2024-09-18 15:07:11
 */

@Getter
@Setter
@ApiModel("炼钢连铸制造命令炉次表 ")
@VersionAudit
@ModifyAudit
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@Table(name = "PM_STEEL_CAST_HEAT")
public class PmSteelCastHeat extends AuditDomain implements Serializable {
    private static final long serialVersionUID = -45461658534312848L;

    public static final String FIELD_STEEL_CAST_HEAT_ID = "steelCastHeatId";
    public static final String FIELD_ARCHIVE_FLAG = "archiveFlag";
    public static final String FIELD_MAIN_BACKLOG_CODE = "mainBacklogCode";
    public static final String FIELD_PONO = "pono";
    public static final String FIELD_PONO_STATUS = "ponoStatus";
    public static final String FIELD_CC_SEQ = "ccSeq";
    public static final String FIELD_ST_NO = "stNo";
    public static final String FIELD_SG_SIGN = "sgSign";
    public static final String FIELD_MOLD_THICK = "moldThick";
    public static final String FIELD_MOLD_WIDTH = "moldWidth";
    public static final String FIELD_CAST_LOT_NO = "castLotNo";
    public static final String FIELD_YEAR_ID = "yearId";
    public static final String FIELD_CAST_LOT_DIV_NO = "castLotDivNo";
    public static final String FIELD_CAST_LOT_SUM = "castLotSum";
    public static final String FIELD_CC_MACH_NO = "ccMachNo";
    public static final String FIELD_CC_TYPE = "ccType";
    public static final String FIELD_RESTRAND_FLG = "restrandFlg";
    public static final String FIELD_BACKLOG_EA = "backlogEa";
    public static final String FIELD_REFINE_ROUTE_CODE = "refineRouteCode";
    public static final String FIELD_SMELT_MODE = "smeltMode";
    public static final String FIELD_PLAN_TAP_WT = "planTapWt";
    public static final String FIELD_APN = "apn";
    public static final String FIELD_DEST = "dest";
    public static final String FIELD_NEW_TEST_NO = "newTestNo";
    public static final String FIELD_STEEL_PLAN_DATE = "steelPlanDate";
    public static final String FIELD_STEEL_APP_DATE = "steelAppDate";
    public static final String FIELD_PLAN_DATE = "planDate";
    public static final String FIELD_CC_REQ_TIME = "ccReqTime";
    public static final String FIELD_CC_REQ_TIME_FLAG = "ccReqTimeFlag";
    public static final String FIELD_HEAT_CONFM_TIME = "heatConfmTime";
    public static final String FIELD_HOT_REQ_TIME = "hotReqTime";
    public static final String FIELD_HOT_SEND_FLAG = "hotSendFlag";
    public static final String FIELD_HOT_CHARGE_FLAG = "hotChargeFlag";
    public static final String FIELD_TD_CHG_FLG = "tdChgFlg";
    public static final String FIELD_PREV_PONO = "prevPono";
    public static final String FIELD_SLAB_REQ = "slabReq";
    public static final String FIELD_FLAME_CLEAN_DIV = "flameCleanDiv";
    public static final String FIELD_SHIFT_POINT = "shiftPoint";
    public static final String FIELD_SHIFT_NO = "shiftNo";
    public static final String FIELD_SHIFT_GROUP = "shiftGroup";
    public static final String FIELD_HOLD_PLANNER = "holdPlanner";
    public static final String FIELD_HOLD_TIME = "holdTime";
    public static final String FIELD_PLAN_RELEASER = "planReleaser";
    public static final String FIELD_REL_TIME = "relTime";
    public static final String FIELD_SEND_PLANNER = "sendPlanner";
    public static final String FIELD_SEND_TIME = "sendTime";
    public static final String FIELD_CC_BASE = "ccBase";
    public static final String FIELD_POUR_TIME = "pourTime";
    public static final String FIELD_ADJUST_FLAG = "adjustFlag";
    public static final String FIELD_TENANT_ID = "tenantId";
    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 static final String FIELD_IS_BLOOM = "isBloom";
    public static final String FIELD_WITNESS_POINT_STATUS = "witnessPointStatus";

    @Id
    @GeneratedValue
    private Long steelCastHeatId;

    @ApiModelProperty(value = "计划下达标记")
    private String archiveFlag;

    @ApiModelProperty(value = "厂别")
    private String mainBacklogCode;

    @ApiModelProperty(value = "制造命令号")
    private String pono;

    @ApiModelProperty(value = "制造命令状态")
    private String ponoStatus;

    @ApiModelProperty(value = "连铸计划顺序号")
    private Long ccSeq;

    @ApiModelProperty(value = "内部钢种")
    private String stNo;

    @ApiModelProperty(value = "牌号")
    private String sgSign;

    @ApiModelProperty(value = "结晶器厚")
    private BigDecimal moldThick;

    @ApiModelProperty(value = "结晶器宽")
    private BigDecimal moldWidth;

    @ApiModelProperty(value = "浇次号")
    private String castLotNo;

    @ApiModelProperty(value = "年", required = true)
    @NotNull
    private Long yearId;

    @ApiModelProperty(value = "浇次分割号")
    private Long castLotDivNo;

    @ApiModelProperty(value = "浇次内炉数")
    private Long castLotSum;

    @ApiModelProperty(value = "连铸机号")
    private String ccMachNo;

    @ApiModelProperty(value = "连铸机类型(1.板坯2.方坯3.钢锭)")
    private String ccType;

    @ApiModelProperty(value = "计划浇次头/尾炉标记")
    private String restrandFlg;

    @ApiModelProperty(value = "钢区工序途径")
    private String backlogEa;

    @ApiModelProperty(value = "计划精炼路径代码")
    private String refineRouteCode;

    @ApiModelProperty(value = "冶炼模式")
    private Long smeltMode;

    @ApiModelProperty(value = "计划出钢重量")
    private BigDecimal planTapWt;

    @ApiModelProperty(value = "产品最终用途码")
    private String apn;

    @ApiModelProperty(value = "板坯计划去向")
    private String dest;

    @ApiModelProperty(value = "新试号")
    private String newTestNo;

    @ApiModelProperty(value = "炼钢计划日期")
    private Date steelPlanDate;

    @ApiModelProperty(value = "炼钢申请日期")
    private Date steelAppDate;

    @ApiModelProperty(value = "计划日期")
    private Date planDate;

    @ApiModelProperty(value = "CC要求时刻设定")
    private Date ccReqTime;

    @ApiModelProperty(value = "CC要求时刻指定标记")
    private String ccReqTimeFlag;

    @ApiModelProperty(value = "判钢时间")
    private Date heatConfmTime;

    @ApiModelProperty(value = "热送要求时间")
    private Date hotReqTime;

    @ApiModelProperty(value = "热送标记")
    private String hotSendFlag;

    @ApiModelProperty(value = "热装标记")
    private String hotChargeFlag;

    @ApiModelProperty(value = "中间包更换标志")
    private Long tdChgFlg;

    @ApiModelProperty(value = "前制造命令")
    private String prevPono;

    @ApiModelProperty(value = "板坯要求")
    private String slabReq;

    @ApiModelProperty(value = "火焰清理区分")
    private String flameCleanDiv;

    @ApiModelProperty(value = "班要点")
    private String shiftPoint;

    @ApiModelProperty(value = "班次号")
    private String shiftNo;

    @ApiModelProperty(value = "班组")
    private String shiftGroup;

    @ApiModelProperty(value = "封锁计划员")
    private String holdPlanner;

    @ApiModelProperty(value = "封锁时刻")
    private String holdTime;

    @ApiModelProperty(value = "计划释放者")
    private String planReleaser;

    @ApiModelProperty(value = "释放时刻")
    private String relTime;

    @ApiModelProperty(value = "下达计划员")
    private String sendPlanner;

    @ApiModelProperty(value = "下达时刻")
    private String sendTime;

    @ApiModelProperty(value = "连连铸基准")
    private String ccBase;

    @ApiModelProperty(value = "浇注时间")
    private Long pourTime;

    @ApiModelProperty(value = "调整标记")
    private String adjustFlag;

    @ApiModelProperty(value = "租户ID", required = true)
    @NotNull
    private Long tenantId;

    @ApiModelProperty(value = "方/板坯区分标记（0：板坯/1：方坯）")
    private Long isBloom;

    @ApiModelProperty(value = "见证点状态：N-未开始见证、Y-开始见证调整标记")
    private String witnessPointStatus;

    @Transient
    @ApiModelProperty(value = "命令状态")
    private String status;

    @Transient
    @ApiModelProperty(value = "命令板坯号")
    private String slabNo;

    @Transient
    @ApiModelProperty(value = "板坯位置代码")
    private String slabPlaceCode;

    @Transient
    @ApiModelProperty(value = "板坯厚度")
    private BigDecimal slabThick;

    @Transient
    @ApiModelProperty(value = "钢坯类型")
    private String billetType;

    @Transient
    @ApiModelProperty(value = "板坯宽度")
    private BigDecimal slabWidth;

    @Transient
    @ApiModelProperty(value = "是否有见证点状态(Y/N)")
    private String isWitnessPoint;

    @Transient
    @ApiModelProperty(value = "是否有热处理要求(Y/N)")
    private String isHavingHreat;

    @Transient
    @ApiModelProperty("决定内部钢种")
    private String dectStNo;

    @Transient
    @ApiModelProperty("炉次确定标记")
    private String heatComfmFlag;

    @Transient
    @ApiModelProperty("炉次等级")
    private String heatGrade;

    @Transient
    @ApiModelProperty("质量使用标记")
    private String flag;

    @Transient
    @ApiModelProperty("操作人id")
    private Long userId;


    private String attribute1;

    private String attribute2;

    private String attribute3;

    private String attribute4;

    private String attribute5;

//    public void setMoldThick(BigDecimal moldThick) {
//        this.moldThick = Utils.conversionDecimal(moldThick, Constants.ConversionType.THICKNESS);
//    }
//
//    public void setMoldWidth(BigDecimal moldWidth) {
//        this.moldWidth = Utils.conversionDecimal(moldWidth, Constants.ConversionType.WIDTH);
//    }

    public void setPlanTapWt(BigDecimal planTapWt) {
        this.planTapWt = Utils.conversionDecimal(planTapWt, Constants.ConversionType.WEIGHT);
    }

}
