Compare commits
No commits in common. "64823b766e0ce8c6e86c8ba619b35d8366435936" and "96ce17cb1d571817678a31b19ffc4fd49e370112" have entirely different histories.
64823b766e
...
96ce17cb1d
|
@ -1,123 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>muyu-analyze</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>20</maven.compiler.source>
|
|
||||||
<maven.compiler.target>20</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.kafka</groupId>
|
|
||||||
<artifactId>kafka-clients</artifactId>
|
|
||||||
<version>2.8.0</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- mqtt -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.paho</groupId>
|
|
||||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
|
||||||
<version>1.2.5</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos Config -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Sentinel -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringBoot Actuator -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Swagger UI -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
|
||||||
<version>${swagger.fox.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Mysql Connector -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RuoYi Common DataSource -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-datasource</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RuoYi Common DataScope -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-datascope</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RuoYi Common Log -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-log</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RuoYi Common Swagger -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-common-swagger</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.muyu</groupId>
|
|
||||||
<artifactId>muyu-file-remote</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.kafka</groupId>
|
|
||||||
<artifactId>spring-kafka</artifactId>
|
|
||||||
<version>2.8.1</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
<build>
|
|
||||||
<finalName>${project.artifactId}</finalName>
|
|
||||||
<plugins>
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>repackage</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
</project>
|
|
|
@ -1,36 +0,0 @@
|
||||||
package com.muyu.analyze;
|
|
||||||
|
|
||||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
|
||||||
import com.muyu.common.security.annotation.EnableRyFeignClients;
|
|
||||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 系统模块
|
|
||||||
*
|
|
||||||
* @author muyu
|
|
||||||
*/
|
|
||||||
@EnableCustomConfig
|
|
||||||
@EnableCustomSwagger2
|
|
||||||
@EnableRyFeignClients
|
|
||||||
@SpringBootApplication
|
|
||||||
@EnableScheduling
|
|
||||||
public class MuYuAnalyzeApplication
|
|
||||||
{
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
SpringApplication.run(MuYuAnalyzeApplication.class, args);
|
|
||||||
System.out.println("(♥◠‿◠)ノ゙ 系统模块启动成功 ლ(´ڡ`ლ)゙ \n" +
|
|
||||||
" .-------. ____ __ \n" +
|
|
||||||
" | _ _ \\ \\ \\ / / \n" +
|
|
||||||
" | ( ' ) | \\ _. / ' \n" +
|
|
||||||
" |(_ o _) / _( )_ .' \n" +
|
|
||||||
" | (_,_).' __ ___(_ o _)' \n" +
|
|
||||||
" | |\\ \\ | || |(_,_)' \n" +
|
|
||||||
" | | \\ `' /| `-' / \n" +
|
|
||||||
" | | \\ / \\ / \n" +
|
|
||||||
" ''-' `'-' `-..-' ");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
package com.muyu.analyze.config;
|
|
||||||
|
|
||||||
import org.apache.kafka.clients.consumer.ConsumerConfig;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerConfig;
|
|
||||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
|
||||||
import org.apache.kafka.common.serialization.StringSerializer;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
@Configuration
|
|
||||||
public class KafkaConfig {
|
|
||||||
|
|
||||||
// Kafka Bootstrap Servers
|
|
||||||
public static final String BOOTSTRAP_SERVERS = "10.10.26.5:9092";
|
|
||||||
|
|
||||||
// 默认主题
|
|
||||||
public static final String DEFAULT_TOPIC = "test";
|
|
||||||
|
|
||||||
public static final String DEFAULT_KEY = "10001";
|
|
||||||
|
|
||||||
|
|
||||||
public static Properties properties1(){
|
|
||||||
// 1;构建 Properties 对象 存放 kafka 生产者配置信息
|
|
||||||
Properties properties1 = new Properties();
|
|
||||||
// 设置 kafka 连接地址(从配置文件/环境变量获取)
|
|
||||||
properties1.setProperty(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, KafkaConfig.BOOTSTRAP_SERVERS);
|
|
||||||
// 设置 键值 序列化
|
|
||||||
properties1.setProperty(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer .class.getName());
|
|
||||||
properties1.setProperty(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName());
|
|
||||||
|
|
||||||
return properties1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Properties properties2(){
|
|
||||||
Properties properties2 = new Properties();
|
|
||||||
properties2.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "10.10.26.5:9092");
|
|
||||||
properties2.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
|
|
||||||
properties2.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName());
|
|
||||||
properties2.setProperty(ConsumerConfig.GROUP_ID_CONFIG, "group");
|
|
||||||
|
|
||||||
return properties2;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
package com.muyu.analyze.consumer;
|
|
||||||
|
|
||||||
import com.muyu.analyze.domian.VehicleData;
|
|
||||||
import com.muyu.analyze.utils.AnalyzeUtils;
|
|
||||||
import org.springframework.kafka.annotation.KafkaListener;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类说明
|
|
||||||
*
|
|
||||||
* @author zhuwenqiang
|
|
||||||
* @date 2023/3/1
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class Consumer {
|
|
||||||
@KafkaListener(topics="test", groupId = "group",properties = {"bootstrap.servers=10.10.26.5:9092"})
|
|
||||||
public void getMessage(String message) {
|
|
||||||
|
|
||||||
VehicleData analyze = AnalyzeUtils.analyze(message);
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("kafka 消费者监听,接收到消息:" + analyze);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,281 +0,0 @@
|
||||||
package com.muyu.analyze.domian;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 牧鱼
|
|
||||||
* @Classname VehicleData
|
|
||||||
* @Description 车辆模拟数据对象
|
|
||||||
* @Date 2021/8/5
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class VehicleData {
|
|
||||||
/**
|
|
||||||
* VIN
|
|
||||||
*/
|
|
||||||
private String vin;
|
|
||||||
/**
|
|
||||||
* 毫秒值
|
|
||||||
*/
|
|
||||||
private String dateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 行驶路线
|
|
||||||
*/
|
|
||||||
private String drivingRoute;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度
|
|
||||||
*/
|
|
||||||
private String longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维度
|
|
||||||
*/
|
|
||||||
private String latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 速度
|
|
||||||
*/
|
|
||||||
private String speed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 里程
|
|
||||||
*/
|
|
||||||
private BigDecimal mileage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总电压
|
|
||||||
*/
|
|
||||||
private String voltage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总电流
|
|
||||||
*/
|
|
||||||
private String current;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绝缘电阻
|
|
||||||
*/
|
|
||||||
private String resistance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 档位
|
|
||||||
*/
|
|
||||||
private String gear = "P";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加速踏板行程值
|
|
||||||
*/
|
|
||||||
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 int vehicleStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 充电状态
|
|
||||||
*/
|
|
||||||
private int chargingStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运行状态
|
|
||||||
*/
|
|
||||||
private int operatingStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SOC
|
|
||||||
*/
|
|
||||||
private int socStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 可充电储能装置工作状态
|
|
||||||
*/
|
|
||||||
private int chargingEnergyStorageStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 驱动电机状态
|
|
||||||
*/
|
|
||||||
private int driveMotorStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定位是否有效
|
|
||||||
*/
|
|
||||||
private int positionStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAS(汽车防盗系统)状态
|
|
||||||
*/
|
|
||||||
private int easStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PTC(电动加热器)状态
|
|
||||||
*/
|
|
||||||
private int ptcStatus = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EPS(电动助力系统)状态
|
|
||||||
*/
|
|
||||||
private int epsStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ABS(防抱死)状态
|
|
||||||
*/
|
|
||||||
private int absStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MCU(电机/逆变器)状态
|
|
||||||
*/
|
|
||||||
private int mcuStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池加热状态
|
|
||||||
*/
|
|
||||||
private int heatingStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池当前状态
|
|
||||||
*/
|
|
||||||
private int batteryStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池保温状态
|
|
||||||
*/
|
|
||||||
private int batteryInsulationStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DCDC(电力交换系统)状态
|
|
||||||
*/
|
|
||||||
private int dcdcStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CHG(充电机)状态
|
|
||||||
*/
|
|
||||||
private int chgStatus = 1;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆状态 报文
|
|
||||||
*/
|
|
||||||
private String vehicleStatusMsg;
|
|
||||||
/**
|
|
||||||
* 智能硬件 报文
|
|
||||||
*/
|
|
||||||
private String smartHardwareMsg;
|
|
||||||
/**
|
|
||||||
* 电池报文
|
|
||||||
*/
|
|
||||||
private String batteryMsg;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,318 +0,0 @@
|
||||||
package com.muyu.analyze.utils;
|
|
||||||
|
|
||||||
import com.muyu.analyze.domian.VehicleData;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Stack;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: cloud-vehicles
|
|
||||||
* @PackageName: com.muyu.analyze.config
|
|
||||||
* @Description TODO
|
|
||||||
* @Author HuangDaJu
|
|
||||||
* @Date 2024/4/2 21:33
|
|
||||||
* @Version 1.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class AnalyzeUtils {
|
|
||||||
|
|
||||||
public static VehicleData analyze(String aa) {
|
|
||||||
|
|
||||||
VehicleData vehicleData = new VehicleData();
|
|
||||||
/**
|
|
||||||
* 车辆VIN private String vin;
|
|
||||||
*/
|
|
||||||
String vin = aa.substring(0, 17);
|
|
||||||
vehicleData.setVin(vin);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 毫秒值 private String dateTime;
|
|
||||||
*/
|
|
||||||
String time = aa.substring(17, 30);
|
|
||||||
vehicleData.setDateTime(time);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 行驶路线 private String drivingRoute;
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度 private String longitude;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String longitude = aa.substring(30, 41);
|
|
||||||
vehicleData.setLongitude(longitude);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 纬度 private String latitude;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String latitude = aa.substring(41, 51);
|
|
||||||
vehicleData.setLatitude(latitude);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 速度 private String speed;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String speed = aa.substring(51, 57);
|
|
||||||
vehicleData.setSpeed(speed);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 里程 private BigDecimal mileage;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String mileage = aa.substring(57, 68);
|
|
||||||
vehicleData.setMileage(new BigDecimal(mileage));
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总电压 private String voltage;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String voltage = aa.substring(68, 74);
|
|
||||||
vehicleData.setVoltage(voltage);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总电流 private String current;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String current = aa.substring(74, 79);
|
|
||||||
vehicleData.setCurrent(current);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绝缘电阻 private String resistance;
|
|
||||||
*/
|
|
||||||
String resistance = aa.substring(79, 88);
|
|
||||||
vehicleData.setResistance(resistance);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 档位 private String gear = "P";
|
|
||||||
*/
|
|
||||||
|
|
||||||
String gear = aa.substring(88, 89);
|
|
||||||
vehicleData.setGear(gear);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加速踏板行程值 private String accelerationPedal;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String accelerationPedal = aa.substring(89, 91);
|
|
||||||
vehicleData.setAccelerationPedal(accelerationPedal);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 制动踏板行程值 private String brakePedal;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String brakePedal =aa.substring(91,93);
|
|
||||||
vehicleData.setBrakePedal(brakePedal);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 燃料消耗率 private String fuelConsumptionRate;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String fuelConsumptionRate =aa.substring(93,98);
|
|
||||||
vehicleData.setFuelConsumptionRate(fuelConsumptionRate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机控制器温度private String motorControllerTemperature;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String motorControllerTemperature =aa.substring(98,104);
|
|
||||||
vehicleData.setMotorControllerTemperature(motorControllerTemperature);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机转速 private String motorSpeed;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String motorSpeed =aa.substring(104,109);
|
|
||||||
vehicleData.setMotorSpeed(motorSpeed);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机转矩 private String motorTorque;
|
|
||||||
*/
|
|
||||||
String motorTorque = aa.substring(109, 113);
|
|
||||||
vehicleData.setMotorTorque(motorTorque);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机温度 private String motorTemperature;
|
|
||||||
*/
|
|
||||||
String motorTemperature = aa.substring(113, 119);
|
|
||||||
vehicleData.setMotorTemperature(motorTemperature);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机电压 private String motorVoltage;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String motorVoltage = aa.substring(119, 124);
|
|
||||||
vehicleData.setMotorVoltage(motorVoltage);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机电流private String motorCurrent;
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// 电机电流: 10446000
|
|
||||||
String motorCurrent = aa.substring(124, 132);
|
|
||||||
vehicleData.setMotorCurrent(motorCurrent);
|
|
||||||
|
|
||||||
// 动力电池剩余电量 SOC: 44103.
|
|
||||||
/**
|
|
||||||
* 动力电池剩余电量SOC private BigDecimal remainingBattery;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String remainingBattery = aa.substring(132, 138);
|
|
||||||
vehicleData.setRemainingBattery(new BigDecimal(remainingBattery));
|
|
||||||
|
|
||||||
|
|
||||||
// 当前状态允许的最大反馈功率: 400000
|
|
||||||
/**
|
|
||||||
* 当前状态允许的最大反馈功率private String maximumFeedbackPower;
|
|
||||||
*/
|
|
||||||
String maximumFeedbackPower = aa.substring(138, 144);
|
|
||||||
vehicleData.setMaximumFeedbackPower(maximumFeedbackPower);
|
|
||||||
|
|
||||||
|
|
||||||
// 当前状态允许最大放电功率: 130000
|
|
||||||
/**
|
|
||||||
* 当前状态允许最大放电功率 private String maximumDischargePower;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String maximumDischargePower = aa.substring(144, 150);
|
|
||||||
vehicleData.setMaximumDischargePower(maximumDischargePower);
|
|
||||||
|
|
||||||
|
|
||||||
// BMS 自检计数器: 20
|
|
||||||
/**
|
|
||||||
* BMS自检计数器private String selfCheckCounter;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String selfCheckCounter = aa.substring(150, 152);
|
|
||||||
vehicleData.setSelfCheckCounter(selfCheckCounter);
|
|
||||||
// 动力电池充放电电流: 00000
|
|
||||||
/**
|
|
||||||
* 动力电池充放电电流 private String totalBatteryCurrent;
|
|
||||||
*/
|
|
||||||
String totalBatteryCurrent = aa.substring(152, 157);
|
|
||||||
vehicleData.setTotalBatteryCurrent(totalBatteryCurrent);
|
|
||||||
|
|
||||||
|
|
||||||
// 动力电池负载端总电压 V3: 605000
|
|
||||||
/**
|
|
||||||
* 动力电池负载端总电压V3 private String totalBatteryVoltage;
|
|
||||||
*/
|
|
||||||
String totalBatteryVoltage = aa.substring(157, 163);
|
|
||||||
vehicleData.setTotalBatteryVoltage(totalBatteryVoltage);
|
|
||||||
|
|
||||||
// 单次最大电压: 4000
|
|
||||||
/**
|
|
||||||
* 单次最大电压 private String singleBatteryMaxVoltage;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String singleBatteryMaxVoltage = aa.substring(163, 167);
|
|
||||||
vehicleData.setSingleBatteryMaxVoltage(singleBatteryMaxVoltage);
|
|
||||||
|
|
||||||
// 单体电池最低电压: 3000
|
|
||||||
/**
|
|
||||||
* 单体电池最低电压 private String singleBatteryMinVoltage;
|
|
||||||
*/
|
|
||||||
|
|
||||||
String singleBatteryMinVoltage = aa.substring(167, 171);
|
|
||||||
vehicleData.setSingleBatteryMinVoltage(singleBatteryMinVoltage);
|
|
||||||
|
|
||||||
// 单体电池最高温度: 650000
|
|
||||||
/**
|
|
||||||
* 单体电池最高温度 private String singleBatteryMaxTemperature;
|
|
||||||
*/
|
|
||||||
String singleBatteryMaxTemperature = aa.substring(171, 177);
|
|
||||||
vehicleData.setSingleBatteryMaxTemperature(singleBatteryMaxTemperature);
|
|
||||||
|
|
||||||
// 单体电池最低温度: 600000
|
|
||||||
/**
|
|
||||||
* 单体电池最低温度 private String singleBatteryMinTemperature;
|
|
||||||
*/
|
|
||||||
String singleBatteryMinTemperature = aa.substring(177, 183);
|
|
||||||
vehicleData.setSingleBatteryMinTemperature(singleBatteryMinTemperature);
|
|
||||||
|
|
||||||
// 动力电池可用容量: 530000
|
|
||||||
/**
|
|
||||||
* 动力电池可用容量 private String availableBatteryCapacity;
|
|
||||||
*/
|
|
||||||
String availableBatteryCapacity = aa.substring(183, 189);
|
|
||||||
vehicleData.setAvailableBatteryCapacity(availableBatteryCapacity);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 车辆状态: 0
|
|
||||||
String vehicleStatus = aa.substring(189, 190);
|
|
||||||
vehicleData.setVehicleStatus(Integer.parseInt(vehicleStatus));
|
|
||||||
|
|
||||||
// 充电状态: 1
|
|
||||||
String chargingStatus = aa.substring(190, 191);
|
|
||||||
vehicleData.setChargingStatus(Integer.parseInt(chargingStatus));
|
|
||||||
// 运行状态: 1
|
|
||||||
String operatingStatus = aa.substring(191, 192);
|
|
||||||
vehicleData.setOperatingStatus(Integer.parseInt(operatingStatus));
|
|
||||||
|
|
||||||
// SOC: 1
|
|
||||||
String socStatus = aa.substring(192, 193);
|
|
||||||
vehicleData.setSocStatus(Integer.parseInt(socStatus));
|
|
||||||
|
|
||||||
// 可充电储能装置工作状态: 0
|
|
||||||
String chargingEnergyStorageStatus = aa.substring(193, 194);
|
|
||||||
vehicleData.setChargingEnergyStorageStatus(Integer.parseInt(chargingEnergyStorageStatus));
|
|
||||||
|
|
||||||
// 驱动电机状态: 1
|
|
||||||
String driveMotorStatus = aa.substring(194, 195);
|
|
||||||
vehicleData.setDriveMotorStatus(Integer.parseInt(driveMotorStatus));
|
|
||||||
|
|
||||||
// 定位是否有效: 1
|
|
||||||
String positionStatus = aa.substring(195, 196);
|
|
||||||
vehicleData.setPositionStatus(Integer.parseInt(positionStatus));
|
|
||||||
|
|
||||||
// EAS: 1
|
|
||||||
String easStatus = aa.substring(196, 197);
|
|
||||||
vehicleData.setEasStatus(Integer.parseInt(easStatus));
|
|
||||||
|
|
||||||
// PTC: 1
|
|
||||||
String ptcStatus = aa.substring(197, 198);
|
|
||||||
vehicleData.setPtcStatus(Integer.parseInt(ptcStatus));
|
|
||||||
|
|
||||||
// EPS: 1
|
|
||||||
String epsStatus = aa.substring(198, 199);
|
|
||||||
vehicleData.setEpsStatus(Integer.parseInt(epsStatus));
|
|
||||||
|
|
||||||
// ABS: 1
|
|
||||||
String absStatus = aa.substring(199, 200);
|
|
||||||
vehicleData.setAbsStatus(Integer.parseInt(absStatus));
|
|
||||||
|
|
||||||
// MCU: 1
|
|
||||||
String mcuStatus = aa.substring(200, 201);
|
|
||||||
vehicleData.setMcuStatus(Integer.parseInt(mcuStatus));
|
|
||||||
|
|
||||||
// 动力电池加热状态: 1
|
|
||||||
String heatingStatus = aa.substring(201, 202);
|
|
||||||
vehicleData.setHeatingStatus(Integer.parseInt(heatingStatus));
|
|
||||||
|
|
||||||
// 动力电池当前状态: 1
|
|
||||||
String batteryStatus = aa.substring(202, 203);
|
|
||||||
vehicleData.setBatteryStatus(Integer.parseInt(batteryStatus));
|
|
||||||
|
|
||||||
// 动力电池保温状态: 1
|
|
||||||
String batteryInsulationStatus = aa.substring(203, 204);
|
|
||||||
vehicleData.setBatteryInsulationStatus(Integer.parseInt(batteryInsulationStatus));
|
|
||||||
|
|
||||||
// DCDC: 1
|
|
||||||
String dcdcStatus = aa.substring(204, 205);
|
|
||||||
vehicleData.setDcdcStatus(Integer.parseInt(dcdcStatus));
|
|
||||||
|
|
||||||
// CHG: 1
|
|
||||||
String chgStatus = aa.substring(205, 206);
|
|
||||||
vehicleData.setChgStatus(Integer.parseInt(chgStatus));
|
|
||||||
System.out.println(vehicleData);
|
|
||||||
return vehicleData;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,36 +0,0 @@
|
||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9008
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: muyu-analyze
|
|
||||||
profiles:
|
|
||||||
# 环境配置
|
|
||||||
active: dev
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: 10.10.26.1:8848
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: 10.10.26.1:8848
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
||||||
# Kafka
|
|
||||||
kafka:
|
|
||||||
producer:
|
|
||||||
key-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
||||||
value-serializer: org.apache.kafka.common.serialization.StringSerializer
|
|
||||||
bootstrap-servers: 10.10.26.5:9092
|
|
||||||
consumer:
|
|
||||||
group-id: group
|
|
||||||
key-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
||||||
value-deserializer: org.apache.kafka.common.serialization.StringDeserializer
|
|
||||||
#kafka:
|
|
||||||
# topic: test
|
|
|
@ -1,140 +0,0 @@
|
||||||
package com.muyu.business.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
|
||||||
import com.muyu.business.domain.req.*;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.*;
|
|
||||||
import org.springframework.format.annotation.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志对象
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@ApiModel("故障日志对象")
|
|
||||||
@TableName("fault_logs")
|
|
||||||
public class FaultLogs implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/** 故障日志主键*/
|
|
||||||
@TableId(type = IdType.AUTO)
|
|
||||||
@ApiModelProperty("故障日志主键")
|
|
||||||
private Long logId;
|
|
||||||
|
|
||||||
/** 车辆VIN*/
|
|
||||||
@ApiModelProperty("车辆VIN")
|
|
||||||
private String carVin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障码
|
|
||||||
*/
|
|
||||||
@ApiModelProperty("故障码")
|
|
||||||
private String faultCode;
|
|
||||||
|
|
||||||
/**故障名称*/
|
|
||||||
@ApiModelProperty("故障名称")
|
|
||||||
private String faultName;
|
|
||||||
|
|
||||||
/** 是否产生报警:Y正常 N报警 */
|
|
||||||
@ApiModelProperty("是否产生报警")
|
|
||||||
private String alarmFlag;
|
|
||||||
|
|
||||||
/** 报警开始时间*/
|
|
||||||
@ApiModelProperty("报警开始时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date startAlarmTime;
|
|
||||||
|
|
||||||
/** 报警结束时间*/
|
|
||||||
@ApiModelProperty("报警结束时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date endAlarmTime;
|
|
||||||
|
|
||||||
/** 最近报警时间*/
|
|
||||||
@ApiModelProperty("最近报警时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date recentlyAlarmTime;
|
|
||||||
|
|
||||||
/** 处理时间*/
|
|
||||||
@ApiModelProperty("处理时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date disposeTime;
|
|
||||||
|
|
||||||
/** 处理人*/
|
|
||||||
private String disposeBy;
|
|
||||||
|
|
||||||
/** 处理状态(0正常 1故障 2维护中)*/
|
|
||||||
private String disposeStatus;
|
|
||||||
|
|
||||||
|
|
||||||
/** 创建者*/
|
|
||||||
@ApiModelProperty("创建者")
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/** 创建时间*/
|
|
||||||
@ApiModelProperty("创建时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/** 更新者*/
|
|
||||||
@ApiModelProperty("更新者")
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/** 更新时间*/
|
|
||||||
@ApiModelProperty("更新时间")
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/** 备注*/
|
|
||||||
@ApiModelProperty("备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
public static FaultLogs addFaultLogsReq(FaultLogsAddReq faultLogsAddReq){
|
|
||||||
return FaultLogs.builder()
|
|
||||||
.carVin(faultLogsAddReq.getCarVin())
|
|
||||||
.faultCode(faultLogsAddReq.getFaultCode())
|
|
||||||
.faultName(faultLogsAddReq.getFaultName())
|
|
||||||
.alarmFlag(faultLogsAddReq.getAlarmFlag())
|
|
||||||
.startAlarmTime(faultLogsAddReq.getStartAlarmTime())
|
|
||||||
.endAlarmTime(faultLogsAddReq.getEndAlarmTime())
|
|
||||||
.recentlyAlarmTime(faultLogsAddReq.getRecentlyAlarmTime())
|
|
||||||
.disposeTime(faultLogsAddReq.getDisposeTime())
|
|
||||||
.disposeBy(faultLogsAddReq.getDisposeBy())
|
|
||||||
.disposeStatus(faultLogsAddReq.getDisposeStatus())
|
|
||||||
.createBy(faultLogsAddReq.getCreateBy())
|
|
||||||
.createTime(faultLogsAddReq.getCreateTime())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static FaultLogs updFaultLogsReq(FaultLogsUpdReq faultLogsUpdReq){
|
|
||||||
return FaultLogs.builder()
|
|
||||||
.logId(faultLogsUpdReq.getLogId())
|
|
||||||
.carVin(faultLogsUpdReq.getCarVin())
|
|
||||||
.faultCode(faultLogsUpdReq.getFaultCode())
|
|
||||||
.faultName(faultLogsUpdReq.getFaultName())
|
|
||||||
.alarmFlag(faultLogsUpdReq.getAlarmFlag())
|
|
||||||
.startAlarmTime(faultLogsUpdReq.getStartAlarmTime())
|
|
||||||
.endAlarmTime(faultLogsUpdReq.getEndAlarmTime())
|
|
||||||
.recentlyAlarmTime(faultLogsUpdReq.getRecentlyAlarmTime())
|
|
||||||
.disposeTime(faultLogsUpdReq.getDisposeTime())
|
|
||||||
.disposeBy(faultLogsUpdReq.getDisposeBy())
|
|
||||||
.disposeStatus(faultLogsUpdReq.getDisposeStatus())
|
|
||||||
.updateBy(faultLogsUpdReq.getUpdateBy())
|
|
||||||
.updateTime(faultLogsUpdReq.getUpdateTime())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,96 +0,0 @@
|
||||||
package com.muyu.business.domain.req;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
|
||||||
import lombok.*;
|
|
||||||
import org.springframework.format.annotation.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增故障日志对象
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class FaultLogsAddReq implements Serializable {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
private String carVin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障码
|
|
||||||
*/
|
|
||||||
private String faultCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障名称
|
|
||||||
*/
|
|
||||||
private String faultName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否产生报警
|
|
||||||
*/
|
|
||||||
private String alarmFlag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警开始时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date startAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date endAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近报警时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date recentlyAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date disposeTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人
|
|
||||||
*/
|
|
||||||
private String disposeBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理状态(0正常 1故障 2维护中)
|
|
||||||
*/
|
|
||||||
private String disposeStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建者
|
|
||||||
*/
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
package com.muyu.business.domain.req;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import lombok.*;
|
|
||||||
import org.springframework.format.annotation.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志查询对象
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class FaultLogsReq implements Serializable {
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
private String carVin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障码
|
|
||||||
*/
|
|
||||||
private String faultCode;
|
|
||||||
|
|
||||||
/**故障名称*/
|
|
||||||
private String faultName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警开始时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date startAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date endAlarmTime;
|
|
||||||
}
|
|
|
@ -1,100 +0,0 @@
|
||||||
package com.muyu.business.domain.req;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
|
||||||
import lombok.*;
|
|
||||||
import org.springframework.format.annotation.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑故障日志对象
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class FaultLogsUpdReq implements Serializable {
|
|
||||||
/**
|
|
||||||
* 故障日志主键
|
|
||||||
*/
|
|
||||||
private Long logId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
private String carVin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障码
|
|
||||||
*/
|
|
||||||
private String faultCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障名称
|
|
||||||
*/
|
|
||||||
private String faultName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否产生报警
|
|
||||||
*/
|
|
||||||
private String alarmFlag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警开始时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date startAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date endAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近报警时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date recentlyAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date disposeTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人
|
|
||||||
*/
|
|
||||||
private String disposeBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理状态(0正常 1故障 2维护中)
|
|
||||||
*/
|
|
||||||
private String disposeStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新者
|
|
||||||
*/
|
|
||||||
private String updateBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 备注
|
|
||||||
*/
|
|
||||||
private String remark;
|
|
||||||
}
|
|
|
@ -1,75 +0,0 @@
|
||||||
package com.muyu.business.domain.res;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.*;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.*;
|
|
||||||
import org.springframework.format.annotation.*;
|
|
||||||
|
|
||||||
import java.io.*;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志响应对象
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
public class FaultLogsResponse implements Serializable {
|
|
||||||
/**
|
|
||||||
* 车辆VIN
|
|
||||||
*/
|
|
||||||
private String carVin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障码
|
|
||||||
*/
|
|
||||||
private Long faultId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否产生报警
|
|
||||||
*/
|
|
||||||
private String alarmFlag;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警开始时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date startAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报警结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date endAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近报警时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date recentlyAlarmTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
|
||||||
private Date disposeTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理人
|
|
||||||
*/
|
|
||||||
private String disposeBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理状态(0正常 1故障 2维护中)
|
|
||||||
*/
|
|
||||||
private String disposeStatus;
|
|
||||||
}
|
|
|
@ -11,7 +11,6 @@ import com.muyu.system.common.domain.FaultCodeInfo;
|
||||||
import com.muyu.system.common.domain.req.FaultCodeReq;
|
import com.muyu.system.common.domain.req.FaultCodeReq;
|
||||||
import com.muyu.system.common.domain.req.FaultCodesAddReq;
|
import com.muyu.system.common.domain.req.FaultCodesAddReq;
|
||||||
import com.muyu.system.common.domain.req.FaultCodesUpdReq;
|
import com.muyu.system.common.domain.req.FaultCodesUpdReq;
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.beans.factory.annotation.*;
|
import org.springframework.beans.factory.annotation.*;
|
||||||
import org.springframework.validation.annotation.*;
|
import org.springframework.validation.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -24,8 +23,6 @@ import java.util.*;
|
||||||
* @author Li YongJie
|
* @author Li YongJie
|
||||||
* @date 2024-03-28
|
* @date 2024-03-28
|
||||||
*/
|
*/
|
||||||
@Api(tags = "故障码管理")
|
|
||||||
@ApiModel(description = "故障码Controller")
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/faultCodes")
|
@RequestMapping("/faultCodes")
|
||||||
public class FaultCodesController extends BaseController {
|
public class FaultCodesController extends BaseController {
|
||||||
|
@ -39,7 +36,6 @@ public class FaultCodesController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 查询故障码列表
|
* 查询故障码列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation("故障码列表")
|
|
||||||
@RequiresPermissions("business:faultCodes:list")
|
@RequiresPermissions("business:faultCodes:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo> list(FaultCodeReq faultCodes) {
|
public Result<TableDataInfo> list(FaultCodeReq faultCodes) {
|
||||||
|
@ -51,7 +47,6 @@ public class FaultCodesController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 新增故障码
|
* 新增故障码
|
||||||
*/
|
*/
|
||||||
@ApiOperation("新增故障码")
|
|
||||||
@RequiresPermissions("business:faultCodes:add")
|
@RequiresPermissions("business:faultCodes:add")
|
||||||
@Log(title = "故障码", businessType = BusinessType.INSERT)
|
@Log(title = "故障码", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@ -62,7 +57,6 @@ public class FaultCodesController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 获取故障码详细信息
|
* 获取故障码详细信息
|
||||||
*/
|
*/
|
||||||
@ApiOperation("获取故障码详细信息")
|
|
||||||
@RequiresPermissions("business:faultCodes:query")
|
@RequiresPermissions("business:faultCodes:query")
|
||||||
@GetMapping(value = "/{faultId}")
|
@GetMapping(value = "/{faultId}")
|
||||||
public Result getInfo(@PathVariable("faultId") Long faultId) {
|
public Result getInfo(@PathVariable("faultId") Long faultId) {
|
||||||
|
@ -72,7 +66,6 @@ public class FaultCodesController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改故障码
|
* 修改故障码
|
||||||
*/
|
*/
|
||||||
@ApiOperation("修改故障码")
|
|
||||||
@RequiresPermissions("business:faultCodes:edit")
|
@RequiresPermissions("business:faultCodes:edit")
|
||||||
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
@ -83,7 +76,6 @@ public class FaultCodesController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改故障码状态
|
* 修改故障码状态
|
||||||
*/
|
*/
|
||||||
@ApiOperation("修改故障码状态")
|
|
||||||
@RequiresPermissions("business:faultCodes:edit")
|
@RequiresPermissions("business:faultCodes:edit")
|
||||||
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
@Log(title = "故障码", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/changeStatus")
|
@PutMapping("/changeStatus")
|
||||||
|
@ -94,7 +86,6 @@ public class FaultCodesController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 删除故障码
|
* 删除故障码
|
||||||
*/
|
*/
|
||||||
@ApiOperation("删除故障码")
|
|
||||||
@RequiresPermissions("business:faultCodes:remove")
|
@RequiresPermissions("business:faultCodes:remove")
|
||||||
@Log(title = "故障码", businessType = BusinessType.DELETE)
|
@Log(title = "故障码", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{faultIds}")
|
@DeleteMapping("/{faultIds}")
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
package com.muyu.business.controller;
|
|
||||||
|
|
||||||
import com.muyu.business.domain.*;
|
|
||||||
import com.muyu.business.domain.req.*;
|
|
||||||
import com.muyu.business.service.*;
|
|
||||||
import com.muyu.common.core.domain.*;
|
|
||||||
import com.muyu.common.core.web.controller.*;
|
|
||||||
import com.muyu.common.core.web.page.*;
|
|
||||||
import com.muyu.common.log.annotation.*;
|
|
||||||
import com.muyu.common.log.enums.*;
|
|
||||||
import com.muyu.common.security.annotation.*;
|
|
||||||
import io.swagger.annotations.*;
|
|
||||||
import org.springframework.beans.factory.annotation.*;
|
|
||||||
import org.springframework.validation.annotation.*;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障码日志Controller
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Api(tags = "故障日志管理")
|
|
||||||
@ApiModel(description = "故障日志Controller")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/faultLogs")
|
|
||||||
public class FaultLogsController extends BaseController {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注入故障日志Service
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private FaultLogsService faultLogsService;
|
|
||||||
|
|
||||||
@ApiOperation("故障日志列表")
|
|
||||||
@RequiresPermissions("business:faultLogs:list")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public Result<TableDataInfo> list(FaultLogsReq faultLogsReq) {
|
|
||||||
startPage();
|
|
||||||
List<FaultLogs> list = faultLogsService.selectFaultLogsList(faultLogsReq);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增故障日志
|
|
||||||
*/
|
|
||||||
@ApiOperation("新增故障日志")
|
|
||||||
@RequiresPermissions("business:faultLogs:add")
|
|
||||||
@Log(title = "故障日志", businessType = BusinessType.INSERT)
|
|
||||||
@PostMapping
|
|
||||||
public Result add(@RequestBody @Validated FaultLogsAddReq faultLogsAddReq) {
|
|
||||||
return toAjax(faultLogsService.insertFaultLogs(FaultLogs.addFaultLogsReq(faultLogsAddReq)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志详情
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "故障日志详情",hidden = true)
|
|
||||||
@RequiresPermissions("business:faultLogs:query")
|
|
||||||
@GetMapping("/{logId}")
|
|
||||||
public Result detail(@ApiParam(value = "故障日志主键") @PathVariable("logId") Long logId) {
|
|
||||||
return Result.success(faultLogsService.selectFaultLogsById(logId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改故障日志
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改故障日志",hidden = true)
|
|
||||||
@RequiresPermissions("business:faultLogs:edit")
|
|
||||||
@Log(title = "故障日志", businessType = BusinessType.UPDATE)
|
|
||||||
@PutMapping
|
|
||||||
public Result edit(@RequestBody @Validated FaultLogsUpdReq faultLogsUpdReq) {
|
|
||||||
return toAjax(faultLogsService.updateFaultLogs(FaultLogs.updFaultLogsReq(faultLogsUpdReq)));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除故障日志
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除故障日志",hidden = true)
|
|
||||||
@RequiresPermissions("business:faultLogs:remove")
|
|
||||||
@Log(title = "故障日志", businessType = BusinessType.DELETE)
|
|
||||||
@DeleteMapping("/{logIds}")
|
|
||||||
public Result remove(@ApiParam(value = "故障日志Id", required = true) @PathVariable("logIds") Long[] logIds) {
|
|
||||||
return toAjax(faultLogsService.deleteFaultLogsByIds(logIds));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.muyu.business.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.*;
|
|
||||||
import com.muyu.business.domain.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志Mapper接口
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
public interface FaultLogsMapper extends BaseMapper<FaultLogs> {
|
|
||||||
}
|
|
|
@ -1,63 +0,0 @@
|
||||||
package com.muyu.business.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.*;
|
|
||||||
import com.muyu.business.domain.*;
|
|
||||||
import com.muyu.business.domain.req.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志Service接口
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
public interface FaultLogsService extends IService<FaultLogs> {
|
|
||||||
/**
|
|
||||||
* 故障日志列表
|
|
||||||
*
|
|
||||||
* @param faultLogsReq
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<FaultLogs> selectFaultLogsList(FaultLogsReq faultLogsReq);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增故障日志
|
|
||||||
*
|
|
||||||
* @param faultLogs
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int insertFaultLogs(FaultLogs faultLogs);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志详情
|
|
||||||
*
|
|
||||||
* @param logId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
FaultLogs selectFaultLogsById(Long logId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑故障日志
|
|
||||||
*
|
|
||||||
* @param faultLogs
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int updateFaultLogs(FaultLogs faultLogs);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除故障日志
|
|
||||||
*
|
|
||||||
* @param logId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int deleteFaultLogsById(Long logId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除故障日志
|
|
||||||
*
|
|
||||||
* @param logIds
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int deleteFaultLogsByIds(Long[] logIds);
|
|
||||||
}
|
|
|
@ -1,84 +0,0 @@
|
||||||
package com.muyu.business.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.*;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.*;
|
|
||||||
import com.muyu.business.domain.*;
|
|
||||||
import com.muyu.business.domain.req.*;
|
|
||||||
import com.muyu.business.mapper.*;
|
|
||||||
import com.muyu.business.service.*;
|
|
||||||
import com.muyu.common.core.utils.*;
|
|
||||||
import com.muyu.common.security.utils.*;
|
|
||||||
import lombok.extern.slf4j.*;
|
|
||||||
import org.springframework.beans.factory.annotation.*;
|
|
||||||
import org.springframework.stereotype.*;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 故障日志Service业务层处理
|
|
||||||
*
|
|
||||||
* @Author LiYonJie
|
|
||||||
* @Date 2024/3/30
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class FaultLogsServiceImpl extends ServiceImpl<FaultLogsMapper, FaultLogs>
|
|
||||||
implements FaultLogsService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注入故障日志mapper
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private FaultLogsMapper faultLogsMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<FaultLogs> selectFaultLogsList(FaultLogsReq faultLogsReq) {
|
|
||||||
LambdaQueryWrapper<FaultLogs> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.like(StringUtils.isNotEmpty(faultLogsReq.getCarVin()), FaultLogs::getCarVin, faultLogsReq.getCarVin());
|
|
||||||
wrapper.eq(StringUtils.isNotNull(faultLogsReq.getFaultCode()), FaultLogs::getFaultCode, faultLogsReq.getFaultCode());
|
|
||||||
wrapper.like(StringUtils.isNotEmpty(faultLogsReq.getFaultName()), FaultLogs::getFaultName, faultLogsReq.getFaultName());
|
|
||||||
Date startAlarmTime = DateUtils.parseDate(faultLogsReq.getStartAlarmTime());
|
|
||||||
Date endAlarmTime = DateUtils.parseDate(faultLogsReq.getEndAlarmTime());
|
|
||||||
// wrapper.gt(StringUtils.isNotNull(faultLogsReq.getStartAlarmTime()), FaultLogs::getStartAlarmTime, startAlarmTime);
|
|
||||||
// wrapper.lt(StringUtils.isNotNull(faultLogsReq.getEndAlarmTime()), FaultLogs::getEndAlarmTime, endAlarmTime);
|
|
||||||
log.info("----------------------",startAlarmTime, ";-------------" + endAlarmTime);
|
|
||||||
wrapper.apply(StringUtils.isNotNull(startAlarmTime),"UNIX_TIMESTAMP(start_alarm_time) >= UNIX_TIMESTAMP('" + startAlarmTime + "')");
|
|
||||||
wrapper.apply(StringUtils.isNotNull(endAlarmTime),"UNIX_TIMESTAMP(end_alarm_time) <= UNIX_TIMESTAMP('" + endAlarmTime + "')");
|
|
||||||
return faultLogsMapper.selectList(wrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int insertFaultLogs(FaultLogs faultLogs) {
|
|
||||||
faultLogs.setEndAlarmTime(null);
|
|
||||||
faultLogs.setRecentlyAlarmTime(null);
|
|
||||||
faultLogs.setDisposeTime(null);
|
|
||||||
faultLogs.setDisposeBy(null);
|
|
||||||
faultLogs.setDisposeStatus("1");
|
|
||||||
faultLogs.setAlarmFlag("N");
|
|
||||||
faultLogs.setCreateBy(SecurityUtils.getUsername());
|
|
||||||
faultLogs.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return faultLogsMapper.insert(faultLogs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public FaultLogs selectFaultLogsById(Long logId) {
|
|
||||||
return faultLogsMapper.selectById(logId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateFaultLogs(FaultLogs faultLogs) {
|
|
||||||
faultLogs.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
faultLogs.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
return faultLogsMapper.updateById(faultLogs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteFaultLogsById(Long logId) {
|
|
||||||
return faultLogsMapper.deleteById(logId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteFaultLogsByIds(Long[] logIds) {
|
|
||||||
return faultLogsMapper.deleteBatchIds(Arrays.asList(logIds));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
<?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">
|
|
||||||
<!-- mybatis数据层 namespace命名空间-->
|
|
||||||
<mapper namespace="com.muyu.business.mapper.FaultLogsMapper">
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
14
pom.xml
14
pom.xml
|
@ -47,7 +47,6 @@
|
||||||
<muyu-business-common.version>3.6.3</muyu-business-common.version>
|
<muyu-business-common.version>3.6.3</muyu-business-common.version>
|
||||||
<muyu-business-remote.version>3.6.3</muyu-business-remote.version>
|
<muyu-business-remote.version>3.6.3</muyu-business-remote.version>
|
||||||
<muyu-business-server.version>3.6.3</muyu-business-server.version>
|
<muyu-business-server.version>3.6.3</muyu-business-server.version>
|
||||||
<muyu-analyze.version>3.6.3</muyu-analyze.version>
|
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
@ -277,11 +276,11 @@
|
||||||
<!-- <artifactId>muyu-search-remote</artifactId>-->
|
<!-- <artifactId>muyu-search-remote</artifactId>-->
|
||||||
<!-- <version>${muyu.version}</version>-->
|
<!-- <version>${muyu.version}</version>-->
|
||||||
<!-- </dependency>-->
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>com.muyu</groupId>
|
<!-- <groupId>com.muyu</groupId>-->
|
||||||
<artifactId>muyu-analyze</artifactId>
|
<!-- <artifactId>muyu-search-server</artifactId>-->
|
||||||
<version>${muyu.version}</version>
|
<!-- <version>${muyu.version}</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
@ -291,9 +290,6 @@
|
||||||
<module>muyu-visual</module>
|
<module>muyu-visual</module>
|
||||||
<module>muyu-modules</module>
|
<module>muyu-modules</module>
|
||||||
<module>muyu-common</module>
|
<module>muyu-common</module>
|
||||||
<module>muyu-analyze</module>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
Loading…
Reference in New Issue