package com.navinfo.outdoor.room;

import androidx.annotation.NonNull;
import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverters;

import com.navinfo.outdoor.bean.Info;
import com.navinfo.outdoor.util.PhotoInfoConverter;

import java.io.File;
import java.io.Serializable;
import java.util.List;
import java.util.UUID;

/**
 * poi, 道路，充电站，其他的表结构
 */
@Entity(tableName = "poi")
public class PoiEntity implements Serializable {
    @PrimaryKey// 设置主键，并且自动生长
    @NonNull
    private String id = UUID.randomUUID().toString().replaceAll("-","");
    private int pid;  //采集id 保存本地或提交数据时时返回
    private int taskId;//任务id
    private int userId;//用户id
    private String createTime; //创建时间/采集时间
    private String name;//名称
    private String describe;//任务描述  用于存储网络下发的memo备注
    private String address;//地址
    private String telPhone;//电话
    private String memo;//备注
    private String precision;//金额
    private String photo;//照片信息
    private boolean checked;
    private String geoWkt; // 数据的wkt
    //ROOM不支持直接存储集合
    @TypeConverters(PhotoInfoConverter.class)
    private List<Info> photoInfo;//照片信息
    private int existence;//是否存在 不存在对应  0 存在对应  1  无法验证对应 2
    private String x;//经度
    private String y;//纬度
    private String detail;//深度信息
    private String dist;//距离用户位置
    private int taskStatus;//任务状态 0.未领取 1.已领取，5  立即采集，2.未保存(保存到本地但未提交成功),3.已保存(保存到本地提交成功)，4已上传（结束采集）
    private int type;//1 "POI"2 "充电站"3 "POI录像"4 "道路录像"5 "其他"6 "面状任务"
    private int station_type;//1."充电站"2 "充换电站"3 "充电桩组"4 "换电站"5 "门牌", "公交:6 情报:7
    private int isLocalData;//是否是本地数据  0,服务 1,本地
    private int isExclusive;//任务类型 0.普通任务，1.专属任务
    private int bodyId;//保存本地的bodyId
    private int work_type;//0."车行" 1."自行车" 2."步行"

    public int getWork_type() {
        return work_type;
    }

    public void setWork_type(int work_type) {
        this.work_type = work_type;
    }

    public String getGeoWkt() {
        return geoWkt;
    }
    public void setGeoWkt(String geoWkt) {
        this.geoWkt = geoWkt;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }


    public int getBodyId() {
        return bodyId;
    }

    public void setBodyId(int bodyId) {
        this.bodyId = bodyId;
    }

    public int getIsExclusive() {
        return isExclusive;
    }

    public void setIsExclusive(int isExclusive) {
        this.isExclusive = isExclusive;
    }

    public int getIsLocalData() {
        return isLocalData;
    }

    public void setIsLocalData(int isLocalData) {
        this.isLocalData = isLocalData;
    }

    public String getDist() {
        return dist;
    }

    public void setDist(String dist) {
        this.dist = dist;
    }

    public int getStation_type() {
        return station_type;
    }

    public void setStation_type(int station_type) {
        this.station_type = station_type;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getTaskStatus() {
        return taskStatus;
    }

    public void setTaskStatus(int taskStatus) {
        this.taskStatus = taskStatus;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTelPhone() {
        return telPhone;
    }

    public void setTelPhone(String telPhone) {
        this.telPhone = telPhone;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public String getPrecision() {
        return precision;
    }

    public void setPrecision(String  precision) {
        this.precision = precision;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public List<Info> getPhotoInfo() {
        return photoInfo;
    }

    public void setPhotoInfo(List<Info> infoList) {
        this.photoInfo = infoList;
    }

    public int getExistence() {
        return existence;
    }

    public void setExistence(int existence) {
        this.existence = existence;
    }

    public String getX() {
        return x;
    }

    public void setX(String x) {
        this.x = x;
    }

    public String getY() {
        return y;
    }

    public void setY(String y) {
        this.y = y;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    @Override
    public String toString() {
        return "PoiEntity{" +
                "id=" + id +
                ", pid=" + pid +
                ", taskId=" + taskId +
                ", userId=" + userId +
                ", createTime='" + createTime + '\'' +
                ", name='" + name + '\'' +
                ", describe='" + describe + '\'' +
                ", address='" + address + '\'' +
                ", telPhone='" + telPhone + '\'' +
                ", memo='" + memo + '\'' +
                ", precision=" + precision +
                ", photo='" + photo + '\'' +
                ", photoInfo=" + photoInfo +
                ", existence=" + existence +
                ", x='" + x + '\'' +
                ", y='" + y + '\'' +
                ", detail='" + detail + '\'' +
                '}';
    }
}
