package com.yuchen.saas.park.api.vo.device;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;

import java.text.DecimalFormat;

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/09/15 15:34
 * @Description: 园区能耗统计
 * @Version: 1.0
 */
@Data
public class CountData {

    /**
     * 今日能耗数据
     */
    @JsonSerialize(using = DoubleSerialize.class)
    private double today;

    /**
     * 当月能耗数据
     */
    @JsonSerialize(using = DoubleSerialize.class)
    private double currentMonth;

    /**
     * 上月能耗数据
     */
    @JsonSerialize(using = DoubleSerialize.class)
    private double lastMonth;

    /**
     * 累计能耗数据
     */
    @JsonSerialize(using = DoubleSerialize.class)
    private double total;


    public double getToday() {
        DecimalFormat df = new DecimalFormat("0.00");
        this.today = Double.valueOf(df.format(this.today));
        return this.today;
    }

    public double getCurrentMonth() {
        DecimalFormat df = new DecimalFormat("0.00");
        this.currentMonth = Double.valueOf(df.format(this.currentMonth));
        return this.currentMonth;
    }

    public double getLastMonth() {
        DecimalFormat df = new DecimalFormat("0.00");
        this.lastMonth = Double.valueOf(df.format(this.lastMonth));
        return this.lastMonth;
    }

    public double getTotal() {
        DecimalFormat df = new DecimalFormat("0.00");
        this.total = Double.valueOf(df.format(this.total));
        return this.total;
    }
}