package cn.estsh.i3plus.pojo.andon.model;

import cn.estsh.i3plus.pojo.andon.bean.AndonManageQueue;
import cn.estsh.i3plus.pojo.andon.bean.MesWorkCenter;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.Data;

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

/**
 * @Description:  安灯主界面Model
 * @Reference:
 * @Author: Crish
 * @CreateDate:2019-11-22-13:44
 * @Modify:
 **/
@Data
public class AndonMenuInterfaceModel implements Serializable {

    private static final long serialVersionUID = 6854130571481363067L;

    @ApiParam("工作中心代码")
    private String  workCenterCode;

    @ApiParam("工作中心名称")
    private String  workCenterName;

    @ApiParam("产线运行状态")
    private String  workCenterStatus;

    @ApiParam("安灯类型")
    private String  alarmCode;

    @ApiParam("安灯类型名称")
    private String  alarmName;

    @ApiParam("故障总时长   单位：分钟")
    private Long  exceptionTime = 0L;

    @ApiParam("当前安灯类型故障时长   单位：分钟")
    private Long  currentExceptionTime = 0L;

    @ApiParam("当前安灯类型故障比例")
    private Double  proportion = 0D;

    @ApiParam("图表类型颜色")
    private String color;

    @ApiParam("安灯状态")
    private Integer actionCode;

    @ApiParam("安灯状态名称")
    private String actionName;

    @ApiParam("mes微服调用-故障次数占比")
    private List<AndonBoardModel> mesBrokenRatioList;

    @ApiParam("故障时长类型占比 / 故障次数占比 / 工厂故障信息-产线故障时长-产线时长集合")
    private List<AndonBoardModel> brokenRatioList;

    @ApiParam("工厂故障信息-产线故障时长-安灯类型集合")
    private List<AndonMenuInterfaceModel> workcenterBrokenTimeList;

    @ApiParam("工厂故障信息-产线故障时长-产线集合")
    private List<MesWorkCenter> workCenterList;

    @ApiParam("产线整体状态")
    private List<AndonMenuInterfaceModel> andonWorkcenterList;

    @ApiParam("产品运行状态示意图")
    private List<CellGroupStatusModel> andonCellGroupStatusList;

    @ApiParam("事件设备时长TOP10")
    private List<AndonMenuInterfaceModel> equTimeList;

    @ApiParam("事件设备时长TOP10-次数")
    private List<String> equInTimeList;

    @ApiParam("事件质量时长TOP10")
    private List<AndonMenuInterfaceModel> qualityTimeList;

    @ApiParam("事件质量时长TOP10-次数")
    private List<String> qualityInTimeList;

    @ApiParam("事件物料时长TOP10")
    private List<AndonMenuInterfaceModel> partTimeList;

    @ApiParam("事件物料时长TOP10-次数")
    private List<String> partInTimeList;

    @ApiParam("当前产线的未解决故障统计")
    private List<AndonBoardModel> pendingSolveBrokenInfoList;

    @ApiParam("安灯队列停机时长")
    private List<AndonManageQueue> andonManageQueueList;

    public double getExceptionTimeVal() {
        return exceptionTime == null ? 0 : exceptionTime;
    }

    public double getCurrentExceptionTimeVal() {
        return currentExceptionTime == null ? 0 : currentExceptionTime;
    }

    public double getProportionVal() {
        return proportion == null ? 0 : proportion;
    }

    @Override
    public String toString() {
        return "AndonMenuInterfaceModel{" +
                "workCenterCode='" + workCenterCode + '\'' +
                ", workCenterName='" + workCenterName + '\'' +
                ", workCenterStatus='" + workCenterStatus + '\'' +
                ", alarmCode='" + alarmCode + '\'' +
                ", alarmName='" + alarmName + '\'' +
                ", exceptionTime=" + exceptionTime +
                ", currentExceptionTime=" + currentExceptionTime +
                ", proportion=" + proportion +
                '}';
    }
}