package cn.iocoder.yudao.module.iot.controller.admin.formula.vo;

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Schema(description = "管理后台 - 变量记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class FormulaRecordRespVO {

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

    @Schema(description = "机台", example = "李四")
    @ExcelProperty("机台")
    private String machineName;

    @Schema(description = "用户", example = "李四")
    @ExcelProperty("用户")
    private String workerName;

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

    @Schema(description = "公式编号")
    @ExcelProperty("公式编号")
    private String formulaCode;

    @Schema(description = "值")
    @ExcelProperty("值")
    private BigDecimal dataValue;

    @Schema(description = "单位")
    @ExcelProperty("单位")
    private String dataUnit;

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

    @Schema(description = "机台ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25709")
    @ExcelProperty("机台ID")
    private Long machineId;
    @Schema(description = "用户id", example = "3807")
    @ExcelProperty("用户id")
    private Long workerId;
    @Schema(description = "公式ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24943")
    @ExcelProperty("公式ID")
    private Long formulaId;
    /**
     * 采集时间
     */
    @Schema(description = "采集时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("采集时间")
    private LocalDateTime deviceDataTime;
}