package com.nantian.cloud.jljc.vo.dualControl;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.text.DecimalFormat;

/**
 * 能耗双控影响因素
 */
@Data
@ApiModel(value = "能耗双控影响因素")
public class DualcontrolImpactFactorVo {

    @ApiModelProperty(value = "项目编码")
    private String itemCode;

    @ApiModelProperty(value = "项目名称")
    private String itemName;

    @ApiModelProperty(value = "能耗总量比重(%)")
    private Double energyTotalProportion;

    @ApiModelProperty(value = "完成率(%)")
    private Double compRateBasic;

    @ApiModelProperty(value = "完成率(%)")
    private Double compRateInspire;

    @ApiModelProperty(value = "完成率影响(%)")
    private Double impactCompRateBasic;

    @ApiModelProperty(value = "完成率影响(%)")
    private Double impactCompRateInspire;

    @ApiModelProperty(value = "综合影响(%)")
    private Double synthesizeRateBasic;

    @ApiModelProperty(value = "综合影响(%)")
    private Double synthesizeRateInspire;

    public DualcontrolImpactFactorVo(String itemCode, String itemName, Double energyTotalProportion, Double compRateBasic,
         Double compRateInspire, Double impactCompRateBasic, Double impactCompRateInspire, Double synthesizeRateBasic, Double synthesizeRateInspire) {
        DecimalFormat df = new DecimalFormat(".00"); //保留2位小数
        this.itemCode = itemCode;
        this.itemName = itemName;
        this.energyTotalProportion = energyTotalProportion;
        this.compRateBasic = compRateBasic;
        this.compRateInspire = compRateInspire;
        this.impactCompRateBasic = impactCompRateBasic;
        this.impactCompRateInspire = impactCompRateInspire;
        this.synthesizeRateBasic = Double.parseDouble(df.format(synthesizeRateBasic));
        this.synthesizeRateInspire = Double.parseDouble(df.format(synthesizeRateInspire));
    }
}
