LpInfoState.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. package com.zy.bms.entity.lp;
  2. import com.alibaba.fastjson.annotation.JSONField;
  3. import com.baomidou.mybatisplus.annotation.IdType;
  4. import com.baomidou.mybatisplus.annotation.TableId;
  5. import lombok.Data;
  6. import java.io.Serializable;
  7. import java.math.BigDecimal;
  8. import java.time.LocalDateTime;
  9. /**
  10. * 设备-路牌
  11. *
  12. * @author chenyi
  13. * @since 2021-06-22
  14. */
  15. @Data
  16. public class LpInfoState implements Serializable {
  17. private static final long serialVersionUID = 1L;
  18. @TableId(type = IdType.AUTO)
  19. private Integer id;
  20. /**
  21. * 设备唯一码
  22. */
  23. private String openNum;
  24. /**
  25. * 定时唤醒时间
  26. */
  27. private BigDecimal wakeInt;
  28. /**
  29. * 阈值
  30. */
  31. private Integer thresh;
  32. /**
  33. * 电量
  34. */
  35. private String battery;
  36. /**
  37. * 信号
  38. */
  39. private String s4g;
  40. private String x;
  41. private String y;
  42. private String z;
  43. private String anglex;
  44. private String angley;
  45. private String anglez;
  46. /**
  47. * 温度
  48. */
  49. private String temp;
  50. /**
  51. * 经度
  52. */
  53. @JSONField(format = "#.######")
  54. private Double lon;
  55. /**
  56. * 纬度
  57. */
  58. @JSONField(format = "#.######")
  59. private Double lat;
  60. /**
  61. * 经度(Gcj)
  62. */
  63. @JSONField(format = "#.######")
  64. private Double lonGcj;
  65. /**
  66. * 纬度(Gcj)
  67. */
  68. @JSONField(format = "#.######")
  69. private Double latGcj;
  70. /**
  71. * 格式化位置
  72. */
  73. private String site;
  74. /**
  75. * 定位模式 1:GPS 2:基站
  76. */
  77. private Integer mode;
  78. /**
  79. * 状态 0:离线 1:在线
  80. */
  81. private Integer status;
  82. /**
  83. * 上传类型
  84. */
  85. private String dataType;
  86. /**
  87. * 数据更新时间
  88. */
  89. private LocalDateTime updateTime;
  90. public Integer getStatus() {
  91. if (updateTime == null || wakeInt == null) return 0;
  92. return LocalDateTime.now().isAfter(updateTime.plusMinutes(wakeInt.multiply(BigDecimal.valueOf(60)).intValue() + 3)) ? 0 : 1;
  93. }
  94. }