package com.chushang.inspection.terminal.dto;

import cn.hutool.core.date.DatePattern;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.chushang.common.dict.annotation.DictFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StoreImportDTO implements Serializable {

    /**
     * 主键
     */
    @ExcelIgnore
    private Long id;
    /**
     * 商户编号
     */
    @ExcelProperty(value = "商户编号")
    @NotBlank(message = "商户编号不能为空")
    @Size(max = 64, message = "商户编号不能大于64个字符")
    private String storeNo;
    /**
     * 商户名称
     */
    @ExcelProperty(value = "商户名称")
    @Size(max = 128, message = "商户名称不能大于128个字符")
    private String storeName;
    /**
     * 商户联系人
     */
    @ExcelProperty(value = "商户联系人")
    @Size(max = 128, message = "商户联系人不能大于128个字符")
    private String storeContact;
    /**
     * 商户联系电话
     */
    @ExcelProperty(value = "商户联系电话")
    @Size(max = 50, message = "商户联系电话不能大于50个字符")
    private String storePhone;
    /**
     * 商户地址
     */
    @ExcelProperty(value = "商户地址")
    @Size(max = 300, message = "商户地址不能大于300个字符")
    private String storeAddress;
    /**
     * 商户特殊编号
     */
    @ExcelProperty(value = "商户特殊编号")
    @Size(max = 300, message = "商户地址不能大于300个字符")
    private String specialNum;
    /**
     * 门店名称
     */
    @ExcelProperty(value = "门店名称")
    @Size(max = 128, message = "门店名称不能大于128个字符")
    private String shopName;

    /**
     * 商户提示工具
     */
    @ExcelProperty(value = "商户提示工具")
    @Size(max = 50, message = "商户提示工具不能大于50个字符")
    private String tipTool;
    /**
     * 商户类型
     */
    @DictFormat(dictType = "store_type", labelGetValue = true, rewrite = true)
    @ExcelProperty(value = "商户类型")
    private String storeType;
    /**
     * 巡检频次
     */

//    @Range(min = 1, max = 5, message = "巡检频次非法")
    @ExcelProperty(value = "巡检频次")
    @DictFormat(dictType = "ins_fre", labelGetValue = true, rewrite = true)
    private String insFre;
    /**
     * 终端sn号
     */
    @ExcelProperty(value = "终端sn号")
    @Size(max = 100, message = "终端sn号不能大于100个字符")
    private String terminalSn;
    /**
     * 终端编号
     */
    @ExcelProperty(value = "终端编号")
    @Size(max = 30, message = "终端编号不能大于30个字符")
    private String terminalNo;
    /**
     * 终端版本号
     */
    @ExcelProperty(value = "终端版本号")
    @Size(max = 64, message = "终端版本号不能大于64个字符")
    private String terminalVersion;
    /**
     * 终端地址
     */
    @ExcelProperty(value = "终端地址")
    @Size(max = 300, message = "终端地址不能大于300个字符")
    private String terminalAddress;
    /**
     * 终端来源
     */
    @DictFormat(dictType = "terminal_source", labelGetValue = true, rewrite = true)
    @Range(min = 1, max = 3, message = "终端来源非法")
    @ExcelProperty(value = "终端来源")
    private String terminalSource;
    /**
     * 终端类型
     */
    @DictFormat(dictType = "terminal_type", labelGetValue = true, rewrite = true)
    @Range(min = 1, max = 9, message = "终端类型非法")
    @ExcelProperty(value = "终端类型")
    private String terminalType;
    /**
     * 终端型号
     */
    @ExcelProperty(value = "终端型号")
    @Size(max = 64, message = "终端型号不能大于64个字符")
    private String terminalModel;
    /**
     * 建档日期
     */
    @ExcelProperty(value = "建档日期")
    @Past(message = "必须是过去的日期")
    @DateTimeFormat(DatePattern.CHINESE_DATE_PATTERN)
    private LocalDate registerTime;

    /**
     * 现有其他收单产品
     */
    @ExcelProperty(value = "现有其他收单产品")
    @Size(max = 50, message = "现有其他收单产品不能大于50个字符")
    private String products;

    /**
     * 操作员账号
     */
    @ExcelProperty(value = "操作员编号")
    @Size(max = 50, message = "操作员编号不能大于50个字符")
    private String adminIds;
    /**
     * 客户经理
     */
    @ExcelProperty(value = "客户经理")
    @Size(max = 30, message = "客户经理不能大于30个字符")
    private String accountManager;

    /**
     * 经理电话
     */
    @ExcelProperty(value = "经理电话")
    @Size(max = 30, message = "经理电话不能大于30个字符")
    private String accountPhone;

    /**
     * 注册地址
     */
    @ExcelProperty(value = "注册地址")
    @Size(max = 128, message = "注册地址不能大于128个字符")
    private String registerAddress;
    /**
     * 法人/负责人
     */
    @ExcelProperty(value = "法人/负责人")
    @Size(max = 64, message = "法人/负责人不能大于64个字符")
    private String legalName;

    /**
     * 任务名称
     */
    @ExcelProperty(value = "任务名称")
    @NotEmpty(message = "任务名称不能为空")
    @Size(max = 64, message = "任务名称不能大于64个字符")
    private String taskName;

}
