package com.aps.macroplanner.output.dto;

import java.util.ArrayList;
import java.util.List;

/**
 * 生产任务结果 — 对应 Quintiq 中 PeriodTaskOperation 的回写数据。
 *
 * <p>每个操作在每个周期的生产量、产能消耗、批次偏差等。</p>
 */
public class PeriodTaskResult {

    private String operationId;
    private String operationName;
    private String unitId;
    private int periodIndex;
    private String periodStartDate;

    /** PTQty — 生产量 */
    private double productionQty;
    /** 产能消耗 = productionQty × coefficient */
    private double capacityUsed;
    /** 产能消耗系数 */
    private double capacityCoeff;

    /** 批次大小 (如有) */
    private Double lotSize;
    /** 超过批次上限的量 */
    private double lotSizeOver;
    /** 低于批次下限的量 */
    private double lotSizeUnder;

    /** 产出: 产品 → 库存点 */
    private final List<OutputInfo> outputs = new ArrayList<>();

    // ==================== 内嵌类 ====================

    /** 产出信息 */
    public static class OutputInfo {
        public String productId;
        public String spId;
        public double factor;
    }

    // ==================== Getters / Setters ====================

    public String getOperationId() { return operationId; }
    public void setOperationId(String v) { this.operationId = v; }

    public String getOperationName() { return operationName; }
    public void setOperationName(String v) { this.operationName = v; }

    public String getUnitId() { return unitId; }
    public void setUnitId(String v) { this.unitId = v; }

    public int getPeriodIndex() { return periodIndex; }
    public void setPeriodIndex(int v) { this.periodIndex = v; }

    public String getPeriodStartDate() { return periodStartDate; }
    public void setPeriodStartDate(String v) { this.periodStartDate = v; }

    public double getProductionQty() { return productionQty; }
    public void setProductionQty(double v) { this.productionQty = v; }

    public double getCapacityUsed() { return capacityUsed; }
    public void setCapacityUsed(double v) { this.capacityUsed = v; }

    public double getCapacityCoeff() { return capacityCoeff; }
    public void setCapacityCoeff(double v) { this.capacityCoeff = v; }

    public Double getLotSize() { return lotSize; }
    public void setLotSize(Double v) { this.lotSize = v; }

    public double getLotSizeOver() { return lotSizeOver; }
    public void setLotSizeOver(double v) { this.lotSizeOver = v; }

    public double getLotSizeUnder() { return lotSizeUnder; }
    public void setLotSizeUnder(double v) { this.lotSizeUnder = v; }

    public List<OutputInfo> getOutputs() { return outputs; }
}