package cn.estsh.i3plus.ext.mes.pojo.model.jx;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author wangjie
 * @version 1.0
 * @date 2021/1/15 15:32
 **/
@Data
@ApiModel("BU出货检验月报日报model")
public class JxOqcCheckStatisticsReportModel implements Serializable {

    private static final long serialVersionUID = -4951355680517558336L;

    @ApiParam("工单号")
    private String workOrderNo;

    @ApiParam("产线代码")
    private String workCenterCode;

    @ApiParam("生产日期:分组")
    private String workTimeFilter;

    @ApiParam("生产日期")
    private String workTime;

    @ApiParam("班次")
    private String shiftCode;

    @ApiParam("产品类别")
    private String categoryCode3;

    @ApiParam("物料编码")
    private String partNo;

    @ApiParam("物料名称")
    private String partNameRdd;

    @ApiParam("销售向")
    private String salesTo;

    @ApiParam("销售向")
    private String salesToName;

    @ApiParam("生产批量数")
    private Integer workTimesQty;

    @ApiParam("检验批量数")
    private Integer lastCheckedQty;

    @ApiParam("检验台数")
    private Double checkAmountQty;

    @ApiParam("产量")
    private Double qty;

    @ApiParam("抽样率")
    private String sampleRate;

    @ApiParam("缺点数")
    private Integer unQcQty;

    @ApiParam("检验结果")
    private Integer checkResult;

    @ApiParam("抽检数量")
    private Double spotCheckQty;

    @ApiParam("组织代码")
    public String organizeCode;

    @ApiParam("生产日期开始")
    public String workTimeStart;

    @ApiParam("生产日期结束")
    public String workTimeEnd;

    @ApiParam("查询维度")
    private Integer dimension;

    @ApiParam("查询维度")
    private Integer dimension1;

    @ApiParam("table动态列名")
    private List<SxDynamicAttributeModel> attributeList = new ArrayList<>();

    @ApiParam("table数据")
    private List<Map<String, Object>> dataList;

    @ApiParam("不等于的工单类型")
    private Integer neqWorkOrderType;

    public JxOqcCheckStatisticsReportModel() {}

    public JxOqcCheckStatisticsReportModel(String workOrderNo, String partNo, String partNameRdd, String workTime, String shiftCode, Double spotCheckQty, Integer checkResult, String salesTo, String categoryCode3) {
        this.workOrderNo = workOrderNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.workTime = workTime;
        this.shiftCode = shiftCode;
        this.spotCheckQty = spotCheckQty;
        this.checkResult = checkResult;
        this.salesTo = salesTo;
        this.categoryCode3 = categoryCode3;
    }

    public JxOqcCheckStatisticsReportModel(String workCenterCode, String workOrderNo, String partNo, String partNameRdd, String workTime, String shiftCode, Double spotCheckQty, Integer checkResult, String salesTo, String categoryCode3) {
        this.workOrderNo = workOrderNo;
        this.partNo = partNo;
        this.partNameRdd = partNameRdd;
        this.workTime = workTime;
        this.shiftCode = shiftCode;
        this.spotCheckQty = spotCheckQty;
        this.checkResult = checkResult;
        this.salesTo = salesTo;
        this.categoryCode3 = categoryCode3;
        this.workCenterCode = workCenterCode;
    }

    public JxOqcCheckStatisticsReportModel addAttribute(SxDynamicAttributeModel attribute) {
        this.attributeList.add(attribute);
        return this;
    }

    public String toBaseString() {
        return "JxOqcCheckStatisticsReportModel{" +
                "dimension=" + dimension +
                ", dimension1=" + dimension1 +
                ", categoryCode3='" + categoryCode3 + '\'' +
                ", salesTo='" + salesTo + '\'' +
                ", partNo='" + partNo + '\'' +
                ", organizeCode='" + organizeCode + '\'' +
                ", workTimeStart='" + workTimeStart + '\'' +
                ", workTimeEnd='" + workTimeEnd + '\'' +
                '}';
    }


}
