package com.zy.bms.entity.lp; import com.alibaba.fastjson.annotation.JSONField; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; /** * 设备-路牌 * * @author chenyi * @since 2021-06-22 */ @Data public class LpInfoState implements Serializable { private static final long serialVersionUID = 1L; @TableId(type = IdType.AUTO) private Integer id; /** * 设备唯一码 */ private String openNum; /** * 定时唤醒时间 */ private BigDecimal wakeInt; /** * 阈值 */ private Integer thresh; /** * 电量 */ private String battery; /** * 信号 */ private String s4g; private String x; private String y; private String z; private String anglex; private String angley; private String anglez; /** * 温度 */ private String temp; /** * 经度 */ @JSONField(format = "#.######") private Double lon; /** * 纬度 */ @JSONField(format = "#.######") private Double lat; /** * 经度(Gcj) */ @JSONField(format = "#.######") private Double lonGcj; /** * 纬度(Gcj) */ @JSONField(format = "#.######") private Double latGcj; /** * 格式化位置 */ private String site; /** * 定位模式 1:GPS 2:基站 */ private Integer mode; /** * 状态 0:离线 1:在线 */ private Integer status; /** * 上传类型 */ private String dataType; /** * 数据更新时间 */ private LocalDateTime updateTime; public Integer getStatus() { if (updateTime == null || wakeInt == null) return 0; return LocalDateTime.now().isAfter(updateTime.plusMinutes(wakeInt.multiply(BigDecimal.valueOf(60)).intValue() + 3)) ? 0 : 1; } }