package cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo;

import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 能源设备 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EnergyDeviceRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25931")
//    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "编码")
    @ExcelProperty("编码")
    private String code;

    @Schema(description = "名称", example = "芋艿")
    @ExcelProperty("名称")
    private String name;

//    @Schema(description = "设备类型", example = "1")
//    @ExcelProperty(value = "设备类型", converter = DictConvert.class)
//    @DictFormat("mes_energy_device_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
//    private String deviceType;

    @Schema(description = "信息资料")
//    @ExcelProperty("信息资料")
    private String info;

    @Schema(description = "抄表周期cron")
//    @ExcelProperty("抄表周期cron")
    private String checkCron;

    @Schema(description = "最后抄表时间")
//    @ExcelProperty("最后抄表时间")
    private LocalDateTime lastCheckTime;

    @Schema(description = "最后抄表值")
//    @ExcelProperty("最后抄表值")
    private BigDecimal lastCheckValue;

    @Schema(description = "单位", example = "赵六")
//    @ExcelProperty("单位")
    private String unitName;

    @Schema(description = "能耗类型名称", example = "水")
    @ExcelProperty("能耗类型名称")
    private String deviceTypeName;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty(value = "是否启用", converter = DictConvert.class)
    @DictFormat("infra_boolean_string") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Boolean isEnable;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
//    @ExcelProperty("创建时间")
//    @ColumnWidth(20)
    private LocalDateTime createTime;

    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("更新时间")
    @ColumnWidth(20)
    private LocalDateTime updateTime;

    @Schema(description = "能耗类型ID", example = "1")
//    @ExcelProperty("能耗类型ID")
    private Long deviceTypeId;



    @Schema(description = "所属区域ID", example = "1")
//    @ExcelProperty("所属区域ID")
    private Long orgId;

    @Schema(description = "所属区域名称", example = "车间1")
    @ExcelProperty("所属区域名称")
    private String orgName;

    @Schema(description = "计算规则", example = "车间1")
//    @ExcelProperty("计算规则")
    private String rules;

    @Schema(description = "计算规则集合")
    private List<OperationRulesVO> operationRulesVOList;


    @Schema(description = "能耗总用量")
//    @ExcelProperty("能耗总用量")
    private String energyConsumption;

    @Schema(description = "子列表点位参数值")
    private Map<String,String> sublistPointList;

    @Schema(description = "点位差值列表")
    private Map<String, String> operationRulesVOMap;

    @Schema(description = "最新数据时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String latestDataTime;

    @Schema(description = "最早数据时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private String earliestDataTime;

    @Schema(description = "点位详情列表")
    private List<PointDetailVO> pointDetails;


}