解析系统
parent
d90f17dad4
commit
25c4aae722
|
@ -1,7 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.fivegroup.analysis.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 主题
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 19:25
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class Topic {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String vehicleVin;
|
||||
/**
|
||||
* 车辆主题
|
||||
*/
|
||||
private String topic;
|
||||
|
||||
/**
|
||||
* 车辆分区
|
||||
*/
|
||||
private Integer subzone;
|
||||
|
||||
}
|
|
@ -0,0 +1,300 @@
|
|||
package com.fivegroup.analysis.domain;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
/**
|
||||
* 车辆数据
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 20:28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class VehicleData {
|
||||
/**
|
||||
* 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))
|
||||
.createTime(new Date(Long.parseLong(messages.substring(18, 31))))
|
||||
.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();
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.fivegroup.analysis.domain.constant;
|
||||
|
||||
/**
|
||||
* kafka
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 19:26
|
||||
*/
|
||||
public class KafkaConstant {
|
||||
public static final String KAFKA_BOOTSTRAP_SERVERS = "101.34.69.116:9092";
|
||||
|
||||
/**
|
||||
* kafka主题
|
||||
*/
|
||||
public static final String KAFKA_TOPIC = "fiveGroup";
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.fivegroup.analysis.mapper;
|
||||
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 车辆信息
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 22:36
|
||||
*/
|
||||
@Mapper
|
||||
public interface VehicleHistoryIncidentMapper {
|
||||
void vehicleInsert(VehicleData vehicleDate);
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.fivegroup.analysis.service;
|
||||
|
||||
import com.fivegroup.analysis.domain.constant.KafkaConstant;
|
||||
import org.apache.kafka.clients.consumer.Consumer;
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* 消费者
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/12/1 - 11:13
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class KafkaConsumerConfig {
|
||||
@Bean
|
||||
public Consumer<String,String> consumerInit(){
|
||||
log.info("kafka消费者初始化开始");
|
||||
long startTime = System.currentTimeMillis();
|
||||
Properties props = new Properties();
|
||||
props.put("bootstrap.servers", KafkaConstant.KAFKA_BOOTSTRAP_SERVERS);
|
||||
props.put("group.id", "group01");
|
||||
props.put("enable.auto.commit", "true");
|
||||
props.put("auto.commit.interval.ms", "1000");
|
||||
props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
|
||||
props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer");
|
||||
log.info("kafka消费者初始化结束, 耗时:[{}MS]", System.currentTimeMillis() - startTime);
|
||||
return new KafkaConsumer<>(props);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
package com.fivegroup.analysis.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fivegroup.analysis.domain.Topic;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.common.core.utils.SpringUtils;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.kafka.clients.consumer.Consumer;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecord;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
||||
import org.apache.kafka.common.TopicPartition;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.util.*;
|
||||
/**
|
||||
* 消费者
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/12/1 - 11:24
|
||||
*/
|
||||
@Service
|
||||
@Log4j2
|
||||
public class KafkaConsumerService {
|
||||
@Autowired
|
||||
private Consumer<String, String> consumer;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
public static final String KAFKA_NAME = "test";
|
||||
|
||||
public static final String REDIS_NAME = "mq_message";
|
||||
@RabbitListener(queuesToDeclare = {@Queue(name = "test")})
|
||||
public void add(String parameter, Message message, Channel channel) {
|
||||
log.info("开始消费了消费");
|
||||
String messageId = message.getMessageProperties().getMessageId();
|
||||
try {
|
||||
log.info("UUID为:{}", messageId);
|
||||
Long add = redisService.redisTemplate.opsForSet().add(REDIS_NAME, messageId);
|
||||
log.info("add为:" + add);
|
||||
if (1 == add && null != add) {
|
||||
log.info("已开始消费");
|
||||
Topic topic = JSONObject.parseObject(parameter, Topic.class);
|
||||
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
||||
TopicPartition topicPartition = new TopicPartition(topic.getTopic(), topic.getSubzone());
|
||||
// 订阅特定分区
|
||||
consumer.assign(Collections.singleton(topicPartition));
|
||||
new Thread(() -> {
|
||||
while (true) {
|
||||
ConsumerRecords<String, String> records = null;
|
||||
try {
|
||||
records = consumer.poll(Duration.ofMillis(1000));
|
||||
for (ConsumerRecord<String, String> record : records) {
|
||||
String value = record.value();
|
||||
String messages = KafkaConsumerService.sixteenToStr(value);
|
||||
VehicleData build = VehicleData.getBuild(messages);
|
||||
if (redisService.hasKey(build.getVin())) {
|
||||
System.out.println(build.getVin());
|
||||
List<String> range = redisService.redisTemplate.opsForList().range(build.getVin(), 0, -1);
|
||||
if (range.size() > 0) {
|
||||
range.forEach(l -> {
|
||||
System.out.println(l);
|
||||
VehicleIncidentService vehicleIncidentService = SpringUtils.getBean(l);
|
||||
vehicleIncidentService.execute(build);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("records: {}", records);
|
||||
log.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
}).start();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
//删除redis添加的数据
|
||||
redisService.redisTemplate.opsForSet().remove(REDIS_NAME, messageId);
|
||||
//退回
|
||||
channel.basicReject(message.getMessageProperties().getDeliveryTag(), true);
|
||||
log.info("异常数据已回退");
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static String sixToStrteen(String s) {
|
||||
StringBuilder builder1 = new StringBuilder();
|
||||
int length = s.length();
|
||||
for (int i = 0; i < length; i++) {
|
||||
int c = s.charAt(i);
|
||||
String s1 = Integer.toHexString(c);
|
||||
builder1.append(s1 + " ");
|
||||
}
|
||||
return builder1.toString();
|
||||
}
|
||||
|
||||
public static String sixteenToStr(String s) {
|
||||
StringBuilder builder1 = new StringBuilder();
|
||||
String[] arr = s.split(" ");
|
||||
int length = arr.length;
|
||||
for (int i = 0; i < length; i++) {
|
||||
int integer = Integer.parseInt(arr[i], 16);
|
||||
builder1.append((char) integer);
|
||||
}
|
||||
return builder1.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.fivegroup.analysis.service;
|
||||
|
||||
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
|
||||
/**
|
||||
* 车辆事件
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 20:58
|
||||
*/
|
||||
public interface VehicleIncidentService {
|
||||
void execute(VehicleData vehicleDate);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.fivegroup.analysis.service.impl;
|
||||
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.analysis.service.VehicleIncidentService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆故障事件检测
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 22:04
|
||||
*/
|
||||
@Log4j2
|
||||
@Service("breakdown")
|
||||
@AllArgsConstructor
|
||||
public class VehicleBreakdownIncidentServiceImpl implements VehicleIncidentService {
|
||||
private final RedisService redisService;
|
||||
|
||||
/**
|
||||
* 车辆故障信息
|
||||
* @param vehicleDate
|
||||
*/
|
||||
@Override
|
||||
public void execute(VehicleData vehicleDate) {
|
||||
log.info("vehicleDate: [{}]车辆故障触发事件" , vehicleDate.getVin());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.fivegroup.analysis.service.impl;
|
||||
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.analysis.service.VehicleIncidentService;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆的电子围栏
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 22:25
|
||||
*/
|
||||
@Log4j2
|
||||
@Service("fence")
|
||||
@AllArgsConstructor
|
||||
public class VehicleFenceIncidentServiceImpl implements VehicleIncidentService {
|
||||
private final RedisService redisService;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏事件
|
||||
* @param vehicleDate
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void execute(VehicleData vehicleDate) {
|
||||
log.info("车辆电子围栏事件",vehicleDate.getVin());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.fivegroup.analysis.service.impl;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.fivegroup.analysis.service.VehicleIncidentService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆的历史轨迹
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 22:28
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Log4j2
|
||||
@Service("history")
|
||||
public class VehicleHistoryIncidentServiceImpl implements VehicleIncidentService {
|
||||
private final RedisService redisService;
|
||||
|
||||
/**
|
||||
* 车辆的历史轨迹
|
||||
* @param vehicleDate
|
||||
*/
|
||||
@Override
|
||||
public void execute(VehicleData vehicleDate) {
|
||||
log.info("车辆的历史轨迹+[{}]",vehicleDate.getVin());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.fivegroup.analysis.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fivegroup.common.redis.service.RedisService;
|
||||
import com.fivegroup.analysis.domain.VehicleData;
|
||||
import com.fivegroup.analysis.service.VehicleIncidentService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 车辆实时数据
|
||||
*
|
||||
* @author ZhangXushuo
|
||||
* @version 2023/11/30 - 22:32
|
||||
*/
|
||||
@Service("incident")
|
||||
@Log4j2
|
||||
@AllArgsConstructor
|
||||
public class VehicleRealIncidentServiceImpl implements VehicleIncidentService {
|
||||
private final RedisService redisService;
|
||||
private static final String MD5_KEY = "MD5_KEY";
|
||||
|
||||
@Override
|
||||
public void execute(VehicleData vehicleDate) {
|
||||
Long along = redisService.redisTemplate.opsForList().leftPush(vehicleDate.getVin() + ""+ MD5_KEY, JSONObject.toJSONString(vehicleDate));
|
||||
if(along>0){
|
||||
log.info("车辆实时数据",vehicleDate.getVin());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.fivegroup.analysis.mapper.VehicleHistoryIncidentMapper">
|
||||
|
||||
<select id="vehicleInsert">
|
||||
INSERT INTO t_vehicle`
|
||||
(`vin`, `create_time`, `longitude`, `latitude`, `speed`, `mileage`, `voltage`, `current`, `resistance`, `gear`, `acceleration_pedal`, `brake_pedal`, `fuel_consumption_rate`, `motor_controller_temperature`, `motor_speed`, `motor_torque`, `motor_temperature`, `motor_voltage`, `motor_current`, `remaining_battery`, `maximum_feedback_power`, `maximum_discharge_power`, `self_check_counter`, `total_battery_current`, `total_battery_voltage`, `single_battery_max_voltage`, `single_battery_min_voltage`, `single_battery_max_temperature`, `single_battery_min_temperature`, `available_battery_capacity`, `vehicle_status`, `charging_status`, `operating_status`, `soc_status`, `charging_energy_storage_status`, `drive_motor_status`, `position_status`, `eas_status`, `ptc_status`, `eps_status`, `abs_status`, `mcu_status`, `heating_status`, `battery_status`, `battery_insulation_status`)
|
||||
VALUES
|
||||
(
|
||||
#{vin},
|
||||
#{createTime},
|
||||
#{longitude},
|
||||
#{latitude},
|
||||
#{speed},
|
||||
#{mileage},
|
||||
#{voltage},
|
||||
#{current},
|
||||
#{resistance},
|
||||
#{gear},
|
||||
#{accelerationPedal},
|
||||
#{brakePedal},
|
||||
#{fuelConsumptionRate},
|
||||
#{motorControllerTemperature},
|
||||
#{motorSpeed},
|
||||
#{motorTorque},
|
||||
#{motorTemperature},
|
||||
#{motorVoltage},
|
||||
#{motorCurrent},
|
||||
#{remainingBattery},
|
||||
#{maximumFeedbackPower},
|
||||
#{maximumDischargePower},
|
||||
#{selfCheckCounter},
|
||||
#{totalBatteryCurrent},
|
||||
#{totalBatteryVoltage},
|
||||
#{singleBatteryMaxVoltage},
|
||||
#{singleBatteryMinVoltage},
|
||||
#{singleBatteryMaxTemperature},
|
||||
#{singleBatteryMinTemperature},
|
||||
#{availableBatteryCapacity},
|
||||
#{vehicleStatus},
|
||||
#{chargingStatus},
|
||||
#{operatingStatus},
|
||||
#{socStatus},
|
||||
#{chargingEnergyStorageStatus},
|
||||
#{driveMotorStatus},
|
||||
#{positionStatus},
|
||||
#{easStatus},
|
||||
#{ptcStatus},
|
||||
#{epsStatus},
|
||||
#{absStatus},
|
||||
#{mcuStatus},
|
||||
#{heatingStatus},
|
||||
#{batteryStatus},
|
||||
#{batteryInsulationStatus}
|
||||
)
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9210
|
||||
port: 9211
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -88,9 +88,6 @@
|
|||
</dependency>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
<module>fivegroup-fault</module>
|
||||
<module>fivegroup-wall</module>
|
||||
<module>fivegroup-trajectory</module>
|
||||
<module>fivegroup-analysis</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>fivegroup-modules</artifactId>
|
||||
|
|
Loading…
Reference in New Issue