package com.sw.mes.production.dto;

import com.sw.mes.production.entity.FormulaSchemeDetail;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;

import javax.persistence.Column;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @author zhaowenjie
 */
@Data
public class FormulaSchemeData {
    /**
     * 方案版本号
     */
    @ApiModelProperty(value = "配方方案id")
    private Long schemeId;

    /**
     * 方案编号
     */
    @ApiModelProperty(value = "配方方案编号")
    private String schemeCode;

    /**
     * 方案版本号
     */
    @ApiModelProperty(value = "配方方案版本号")
    private Integer schemeVersion;

    /**
     * 方案编号
     */
    @ApiModelProperty(value = "重量方案id")
    private Long weightSchemeId;

    /**
     * 桶规格
     */
    @ApiModelProperty(value = "桶规格")
    private BigDecimal barrelSpecs;

    /**
     * 前端展示数据
     */
    Object[][] materialFeedingDetailArrs;

    /**
     * 方案编号
     */
    @ApiModelProperty(value = "重量方案名称")
    private String weightSchemeName;

    List<FormulaSchemeDataDetail> detail;

    @Data
    public static class FormulaSchemeDataDetail {
        /**
         * 桶数序号
         */
        @ApiModelProperty(value = "桶数序号")
        private Integer index;

        /**
         * 桶重量
         */
        @ApiModelProperty(value = "桶重量")
        private BigDecimal weight;

        /**
         * 装料明细
         */
        @ApiModelProperty(value = "装料明细")
        private List<LoadingDetail> loadingDetails;
    }


    /**
     * 装料明细
     */
    @Data
    public static class LoadingDetail {
        /**
         * 物料种类
         */
        @ApiModelProperty(value = "物料种类")
        private String materialType;
        /**
         * 物料分类
         */
        @ApiModelProperty(value = "物料分类")
        private String materialClassName;
        /**
         * 重量
         */
        @ApiModelProperty(value = "重量")
        private BigDecimal weight;
        /**
         * 物料明细
         */
        @Getter
        public List<FormulaSchemeDetail> formulaSchemeDetails = new ArrayList<>();
    }

}
