package com.tofly.ghrq_route.module.sign.domain;


import com.google.gson.annotations.SerializedName;
import com.tofly.ghrq_route.common.util.date.DateUtils;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Unique;

import java.util.UUID;

/**
 * Created by Amu on 2017/3/14.
 */

@Entity(nameInDb = "DB_SIGN_HISTORY")
public class SignHistoryDataBean {
    @Id @NotNull @Unique
    private String id;
    @SerializedName(value = "signStatus",alternate = "signType")
    private int signType = 1;  //1：签到 2：签退
    private int carmode = 0;    //0：人巡 1：车巡
    @SerializedName(value = "lng",alternate = "locationX")
    private String lng;     //GPS经度
    @SerializedName(value = "lat",alternate = "locationY")
    private String lat;      //GPS纬度
    @SerializedName(value = "gpsFlag",alternate = "flag")
    private int gpsFlag = 0;    //0：自动 1：手动
    @SerializedName(value = "signTime",alternate = "sign_time")
    private String signTime;
    @SerializedName(value = "signAddr",alternate = "signAddress")
    private String signAddr;
    private String deviceInfoId;
    private String planIds;
    private int state;
    private int isUpload = 0;  //未上传到服务器
    private String userid;

    public SignHistoryDataBean(int signType, String lng, String lat, int gpsFlag, String signAddr) {
        String sign_id = UUID.randomUUID().toString();
        String sign_time = DateUtils.getDate();
        this.id = sign_id;
        this.signType = signType;
        this.lng = lng;
        this.lat = lat;
        this.gpsFlag = gpsFlag;
        this.signTime = sign_time;
        this.signAddr = signAddr;
    }

    @Generated(hash = 1621680424)
    public SignHistoryDataBean(@NotNull String id, int signType, int carmode, String lng, String lat,
                               int gpsFlag, String signTime, String signAddr, String deviceInfoId, String planIds,
                               int state, int isUpload, String userid) {
        this.id = id;
        this.signType = signType;
        this.carmode = carmode;
        this.lng = lng;
        this.lat = lat;
        this.gpsFlag = gpsFlag;
        this.signTime = signTime;
        this.signAddr = signAddr;
        this.deviceInfoId = deviceInfoId;
        this.planIds = planIds;
        this.state = state;
        this.isUpload = isUpload;
        this.userid = userid;
    }

    @Generated(hash = 2104647057)
    public SignHistoryDataBean() {
    }

    public String getId() {
        return this.id;
    }

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

    public int getSignType() {
        return this.signType;
    }

    public void setSignType(int signType) {
        this.signType = signType;
    }

    public String getLng() {
        return this.lng;
    }

    public void setLng(String lng) {
        this.lng = lng;
    }

    public String getLat() {
        return this.lat;
    }

    public void setLat(String lat) {
        this.lat = lat;
    }

    public String getSignTime() {
        return this.signTime;
    }

    public void setSignTime(String signTime) {
        this.signTime = signTime;
    }

    public String getSignAddr() {
        return this.signAddr;
    }

    public void setSignAddr(String signAddr) {
        this.signAddr = signAddr;
    }

    public int getIsUpload() {
        return this.isUpload;
    }

    public void setIsUpload(int isUpload) {
        this.isUpload = isUpload;
    }

    public String getUserid() {
        return this.userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public int getCarmode() {
        return this.carmode;
    }

    public void setCarmode(int carmode) {
        this.carmode = carmode;
    }

    public String getDeviceInfoId() {
        return this.deviceInfoId;
    }

    public void setDeviceInfoId(String deviceInfoId) {
        this.deviceInfoId = deviceInfoId;
    }

    public String getPlanIds() {
        return this.planIds;
    }

    public void setPlanIds(String planIds) {
        this.planIds = planIds;
    }

    public int getGpsFlag() {
        return this.gpsFlag;
    }

    public void setGpsFlag(int gpsFlag) {
        this.gpsFlag = gpsFlag;
    }

    public SignDataBean getSignDataBean(){
        SignDataBean signDataBean  = new SignDataBean();
        signDataBean.signTime = this.signTime;
        signDataBean.signAddr = this.signAddr;
        signDataBean.signStatus = this.signType + 1;
        return signDataBean;
    }

    public int getState() {
        return this.state;
    }

    public void setState(int state) {
        this.state = state;
    }
}
