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

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

import java.io.Serializable;

/**
 * @Description: 按照安灯类型统计分组统计当天发生的安灯总次数和安灯超时次数 model
 * @Reference:
 * @Author: Crish
 * @CreateDate:2019-11-12-10:21
 * @Modify:
 **/
@Data
public class AndonBoardModel implements Serializable {

    private static final long serialVersionUID = 4995310176494124290L;

    @ApiParam("工作单元代码")
    private String workCellCode;

    @ApiParam("工作单元名称")
    private String workCellName;

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

    @ApiParam("生产线名称")
    private String workCenterName;

    @ApiParam("安灯任务编号")
    private String andonOrderNo;

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

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

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

    @ApiParam("响应时长  单位：分钟")
    private Long responseTimeCount = 0L;

    @ApiParam("响应时长  单位：分钟")
    private Long resetTimeCount = 0L;

    @ApiParam("响应时长/响应时长(通用)  单位：分钟")
    private Long commonTimeCount = 0L;

    @ApiParam("安灯正常处理的次数")
    private Integer inTime = 0;

    @ApiParam("安灯超时次数")
    private Integer overTime = 0;

    @ApiParam("安灯总次数")
    private Integer totalTime = 0;

    @ApiParam("安灯类型百分比")
    private float propagation = 0;

    @ApiParam("事件描述代码")
    private String acCode;

    @ApiParam("事件描述详情")
    private String acDesc;

    @ApiParam("工位运行状态")
    private String  cellStatus;

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

    @ApiParam("停线时间比率")
    private String downtimeRate;

    public int getTotalTimeVal() {
        return totalTime == null ? 0 : totalTime;
    }

    public int getOverTimeVal() {
        return overTime == null ? 0 : overTime;
    }

    public int getInTime() {
        return inTime == null ? 0 : inTime;
    }

    public double getExceptionCountVal() {
        return exceptionTimeCount == null ? 0 : exceptionTimeCount;
    }

    public double getResponseTimeCountVal() {
        return responseTimeCount == null ? 0 : responseTimeCount;
    }

    public double getResetTimeCountVal() {
        return resetTimeCount == null ? 0 : resetTimeCount;
    }

    public double getCommonTimeCountVal() {
        return commonTimeCount == null ? 0 : commonTimeCount;
    }

}
