package cn.hanghui.outapi.platform.tenant.entity.po;

import cn.hanghui.outapi.platform.common.entity.po.Base;
import cn.hanghui.outapi.platform.tenant.entity.dto.ManualInIdCardAuthDto;
import cn.hanghui.outapi.platform.tenant.entity.enums.SetPersonalListEnum;
import cn.hanghui.outapi.platform.tenant.entity.enums.SuccessShowPersonalInfoListEnum;
import cn.hanghui.outapi.platform.tenant.typehandle.IntegerTypeHandler;
import cn.hanghui.outapi.platform.tenant.typehandle.LongTypeHandler;
import cn.hanghui.outapi.platform.tenant.typehandle.ManualInIdCardAuthHandler;
import cn.hanghui.outapi.platform.tenant.typehandle.StringTypeHandler;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Date;
import java.util.List;

/**
 * 设备
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "hh_local_device", autoResultMap = true)
public class HhLocalDevice extends Base {

    @ApiModelProperty(value = "授权状态  0：未授权 1：已授权")
    private Boolean status;
    @ApiModelProperty(value = "第一次授权时间")
    private Date firstAuthTime;

    //设备基本配置
    @ApiModelProperty(value = "设备sn")
    private String sn;
    @ApiModelProperty(value = "购买方公司id")
    private Long purchaserId;
    @ApiModelProperty(value = "应用类型id")
    private Long applicationTypeId;
    @ApiModelProperty(value = "设备型号(硬件)id")
    private Long deviceModelHardwareId;
    @ApiModelProperty(value = "到期日期")
    private LocalDate expirationDate;
    @ApiModelProperty(value = "(百度)激活序列号")
    private String licenseOnlineKey;

    //应用配置
    @ApiModelProperty(value = "应用通信模式 1-HTTP 2-WS 3-serialPort")
    private Integer communicationMode;
    @ApiModelProperty(value = "websocket地址")
    private String wsAddress;
    @ApiModelProperty(value = "串口地址serialPort")
    private String communicationSerialPort;
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.LinkageCheckModeEnum
     */
    @ApiModelProperty(value = "联动平台校验模式 1-通用 2-预检查模式")
    private Integer linkageCheckMode;

    //采集配置
    @ApiModelProperty(value = "是否启用身份证功能 默认：true")
    private Boolean useIdcard;
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.IdCardReaderBrandEnum
     */
    @ApiModelProperty(value = "身份证阅读器品牌 IdCardReaderBrandEnum")
    private Integer idCardReaderBrand;
    @ApiModelProperty(value = "是否解析身份证照片 0-否 1-是 默认-1")
    private Integer analysisPhoto;
    @ApiModelProperty(value = "是否解析身份证指纹 0-否 1-是 默认-0")
    private Integer analysisFingerprint;
    @ApiModelProperty(value = "是否人证比对 默认：false")
    private Boolean usePersonCard;
    @ApiModelProperty(value = "同证间隔时间 取值范围0-20 默认-7")
    private Integer idCardInterval;
    @ApiModelProperty(value = "是否启用二维码功能 默认：true")
    private Boolean useQrcode;
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.QrCodeReaderBrandEnum
     */
    @ApiModelProperty(value = "二维码读头品牌 QrCodeReaderBrandEnum")
    private Integer qrCodeReaderBrand;
    @ApiModelProperty(value = "二维码读头通信模式 1-虚拟串口 2-串口serialPort")
    private Integer qrCodeReaderCommunicationMode;
    @ApiModelProperty(value = "二维码读头串口地址serialPort")
    private String qrCodeReaderSerialPort;
    @ApiModelProperty(value = "同码间隔时间 取值范围0-20 默认-7")
    private Integer qrCodeInterval;
    @ApiModelProperty(value = "刷证/码延时(毫秒)： x/ms")
    private Integer openDelayTime;
    @ApiModelProperty(value = "是否开启护照机")
    private Boolean isOpenPassport;
    @ApiModelProperty(value = "是否开启手动输入证件号 默认false")
    private Boolean manualInIdCard;
    @ApiModelProperty(value = "开启手动输入证件号的密钥信息")
    @TableField(value = "manual_in_id_card_auth", typeHandler = ManualInIdCardAuthHandler.class)
    private ManualInIdCardAuthDto manualInIdCardAuth;
    @ApiModelProperty(value = "二维码是否人证比对 默认：false")
    private Boolean qrCodeUsePersonCard;
    @ApiModelProperty(value = "护照是否人证比对 默认：false")
    private Boolean passportUsePersonCard;
    @ApiModelProperty(value = "手动输入证件号是否人证比对 默认：false")
    private Boolean manualInUsePersonCard;
    @ApiModelProperty(value = "是否开启1:N刷脸能力 默认：true")
    private Boolean openOneToN;
    @ApiModelProperty(value = "ic14443-是否启用IC卡ISO14443A功能 false-否（默认） true-是")
    private Boolean ic14443IcCardFunction;
    @ApiModelProperty(value = "ic14443-阅读器品牌 ReaderBrandEnum")
    private Integer ic14443ReaderBrand;
    @ApiModelProperty(value = "ic14443-读取扇区-数字；0-99 默认15")
    private Integer ic14443ReaderSectorNumbers;
    @ApiModelProperty(value = "ic14443-读取块-填写,数字逗号隔开 0,1,2,3 长度100 默认0")
    private String ic14443ReaderBlock;
    @ApiModelProperty(value = "ic14443-读取密钥-填写,默认 FFFFFFFFFFFF 长度100 默认12个F")
    private String ic14443ReaderKey;
    @ApiModelProperty(value = "ic14443-起始偏移量-数字 0-100 默认 0")
    private Integer ic14443StartOffset;
    @ApiModelProperty(value = "ic14443-末尾偏移量-数字 0-100 默认 0")
    private Integer ic14443EndOffset;
    @ApiModelProperty(value = "ic14443-是否人证比对；false-否（默认） true-是")
    private Boolean ic14443PersonCardComparison;
    @ApiModelProperty(value = "ic14443-同卡间隔时间；默认7")
    private Integer ic14443SameCardIntervalTime;
    @ApiModelProperty(value = "ic15693-是否启用IC卡ISO14443A功能 false-否（默认） true-是")
    private Boolean ic15693IcCardFunction;
    @ApiModelProperty(value = "ic15693-阅读器品牌 ReaderBrandEnum")
    private Integer ic15693ReaderBrand;
    @ApiModelProperty(value = "ic15693-读取块-填写,数字逗号隔开 0,1,2,3 长度100 默认0")
    private String ic15693ReaderBlock;
    @ApiModelProperty(value = "ic15693-起始偏移量-数字 0-100 默认 0")
    private Integer ic15693StartOffset;
    @ApiModelProperty(value = "ic15693-末尾偏移量-数字 0-100 默认 0")
    private Integer ic15693EndOffset;
    @ApiModelProperty(value = "ic15693-是否人证比对；false-否（默认） true-是")
    private Boolean ic15693PersonCardComparison;
    @ApiModelProperty(value = "ic15693-同卡间隔时间；默认7")
    private Integer ic15693SameCardIntervalTime;

    //摄像头配置
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.CameraTypeEnum
     */
    @ApiModelProperty(value = "摄像头类型 MONO-单目 IR-双目 3D-3D结构光")
    private String cameraType;
    @ApiModelProperty(value = "预览画面角度(RGB)")
    private Integer rgbVideoDirection;
    @ApiModelProperty(value = "预览画面是否镜像(RGB)")
    @TableField(value = "mirror_video_rgb")
    private Integer mirrorVideoRGB;
    @ApiModelProperty(value = "人脸识别检测角度(RGB)")
    private Integer rgbDetectDirection;
    @ApiModelProperty(value = "人脸识别检测是否镜像(RGB)")
    @TableField(value = "mirror_detect_rgb")
    private Integer mirrorDetectRGB;
    @ApiModelProperty(value = "预览画面角度(NIR)")
    private Integer nirVideoDirection;
    @ApiModelProperty(value = "预览画面是否镜像(NIR)")
    @TableField(value = "mirror_video_nir")
    private Integer mirrorVideoNIR;
    @ApiModelProperty(value = "人脸识别检测角度(NIR)")
    private Integer nirDetectDirection;
    @ApiModelProperty(value = "人脸识别检测是否镜像(NIR)")
    @TableField(value = "mirror_detect_nir")
    private Integer mirrorDetectNIR;

    //识别配置
    @ApiModelProperty(value = "是否显示人脸跟随框 默认值true")
    private Boolean faceFollowBoxSwitch;
    @ApiModelProperty(value = "视频流是否开启最优人脸检测")
    private Boolean usingBestImage;
    @ApiModelProperty(value = "人脸阈值：0-100；默认 50")
    private Integer bestImageScore;
    @ApiModelProperty(value = "视频流是否开启质量检测")
    private Boolean qualityControl;
    @ApiModelProperty(value = "模糊阈值：0-1；默认 0.5 取值范围[0~1]，0是最清晰，1是最模糊")
    private Float blur;
    @ApiModelProperty(value = "光照阈值：0-1；默认 0.8 取值范围[0~1], 数值越大，光线越强")
    private Float illum;
    @ApiModelProperty(value = "视频流是否开启活体检测")
    private Boolean livingControl;
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.LiveTypeEnum
     */
    @ApiModelProperty(value = "活体检测模式")
    private Integer liveType;
    @ApiModelProperty(value = "RGB 可见光活体阈值：0-1；默认 0.8  ")
    private Float rgbLiveScore;
    @ApiModelProperty(value = "NIR 近红外活体阈值：0-1；默认 0.8  ")
    private Float nirLiveScore;
    @ApiModelProperty(value = "Depth深度活体阈值(3D结构光)：0-1；默认 0.8 ")
    private Float depthLiveScore;
    @ApiModelProperty(value = "人脸检测最小人脸大小： 1-100; 默认 50")
    public Integer minFaceSize;
    @ApiModelProperty(value = "1:N比对阈值：0-1；默认 0.8")
    @TableField(value = "one_to_n_score_threshold")
    private Float oneToNScoreThreshold;
    @ApiModelProperty(value = "1:1比对阈值：0-1；默认 0.5")
    private Float oneToOneScoreThreshold;
    @ApiModelProperty(value = "1:1人脸连续未通过秒数：1-50；默认 3")
    private Integer oneToOneContinueFailTime;
    @ApiModelProperty(value = "1:1人脸比对超时时间：1-50；默认 10")
    private Integer oneToOneTimeout;
    @ApiModelProperty(value = "1:N未通过是否显示提示语：是/否；默认 否")
    @TableField(value = "one_to_n_fail_show_tip")
    private Boolean oneToNFailShowTip;
    @ApiModelProperty(value = "1:N人脸连续未通过秒数：1-50；默认 3")
    @TableField(value = "one_to_n_continue_fail_time")
    private Integer oneToNContinueFailTime;


    //三方接口接入配置
    @ApiModelProperty(value = "是否启用核验接口 默认：false")
    private Boolean useLinkage;
    @ApiModelProperty(value = "联动平台地址")
    private String linkageAds;
    @ApiModelProperty(value = "核验接口数据是否加解密 默认true")
    private Boolean checkVerifyEncryptSwitch;
    @ApiModelProperty(value = "核验接口数据是否加解密appKey")
    private String checkVerifyEncryptAppKey;
    @ApiModelProperty(value = "核验接口数据是否加解密appSecrete")
    private String checkVerifyEncryptAppSecret;
    @ApiModelProperty(value = "核验接口数据是否加解密PrivateKey")
    private String checkVerifyEncryptPrivateKey;
    @ApiModelProperty(value = "核验接口失败重试次数 默认-1")
    private Integer checkVerifyRetryTimes;
    @ApiModelProperty(value = "核验接口超时提示语 默认-核验接口超时")
    private String checkVerifyTimeoutTips;
    @ApiModelProperty(value = "核验接口失败提示语 默认-核验接口失败")
    private String checkVerifyFailedTips;
    @ApiModelProperty(value = "核验接口超时时间：4s")
    private Integer linkTimeout;
    @ApiModelProperty(value = "verify核验接口失败重试次数 默认2")
    private Integer verifyRetryTimes;
    @ApiModelProperty(value = "verify核验接口超时时间：15s")
    private Integer verifyLinkTimeout;

    @ApiModelProperty(value = "启用三要素获取特殊码接口 默认：false-否")
    private Boolean specialCodeSwitch;
    @ApiModelProperty(value = "三要素获取特殊码接口地址")
    private String specialCodeUrl;
    @ApiModelProperty(value = "三要素获取特殊码接口超时时间：5s")
    private Integer specialCodeTimeout;
    @ApiModelProperty(value = "三要素获取特殊码接口超时提示语 默认-三要素获取特殊码接口请求超时")
    private String specialCodeTimeoutTips;
    @ApiModelProperty(value = "三要素获取特殊码接口失败提示语 默认-三要素获取特殊码接口请求失败")
    private String specialCodeFailedTips;
    @ApiModelProperty(value = "特殊码标识（首位/前缀）")
    private String specialCodePrefix;

    @ApiModelProperty(value = "开启黑名单 默认：false-否")
    private Boolean userBlacklistSwitch;
    @ApiModelProperty(value = "是否阻止通行 默认：true-是")
    private Boolean forbidPassSwitch;
    @ApiModelProperty(value = "阻止通行的文本 默认：禁止通行")
    private String forbidPassText;
    @ApiModelProperty(value = "阻止通信提示语音 默认：禁止通行，请联系管理员")
    private String forbidPassVoice;
    @ApiModelProperty(value = "命中条件 IDENTITY_CARD-身份证 PHONE-手机号 默认：勾选身份证")
    @TableField(value = "user_blacklist_hit_rule", typeHandler = StringTypeHandler.class)
    private List<String> userBlacklistHitRule;
    @ApiModelProperty(value = "是否启用接口拉取 默认：true")
    private Boolean userBlacklistInterfFetchSwitch;
    @ApiModelProperty(value = "接口拉取地址")
    private String userBlacklistInterfUrl;
    @ApiModelProperty(value = "黑名单数据是否加解密 默认true")
    private Boolean userBlacklistEncryptSwitch;
    @ApiModelProperty(value = "核验接口数据是否加解密appKey")
    private String userBlacklistEncryptAppKey;
    @ApiModelProperty(value = "核验接口数据是否加解密appSecrete")
    private String userBlacklistEncryptAppSecret;
    @ApiModelProperty(value = "核验接口数据是否加解密PrivateKey")
    private String userBlacklistEncryptPrivateKey;
    @ApiModelProperty(value = "是否启用本地名单 默认false")
    private Boolean userBlacklistOfflineSwitch;
    @ApiModelProperty(value = "本地名单任务id集合")
    @TableField(value = "user_blacklist_offline_task_id", typeHandler = LongTypeHandler.class)
    private List<Long> userBlacklistOfflineTaskId;
    @ApiModelProperty(value = "人脸管理平台ws地址")
    private String websocketSubscribeUrl;


    //结果页配置
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.ResultPageTemplateEnum
     */
    @ApiModelProperty(value = "结果页模版 1-通用版 2-悬浮版")
    private Integer resultPageTemplate;
    @ApiModelProperty(value = "刷脸失败是否静默显示 false-关闭 true-开启 默认false")
    private Boolean compareSilentDisplay;
    @ApiModelProperty(value = "刷脸失败静默时长 默认2s")
    private Integer compareSilentDisplayTime;
    @ApiModelProperty(value = "刷脸失败顶部文字 默认：未查询到人脸信息")
    private String compareTopTitle;
    @ApiModelProperty(value = "刷脸成功结果页时长 1-10 默认值2")
    private Integer successPageTime;
    @ApiModelProperty(value = "成功语音 默认: 请通行")
    private String sucVoice;
    @ApiModelProperty(value = "成功文字 默认: 请通行")
    private String sucText;
    @ApiModelProperty(value = "是否根据开门次数决定显示时长 false-关闭 true-开启 默认false")
    private Boolean showDisplayTimeByOpenTimesSwitch;
    @ApiModelProperty(value = "单次开门时长 默认2")
    private Integer onceOpenDoorTime;
    @ApiModelProperty(value = "刷脸失败结果页时长 1-10 默认值5")
    private Integer failPageTime;
    @ApiModelProperty(value = "失败文字 默认: 比对失败,请联系现场工作人员")
    private String failText;
    @ApiModelProperty(value = "失败语音 默认: 比对失败,请联系现场工作人员")
    private String failVoice;
    @ApiModelProperty(value = "默认单选页时长 默认120")
    private Integer singlePageTime;
    @ApiModelProperty(value = "默认多选页时长 默认120")
    private Integer multiPageTime;
    @ApiModelProperty(value = "默认等待页时长 默认120")
    private Integer waitPageTime;
    @ApiModelProperty(value = "1:1比对是否显示提醒页面 默认：true")
    private Boolean oneToOneTipsSwitch;
    @ApiModelProperty(value = "1:1比对提醒文字 默认：请面向屏幕刷脸")
    private String oneToOneTips;
    @ApiModelProperty(value = "1:1比对提醒语音")
    private String oneToOneVoice;
    @ApiModelProperty(value = "是否显示通行统计 默认false")
    private Boolean showTopBar;
    @ApiModelProperty(value = "顶部栏左边显示内容")
    private String leftTopBarText;
    @ApiModelProperty(value = "顶部栏右边显示内容")
    private String rightTopBarText;

    // 硬件模组配置
    @ApiModelProperty(value = "开门信号: 继电器/RS232 default/RS232 默认：default")
    private String useSerialPort;
    @ApiModelProperty(value = "RS232开门信号串口地址")
    private String doorSerialPort;
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.RelayOpenModelEnum
     */
    @ApiModelProperty(value = "继电器开门模式 1-开-闭信号 2-开-门磁-闭信息")
    private Integer relayOpenModel;
    @ApiModelProperty(value = "门磁串口地址")
    private String doorSerialPortAddress;
    @ApiModelProperty(value = "门磁超时时间（s）")
    private Integer gateTimeOut;
    @ApiModelProperty(value = "补光灯: 自动 auto 默认:auto")
    private String lightMode;
    @ApiModelProperty(value = "补光灯亮度 0-200")
    private Integer ledBrightness;
    @ApiModelProperty(value = "开闭时间间隔（s）")
    private Integer openCloseInterval;
    @ApiModelProperty(value = "信号间间隔（s）")
    private Integer signalInterval;

    //推送配置
    @ApiModelProperty(value = "应用状态推送地址")
    private String heartTrackingUrl;
    @ApiModelProperty(value = "在线日志推送地址")
    private String logPushUrl;
    @ApiModelProperty(value = "进出记录推送地址")
    private String transitPushUrl;
    @ApiModelProperty(value = "进出记录滤重时间 默认0 0-120s")
    private Integer inOutFilterRepeatTime;

    @ApiModelProperty(value = "启用进出记录推送 默认: true")
    private Boolean transitPushSwitch;
    @ApiModelProperty(value = "进出记录推送数据是否加解密 默认true")
    private Boolean transitPushEncryptSwitch;
    @ApiModelProperty(value = "进出记录推送数据是否加解密appKey")
    private String transitPushEncryptAppKey;
    @ApiModelProperty(value = "进出记录推送数据是否加解密appSecrete")
    private String transitPushEncryptAppSecret;
    @ApiModelProperty(value = "进出记录推送数据是否加解密PrivateKey")
    private String transitPushEncryptPrivateKey;

    //功能配置
    @ApiModelProperty(value = "是否开启年龄限制")
    private Boolean isOpenAgeLimit;
    @ApiModelProperty(value = "限制区间-开始年龄")
    private Integer limitSectionStart;
    @ApiModelProperty(value = "限制区间-结束年龄")
    private Integer limitSectionEnd;
    @ApiModelProperty(value = "禁止进入文本 默认：未满18岁禁止进入")
    private String ageForbidText;
    @ApiModelProperty(value = "门磁信号推送地址")
    @JsonProperty("GMAddress")
    @TableField("gm_address")
    private String GMAddress;
    @ApiModelProperty(value = "是否推送门磁信号")
    @TableField("is_push_gm")
    private Boolean isPushGM;
    @ApiModelProperty(value = "门磁信号推送频率")
    @JsonProperty("GMFrequency")
    @TableField("gm_frequency")
    private Integer GMFrequency;
    @ApiModelProperty(value = "是否推送失败记录")
    private Boolean pushFailedRecordSwitch;
    /**
     * @see cn.hanghui.outapi.platform.tenant.entity.enums.PushFailedRecordTypeEnum
     */
    @ApiModelProperty(value = "推送失败记录类型")
    @TableField(value = "push_failed_record_type", typeHandler = IntegerTypeHandler.class)
    private List<Integer> pushFailedRecordType;

    //系统配置
    @ApiModelProperty(value = "设备管理员密码")
    private String mpassword;
    @ApiModelProperty(value = "语音音量 0-100 默认值80")
    private Integer volume;
    @ApiModelProperty(value = "隐藏底部导航栏 默认: false")
    private Boolean hideNavigationBar;
    @ApiModelProperty(value = "禁止下拉通知栏 默认: false")
    private Boolean forbidPullDown;
    @ApiModelProperty(value = "应用是否自启动")
    private Boolean autoLaunch;
    @ApiModelProperty(value = "是否开启定时重启 true-是 false-否 默认-false")
    private Boolean scheduledRestart;
    @ApiModelProperty(value = "定时重启时间HH:mm:ss")
    private LocalTime scheduledRestartTime;
    @ApiModelProperty(value = "首页图片配置")
    private String homePageUrl;
    @ApiModelProperty(value = "过渡页图片配置")
    private String transitionPageUrl;
    @ApiModelProperty(value = "预览页图片配置")
    private String previewPageUrl;
    @ApiModelProperty(value = "刷脸失败结果页图片配置")
    private String scanFaceFailedPageUrl;
    @ApiModelProperty(value = "人脸框跟随框是否镜像")
    private Boolean rgbRevert;

    @ApiModelProperty(value = "是否启用有效时间 默认-false")
    private Boolean validTimeSwitch;
    @ApiModelProperty(value = "同人脸间隔时间（s）")
    private Integer sameFaceInterval;
    /** @see SuccessShowPersonalInfoListEnum */
    @ApiModelProperty(value = "成功显示人员信息列表-枚举")
    @TableField(value = "success_show_personal_info_json", typeHandler = IntegerTypeHandler.class)
    private List<Integer> successShowPersonalInfoList;
    /** @see SetPersonalListEnum */
    @ApiModelProperty(value = "“设置——人员列表”【控制设置页里的人员数据的信息】-枚举")
    @TableField(value = "set_personal_json", typeHandler = IntegerTypeHandler.class)
    private List<Integer> setPersonalList;
    @ApiModelProperty(value = "预览页是否显示人员数量 默认-true")
    private Boolean showPersonalNumSwitch;


}

