package com.aucma.base.domain;

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

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

/**
 * 工单信息对象 base_orderinfo
 *
 * @author Yinq
 * @date 2023-09-27
 */
public class BaseOrderInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键标识
     */
    private Long objId;

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

    /**
     * 销售订单编号
     */
    @Excel(name = "销售订单编号")
    private String saleOrderCode;

    /**
     * 销售订单行号
     */
    @Excel(name = "销售订单行号")
    private String saleOrderLineNumber;

    /**
     * 物料编码
     */
    @Excel(name = "物料编码")
    private String materialCode;

    /**
     * 物料名称
     */
    @Excel(name = "物料名称")
    private String materialName;

    /**
     * 物料组
     */
    @Excel(name = "物料组")
    private String matkl;

    /**
     * 订单计划数量
     */
    @Excel(name = "订单计划数量")
    private BigDecimal orderAmount;

    /**
     * 完成数量
     */
    @Excel(name = "完成数量")
    private Long completeAmount;

    /**
     * 工单类型
     */
    @Excel(name = "工单类型")
    private String orderType;

    /**
     * 工单状态
     */
    @Excel(name = "工单状态")
    private String orderStatus;

    /**
     * 开始日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date beginDate;

    /**
     * 结束日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endDate;

    /**
     * 工厂编码
     */
    @Excel(name = "工厂编码")
    private String factoryCode;

    /**
     * 启用标识
     */
    @Excel(name = "启用标识")
    private Long isFlag;

    /**
     * 是否已下达计划（0-是，1-否）
     */
    @Excel(name = "是否已下达计划")
    private Long isRelease;

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

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

    /**
     * 更新人
     */
    @Excel(name = "更新人")
    private String updatedBy;

    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    /**
     * 完成日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "完成日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date completeDate;

    /** 查询开始时间（非持久化） */
    private Date beginTime;

    /** 查询结束时间（非持久化） */
    private Date endTime;

    /**
     * 工作中心
     */
    private String workCenterCode;

    /**
     * 工艺路线
     */
    private String routingCode;

    /**
     * 更换产线数量
     */
    private Long replaceAmount;

    /**
     * 手动更新标识（0=否，1=是）
     */
    private String manualUpdateFlag;

    /**
     * 执行状态：PENDING-待执行/RUNNING-运行中/COMPLETED-已完成/PAUSED-已暂停
     */
    @Excel(name = "执行状态")
    private String executionStatus;

    /**
     * 开始生产时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始生产时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 完工时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完工时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    /**
     * 执行操作员
     */
    @Excel(name = "操作员")
    private String executionOperator;

    /**
     * 实际完工数量
     */
    @Excel(name = "实际完工数量")
    private Long actualCompleteQty;

    /**
     * 实际不良数量
     */
    @Excel(name = "实际不良数量")
    private Long actualDefectQty;

    /**
     * 机台/设备编号
     */
    @Excel(name = "设备编号")
    private String deviceCode;

    public Long getReplaceAmount() {
        return replaceAmount;
    }

    public void setReplaceAmount(Long replaceAmount) {
        this.replaceAmount = replaceAmount;
    }

    public String getManualUpdateFlag() {
        return manualUpdateFlag;
    }

    public void setManualUpdateFlag(String manualUpdateFlag) {
        this.manualUpdateFlag = manualUpdateFlag;
    }

    public String getExecutionStatus() {
        return executionStatus;
    }

    public void setExecutionStatus(String executionStatus) {
        this.executionStatus = executionStatus;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public String getExecutionOperator() {
        return executionOperator;
    }

    public void setExecutionOperator(String executionOperator) {
        this.executionOperator = executionOperator;
    }

    public Long getActualCompleteQty() {
        return actualCompleteQty;
    }

    public void setActualCompleteQty(Long actualCompleteQty) {
        this.actualCompleteQty = actualCompleteQty;
    }

    public Long getActualDefectQty() {
        return actualDefectQty;
    }

    public void setActualDefectQty(Long actualDefectQty) {
        this.actualDefectQty = actualDefectQty;
    }

    public String getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }

    public String getWorkCenterCode() {
        return workCenterCode;
    }

    public void setWorkCenterCode(String workCenterCode) {
        this.workCenterCode = workCenterCode;
    }

    public String getRoutingCode() {
        return routingCode;
    }

    public void setRoutingCode(String routingCode) {
        this.routingCode = routingCode;
    }

    public Long getIsRelease() {
        return isRelease;
    }

    public void setIsRelease(Long isRelease) {
        this.isRelease = isRelease;
    }

    public void setObjId(Long objId) {
        this.objId = objId;
    }

    public Long getObjId() {
        return objId;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setSaleOrderCode(String saleOrderCode) {
        this.saleOrderCode = saleOrderCode;
    }

    public String getSaleOrderCode() {
        return saleOrderCode;
    }

    public void setSaleOrderLineNumber(String saleOrderLineNumber) {
        this.saleOrderLineNumber = saleOrderLineNumber;
    }

    public String getSaleOrderLineNumber() {
        return saleOrderLineNumber;
    }

    public void setMaterialCode(String materialCode) {
        this.materialCode = materialCode;
    }

    public String getMaterialCode() {
        return materialCode;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMatkl(String matkl) {
        this.matkl = matkl;
    }

    public String getMatkl() {
        return matkl;
    }

    public BigDecimal getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(BigDecimal orderAmount) {
        this.orderAmount = orderAmount;
    }

    public void setCompleteAmount(Long completeAmount) {
        this.completeAmount = completeAmount;
        // 保持展示字段与实际完工数量一致
        this.actualCompleteQty = completeAmount;
    }

    public Long getCompleteAmount() {
        return completeAmount;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderStatus(String orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getOrderStatus() {
        return orderStatus;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setFactoryCode(String factoryCode) {
        this.factoryCode = factoryCode;
    }

    public String getFactoryCode() {
        return factoryCode;
    }

    public void setIsFlag(Long isFlag) {
        this.isFlag = isFlag;
    }

    public Long getIsFlag() {
        return isFlag;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedTime(Date updatedTime) {
        this.updatedTime = updatedTime;
    }

    public Date getUpdatedTime() {
        return updatedTime;
    }

    public void setCompleteDate(Date completeDate) {
        this.completeDate = completeDate;
    }

    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getCompleteDate() {
        return completeDate;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("objId", getObjId())
                .append("orderCode", getOrderCode())
                .append("saleOrderCode", getSaleOrderCode())
                .append("saleOrderLineNumber", getSaleOrderLineNumber())
                .append("materialCode", getMaterialCode())
                .append("materialName", getMaterialName())
                .append("matkl", getMatkl())
                .append("orderAmount", getOrderAmount())
                .append("completeAmount", getCompleteAmount())
                .append("orderType", getOrderType())
                .append("orderStatus", getOrderStatus())
                .append("beginDate", getBeginDate())
                .append("endDate", getEndDate())
                .append("factoryCode", getFactoryCode())
                .append("isFlag", getIsFlag())
                .append("createdBy", getCreatedBy())
                .append("createdTime", getCreatedTime())
                .append("updatedBy", getUpdatedBy())
                .append("updatedTime", getUpdatedTime())
                .append("completeDate", getCompleteDate())
                .append("executionStatus", getExecutionStatus())
                .append("startTime", getStartTime())
                .append("finishTime", getFinishTime())
                .append("executionOperator", getExecutionOperator())
                .append("actualCompleteQty", getActualCompleteQty())
                .append("actualDefectQty", getActualDefectQty())
                .append("deviceCode", getDeviceCode())
                .toString();
    }
}
