package com.njcn.pojo.excelreport;

/**
 * @Author: Sunwei 【sunW2016@163.com】
 * @Description:
 * @Date: Create in 10:54 2018/6/7
 * @Modified By:
 */
public class ReportValueData {
    private String phaseType; //A(AB)相，B(BC)相，C(CA)相
    private Float fmaxValue; //最大值
    private Float minValue; //最小值
    private Float meanValue; //平均值
    private Float cp95Value; //CP95值

    public ReportValueData() {
        super();
    }

    public ReportValueData(String phaseType, Float maxValue, Float minValue, Float meanValue, Float cp95Value) {
        this.phaseType = phaseType;
        this.fmaxValue = transData(maxValue);
        this.minValue = transData(minValue);
        this.meanValue = transData(meanValue);
        this.cp95Value = transData(cp95Value);
    }

    @Override
    public String toString() {
        return "ReportValueData{" +
                ", phaseType='" + phaseType + '\'' +
                ", maxValue=" + fmaxValue +
                ", minValue=" + minValue +
                ", meanValue=" + meanValue +
                ", cp95Value=" + cp95Value +
                '}';
    }

    public String getPhaseType() {
        return phaseType;
    }

    public void setPhaseType(String phaseType) {
        this.phaseType = phaseType;
    }

    public Float getFmaxValue() {
        return fmaxValue;
    }

    public void setFmaxValue(Float maxValue) {
        this.fmaxValue = transData(maxValue);
    }

    public Float getMinValue() {
        return minValue;
    }

    public void setMinValue(Float minValue) {
        this.minValue = transData(minValue);
    }

    public Float getMeanValue() {
        return meanValue;
    }

    public void setMeanValue(Float meanValue) {
        this.meanValue = transData(meanValue);
    }

    public Float getCp95Value() {
        return cp95Value;
    }

    public void setCp95Value(Float cp95Value) {
        this.cp95Value = transData(cp95Value);
    }

    private Float transData(Float f) {
        if (f == null) {
            return f;
        }

        float f1 = (float) (Math.round(f.floatValue() * 100)) / 100;
        return new Float(f1);
    }

}
