package com.ximai.mes.report.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

/**
 * 进度报表行数据
 * 工序列为动态：processQuantities key 为工序名称，value 为该工序完工数量
 */
@Data
public class ProgressReportResponse {

    @ApiModelProperty("排产时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date scheduleTime;

    @ApiModelProperty("订单单号")
    private String orderCode;

    @ApiModelProperty("产线名称")
    private String lineName;

    @ApiModelProperty("生产工单")
    private String workorderCode;

    @ApiModelProperty("订单序号")
    private String orderSerial;

    @ApiModelProperty("工单类型")
    private String workorderType;

    @ApiModelProperty("产品编号")
    private String productCode;

    @ApiModelProperty("产品名称")
    private String productName;

    /** 动态工序列：key=工序名称，value=完工数量 */
    @ApiModelProperty("各工序完工数量(工序名为key)")
    private Map<String, BigDecimal> processQuantities = new LinkedHashMap<>();

    @ApiModelProperty("计划数量")
    private BigDecimal planQuantity;

    @ApiModelProperty("在制进度%")
    private BigDecimal progressPercent;

    @ApiModelProperty("需求时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date requestDate;
}
