package com.djhk.uav.uav.model.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.djhk.common.annotation.Excel;
import com.djhk.common.utils.StringUtils;
import com.djhk.uav.uav.model.UavOperatorAbility;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author lwk
 * @date 2023/6/6 20:00
 * @description
 */
@Data
public class UavOperatorVo {
    /** 无人机飞手管理表主键 */
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;

    /** 用户表主键 */
    private Long userId;

    /** 昵称 */
    @Excel(name = "飞手名称")
    private String userName;

    /** 飞手联系方式 */
    private String tel;


    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;


    /** 最后一次执行任务时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后一次执行任务时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date planTime;

    private String status;

    /** 邮箱 */
    private String email;

    /** 性别（0：女 1：男） */
    @Excel(name = "性别", readConverterExp = "0=：女,1=：男")
    private String sex;

    /** 飞手类型 */
    @Excel(name = "飞手类型")
    private String operatorType;

    /** 证书类型 */
    @Excel(name = "证书类型")
    private String certificateType;

    /** 备注 */
    @Excel(name = "备注")
    private String remark;

    /** 证书名称 */
    @Excel(name = "证书名称")
    private String certificateName;

    /** 证书编号 */
    @Excel(name = "证书编号")
    private String certificateNo;

    /** 证书文件id */
    @Excel(name = "证书文件id")
    private String certificateFileId;

    /** 场景分类 */
    @Excel(name = "场景分类")
    private String sceneType;

    /** 场景名称 */
    @Excel(name = "场景名称")
    private String sceneName;

    /** 应用id */
    private String appId;

    /** 组织id */
    private Long orgId;

    /** 能力名称 */
    @TableField(exist = false)
    private String abilityName;

    @TableField(exist = false)
    private List<String> abilityNameList;

    @TableField(exist = false)
    private List<UavOperatorAbility>  operatorAbilityList;

    @TableField(exist = false)
    private Map<String,String> certificateMap;

    @TableField(exist = false)
    private MultipartFile file;

    @TableField(exist = false)
    private String fileBase64;

    public void setFileBase64(String fileBase64) {
        this.fileBase64 = fileBase64;
        if (StringUtils.isNotEmpty(fileBase64)) {
            //文件base64转multipartFile
        }
    }
}
