package com.njcn.process.pojo.dto.excel;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDate;

/**
 * <功能描述>
 *
 * @author wr
 * @createTime: 2023-02-27
 */
@Data
public class TerminalExcel implements Serializable {


    @Excel(name = "终端编号",width = 15)
    @NotBlank(message = "终端编号不为空")
    @Pattern(regexp = "^[A-Za-z0-9]{1,32}$", message = "终端编号违规长度不能超过32位(数字 、 字母)")
    private String id;

    @Excel(name = "终端名称",width = 15)
    @NotBlank(message = "终端名称不为空")
    private String name;

    @Excel(name = "组织机构名称",width = 15)
    @NotBlank(message = "组织机构名称不为空")
    private String orgName;

    @Excel(name = "生产厂家",width = 15)
    @NotBlank(message = "生产厂家不为空")
    private String manufacture;

    @Excel(name = "安装位置")
    @NotBlank(message = "安装位置不为空")
    private String installPlace;

    @Excel(name = "送检单位")
    @NotBlank(message = "送检单位不为空")
    private String inspectionUnit;

    @Excel(name = "检测时间(yyyy-MM-dd)",format = "yyyy-MM-dd", width = 30)
    @NotNull(message = "检测时间不为空")
    private LocalDate inspectionTime;

//    @Excel(name = "检测结果")
//    @NotBlank(message = "检测结果不为空")
//    private String testResults;
//
//    @Excel(name = "下次检测时间",format = "yyyy-MM-dd", width = 15)
//    @NotNull(message = "下次检测时间不为空")
//    private LocalDate nextInspectionTime;

    @Data
    @EqualsAndHashCode(callSuper = true)
    public static class TerminalExcelMsg extends TerminalExcel implements Serializable {
        @Excel(name = "错误信息描述", width = 30)
        private String msg;
    }
}
