package com.aucma.dms.domain;

import com.aucma.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;



/**
 * 检修工单;一是根据检修计划自动创建的检修工单，二是手工创建故障报修工单对象 dms_repair_instance
 *
 * @author Open Platform
 * @date 2024-01-24
 */
public class DmsRepairInstance extends DmsBaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键标识;此表不会长期保存 */
    private Long repairInstanceId;

    /** 检修计划ID，关联dms_plan_repair的plan_repair_id */
    @Excel(name = "检修计划ID，关联dms_plan_repair的plan_repair_id")
    private Long planRepairId;

    /** 工单流程ID，关联wf_process的wf_process_id;固定101 - 已废弃审批流功能 */
    // @Excel(name = "工单流程ID，关联wf_process的wf_process_id;固定101")
    // private Long wfProcessId;

    /** 工单编号 */
    @Excel(name = "工单编号")
    private String billsRepairCode;

    /** 工单状态：0-待检修，1-检修中，2-检修完成 */
    @Excel(name = "工单状态：0-待检修，1-检修中，2-检修完成")
    private String billsStatus;

    /** 计划开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planBeginTime;

    /** 实际开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date realBeginTime;

    /** 计划完成时间;根据计划的时限计算 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "计划完成时间;根据计划的时限计算", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planEndTime;

    /** 实际完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "实际完成时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date realEndTime;

    /** 检修完成率 */
    @Excel(name = "检修完成率")
    private BigDecimal repairCompRate;

    /** 工单类型（1手工创建,2自动创建） */
    @Excel(name = "工单类型", readConverterExp = "1=手工创建,2自动创建")
    private String instanceType;

    /** 是否标识：1-是；0-否 */
    @Excel(name = "是否标识：1-是；0-否")
    private String isFlag;

    /** 创建人 */
    @Excel(name = "创建人")
    private String applyBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date applyTime;

    private String repairType;
    private String repairGroup;
    private String repairSupervisor;

    public String getRepairType() {
        return repairType;
    }

    public void setRepairType(String repairType) {
        this.repairType = repairType;
    }

    public String getRepairGroup() {
        return repairGroup;
    }

    public void setRepairGroup(String repairGroup) {
        this.repairGroup = repairGroup;
    }

    public String getRepairSupervisor() {
        return repairSupervisor;
    }

    public void setRepairSupervisor(String repairSupervisor) {
        this.repairSupervisor = repairSupervisor;
    }

    public void setRepairInstanceId(Long repairInstanceId)
    {
        this.repairInstanceId = repairInstanceId;
    }

    public Long getRepairInstanceId()
    {
        return repairInstanceId;
    }
    public void setPlanRepairId(Long planRepairId)
    {
        this.planRepairId = planRepairId;
    }

    public Long getPlanRepairId()
    {
        return planRepairId;
    }
    // 已废弃审批流功能
    // public void setWfProcessId(Long wfProcessId)
    // {
    //     this.wfProcessId = wfProcessId;
    // }

    // public Long getWfProcessId()
    // {
    //     return wfProcessId;
    // }
    public void setBillsRepairCode(String billsRepairCode)
    {
        this.billsRepairCode = billsRepairCode;
    }

    public String getBillsRepairCode()
    {
        return billsRepairCode;
    }
    public void setBillsStatus(String billsStatus)
    {
        this.billsStatus = billsStatus;
    }

    public String getBillsStatus()
    {
        return billsStatus;
    }
    public void setPlanBeginTime(Date planBeginTime)
    {
        this.planBeginTime = planBeginTime;
    }

    public Date getPlanBeginTime()
    {
        return planBeginTime;
    }
    public void setRealBeginTime(Date realBeginTime)
    {
        this.realBeginTime = realBeginTime;
    }

    public Date getRealBeginTime()
    {
        return realBeginTime;
    }
    public void setPlanEndTime(Date planEndTime)
    {
        this.planEndTime = planEndTime;
    }

    public Date getPlanEndTime()
    {
        return planEndTime;
    }
    public void setRealEndTime(Date realEndTime)
    {
        this.realEndTime = realEndTime;
    }

    public Date getRealEndTime()
    {
        return realEndTime;
    }
    public void setRepairCompRate(BigDecimal repairCompRate)
    {
        this.repairCompRate = repairCompRate;
    }

    public BigDecimal getRepairCompRate()
    {
        return repairCompRate;
    }
    public void setInstanceType(String instanceType)
    {
        this.instanceType = instanceType;
    }

    public String getInstanceType()
    {
        return instanceType;
    }
    public void setIsFlag(String isFlag)
    {
        this.isFlag = isFlag;
    }

    public String getIsFlag()
    {
        return isFlag;
    }
    public void setApplyBy(String applyBy)
    {
        this.applyBy = applyBy;
    }

    public String getApplyBy()
    {
        return applyBy;
    }
    public void setApplyTime(Date applyTime)
    {
        this.applyTime = applyTime;
    }

    public Date getApplyTime()
    {
        return applyTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("repairInstanceId", getRepairInstanceId())
            .append("planRepairId", getPlanRepairId())
            // .append("wfProcessId", getWfProcessId()) // 已废弃审批流
            .append("billsRepairCode", getBillsRepairCode())
            .append("billsStatus", getBillsStatus())
            .append("planBeginTime", getPlanBeginTime())
            .append("realBeginTime", getRealBeginTime())
            .append("planEndTime", getPlanEndTime())
            .append("realEndTime", getRealEndTime())
            .append("repairCompRate", getRepairCompRate())
            .append("instanceType", getInstanceType())
            .append("isFlag", getIsFlag())
            .append("remark", getRemark())
            .append("applyBy", getApplyBy())
            .append("applyTime", getApplyTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
