package com.bonus.common.entity.bracelet.vo;

import com.bonus.common.core.annotation.Excel;
import com.bonus.common.core.annotation.Excel.ColumnType;
import com.bonus.common.security.utils.SecurityUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.Api;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * 工程杆塔表 tb_project_power
 *
 * @author bonus
 */

@Api("GtVo")
@Data
public class GtVo
{
    /**
     * 序号
     */
    private String serialNumber;

    /** 工程id */
    @Excel(name = "工程id")
    private long proId;

    /** 班组数量 */
    @Excel(name = "班组数量")
    private int teamNum;

    /** 杆塔id */
//    @Excel(name = "杆塔id", cellType = ColumnType.NUMERIC)
    private int gtId;

    /** 杆塔编号 */
    @Excel(name = "杆塔编号")
    @NotBlank(message = "杆塔编号不能为空", groups = {GtVo.Query.class})
    @Length(max = 20, message = "杆塔编号长度不能超过20", groups = {GtVo.Query.class})
    private String gtCode;

    /** 经度 */
    @NotBlank(message = "经度不能为空", groups = {GtVo.Query.class})
    @Length(max = 20, message = "经度长度不能超过32", groups = {GtVo.Query.class})
    @Pattern(regexp = "^-?((\\d{1,2}|1[0-7]\\d|180)(\\.\\d{1,6})?)$", message = "经度范围不正确，或者小数点后尾数超过6位", groups = {GtVo.Query.class})
    private String lon;

    /** 纬度 */
    @NotBlank(message = "纬度不能为空", groups = {GtVo.Query.class})
    @Length(max = 20, message = "纬度长度不能超过32", groups = {GtVo.Query.class})
    @Pattern(regexp = "^-?([0-8]?\\d(\\.\\d{1,6})?|90(\\.0{1,6})?)$", message = "纬度范围不正确，或者小数点后尾数超过6位", groups = {GtVo.Query.class})
    private String lat;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Date createTime = new Date();
    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Date updateTime = new Date();
    /**
     * 创建人
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Long createUser = SecurityUtils.getUserId();
    /**
     * 修改人
     */
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    private Long updateUser = SecurityUtils.getUserId();

    /**
     * 查询条件限制
     */
    public interface Query {
    }
}
