MapDataDTO.java 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package com.yihu.es.entity;
  2. import com.alibaba.fastjson.annotation.JSONField;
  3. import com.fasterxml.jackson.annotation.JsonFormat;
  4. import io.searchbox.annotations.JestId;
  5. import org.springframework.data.elasticsearch.annotations.GeoPointField;
  6. import org.springframework.data.elasticsearch.core.geo.GeoPoint;
  7. import java.util.Date;
  8. /**
  9. * Created by chenweida on 2018/2/12.
  10. */
  11. public class MapDataDTO {
  12. @JestId
  13. private String id;
  14. private String idCard; //设备绑定身份证
  15. private String deviceSn;//设备SnID
  16. private Long deviceId;//设备ID 用于区分类型
  17. @GeoPointField
  18. private GeoPoint location;//经纬度
  19. @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
  20. @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
  21. private Date deviceTime;//设备版定数时间
  22. @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
  23. @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
  24. private Date createTime; // 创建时间(ES:必填)
  25. public String getId() {
  26. return id;
  27. }
  28. public void setId(String id) {
  29. this.id = id;
  30. }
  31. public String getIdCard() {
  32. return idCard;
  33. }
  34. public void setIdCard(String idCard) {
  35. this.idCard = idCard;
  36. }
  37. public String getDeviceSn() {
  38. return deviceSn;
  39. }
  40. public void setDeviceSn(String deviceSn) {
  41. this.deviceSn = deviceSn;
  42. }
  43. public Long getDeviceId() {
  44. return deviceId;
  45. }
  46. public void setDeviceId(Long deviceId) {
  47. this.deviceId = deviceId;
  48. }
  49. public GeoPoint getLocation() {
  50. return location;
  51. }
  52. public void setLocation(GeoPoint location) {
  53. this.location = location;
  54. }
  55. public Date getDeviceTime() {
  56. return deviceTime;
  57. }
  58. public void setDeviceTime(Date deviceTime) {
  59. this.deviceTime = deviceTime;
  60. }
  61. public Date getCreateTime() {
  62. return createTime;
  63. }
  64. public void setCreateTime(Date createTime) {
  65. this.createTime = createTime;
  66. }
  67. public void setLocation(Double lat, Double lng) {
  68. GeoPoint geoPoint = new GeoPoint(lat, lng);
  69. this.location = geoPoint;
  70. }
  71. }