package com.railway.business.catenary.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;

/**
 * 检查表-避雷器
 * @author wuhonghao 2021-10-17
 */
@Data
@ApiModel("检查表-避雷器")
@EqualsAndHashCode(callSuper = true)
public class BusJcbBlq extends BusJcab{

    @ApiModelProperty(value = "避雷器主键")
    private Long blqId;

    @ApiModelProperty(value = "支柱号")
    @Length(min = 1, max = 50, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
    private String pillarCode;

    @ApiModelProperty(value = "图片路径")
    @Length(max = 255, message = "【图片路径】长度必须介于 {min} 和 {max} 之间")
    private String picUrl;

    @ApiModelProperty(value = "避雷器托架安装水平")
    @Length(min = 1, max = 1, message = "【避雷器托架安装水平】长度必须介于 {min} 和 {max} 之间")
    private String tjwzBlqtjazsp;

    @ApiModelProperty(value = "避雷器托架安装水平(故障描述)")
    @Length(max = 225, message = "【避雷器托架安装水平(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String tjwzBlqtjazspDesc;

    @ApiModelProperty(value = "无锈蚀")
    @Length(min = 1, max = 1, message = "【无锈蚀】长度必须介于 {min} 和 {max} 之间")
    private String tjwzWxs;

    @ApiModelProperty(value = "无锈蚀(故障描述)")
    @Length(max = 225, message = "【无锈蚀(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String tjwzWxsDesc;

    @ApiModelProperty(value = "各部螺栓连接紧固")
    @Length(min = 1, max = 1, message = "【各部螺栓连接紧固】长度必须介于 {min} 和 {max} 之间")
    private String tjwzGblsljjg;

    @ApiModelProperty(value = "各部螺栓连接紧固(故障描述)")
    @Length(max = 225, message = "【各部螺栓连接紧固(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String tjwzGblsljjgDesc;

    @ApiModelProperty(value = "避雷器及支持绝缘子呈竖直状态")
    @Length(min = 1, max = 1, message = "【避雷器及支持绝缘子呈竖直状态】长度必须介于 {min} 和 {max} 之间")
    private String blqjyzBlqjzcjyzcszzt;

    @ApiModelProperty(value = "避雷器及支持绝缘子呈竖直状态(故障描述)")
    @Length(max = 255, message = "【避雷器及支持绝缘子呈竖直状态(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String blqjyzBlqjzcjyzcszztDesc;

    @ApiModelProperty(value = "表面清洁，安装牢固,无裂纹、破损及放电痕迹")
    @Length(min = 1, max = 1, message = "【表面清洁，安装牢固,无裂纹、破损及放电痕迹】长度必须介于 {min} 和 {max} 之间")
    private String blqjyzBmqjazlg;

    @ApiModelProperty(value = "表面清洁，安装牢固,无裂纹、破损及放电痕迹(故障描述)")
    @Length(max = 255, message = "【表面清洁，安装牢固,无裂纹、破损及放电痕迹(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String blqjyzBmqjazlgDesc;

    @ApiModelProperty(value = "避雷器引线无烧伤、断股")
    @Length(min = 1, max = 1, message = "【避雷器引线无烧伤、断股】长度必须介于 {min} 和 {max} 之间")
    private String blqyxBlqyxwssdg;

    @ApiModelProperty(value = "避雷器引线无烧伤、断股(故障描述)")
    @Length(max = 255, message = "【避雷器引线无烧伤、断股(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String blqyxBlqyxwssdgDesc;

    @ApiModelProperty(value = "高压侧引线对接地体的动态最小距离")
    private BigDecimal blqyxGycyxdjdtdtzxjl;

    @ApiModelProperty(value = "状态良好，无破损、裂纹")
    @Length(min = 1, max = 1, message = "【状态良好，无破损、裂纹】长度必须介于 {min} 和 {max} 之间")
    private String tlqZtlhwpslh;

    @ApiModelProperty(value = "状态良好，无破损、裂纹(故障描述)")
    @Length(max = 255, message = "【状态良好，无破损、裂纹(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String tlqZtlhwpslhDesc;

    @ApiModelProperty(value = "计数器-动作计数")
    @Length(min = 1, max = 20, message = "【计数器-动作计数】长度必须介于 {min} 和 {max} 之间")
    private String jsqDzjs;

    @ApiModelProperty(value = "避雷器接地状态-接地电阻")
    private BigDecimal blqjdztJddz;

    @ApiModelProperty(value = "设备状态(故障描述)")
    @Length(max = 255, message = "【设备状态(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String sbztDesc;

    @ApiModelProperty(value = "生产厂家")
    private String sccj;

    public String getXb(){
        return "检测";
    }

    public String getBtzt(){
        if("1".equals(blqjyzBlqjzcjyzcszzt)&& "1".equals(blqjyzBmqjazlg)){
            return "良好";
        }else{
            return "故障";
        }
    }

    public String getYx(){
        if("1".equals(blqyxBlqyxwssdg)){
            return "良好";
        }else{
            return "故障";
        }
    }

    public String getJdx(){
        if(blqjdztJddz!=null&&blqjdztJddz.compareTo(new BigDecimal("10"))==1){
            return "良好";
        }else{
            return "故障";
        }
    }


    public String getTlq(){
        if("1".equals(tlqZtlhwpslh)){
            return "良好";
        }else{
            return "故障";
        }
    }

    public String getFszzqt(){
        if("1".equals(tjwzBlqtjazsp)&& "1".equals(tjwzWxs)&& "1".equals(tjwzGblsljjg)){
            return "良好";
        }else{
            return "故障";
        }
    }

}