package com.ruoyi.ss.meterReadingRecord.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.collection.FillAble;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author wjh
 * 2024/3/28
 */
@Data
public class SmMeterReadingRecordVo extends SmMeterReadingRecord implements FillAble {

    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createDate;

    @ApiModelProperty("创建时")
    private Integer createHour;

    @ApiModelProperty("创建月")
    private Integer createMonth;

    @ApiModelProperty("创建日")
    private Integer createDay;

    @ApiModelProperty("分组内已使用的电量统计")
    private BigDecimal groupUsedElectriQuantity;

    @Override
    public Date fillDate() {
        return this.createDate;
    }

    @Override
    public FillAble fillElement(Date currentDate) {
        SmMeterReadingRecordVo el = new SmMeterReadingRecordVo();
        el.setCreateDate(currentDate);
        el.setCreateMonth(DateUtils.getMonth(currentDate));
        el.setCreateDay(DateUtils.getDay(currentDate));
        el.setGroupUsedElectriQuantity(BigDecimal.ZERO);
        el.setTotalElectriQuantity(BigDecimal.ZERO);
        el.setUsedElectriQuantity(BigDecimal.ZERO);
        return el;
    }
}
