存储最后上报时间

This commit is contained in:
attiya 2025-12-04 09:41:50 +08:00
parent f580956f19
commit 5cb28e4371
3 changed files with 88 additions and 61 deletions

View File

@ -2,6 +2,8 @@ package com.cdzy.common.model.dto;
import lombok.Data; import lombok.Data;
import java.time.LocalDateTime;
/** /**
* @author attiya * @author attiya
* @since 2025-03-20 * @since 2025-03-20
@ -104,13 +106,15 @@ public class ResGPSDto {
*/ */
private Boolean inParking; private Boolean inParking;
/**
* 最后一次还车时间
*/
private Number latestTimestamp;
/** /**
* 放电状态0-关闭断电 1-打开通电 * 放电状态0-关闭断电 1-打开通电
*/ */
private Integer mosState; private Integer mosState;
/**
* 最后一次上报时间
*/
private LocalDateTime latestTime;
} }

View File

@ -36,40 +36,6 @@ public class EbikeOrderBikeInfoDto implements Serializable {
*/ */
private Long bikeInfoId; private Long bikeInfoId;
/**
* 运营商ID
*/
private Long operatorId;
/**
* 运营区ID
*/
private Long regionId;
/**
* 运营区名称
*/
private String regionName;
/**
* 车辆编号与车辆二维码编号相同
*/
private String bikeCode;
/**
* 电池ID
*/
private Long batteryId;
/**
* 中控ID
*/
private Long ecuId;
/**
* 头盔ID
*/
private Long helmetId;
/** /**
* 定位 * 定位
@ -79,15 +45,6 @@ public class EbikeOrderBikeInfoDto implements Serializable {
@JsonDeserialize(using = PGpointDeserializer.class) @JsonDeserialize(using = PGpointDeserializer.class)
private PGpoint location; private PGpoint location;
/**
* 备注
*/
private String remarks;
/**
* 车辆状态
*/
private Integer status;
/** /**
* 车辆使用状态 * 车辆使用状态
@ -95,35 +52,98 @@ public class EbikeOrderBikeInfoDto implements Serializable {
private Integer usageStatus; private Integer usageStatus;
/** /**
* 创建时间 * 外接电池电量该值由控制器提供若控制器不支持此值为0
*/ */
@Column(onInsertValue = "now()") private Integer soc;
private LocalDateTime createdAt;
/** /**
* 创建人 * 外接电源电压单位毫伏
*/ */
private Long createdBy; private Integer voltage;
/** /**
* 修改时间 * GPS信号强度0-31
*/ */
@Column(onUpdateValue = "now()") private Integer gsm;
private LocalDateTime updatedAt;
/** /**
* 修改人 * 时间戳
*/ */
private Long updatedBy; private Number timestamp;
/** /**
* 删除与否 * 0: 头盔不在位 1: 头盔在位
*/ */
private Boolean isDeleted; private Character helmetExit;
/** /**
* 是否包含头盔 * 0: 头盔锁未上锁 1: 头盔锁已上锁
*/ */
private Boolean hasHelme; private Character isHelmetLocked;
/**
* 0:后轮静止 1:后轮转动轮动状态
*/
private Character isWheelSpin;
/**
* 0:撤防状态 1:设防状态
*/
private Character isDefendOn;
/**
* 0: 车辆静止 1: 车辆移动运动状态
*/
private Character isMoving;
/**
* 0:电门关闭 1:电门打开
*/
private Character accOn;
/**
* 0:后轮未锁 1:后轮已锁
*/
private Character wheelLocked;
/**
* 0:电池仓未锁 1:电池仓已锁
*/
private Character seatLocked;
/**
* 速度
*/
private Float speed;
/**
* 中文位置
*/
private String chineseLocation;
/**
* ecuSn
*/
private String ecuSn;
/**
* 是否在运营区记录最后一次用户停车
*/
private Boolean inOperation;
/**
* 是否在停车区记录最后一次用户停车
*/
private Boolean inParking;
/**
* 最后一次上报时间
*/
private LocalDateTime latestTime;
/**
* 放电状态0-关闭断电 1-打开通电
*/
private Integer mosState;
} }

View File

@ -14,6 +14,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.annotation.Resource; import jakarta.annotation.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/** /**
* @author attiya * @author attiya
@ -79,6 +81,7 @@ public class ReoprtHandler {
resGpsDto.setIsHelmetLocked(isHelmetLocked); resGpsDto.setIsHelmetLocked(isHelmetLocked);
resGpsDto.setIsWheelSpin(isWheelSpin); resGpsDto.setIsWheelSpin(isWheelSpin);
resGpsDto.setIsMoving(isMoving); resGpsDto.setIsMoving(isMoving);
resGpsDto.setLatestTime(LocalDateTime.now());
redisUtil.saveEcu(deviceId, resGpsDto); redisUtil.saveEcu(deviceId, resGpsDto);
double[] doubles = CoordinateUtil.WGS84ToGCJ02(resGpsDto.getLongitude(), resGpsDto.getLatitude()); double[] doubles = CoordinateUtil.WGS84ToGCJ02(resGpsDto.getLongitude(), resGpsDto.getLatitude());
boolean outOfChina = CoordinateUtil.outOfChina(doubles[0], doubles[1]); boolean outOfChina = CoordinateUtil.outOfChina(doubles[0], doubles[1]);