package com.nantian.cloud.dbcapp.pojo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.metadata.BaseRowModel;
import io.swagger.annotations.ApiModel;
import lombok.Data;

@Data
@ApiModel(value = "企业一级电力和电网数据明细表")
public class EnterpriseElectricPOJO extends BaseRowModel {

    @ColumnWidth(5)
    @ExcelProperty(value = "序号")
    private String id;

    @ColumnWidth(15)
    @ExcelProperty(value = "企业名称")
    private String cmpName;

    @ColumnWidth(10)
    @ExcelProperty(value = "企业信用代码")
    private String enterpriseCode;

    @ExcelProperty(value = {"一月","电网数据(万千瓦时)"})
    private Float month1;

    @ExcelProperty(value = {"一月","在线采集数据(万千瓦时)"})
    private Float month1Zxjc;

    @ExcelProperty(value = {"一月","电力外供(万千瓦时)"})
    private Float month1ZxjcOut;

    @ExcelProperty(value = {"一月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month1OverstepLevel;

    @ExcelProperty(value = {"二月","电网数据(万千瓦时)"})
    private Float month2;

    @ExcelProperty(value = {"二月","在线采集数据(万千瓦时)"})
    private Float month2Zxjc;

    @ExcelProperty(value = {"二月","电力外供(万千瓦时)"})
    private Float month2ZxjcOut;

    @ExcelProperty(value = {"二月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month2OverstepLevel;

    @ExcelProperty(value = {"三月","电网数据(万千瓦时)"})
    private Float month3;

    @ExcelProperty(value = {"三月","在线采集数据(万千瓦时)"})
    private Float month3Zxjc;

    @ExcelProperty(value = {"三月","电力外供(万千瓦时)"})
    private Float month3ZxjcOut;

    @ExcelProperty(value = {"三月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month3OverstepLevel;

    @ExcelProperty(value = {"四月","电网数据(万千瓦时)"})
    private Float month4;

    @ExcelProperty(value = {"四月","在线采集数据(万千瓦时)"})
    private Float month4Zxjc;

    @ExcelProperty(value = {"四月","电力外供(万千瓦时)"})
    private Float month4ZxjcOut;

    @ExcelProperty(value = {"四月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month4OverstepLevel;

    @ExcelProperty(value = {"五月","电网数据(万千瓦时)"})
    private Float month5;

    @ExcelProperty(value = {"五月","在线采集数据(万千瓦时)"})
    private Float month5Zxjc;

    @ExcelProperty(value = {"五月","电力外供(万千瓦时)"})
    private Float month5ZxjcOut;

    @ExcelProperty(value = {"五月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month5OverstepLevel;

    @ExcelProperty(value = {"六月","电网数据(万千瓦时)"})
    private Float month6;

    @ExcelProperty(value = {"六月","在线采集数据(万千瓦时)"})
    private Float month6Zxjc;

    @ExcelProperty(value = {"六月","电力外供(万千瓦时)"})
    private Float month6ZxjcOut;

    @ExcelProperty(value = {"六月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month6OverstepLevel;

    @ExcelProperty(value = {"七月","电网数据(万千瓦时)"})
    private Float month7;

    @ExcelProperty(value = {"七月","在线采集数据(万千瓦时)"})
    private Float month7Zxjc;

    @ExcelProperty(value = {"七月","电力外供(万千瓦时)"})
    private Float month7ZxjcOut;

    @ExcelProperty(value = {"七月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month7OverstepLevel;

    @ExcelProperty(value = {"八月","电网数据(万千瓦时)"})
    private Float month8;

    @ExcelProperty(value = {"八月","在线采集数据(万千瓦时)"})
    private Float month8Zxjc;

    @ExcelProperty(value = {"八月","电力外供(万千瓦时)"})
    private Float month8ZxjcOut;

    @ExcelProperty(value = {"八月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month8OverstepLevel;

    @ExcelProperty(value = {"九月","电网数据(万千瓦时)"})
    private Float month9;

    @ExcelProperty(value = {"九月","在线采集数据(万千瓦时)"})
    private Float month9Zxjc;

    @ExcelProperty(value = {"九月","电力外供(万千瓦时)"})
    private Float month9ZxjcOut;

    @ExcelProperty(value = {"九月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month9OverstepLevel;

    @ExcelProperty(value = {"十月","电网数据(万千瓦时)"})
    private Float month10;

    @ExcelProperty(value = {"十月","在线采集数据(万千瓦时)"})
    private Float month10Zxjc;

    @ExcelProperty(value = {"十月","电力外供(万千瓦时)"})
    private Float month10ZxjcOut;

    @ExcelProperty(value = {"十月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month10OverstepLevel;

    @ExcelProperty(value = {"十一月","电网数据(万千瓦时)"})
    private Float month11;

    @ExcelProperty(value = {"十一月","在线采集数据(万千瓦时)"})
    private Float month11Zxjc;

    @ExcelProperty(value = {"十一月","电力外供(万千瓦时)"})
    private Float month11ZxjcOut;

    @ExcelProperty(value = {"十一月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month11OverstepLevel;

    @ExcelProperty(value = {"十二月","电网数据(万千瓦时)"})
    private Float month12;

    @ExcelProperty(value = {"十二月","在线采集数据(万千瓦时)"})
    private Float month12Zxjc;

    @ExcelProperty(value = {"十二月","电力外供(万千瓦时)"})
    private Float month12ZxjcOut;

    @ExcelProperty(value = {"十二月","在线采集数据超出电网数据±10%"}) //1是，0
    private String month12OverstepLevel;

    @ExcelProperty(value = {"合计","电网数据(万千瓦时)"})
    private Float sumElectric;

    @ExcelProperty(value = {"合计","在线采集数据(万千瓦时)"})
    private Float sumElectricZxjc;

    @ExcelProperty(value = {"合计","电力外供(万千瓦时)"})
    private Float sumElectricZxjcOut;

    @ExcelProperty(value = {"合计","在线采集数据超出电网数据±10%"}) //1是，0
    private String sumElectricOverstepLevel;

    public void setOverstepLevel() {
        this.month1OverstepLevel = this.month1Zxjc > this.month1 * 1.1 || this.month1Zxjc < this.month1 * 0.9 ? "是" : "";
        this.month2OverstepLevel = this.month2Zxjc > this.month2 * 1.1 || this.month2Zxjc < this.month2 * 0.9 ? "是" : "";
        this.month3OverstepLevel = this.month3Zxjc > this.month3 * 1.1 || this.month3Zxjc < this.month3 * 0.9 ? "是" : "";
        this.month4OverstepLevel = this.month4Zxjc > this.month4 * 1.1 || this.month4Zxjc < this.month4 * 0.9 ? "是" : "";
        this.month5OverstepLevel = this.month5Zxjc > this.month5 * 1.1 || this.month5Zxjc < this.month5 * 0.9 ? "是" : "";
        this.month6OverstepLevel = this.month6Zxjc > this.month6 * 1.1 || this.month6Zxjc < this.month6 * 0.9 ? "是" : "";
        this.month7OverstepLevel = this.month7Zxjc > this.month7 * 1.1 || this.month7Zxjc < this.month7 * 0.9 ? "是" : "";
        this.month8OverstepLevel = this.month8Zxjc > this.month8 * 1.1 || this.month8Zxjc < this.month8 * 0.9 ? "是" : "";
        this.month9OverstepLevel = this.month9Zxjc > this.month9 * 1.1 || this.month9Zxjc < this.month9 * 0.9 ? "是" : "";
        this.month10OverstepLevel = this.month10Zxjc > this.month10 * 1.1 || this.month10Zxjc < this.month10 * 0.9 ? "是" : "";
        this.month11OverstepLevel = this.month11Zxjc > this.month11 * 1.1 || this.month11Zxjc < this.month11 * 0.9 ? "是" : "";
        this.month12OverstepLevel = this.month12Zxjc > this.month12 * 1.1 || this.month12Zxjc < this.month12 * 0.9 ? "是" : "";
    }

    public void setSumOverstepLevel() {
        this.sumElectric = this.month1 + this.month2 + this.month3 + this.month4 + this.month5 + this.month6 + this.month7 + this.month8 + this.month9 + this.month10 + this.month11 + this.month12;
        this.sumElectricZxjc = this.month1Zxjc + this.month2Zxjc + this.month3Zxjc + this.month4Zxjc + this.month5Zxjc + this.month6Zxjc + this.month7Zxjc + this.month8Zxjc + this.month9Zxjc + this.month10Zxjc + this.month11Zxjc + this.month12Zxjc;
        this.sumElectricOverstepLevel = this.sumElectricZxjc > this.sumElectric * 1.1 || this.sumElectricZxjc < this.sumElectric * 0.9 ? "是" : "";
    }

}
