package com.usoftchina.uas.office.qywx.entity;

import com.usoftchina.qywx.sdk.dto.GetCheckinDataResp;

import java.util.Date;

/**
 * @author yingp
 * @date 2020/2/16
 */
public class CardLog {
    private Integer cl_id;
    private String cl_sourcetype;
    private Date cl_time;
    private String cl_cardcode;
    private Integer cl_emid;
    private String cl_emcode;
    private String cl_emname;
    private String cl_address;
    private String cl_phone;
    private String cl_location;
    private String cl_groupname;
    private String cl_checkintype;
    private String cl_exceptiontype;
    private String cl_wifiname;
    private String cl_notes;
    private String cl_wifimac;
    private String cl_mediaids;
    private Long cl_lat;
    private Long cl_lng;

    public CardLog(Employee employee, GetCheckinDataResp.CheckinData data) {
        this.cl_sourcetype = "WeChat";
        this.cl_time = new Date(data.getCheckin_time() * 1000);
        this.cl_cardcode = employee.getEm_code();
        this.cl_emid = employee.getEm_id();
        this.cl_emcode = employee.getEm_code();
        this.cl_emname = employee.getEm_name();
        this.cl_address = data.getLocation_detail();
        this.cl_phone = employee.getEm_mobile();
        this.cl_location = data.getLocation_title();
        this.cl_groupname = data.getGroupname();
        this.cl_checkintype = data.getCheckin_type();
        this.cl_exceptiontype = data.getException_type();
        this.cl_wifiname = data.getWifiname();
        this.cl_notes = data.getNotes();
        this.cl_wifimac = data.getWifimac();
        this.cl_mediaids = String.join(",", data.getMediaids());
        this.cl_lat = data.getLat();
        this.cl_lng = data.getLng();
    }

    public Integer getCl_id() {
        return cl_id;
    }

    public void setCl_id(Integer cl_id) {
        this.cl_id = cl_id;
    }

    public String getCl_sourcetype() {
        return cl_sourcetype;
    }

    public void setCl_sourcetype(String cl_sourcetype) {
        this.cl_sourcetype = cl_sourcetype;
    }

    public Date getCl_time() {
        return cl_time;
    }

    public void setCl_time(Date cl_time) {
        this.cl_time = cl_time;
    }

    public String getCl_cardcode() {
        return cl_cardcode;
    }

    public void setCl_cardcode(String cl_cardcode) {
        this.cl_cardcode = cl_cardcode;
    }

    public Integer getCl_emid() {
        return cl_emid;
    }

    public void setCl_emid(Integer cl_emid) {
        this.cl_emid = cl_emid;
    }

    public String getCl_emcode() {
        return cl_emcode;
    }

    public void setCl_emcode(String cl_emcode) {
        this.cl_emcode = cl_emcode;
    }

    public String getCl_emname() {
        return cl_emname;
    }

    public void setCl_emname(String cl_emname) {
        this.cl_emname = cl_emname;
    }

    public String getCl_address() {
        return cl_address;
    }

    public void setCl_address(String cl_address) {
        this.cl_address = cl_address;
    }

    public String getCl_phone() {
        return cl_phone;
    }

    public void setCl_phone(String cl_phone) {
        this.cl_phone = cl_phone;
    }

    public String getCl_location() {
        return cl_location;
    }

    public void setCl_location(String cl_location) {
        this.cl_location = cl_location;
    }

    public String getCl_groupname() {
        return cl_groupname;
    }

    public void setCl_groupname(String cl_groupname) {
        this.cl_groupname = cl_groupname;
    }

    public String getCl_checkintype() {
        return cl_checkintype;
    }

    public void setCl_checkintype(String cl_checkintype) {
        this.cl_checkintype = cl_checkintype;
    }

    public String getCl_exceptiontype() {
        return cl_exceptiontype;
    }

    public void setCl_exceptiontype(String cl_exceptiontype) {
        this.cl_exceptiontype = cl_exceptiontype;
    }

    public String getCl_wifiname() {
        return cl_wifiname;
    }

    public void setCl_wifiname(String cl_wifiname) {
        this.cl_wifiname = cl_wifiname;
    }

    public String getCl_notes() {
        return cl_notes;
    }

    public void setCl_notes(String cl_notes) {
        this.cl_notes = cl_notes;
    }

    public String getCl_wifimac() {
        return cl_wifimac;
    }

    public void setCl_wifimac(String cl_wifimac) {
        this.cl_wifimac = cl_wifimac;
    }

    public String getCl_mediaids() {
        return cl_mediaids;
    }

    public void setCl_mediaids(String cl_mediaids) {
        this.cl_mediaids = cl_mediaids;
    }

    public Long getCl_lat() {
        return cl_lat;
    }

    public void setCl_lat(Long cl_lat) {
        this.cl_lat = cl_lat;
    }

    public Long getCl_lng() {
        return cl_lng;
    }

    public void setCl_lng(Long cl_lng) {
        this.cl_lng = cl_lng;
    }
}
