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

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.util.CollectionUtils;

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

/**
 * @DESCRIPTION:
 * @USER: wangjie
 * @DATE: 2022-11-01 15:54
 */
@Data
@ApiModel("月度非作业汇总（损失时间）报表数据MODEL")
public class SxLossTimeMonthlyModel extends SxEChartsReportCommonDataModel implements Serializable {

    private static final long serialVersionUID = 3594190044586226847L;

    @ApiParam("作业时间")
    private String workTime;

    @ApiParam("产品别")
    private String categoryName;

    @ApiParam(value = "生产线代码")
    private String workCenterCodeArr;

    @ApiParam("操作类型代码")
    private Integer prodType;

    @ApiParam("内容分类")
    private Integer prodCategory;

    @ApiParam("标题")
    public String title;

    @ApiParam("表字段")
    private List<SxDataModel> tableNameList;

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

    @ApiParam("作业时间")
    private String curDataTimeStart;

    @ApiParam("作业时间")
    private String curDataTimeEnd;

    @ApiParam("作业时间")
    private String lastDataTimeStart;

    @ApiParam("作业时间")
    private String lastDataTimeEnd;

    @ApiParam("作业时间")
    private String actualDataTimeStart;

    @ApiParam("作业时间")
    private String actualDataTimeEnd;

    public SxLossTimeMonthlyModel title(String title) {
        this.title = title;
        return this;
    }

    public SxLossTimeMonthlyModel addTableName(String field, String name) {
        if (CollectionUtils.isEmpty(this.tableNameList)) this.tableNameList = new LinkedList<>();
        this.tableNameList.add(new SxDataModel(field, name));
        return this;
    }

    public SxLossTimeMonthlyModel addTableData(Map<String, Object> tableDataMap) {
        if (CollectionUtils.isEmpty(this.tableDataList)) this.tableDataList = new LinkedList<>();
        this.tableDataList.add(tableDataMap);
        return this;
    }

    public SxLossTimeMonthlyModel curDataTimeStart(String curDataTimeStart) {
        this.curDataTimeStart = curDataTimeStart;
        return this;
    }

    public SxLossTimeMonthlyModel curDataTimeEnd(String curDataTimeEnd) {
        this.curDataTimeEnd = curDataTimeEnd;
        return this;
    }

    public SxLossTimeMonthlyModel lastDataTimeStart(String lastDataTimeStart) {
        this.lastDataTimeStart = lastDataTimeStart;
        return this;
    }

    public SxLossTimeMonthlyModel lastDataTimeEnd(String lastDataTimeEnd) {
        this.lastDataTimeEnd = lastDataTimeEnd;
        return this;
    }

    public SxLossTimeMonthlyModel actualDataTimeStart(String actualDataTimeStart) {
        this.actualDataTimeStart = actualDataTimeStart;
        return this;
    }

    public SxLossTimeMonthlyModel actualDataTimeEnd(String actualDataTimeEnd) {
        this.actualDataTimeEnd = actualDataTimeEnd;
        return this;
    }


}
