package com.ruoyi.common.core.domain.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseLongitudeLatitude;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 区域对象 tb_sys_area
 *
 * @author ruoyi
 * @date 2023-08-01
 */
@Data
public class TbSysArea implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    private Long id;

    /**
     * 区域编码
     */
    @Excel(name = "区域编码")
    private String areaCode;

    /**
     * 区域名称
     */
    @Excel(name = "区域名称")
    private String areaName;


//    @Excel(name = "经度")
//    private BigDecimal longitude;
//    @Excel(name = "维度")
//    private BigDecimal latitude;

    /**
     * 经纬度的集合
     */
    @TableField(exist = false)
    private List<BaseLongitudeLatitude> currentLnglatList;

    /**
     * 父级区域id
     */
    @Excel(name = "父级区域id")
    private Long parentId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createDate;

    /**
     * 创建人ID
     */
    @Excel(name = "创建人ID")
    private Long createUserId;

    /**
     * 最后修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "最后修改时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updateDate;

    /**
     * 最后修改人ID
     */
    @Excel(name = "最后修改人ID")
    private Long updateUserId;

    /**
     * 企业编码
     */
    @Excel(name = "企业编码")
    private String companyCode;

    /**
     * 删除标识，0正常，1已删除
     */
    @Excel(name = "删除标识，0正常，1已删除")
    private Integer isDel;

    private String remark;
    /**
     * 岗位ID：调整为只能绑定一个岗位
     */
    private Long postId;
    /**
     * 岗位名称
     */
    @TableField(exist = false)
    private String postName;

    @TableField(exist = false)
    private List<Long> userIdList = new ArrayList<>();
    @TableField(exist = false)
    private List<TbSysAreaUser> userList = new ArrayList<>();

    //    private List<TbSysAreaUserRelation> userList; 改为单个岗位post_id


    public TbSysArea() {

    }

//    public TbSysArea(String areaName, BigDecimal longitude, BigDecimal latitude, Long parentId, List<Long> userIdList) {
//        this.areaName = areaName;
//        this.longitude = longitude;
//        this.latitude = latitude;
//        this.parentId = parentId;
//        this.userIdList = userIdList;
//    }

    public TbSysArea(String areaName, Long parentId, List<BaseLongitudeLatitude> currentLnglatList, List<Long> userIdList) {
        this.areaName = areaName;
        this.parentId = parentId;
        this.currentLnglatList = currentLnglatList;
        this.userIdList = userIdList;
    }
}
