历史记录测试
parent
0845f082af
commit
80b042b1d7
|
@ -1,5 +1,6 @@
|
||||||
package com.dragon.vehicle.history.common.domain;
|
package com.dragon.vehicle.history.common.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
|
@ -17,7 +18,7 @@ import java.util.Date;
|
||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "history_record")
|
@TableName(value = "tb_record")
|
||||||
public class HistoryRecord {
|
public class HistoryRecord {
|
||||||
/**
|
/**
|
||||||
* 历史轨迹ID
|
* 历史轨迹ID
|
||||||
|
@ -38,5 +39,7 @@ public class HistoryRecord {
|
||||||
/**
|
/**
|
||||||
* 是否删除记录 1-是 0-否
|
* 是否删除记录 1-是 0-否
|
||||||
*/
|
*/
|
||||||
|
@TableLogic(value="0",delval="1")
|
||||||
|
//value为正常数据的值,delval为删除数据的值
|
||||||
private Integer isDelete;
|
private Integer isDelete;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,308 @@
|
||||||
|
package com.dragon.vehicle.history.common.domain;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@ToString
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName("vehicle_data")
|
||||||
|
public class VehicleData {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VIN
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间戳
|
||||||
|
*/
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 速度
|
||||||
|
*/
|
||||||
|
private String speed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 里程
|
||||||
|
*/
|
||||||
|
private BigDecimal mileage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总电压
|
||||||
|
*/
|
||||||
|
private String voltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总电流
|
||||||
|
*/
|
||||||
|
private String current;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绝缘电阻
|
||||||
|
*/
|
||||||
|
private String resistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档位
|
||||||
|
*/
|
||||||
|
private String gear;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加速踏板行程值
|
||||||
|
*/
|
||||||
|
private String accelerationPedal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制动踏板行程值
|
||||||
|
*/
|
||||||
|
private String brakePedal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 燃料消耗率
|
||||||
|
*/
|
||||||
|
private String fuelConsumptionRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机控制器温度
|
||||||
|
*/
|
||||||
|
private String motorControllerTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机转速
|
||||||
|
*/
|
||||||
|
private String motorSpeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机转矩
|
||||||
|
*/
|
||||||
|
private String motorTorque;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机温度
|
||||||
|
*/
|
||||||
|
private String motorTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机电压
|
||||||
|
*/
|
||||||
|
private String motorVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机电流
|
||||||
|
*/
|
||||||
|
private String motorCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池剩余电量SOC
|
||||||
|
*/
|
||||||
|
private BigDecimal remainingBattery;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前状态允许的最大反馈功率
|
||||||
|
*/
|
||||||
|
private String maximumFeedbackPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前状态允许最大放电功率
|
||||||
|
*/
|
||||||
|
private String maximumDischargePower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BMS自检计数器
|
||||||
|
*/
|
||||||
|
private String selfCheckCounter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池充放电电流
|
||||||
|
*/
|
||||||
|
private String totalBatteryCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池负载端总电压V3
|
||||||
|
*/
|
||||||
|
private String totalBatteryVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单次最大电压
|
||||||
|
*/
|
||||||
|
private String singleBatteryMaxVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体电池最低电压
|
||||||
|
*/
|
||||||
|
private String singleBatteryMinVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体电池最高温度
|
||||||
|
*/
|
||||||
|
private String singleBatteryMaxTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体电池最低温度
|
||||||
|
*/
|
||||||
|
private String singleBatteryMinTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池可用容量
|
||||||
|
*/
|
||||||
|
private String availableBatteryCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
private int vehicleStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电状态
|
||||||
|
*/
|
||||||
|
private int chargingStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行状态
|
||||||
|
*/
|
||||||
|
private int operatingStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SOC
|
||||||
|
*/
|
||||||
|
private int socStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可充电储能装置工作状态
|
||||||
|
*/
|
||||||
|
private int chargingEnergyStorageStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驱动电机状态
|
||||||
|
*/
|
||||||
|
private int driveMotorStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位是否有效
|
||||||
|
*/
|
||||||
|
private int positionStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAS(汽车防盗系统)状态
|
||||||
|
*/
|
||||||
|
private int easStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PTC(电动加热器)状态
|
||||||
|
*/
|
||||||
|
private int ptcStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EPS(电动助力系统)状态
|
||||||
|
*/
|
||||||
|
private int epsStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ABS(防抱死)状态
|
||||||
|
*/
|
||||||
|
private int absStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MCU(电机/逆变器)状态
|
||||||
|
*/
|
||||||
|
private int mcuStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池加热状态
|
||||||
|
*/
|
||||||
|
private int heatingStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池当前状态
|
||||||
|
*/
|
||||||
|
private int batteryStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池保温状态
|
||||||
|
*/
|
||||||
|
private int batteryInsulationStatus;
|
||||||
|
|
||||||
|
|
||||||
|
public static VehicleData getBuild(String messages) {
|
||||||
|
char start = messages.charAt(0);
|
||||||
|
char end = messages.charAt(messages.length() - 1);
|
||||||
|
System.out.println(start);
|
||||||
|
System.out.println(end);
|
||||||
|
return VehicleData.builder()
|
||||||
|
.vin(messages.substring(1, 18))
|
||||||
|
//messages.substring(18, 31)
|
||||||
|
.createTime(new Date())
|
||||||
|
.longitude(messages.substring(31, 42))
|
||||||
|
.latitude(messages.substring(42, 52))
|
||||||
|
.speed(messages.substring(52, 58))
|
||||||
|
.mileage(new BigDecimal(messages.substring(58, 69)))
|
||||||
|
.voltage(messages.substring(69, 75))
|
||||||
|
.current(messages.substring(75, 80))
|
||||||
|
.resistance(messages.substring(80, 89))
|
||||||
|
.gear(messages.substring(89, 90))
|
||||||
|
.accelerationPedal(messages.substring(90, 92))
|
||||||
|
.brakePedal(messages.substring(92, 94))
|
||||||
|
.fuelConsumptionRate(messages.substring(94, 99))
|
||||||
|
.motorControllerTemperature(messages.substring(99, 105))
|
||||||
|
.motorSpeed(messages.substring(105, 110))
|
||||||
|
.motorTorque(messages.substring(110, 114))
|
||||||
|
.motorTemperature(messages.substring(114, 120))
|
||||||
|
.motorVoltage(messages.substring(120, 125))
|
||||||
|
.motorCurrent(messages.substring(125, 133))
|
||||||
|
.remainingBattery(new BigDecimal(messages.substring(133, 139)))
|
||||||
|
.maximumFeedbackPower(messages.substring(139, 145))
|
||||||
|
.maximumDischargePower(messages.substring(145, 151))
|
||||||
|
.selfCheckCounter(messages.substring(151, 153))
|
||||||
|
.totalBatteryCurrent(messages.substring(153, 158))
|
||||||
|
.totalBatteryVoltage(messages.substring(158, 164))
|
||||||
|
.singleBatteryMaxVoltage(messages.substring(164, 168))
|
||||||
|
.singleBatteryMinVoltage(messages.substring(168, 172))
|
||||||
|
.singleBatteryMaxTemperature(messages.substring(172, 178))
|
||||||
|
.singleBatteryMinTemperature(messages.substring(178, 184))
|
||||||
|
.availableBatteryCapacity(messages.substring(184, 190))
|
||||||
|
.vehicleStatus(Integer.valueOf(messages.substring(190, 191)))
|
||||||
|
.chargingStatus(Integer.valueOf(messages.substring(191, 192)))
|
||||||
|
.operatingStatus(Integer.valueOf(messages.substring(192, 193)))
|
||||||
|
.socStatus(Integer.valueOf(messages.substring(193, 194)))
|
||||||
|
.chargingEnergyStorageStatus(Integer.valueOf(messages.substring(194, 195)))
|
||||||
|
.driveMotorStatus(Integer.valueOf(messages.substring(195, 196)))
|
||||||
|
.positionStatus(Integer.valueOf(messages.substring(196, 197)))
|
||||||
|
.easStatus(Integer.valueOf(messages.substring(197, 198)))
|
||||||
|
.ptcStatus(Integer.valueOf(messages.substring(198, 199)))
|
||||||
|
.epsStatus(Integer.valueOf(messages.substring(199, 200)))
|
||||||
|
.absStatus(Integer.valueOf(messages.substring(200, 201)))
|
||||||
|
.mcuStatus(Integer.valueOf(messages.substring(201, 202)))
|
||||||
|
.heatingStatus(Integer.valueOf(messages.substring(202, 203)))
|
||||||
|
.batteryStatus(Integer.valueOf(messages.substring(203, 204)))
|
||||||
|
.batteryInsulationStatus(Integer.valueOf(messages.substring(204, 205)))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,221 +0,0 @@
|
||||||
package com.dragon.vehicle.history.common.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Wenkang Tang
|
|
||||||
* @date 2023/11/19 20:01
|
|
||||||
* @description 车辆详细信息表
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
|
||||||
@TableName(value = "vehicle_operation")
|
|
||||||
public class VehicleOperation {
|
|
||||||
/**
|
|
||||||
* 车辆实时轨迹数据表
|
|
||||||
*/
|
|
||||||
@TableId(value = "vehicle_operation_id")
|
|
||||||
private Integer vehicleOperationId;
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
private String vin;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
|
||||||
private Date createTime;
|
|
||||||
/**
|
|
||||||
* 经度
|
|
||||||
*/
|
|
||||||
private String longitude;
|
|
||||||
/**
|
|
||||||
* 纬度
|
|
||||||
*/
|
|
||||||
private String latitude;
|
|
||||||
/**
|
|
||||||
* 速度
|
|
||||||
*/
|
|
||||||
private String speed;
|
|
||||||
/**
|
|
||||||
* 总里程
|
|
||||||
*/
|
|
||||||
private BigDecimal mileage;
|
|
||||||
/**
|
|
||||||
* 总电压
|
|
||||||
*/
|
|
||||||
private String voltage;
|
|
||||||
/**
|
|
||||||
* 总电流
|
|
||||||
*/
|
|
||||||
private String current;
|
|
||||||
/**
|
|
||||||
* 绝缘电阻
|
|
||||||
*/
|
|
||||||
private String resistance;
|
|
||||||
/**
|
|
||||||
* 档位
|
|
||||||
*/
|
|
||||||
private String gear;
|
|
||||||
/**
|
|
||||||
* 加速踏板行程值
|
|
||||||
*/
|
|
||||||
private String accelerationPedal;
|
|
||||||
/**
|
|
||||||
* 制动踏板行程值
|
|
||||||
*/
|
|
||||||
private String brakePedal;
|
|
||||||
/**
|
|
||||||
* 燃料消耗率
|
|
||||||
*/
|
|
||||||
private String fuelConsumptionRate;
|
|
||||||
/**
|
|
||||||
* 电机控制器温度
|
|
||||||
*/
|
|
||||||
private String motorControllerTemperature;
|
|
||||||
/**
|
|
||||||
* 电机转速
|
|
||||||
*/
|
|
||||||
private String motorSpeed;
|
|
||||||
/**
|
|
||||||
* 电机转矩
|
|
||||||
*/
|
|
||||||
private String motorTorque;
|
|
||||||
/**
|
|
||||||
* 电机温度
|
|
||||||
*/
|
|
||||||
private String motorTemperature;
|
|
||||||
/**
|
|
||||||
* 电机电压
|
|
||||||
*/
|
|
||||||
private String motorVoltage;
|
|
||||||
/**
|
|
||||||
* 电机电流
|
|
||||||
*/
|
|
||||||
private String motorCurrent;
|
|
||||||
/**
|
|
||||||
* 动力电池剩余电量SOC
|
|
||||||
*/
|
|
||||||
private BigDecimal remainingBattery;
|
|
||||||
/**
|
|
||||||
* 电池总容量
|
|
||||||
*/
|
|
||||||
private BigDecimal batteryLevel;
|
|
||||||
/**
|
|
||||||
* 当前状态允许的最大反馈功率
|
|
||||||
*/
|
|
||||||
private String maximumFeedbackPower;
|
|
||||||
/**
|
|
||||||
* 当前状态允许最大放电功率
|
|
||||||
*/
|
|
||||||
private String maximumDischargePower;
|
|
||||||
/**
|
|
||||||
* BMS自检计数器
|
|
||||||
*/
|
|
||||||
private String selfCheckCounter;
|
|
||||||
/**
|
|
||||||
* 动力电池充放电电流
|
|
||||||
*/
|
|
||||||
private String totalBatteryCurrent;
|
|
||||||
/**
|
|
||||||
* 动力电池负载端总电压V3
|
|
||||||
*/
|
|
||||||
private String totalBatteryVoltage;
|
|
||||||
/**
|
|
||||||
* 单次最大电压
|
|
||||||
*/
|
|
||||||
private String singleBatteryMaxVoltage;
|
|
||||||
/**
|
|
||||||
* 单体电池最低电压
|
|
||||||
*/
|
|
||||||
private String singleBatteryMinVoltage;
|
|
||||||
/**
|
|
||||||
* 单体电池最高温度
|
|
||||||
*/
|
|
||||||
private String singleBatteryMaxTemperature;
|
|
||||||
/**
|
|
||||||
* 单体电池最低温度
|
|
||||||
*/
|
|
||||||
private String singleBatteryMinTemperature;
|
|
||||||
/**
|
|
||||||
* 动力电池可用容量
|
|
||||||
*/
|
|
||||||
private String availableBatteryCapacity;
|
|
||||||
/**
|
|
||||||
* 车辆状态
|
|
||||||
*/
|
|
||||||
private Integer vehicleStatus;
|
|
||||||
/**
|
|
||||||
* 充电状态
|
|
||||||
*/
|
|
||||||
private Integer chargingStatus;
|
|
||||||
/**
|
|
||||||
* 运行状态
|
|
||||||
*/
|
|
||||||
private Integer operatingStatus;
|
|
||||||
/**
|
|
||||||
* SOC
|
|
||||||
*/
|
|
||||||
private Integer socStatus;
|
|
||||||
/**
|
|
||||||
* 可充电储能装置工作状态
|
|
||||||
*/
|
|
||||||
private Integer chargingRnergyStorageStatus;
|
|
||||||
/**
|
|
||||||
* 驱动电机状态
|
|
||||||
*/
|
|
||||||
private Integer driveMotorStatus;
|
|
||||||
/**
|
|
||||||
* 定位是否有效
|
|
||||||
*/
|
|
||||||
private Integer positionStatus;
|
|
||||||
/**
|
|
||||||
* EAS(汽车防盗系统)状态
|
|
||||||
*/
|
|
||||||
private Integer easStatus;
|
|
||||||
/**
|
|
||||||
* EPS(电动助力系统)状态
|
|
||||||
*/
|
|
||||||
private Integer epsStatus;
|
|
||||||
/**
|
|
||||||
* ABS(防抱死)状态
|
|
||||||
*/
|
|
||||||
private Integer absStatus;
|
|
||||||
/**
|
|
||||||
* MCU(电机/逆变器)状态
|
|
||||||
*/
|
|
||||||
private Integer mcuStatus;
|
|
||||||
/**
|
|
||||||
* 动力电池加热状态
|
|
||||||
*/
|
|
||||||
private Integer heatingStatus;
|
|
||||||
/**
|
|
||||||
* 动力电池当前状态
|
|
||||||
*/
|
|
||||||
private Integer batteryStatus;
|
|
||||||
/**
|
|
||||||
* 动力电池保温状态
|
|
||||||
*/
|
|
||||||
private Integer batteryInsulationStatus;
|
|
||||||
/**
|
|
||||||
* DCDC(电力交换系统)状态
|
|
||||||
*/
|
|
||||||
private Integer dcdcStatus;
|
|
||||||
/**
|
|
||||||
* CHG(充电机)状态
|
|
||||||
*/
|
|
||||||
private Integer chgStatus;
|
|
||||||
}
|
|
|
@ -21,7 +21,7 @@ public class HistoryReq {
|
||||||
/**
|
/**
|
||||||
* 车辆VIN
|
* 车辆VIN
|
||||||
*/
|
*/
|
||||||
private String carVin;
|
private String vin;
|
||||||
/**
|
/**
|
||||||
* 开始时间
|
* 开始时间
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.dragon.vehicle.history.server.controller;
|
||||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
import com.dragon.vehicle.history.common.domain.VehicleData;
|
||||||
import com.dragon.vehicle.history.common.domain.req.HistoryReq;
|
import com.dragon.vehicle.history.common.domain.req.HistoryReq;
|
||||||
import com.dragon.vehicle.history.server.service.HistoricalTrackService;
|
import com.dragon.vehicle.history.server.service.HistoricalTrackService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -38,6 +38,7 @@ public class HistoricalTrackController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/delHistoricalTrack")
|
@PostMapping("/delHistoricalTrack")
|
||||||
|
@DS(value = "slave")
|
||||||
public Result delHistoricalTrack(@RequestParam Integer recordId){
|
public Result delHistoricalTrack(@RequestParam Integer recordId){
|
||||||
historicalTrackService.delHistoricalTrack(recordId);
|
historicalTrackService.delHistoricalTrack(recordId);
|
||||||
return Result.success("删除成功!");
|
return Result.success("删除成功!");
|
||||||
|
@ -49,7 +50,8 @@ public class HistoricalTrackController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/CarRecord")
|
@PostMapping("/CarRecord")
|
||||||
public Result<List<VehicleOperation>> CarRecord(@RequestParam HistoryReq historyReq){
|
@DS(value = "slave1")
|
||||||
|
public Result<List<VehicleData>> CarRecord(@RequestBody HistoryReq historyReq){
|
||||||
return Result.success(historicalTrackService.CarRecord(historyReq));
|
return Result.success(historicalTrackService.CarRecord(historyReq));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
package com.dragon.vehicle.history.server.controller;
|
|
||||||
|
|
||||||
import com.dragon.common.core.domain.Result;
|
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
|
||||||
import com.dragon.vehicle.history.server.service.LatestTrackService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Wenkang Tang
|
|
||||||
* @date 2023/11/29 15:05
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/latest")
|
|
||||||
public class LatestTrackController {
|
|
||||||
@Autowired
|
|
||||||
private LatestTrackService latestTrackService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实时轨迹
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/listLatestTrack")
|
|
||||||
public Result<List<VehicleOperation>> listLatestTrack() {
|
|
||||||
return Result.success(latestTrackService.listLatestTrack());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.dragon.vehicle.history.server.mapper;
|
package com.dragon.vehicle.history.server.mapper;
|
||||||
|
|
||||||
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
import com.dragon.vehicle.history.common.domain.VehicleData;
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
package com.dragon.vehicle.history.server.mapper;
|
|
||||||
|
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Wenkang Tang
|
|
||||||
* @date 2023/11/29 15:07
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface LatestTrackMapper extends MPJBaseMapper<VehicleOperation> {
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.dragon.vehicle.history.server.mapper;
|
package com.dragon.vehicle.history.server.mapper;
|
||||||
|
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
import com.dragon.vehicle.history.common.domain.VehicleData;
|
||||||
import com.github.yulichang.base.MPJBaseMapper;
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,5 +8,5 @@ import com.github.yulichang.base.MPJBaseMapper;
|
||||||
* @date 2023/11/30 20:06
|
* @date 2023/11/30 20:06
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
public interface VehicleOperationMapper extends MPJBaseMapper<VehicleOperation> {
|
public interface VehicleDataMapper extends MPJBaseMapper<VehicleData> {
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ package com.dragon.vehicle.history.server.service;
|
||||||
|
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
import com.dragon.vehicle.history.common.domain.VehicleData;
|
||||||
import com.dragon.vehicle.history.common.domain.req.HistoryReq;
|
import com.dragon.vehicle.history.common.domain.req.HistoryReq;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -30,5 +30,5 @@ public interface HistoricalTrackService {
|
||||||
* @param historyReq
|
* @param historyReq
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<VehicleOperation> CarRecord(HistoryReq historyReq);
|
List<VehicleData> CarRecord(HistoryReq historyReq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
package com.dragon.vehicle.history.server.service;
|
|
||||||
|
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Wenkang Tang
|
|
||||||
* @date 2023/11/29 15:06
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
public interface LatestTrackService {
|
|
||||||
/**
|
|
||||||
* 实时轨迹
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<VehicleOperation> listLatestTrack();
|
|
||||||
}
|
|
|
@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.dragon.common.core.domain.Result;
|
import com.dragon.common.core.domain.Result;
|
||||||
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
import com.dragon.vehicle.history.common.domain.HistoryRecord;
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
import com.dragon.vehicle.history.common.domain.VehicleData;
|
||||||
import com.dragon.vehicle.history.common.domain.req.HistoryReq;
|
import com.dragon.vehicle.history.common.domain.req.HistoryReq;
|
||||||
import com.dragon.vehicle.history.server.mapper.HistoricalTrackMapper;
|
import com.dragon.vehicle.history.server.mapper.HistoricalTrackMapper;
|
||||||
import com.dragon.vehicle.history.server.mapper.VehicleOperationMapper;
|
import com.dragon.vehicle.history.server.mapper.VehicleDataMapper;
|
||||||
import com.dragon.vehicle.history.server.service.HistoricalTrackService;
|
import com.dragon.vehicle.history.server.service.HistoricalTrackService;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -27,7 +27,7 @@ public class HistoricalTrackServiceImpl implements HistoricalTrackService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private HistoricalTrackMapper historicalTrackMapper;
|
private HistoricalTrackMapper historicalTrackMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private VehicleOperationMapper vehicleOperationMapper;
|
private VehicleDataMapper VehicleDataMapper;
|
||||||
/**
|
/**
|
||||||
* 历史轨迹列表
|
* 历史轨迹列表
|
||||||
* @return
|
* @return
|
||||||
|
@ -47,7 +47,7 @@ public class HistoricalTrackServiceImpl implements HistoricalTrackService {
|
||||||
LambdaUpdateWrapper<HistoryRecord> updateWrapper = new LambdaUpdateWrapper<>();
|
LambdaUpdateWrapper<HistoryRecord> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
LambdaUpdateWrapper<HistoryRecord> wrapper = updateWrapper
|
LambdaUpdateWrapper<HistoryRecord> wrapper = updateWrapper
|
||||||
.eq(HistoryRecord::getRecordId, recordId);
|
.eq(HistoryRecord::getRecordId, recordId);
|
||||||
historicalTrackMapper.deleteById(wrapper);
|
historicalTrackMapper.delete(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -56,12 +56,12 @@ public class HistoricalTrackServiceImpl implements HistoricalTrackService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<VehicleOperation> CarRecord(HistoryReq historyReq) {
|
public List<VehicleData> CarRecord(HistoryReq historyReq) {
|
||||||
LambdaQueryWrapper<VehicleOperation> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<VehicleData> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
LambdaQueryWrapper<VehicleOperation> wrapper = queryWrapper
|
LambdaQueryWrapper<VehicleData> wrapper = queryWrapper
|
||||||
.eq(VehicleOperation::getVin, historyReq.getCarVin())
|
.eq(VehicleData::getVin, historyReq.getVin())
|
||||||
.ge(VehicleOperation::getCreateTime, historyReq.getStartTime())
|
.ge(VehicleData::getCreateTime, historyReq.getStartTime())
|
||||||
.le(VehicleOperation::getCreateTime, historyReq.getEndTime());
|
.le(VehicleData::getCreateTime, historyReq.getEndTime());
|
||||||
return vehicleOperationMapper.selectList(wrapper);
|
return VehicleDataMapper.selectList(wrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.dragon.vehicle.history.server.service.impl;
|
|
||||||
|
|
||||||
import com.dragon.vehicle.history.common.domain.VehicleOperation;
|
|
||||||
import com.dragon.vehicle.history.server.mapper.LatestTrackMapper;
|
|
||||||
import com.dragon.vehicle.history.server.service.LatestTrackService;
|
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Wenkang Tang
|
|
||||||
* @date 2023/11/29 15:06
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class LatestTrackServiceImpl implements LatestTrackService {
|
|
||||||
@Autowired
|
|
||||||
private LatestTrackMapper latestTrackMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 实时轨迹
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<VehicleOperation> listLatestTrack() {
|
|
||||||
return latestTrackMapper.selectList(new MPJLambdaWrapper<VehicleOperation>().selectAll(VehicleOperation.class));
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue