package com.ruoyi.bst.areaSub.domain;

import java.math.BigDecimal;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.constants.DictType;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.interfaces.LogBizParam;
import com.ruoyi.common.core.validate.ValidGroup;
import com.ruoyi.common.valid.DictValid;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 子区域对象 bst_area_sub
 *
 * @author ruoyi
 * @date 2025-03-15
 */
@Data
public class AreaSub extends BaseEntity implements LogBizParam
{
    private static final long serialVersionUID = 1L;

    private Long id;

    @Excel(name = "区域名称")
    @ApiModelProperty("区域名称")
    @NotBlank(message = "区域名称不允许为空", groups = {ValidGroup.Create.class})
    @Size(max = 64, message = "区域名称长度不允许超过64个字符")
    private String name;

    @Excel(name = "类型", readConverterExp = "1=停车区,2=禁停区,3=禁行区")
    @ApiModelProperty("类型")
    @NotBlank(message = "类型不允许为空", groups = {ValidGroup.Create.class})
    @DictValid(type = DictType.AREA_SUB_TYPE, message = "非法的类型")
    private String type;

    @Excel(name = "运营区ID")
    @ApiModelProperty("运营区ID")
    @NotNull(message = "运营区ID不允许为空", groups = {ValidGroup.Create.class})
    private Long areaId;

    @Excel(name = "边界")
    @ApiModelProperty("边界")
    private String boundary;

    @Excel(name = "边界值(高德地图)")
    @ApiModelProperty("边界值")
    @NotBlank(message = "边界值不允许为空", groups = {ValidGroup.Create.class})
    private String boundaryStr;

    @Excel(name = "还车误差")
    @ApiModelProperty("还车误差")
    @Min(value = 0, message = "还车误差不允许为负数")
    private BigDecimal error;

    @Excel(name = "经度")
    @ApiModelProperty("经度")
    @NotNull(message = "经度不允许为空", groups = {ValidGroup.Create.class})
    private BigDecimal longitude;

    @Excel(name = "纬度")
    @ApiModelProperty("纬度")
    @NotNull(message = "纬度不允许为空", groups = {ValidGroup.Create.class})
    private BigDecimal latitude;

    @Excel(name = "照片")
    @ApiModelProperty("照片")
    private String picture;

    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    @ApiModelProperty("状态")
    @NotBlank(message = "状态不允许为空", groups = {ValidGroup.Create.class})
    @DictValid(type = DictType.AREA_SUB_STATUS, message = "非法的状态")
    private String status;

    @Override
    public Object logBizId() {
        return id;
    }

}
