package com.repair.model.vo;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;

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

/**
 * @Author: binguo
 * @Date: 2023/7/30 星期日 14:47
 * @Description: com.repair.model.vo
 * @Version: 1.0
 */
@Data
public class ConsumableExcelVo {
    /**
     * 数据ID
     */
    @ExcelProperty("数据ID")
    @ColumnWidth(25)
    private Integer id;

    /**
     * 耗材名称
     */
    @ExcelProperty("耗材名称")
    @ColumnWidth(25)
    private String consumeName;

    /**
     * 单价(元)
     */
    @ExcelProperty("单价(元)")
    @ColumnWidth(25)
    private BigDecimal price;

    /**
     * 数量
     */
    @ExcelProperty("数量")
    @ColumnWidth(25)
    private Double number;

    /**
     * 金额(元)
     */
    @ExcelProperty("金额(元)")
    @ColumnWidth(25)
    private BigDecimal totalPrice;

    /**
     * 关联故障种类
     */
    @ExcelProperty("关联故障种类")
    @ColumnWidth(25)
    private String articleName;

    /**
     * 工单
     */
    @ExcelProperty("工单")
    @ColumnWidth(25)
    private String recordNo;

    /**
     * 报修时间
     */
    @ExcelIgnore
    private LocalDateTime reportTime;

    @ExcelProperty("报修时间")
    @ColumnWidth(25)
    private String reportTimeStr;

    public String getReportTimeStr() {
        return reportTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    public void String(String reportTimeStr) {
        this.reportTimeStr = reportTimeStr;
    }

    /**
     * 维修时间
     */
    @ExcelIgnore
    private LocalDateTime updateTime;

    @ExcelProperty("维修时间")
    @ColumnWidth(25)
    private String updateTimeStr;

    public String getUpdateTimeStr() {
        return updateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
    }

    public void setUpdateTimeStr(String updateTimeStr) {
        this.updateTimeStr = updateTimeStr;
    }
}
