package com.citygis.web.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.citygis.common.annotation.Excel;
import com.citygis.common.annotation.Excels;
import com.citygis.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 接入基本准备表
 * </p>
 *
 * @author citygis
 * @since 2025-01-10
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("TAB_ACCESS_READY")
@ApiModel(value = "TabAccessReady对象", description = "接入基本准备表")
public class TabAccessReady extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableField("ID")
    @TableId(value = "ID",type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    @ApiModelProperty(value = "标识符")
    @TableField("CODE")
    @Excel(name = "标识符")
    private String code;

    @ApiModelProperty(value = "联系人")
    @TableField("PERSION")
    @Excel(name = "联系人")
    private String persion;

    @ApiModelProperty(value = "联系方式")
    @TableField("PHONE")
    @Excel(name = "联系方式")
    private String phone;

    @ApiModelProperty(value = "审核意见")
    @TableField("AUDIT_DETAIL")
    @Excel(name = "审核意见")
    private String auditDetail;

    @ApiModelProperty(value = "审核人")
    @TableField("AUDIT_NAME")
    @Excel(name = "审核人")
    private String auditName;

    @ApiModelProperty(value = "审核时间")
    @TableField("AUDIT_TIME")
    @Excel(name = "审核时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    @ApiModelProperty(value = "是否删除：0未删除1删除")
    @TableField("IS_DEL")
    @Excel(name = "是否删除：0未删除1删除")
    private Integer isDel;

    @ApiModelProperty(value = "创建人ID")
    @TableField("USER_ID")
    private Long userId;

    @ApiModelProperty(value = "创建人部门ID")
    @TableField("DEPT_ID")
    private Long deptId;

    @ApiModelProperty(value = "数据接收方")
    @TableField(exist = false)
    @Excels({
            @Excel(name = "接入方部门", targetAttr = "dept", type = Excel.Type.EXPORT),
            @Excel(name = "接入方系统", targetAttr = "system", type = Excel.Type.EXPORT),
            @Excel(name = "接入方ip", targetAttr = "readyIp", type = Excel.Type.EXPORT),
            @Excel(name = "接入方端口", targetAttr = "readyPort", type = Excel.Type.EXPORT)
    })
    private List<TabAccessAndReady> access;

    @ApiModelProperty(value = "数据提供方")
    @TableField(exist = false)
    private List<TabAccessAndReady> offers;

    @ApiModelProperty(value = "数据接收方式")
    @TableField("DATA_ACCESS_TYPE")
    private String dataAccessType;

    @ApiModelProperty(value = "数据提供方式")
    @TableField("DATA_OFFER_TYPE")
    private String dataOfferType;

    @ApiModelProperty(value = "接入其他")
    @TableField("ACCESS_OTHER")
    private String accessOther;

    @ApiModelProperty(value = "提供其他")
    @TableField("OFFER_OTHER")
    private String offerOther;

    @ApiModelProperty(value = "接入方所属部门")
    @TableField(exist = false)
    private String accessDept;

    @ApiModelProperty(value = "接入方所属系统")
    @TableField(exist = false)
    private String accessSystem;

    @ApiModelProperty(value = "提供方所属部门")
    @TableField(exist = false)
    private String offerDept;

    @ApiModelProperty(value = "提供方所属系统")
    @TableField(exist = false)
    private String offerSystem;

    @ApiModelProperty(value = "状态")
    @TableField(value = "STATUS")
    private Integer status;

    @ApiModelProperty(value = "状态组")
    @TableField(exist = false)
    private List<Integer> states;

    @ApiModelProperty(value = "ip")
    @TableField(exist = false)
    private String ip;

    @ApiModelProperty(value = "端口")
    @TableField(exist = false)
    private String port;

    @TableField(exist = false)
    private List<Long> ids;


    @ApiModelProperty(value = "是否启用：0未启用，1启用")
    @TableField("IS_APPLY")
    private Integer  isApply;

}
