/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workattendance.entity;

import com.jeeplus.common.utils.StringUtils;
import com.jeeplus.modules.sys.entity.Area;

import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 考勤地点Entity
 * @author 杨帆
 * @version 2018-09-05
 */
public class WorkAttendancePlace extends DataEntity<WorkAttendancePlace> {
	
	private static final long serialVersionUID = 1L;
	private Area area;		// 考勤城市
	private String placeName;		// 考勤地址
	private Double placeScope;		// 考勤范围
	private String wifi;		// wifi
	private String wifiName;		// wifi名称 
	private String longitude;		// 经度
	private String latitude;		// 纬度
	private String itude;		// company_id
	private String attendanceRuleId;		// 考勤规则主键
	private WorkAttendanceRule workAttendanceRule;		// 考勤规则

	public WorkAttendancePlace() {
		super();
	}

	public WorkAttendancePlace(String id){
		super(id);
	}

	@ExcelField(title="考勤城市", fieldType=Area.class, value="area.name", align=2, sort=1)
	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}
	
	@ExcelField(title="考勤地址", align=2, sort=2)
	public String getPlaceName() {
		return placeName;
	}

	public void setPlaceName(String placeName) {
		this.placeName = placeName;
	}
	
	@ExcelField(title="考勤范围", align=2, sort=3)
	public Double getPlaceScope() {
		return placeScope;
	}

	public void setPlaceScope(Double placeScope) {
		this.placeScope = placeScope;
	}
	
	@ExcelField(title="wifi", align=2, sort=4)
	public String getWifi() {
		return wifi;
	}

	public void setWifi(String wifi) {
		this.wifi = wifi;
	}
	
	@ExcelField(title="wifi名称 ", align=2, sort=5)
	public String getWifiName() {
		return wifiName;
	}

	public void setWifiName(String wifiName) {
		this.wifiName = wifiName;
	}
	
	@ExcelField(title="经度", align=2, sort=6)
	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}
	
	@ExcelField(title="纬度", align=2, sort=7)
	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	@ExcelField(title="考勤规则主键", align=2, sort=9)
	public String getAttendanceRuleId() {
		return attendanceRuleId;
	}

	public void setAttendanceRuleId(String attendanceRuleId) {
		this.attendanceRuleId = attendanceRuleId;
	}

	public WorkAttendanceRule getWorkAttendanceRule() {
		return workAttendanceRule;
	}

	public void setWorkAttendanceRule(WorkAttendanceRule workAttendanceRule) {
		this.workAttendanceRule = workAttendanceRule;
	}

	public String getItude() {
		if (StringUtils.isBlank(itude) && StringUtils.isNotBlank(longitude) && StringUtils.isNotBlank(latitude)){
			return this.itude = longitude+","+latitude;
		}else {
			return itude;
		}
	}

	public void setItude(String itude) {
		this.itude = itude;
	}
}