package com.njcn.device.pq.pojo.param;


import com.njcn.common.pojo.constant.PatternRegex;
import com.njcn.web.pojo.annotation.DateTimeStrValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.Valid;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * pqs
 *
 * @author cdf
 * @date 2021/6/23
 */
@Data
@ApiModel
public class DeviceParam {

    @ApiModelProperty(name = "devIndex",value = "设备索引")
    private String devIndex;

    @ApiModelProperty(name = "name",value = "设备名称",required = true)
    @Pattern(regexp = PatternRegex.DEV_NAME_REGEX,message = "设备名称违规")
    private String name;

    @ApiModelProperty(name = "devType",value = "设备型号",required = true)
    @NotBlank(message = "设备型号不能为空")
    private String devType;

    /**
     * 通讯类型（MMS、CLD）字典表
     */
    @ApiModelProperty(name = "frontType",value = "通讯类型",required = true)
    @NotBlank(message = "通讯类型不能为空")
    private String frontType;

    @ApiModelProperty(name = "ip",value = "装置ip",required = true)
    @NotBlank(message = "设备ip不能为空")
    private String ip;

    @ApiModelProperty(name = "port",value = "端口号",required = true)
    @Range(min=1,max=100000,message="端口号违规")
    @NotNull(message = "设备端口号不能为空")
    private Integer port;

    @ApiModelProperty(name = "nodeId",value = "前置服务器索引",required = true)
    @NotNull(message = "前置机索引不能为空")
    private String nodeId;

//    @ApiModelProperty(name = "nodeId",value = "所属前置机机进程",required = true)
//    @NotNull(message = "所属前置机机进程不能为空")
//    private Integer processNum;

    @ApiModelProperty(name = "series",value = "装置识别码，采用3ds加密")
    private String series;

    /**
     * 装置秘钥，采用3ds加密
     */
    @ApiModelProperty(name = "devKey",value = "设备秘钥")
    private String devKey;

    /**
     * 装置模型（0：虚拟设备；1：实际设备；2：离线设备；）默认是实际设备
     */
    @ApiModelProperty(name = "devModel",value = "设备模型",required = true)
    @NotNull(message = "设备模型不能为空")
    private Integer devModel;

    /**
     * 系统数据类型（0：暂态系统；1：稳态系统；2：两个系统）
     */
    @ApiModelProperty(name = "devDataType",value = "系统数据类型（0：暂态系统；1：稳态系统；2：两个系统）",required = true)
    @NotNull(message = "数据类型不能为空")
    private Integer devDataType;
    /**
     * 已召唤标志（0：周期触发；1：变为触发）
     */
    @ApiModelProperty(name = "callFlag",value = "已召唤标志（0：周期触发；1：变为触发）",required = true)
    @NotNull(message = "召唤标志不能为空")
    private Integer callFlag;

    @ApiModelProperty(name = "manufacturer",value = "设备制造商Guid",required = true)
    @NotBlank(message = "设备制造商不能为空")
    private String manufacturer;

    @ApiModelProperty(name = "electroplate",value = "电度功能",required = true)
    @NotNull(message = "电镀标识不能为空")
    private Integer electroplate;

    /**
     * 投运时间
     */
    @ApiModelProperty(name = "loginTime",value = "投运时间",required = true)
    @NotBlank(message = "投运时间不为空")
    @DateTimeStrValid(message = "投运时间格式错误")
    private String loginTime;

    @ApiModelProperty(name = "thisTimeCheck",value = "本次定检时间")
    @DateTimeStrValid(message = "本次定检时间格式错误")
    @NotBlank(message = "本次定检时间不为空")
    private String thisTimeCheck;

    @ApiModelProperty(name = "nextTimeCheck",value = "下次定检时间")
    @DateTimeStrValid(message = "下次定检时间格式错误")
    @NotBlank(message = "下次定检时间不为空")
    private String nextTimeCheck;

    @ApiModelProperty(name = "contract",value = "合同号")
    private String contract;

    @ApiModelProperty(name = "sim",value = "装置sim卡号")
    private String sim;

    @ApiModelProperty(name = "devSeries",value = "装置系列")
    private String devSeries;

    @ApiModelProperty(name = "devLocation",value = "监测装置安装位置")
    private String devLocation;

    @ApiModelProperty(name = "devNo",value = "监测厂家设备编号")
    private String devNo;

    @ApiModelProperty(name = "isAlarm",value = "告警功能 0:关闭  null、1:开启")
    private Integer isAlarm;

    @ApiModelProperty(name = "sort",value = "排序",required = true)
    @NotNull(message = "排序不可为空")
    @Min(value = 0,message = "排序格式有误")
    private Integer sort;


    @ApiModelProperty(name = "subVoltageParam",value = "母线集合")
    @Valid
    private List<SubVoltageParam> subVoltageParam;

    /**
     * 修改标识
     */
    @ApiModelProperty(name = "updateFlag",value = "修改标识")
    private Integer updateFlag;



}
