package com.fuyuanshen.equipment.domain.vo;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import com.fuyuanshen.common.excel.annotation.ExcelDictFormat;
import com.fuyuanshen.common.excel.convert.ExcelDictConvert;
import com.fuyuanshen.equipment.domain.DeviceGeoFence;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

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


/**
 * 电子围栏视图对象 device_geo_fence
 *
 * @author Lion Li
 * @date 2025-09-11
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = DeviceGeoFence.class)
public class DeviceGeoFenceVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 围栏唯一标识
     */
    // @ExcelProperty(value = "围栏唯一标识")
    private Long id;

    /**
     * 围栏名称
     */
    @ExcelProperty(value = "围栏名称")
    private String name;

    /**
     * 围栏区域类型,  0 POLYGON, 1 CIRCLE
     */
    // @ExcelProperty(value = "围栏区域类型")
    private Integer areaType;

    /**
     * 围栏区域类型,  0 POLYGON 多边形, 1 CIRCLE 圆形
     */
    @ExcelProperty(value = "围栏区域类型")
    private String areaTypeName;

    /**
     * 围栏坐标数据
     */
    // @ExcelProperty(value = "围栏坐标数据")
    private String coordinates;

    /**
     * 圆形围栏半径(米)
     */
    @ExcelProperty(value = "圆形围栏半径(米)")
    private Long radius;

    /**
     * 是否激活
     */
    // @ExcelProperty(value = "是否激活")
    private Long isActive;

    /**
     * 激活状态名称
     */
    @ExcelProperty(value = "是否激活")
    private String isActiveName;

    /**
     * 围栏描述
     */
    @ExcelProperty(value = "围栏描述")
    private String description;

    /**
     * 创建人
     */
    // @ExcelProperty(value = "创建人")
    private Long createBy;

    /**
     * 创建时间
     */
    // @ExcelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    // @ExcelProperty(value = "更新时间")
    private Date updateTime;
    /**
     * 高德服务ID
     */
    private Long sid;
    /**
     * 高德围栏ID
     */
    private Long gfid;


    public void setAreaTypeNameByAreaType() {
        if (this.areaType != null) {
            switch (this.areaType) {
                case 0:
                    this.areaTypeName = "多边形";
                    break;
                case 1:
                    this.areaTypeName = "圆形";
                    break;
                default:
                    this.areaTypeName = "未知";
                    break;
            }
        } else {
            this.areaTypeName = "未知";
        }
    }



    public void setIsActiveNameByIsActive() {
        if (this.isActive != null) {
            switch (this.isActive.intValue()) {
                case 0:
                    this.isActiveName = "未激活";
                    break;
                case 1:
                    this.isActiveName = "已激活";
                    break;
                default:
                    this.isActiveName = "未知";
                    break;
            }
        } else {
            this.isActiveName = "未知";
        }
    }



}
