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 EnterpriseQuotaDetailPOJO extends BaseRowModel {

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

    @ColumnWidth(5)
    @ExcelProperty(value = "地区")
    private String region;

    @ColumnWidth(10)
    @ExcelProperty(value = "通俗行业")
    private String industry;

    @ColumnWidth(10)
    @ExcelProperty(value = "国民经济行业")
    private String jnjcTrade;

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

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

    @ColumnWidth(15)
    @ExcelProperty(value = "指标名称")
    private String quotaName;

    @ColumnWidth(15)
    @ExcelProperty(value = "国家限定值")
    private String quotaLimit;

    @ExcelProperty(value = "指标单位")
    private String quotaUnit;

    @ExcelProperty(value = {"一月","单位产品能耗"})
    private Float month1;

    @ExcelProperty(value = {"一月","超出国家标准"}) //1是，0
    private String month1OverstepLevel;

    @ExcelProperty(value = {"二月","单位产品能耗"})
    private Float month2;

    @ExcelProperty(value = {"二月","超出国家标准"}) //1是，0
    private String month2OverstepLevel;

    @ExcelProperty(value = {"三月","单位产品能耗"})
    private Float month3;

    @ExcelProperty(value = {"三月","超出国家标准"}) //1是，0
    private String month3OverstepLevel;

    @ExcelProperty(value = {"四月","单位产品能耗"})
    private Float month4;

    @ExcelProperty(value = {"四月","超出国家标准"}) //1是，0
    private String month4OverstepLevel;

    @ExcelProperty(value = {"五月","单位产品能耗"})
    private Float month5;

    @ExcelProperty(value = {"五月","超出国家标准"}) //1是，0
    private String month5OverstepLevel;

    @ExcelProperty(value = {"六月","单位产品能耗"})
    private Float month6;

    @ExcelProperty(value = {"六月","超出国家标准"}) //1是，0
    private String month6OverstepLevel;

    @ExcelProperty(value = {"七月","单位产品能耗"})
    private Float month7;

    @ExcelProperty(value = {"七月","超出国家标准"}) //1是，0
    private String month7OverstepLevel;

    @ExcelProperty(value = {"八月","单位产品能耗"})
    private Float month8;

    @ExcelProperty(value = {"八月","超出国家标准"}) //1是，0
    private String month8OverstepLevel;

    @ExcelProperty(value = {"九月","单位产品能耗"})
    private Float month9;

    @ExcelProperty(value = {"九月","超出国家标准"}) //1是，0
    private String month9OverstepLevel;

    @ExcelProperty(value = {"十月","单位产品能耗"})
    private Float month10;

    @ExcelProperty(value = {"十月","超出国家标准"}) //1是，0
    private String month10OverstepLevel;

    @ExcelProperty(value = {"十一月","单位产品能耗"})
    private Float month11;

    @ExcelProperty(value = {"十一月","超出国家标准"}) //1是，0
    private String month11OverstepLevel;

    @ExcelProperty(value = {"十二月","单位产品能耗"})
    private Float month12;

    @ExcelProperty(value = {"十二月","超出国家标准"}) //1是，0
    private String month12OverstepLevel;

    public void setOverstepLevel() {
        this.month1OverstepLevel = this.month1 != null && this.quotaLimit != null && Float.valueOf(this.month1) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month2OverstepLevel = this.month2 != null && this.quotaLimit != null && Float.valueOf(this.month2) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month3OverstepLevel = this.month3 != null && this.quotaLimit != null && Float.valueOf(this.month3) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month4OverstepLevel = this.month4 != null && this.quotaLimit != null && Float.valueOf(this.month4) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month5OverstepLevel = this.month5 != null && this.quotaLimit != null && Float.valueOf(this.month5) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month6OverstepLevel = this.month6 != null && this.quotaLimit != null && Float.valueOf(this.month6) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month7OverstepLevel = this.month7 != null && this.quotaLimit != null && Float.valueOf(this.month7) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month8OverstepLevel = this.month8 != null && this.quotaLimit != null && Float.valueOf(this.month8) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month9OverstepLevel = this.month9 != null && this.quotaLimit != null && Float.valueOf(this.month9) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month10OverstepLevel = this.month10 != null && this.quotaLimit != null && Float.valueOf(this.month10) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month11OverstepLevel = this.month11 != null && this.quotaLimit != null && Float.valueOf(this.month11) > Float.valueOf(this.quotaLimit) ? "是" : "";
        this.month12OverstepLevel = this.month12 != null && this.quotaLimit != null && Float.valueOf(this.month12) > Float.valueOf(this.quotaLimit) ? "是" : "";
    }
}
