package com.railway.business.catenary.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.math.BigDecimal;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
/**
 * dxf分选绝缘器检查表 
 * @author wuhonghao 2021-10-14
 */
@Data
@ApiModel("dxf分选绝缘器检查表 ")
@EqualsAndHashCode(callSuper = true)
public class BusJcbFdfxjyq extends BusJcab{

    @ApiModelProperty(value = "绝缘器主键")
    private Long fdfxjyqId;

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

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

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

    @ApiModelProperty(value = "a点值")
    private BigDecimal pointA;

    @ApiModelProperty(value = "b点值")
    private BigDecimal pointB;

    @ApiModelProperty(value = "c点值")
    private BigDecimal pointC;

    @ApiModelProperty(value = "d点值")
    private BigDecimal pointD;

    @ApiModelProperty(value = "e点值")
    private BigDecimal pointE;

    @ApiModelProperty(value = "f点值")
    private BigDecimal pointF;

    @ApiModelProperty(value = "g点值")
    private BigDecimal pointG;

    @ApiModelProperty(value = "h点值")
    private BigDecimal pointH;

    @ApiModelProperty(value = "分段负驰度")
    private BigDecimal fcd;

    @ApiModelProperty(value = "分段地面平顺度（任意两点间导高差最大值）")
    private BigDecimal fddmpsd;

    @ApiModelProperty(value = "线路、分段数据-线路坡度")
    private BigDecimal xlfdXlpd;

    @ApiModelProperty(value = "线路、分段数据-外轨超高")
    private BigDecimal xlfdWgdg;

    @ApiModelProperty(value = "线路、分段数据-分段顺线路倾角")
    private BigDecimal xlfdFdsxlqj;

    @ApiModelProperty(value = "线路、分段数据-分段垂直线路倾角")
    private BigDecimal xlfdFdczxlqj;

    @ApiModelProperty(value = "分段绝缘器主绝缘状态")
    @Length(min = 1, max = 1, message = "【分段绝缘器主绝缘状态】长度必须介于 {min} 和 {max} 之间")
    private String jybjFdjyqzjyzt;

    @ApiModelProperty(value = "分段绝缘器主绝缘状态(故障描述)")
    @Length(max = 255, message = "【分段绝缘器主绝缘状态(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String jybjFdjyqzjyztDesc;

    @ApiModelProperty(value = "承力索绝缘子状态")
    @Length(min = 1, max = 1, message = "【承力索绝缘子状态】长度必须介于 {min} 和 {max} 之间")
    private String jybjClsjyzzt;

    @ApiModelProperty(value = "承力索绝缘子状态(故障描述)")
    @Length(max = 255, message = "【承力索绝缘子状态(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String jybjClsjyzztDesc;

    @ApiModelProperty(value = "各螺栓无锈蚀、烧伤、裂纹")
    @Length(min = 1, max = 1, message = "【各螺栓无锈蚀、烧伤、裂纹】长度必须介于 {min} 和 {max} 之间")
    private String lbjztLs;

    @ApiModelProperty(value = "各螺栓无锈蚀、烧伤、裂纹(故障描述)")
    @Length(max = 255, message = "【各螺栓无锈蚀、烧伤、裂纹(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String lbjztLsDesc;

    @ApiModelProperty(value = "斜吊线无锈蚀、烧伤、裂纹")
    @Length(min = 1, max = 1, message = "【斜吊线无锈蚀、烧伤、裂纹】长度必须介于 {min} 和 {max} 之间")
    private String lbjztXdx;

    @ApiModelProperty(value = "斜吊线无锈蚀、烧伤、裂纹(故障描述)")
    @Length(max = 255, message = "【斜吊线无锈蚀、烧伤、裂纹(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String lbjztXdxDesc;

    @ApiModelProperty(value = "平衡支架无锈蚀、烧伤、裂纹")
    @Length(min = 1, max = 1, message = "【平衡支架无锈蚀、烧伤、裂纹】长度必须介于 {min} 和 {max} 之间")
    private String lbjztPhzj;

    @ApiModelProperty(value = "平衡支架无锈蚀、烧伤、裂纹(故障描述)")
    @Length(max = 255, message = "【平衡支架无锈蚀、烧伤、裂纹(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String lbjztPhzjDesc;

    @ApiModelProperty(value = "接触线接头处过渡平滑")
    @Length(min = 1, max = 1, message = "【接触线接头处过渡平滑】长度必须介于 {min} 和 {max} 之间")
    private String lbjztJcxjt;

    @ApiModelProperty(value = "接触线接头处过渡平滑(故障描述)")
    @Length(max = 255, message = "【接触线接头处过渡平滑(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String lbjztJcxjtDesc;

    @ApiModelProperty(value = "消弧角无裂纹、烧伤")
    @Length(min = 1, max = 1, message = "【消弧角无裂纹、烧伤】长度必须介于 {min} 和 {max} 之间")
    private String lbjztXhj;

    @ApiModelProperty(value = "消弧角无裂纹、烧伤(故障描述)")
    @Length(max = 255, message = "【消弧角无裂纹、烧伤(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String lbjztXhjDesc;

    @ApiModelProperty(value = "受电弓接触状态-两端长短滑轨分别与接触线三点等高")
    @Length(min = 1, max = 1, message = "【受电弓接触状态-两端长短滑轨分别与接触线三点等高】长度必须介于 {min} 和 {max} 之间")
    private String sdgjcztSddg;

    @ApiModelProperty(value = "受电弓接触状态-两端长短滑轨分别与接触线三点等高(故障描述)")
    @Length(max = 255, message = "【受电弓接触状态-两端长短滑轨分别与接触线三点等高(故障描述)】长度必须介于 {min} 和 {max} 之间")
    private String sdgjcztSddgDesc;

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

    public BigDecimal getDxlzxpy(){
        if(pointB!=null&&pointG!=null){
            return pointB.add(pointG).divide(new BigDecimal("2")).setScale(2,BigDecimal.ROUND_HALF_UP);
        }else{
            return null;
        }
    }

    public String getJybjzt(){
        if("1".equals(jybjFdjyqzjyzt)&&"1".equals(jybjClsjyzzt)){
            return "合格";
        }else{
            return "不合格";
        }
    }

    public String getJtgdph(){
        if("1".equals(lbjztJcxjt)){
            return "是";
        }else{
            return "否";
        }
    }

    public String getGlbjzt(){
        if("1".equals(lbjztLs)&& "1".equals(lbjztXdx)&& "1".equals(lbjztPhzj)&& "1".equals(lbjztXhj)&& "1".equals(sdgjcztSddg)){
            return "合格";
        }else{
            return "不合格";
        }
    }

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

}