Compare commits
No commits in common. "dev.parse.data" and "master" have entirely different histories.
dev.parse.
...
master
|
@ -1,32 +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>cloud-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<description>
|
||||
cloud-common-cache 缓存基准
|
||||
</description>
|
||||
|
||||
<artifactId>cloud-common-cache</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>23</maven.compiler.source>
|
||||
<maven.compiler.target>23</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- redis 缓存模块-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-redis</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,63 +0,0 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 抽象缓存层
|
||||
* * @className: CacheAbsBasic ️✈️
|
||||
* * @author: Yang 鹏 🦅
|
||||
* * @date: 2024/9/29 16:08 ⏰
|
||||
* * @Version: 1.0
|
||||
* * @description:
|
||||
*/
|
||||
public abstract class CacheAbsBasic <K, V> implements CacheBasic<K, V>{
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
@Override
|
||||
public void put(K key, V value) {
|
||||
|
||||
try {
|
||||
redisService.setCacheObject(encode(key), value,30L,TimeUnit.MINUTES);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("运行时异常,异常信息为:{}"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public V get(K key) {
|
||||
|
||||
try {
|
||||
return redisService.getCacheObject(encode(key));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("运行时异常,异常信息为:{}"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(K key) {
|
||||
|
||||
try {
|
||||
redisService.deleteObject(encode(key));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("运行时异常,异常信息为:{}"+e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hashKey(K key){
|
||||
Boolean b = false;
|
||||
|
||||
try {
|
||||
b = redisService.hasKey(encode(key));
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException("运行时异常,异常信息为:{}"+e.getMessage());
|
||||
}
|
||||
return b;
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
import org.springframework.data.redis.core.TimeoutUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 缓存基础
|
||||
* * @className: CacheBasic ️✈️
|
||||
* * @author: Yang 鹏 🦅
|
||||
* * @date: 2024/9/29 16:08 ⏰
|
||||
* * @Version: 1.0
|
||||
* * @description:
|
||||
*/
|
||||
public interface CacheBasic<K,V> extends PrimaryKeyBasic<K>{
|
||||
void put(K key, V value);
|
||||
|
||||
V get(K key);
|
||||
|
||||
void remove(K key);
|
||||
|
||||
boolean hashKey(K key);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
/**
|
||||
* 主键基础
|
||||
* * @className: PrimaryKeyBasic ️✈️
|
||||
* * @author: Yang 鹏 🦅
|
||||
* * @date: 2024/9/29 16:08 ⏰
|
||||
* * @Version: 1.0
|
||||
* * @description:
|
||||
*/
|
||||
public interface PrimaryKeyBasic <K>{
|
||||
|
||||
/**
|
||||
* 主键前缀
|
||||
* @return
|
||||
*/
|
||||
public String keyPre();
|
||||
|
||||
/**
|
||||
* 主键编码
|
||||
* @param key 缓存建
|
||||
* @return 装修建
|
||||
*/
|
||||
public default String encode(K key){
|
||||
return keyPre() + key.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 主键解码
|
||||
* @param key 缓存建
|
||||
* @return 装修建
|
||||
*/
|
||||
public default K decode(String key) {
|
||||
return (K) key.substring(keyPre().length());
|
||||
}
|
||||
}
|
|
@ -20,10 +20,4 @@ public class ServiceNameConstants {
|
|||
* 文件服务的serviceid
|
||||
*/
|
||||
public static final String FILE_SERVICE = "cloud-file";
|
||||
|
||||
/**
|
||||
* 车辆服务的serviceid
|
||||
*/
|
||||
public static final String ENTERPRISE_SERVICE = "cloud-saas";
|
||||
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import com.github.pagehelper.PageInfo;
|
|||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.common.core.utils.PageUtils;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -20,7 +19,7 @@ import java.util.List;
|
|||
*
|
||||
* @author muyu
|
||||
*/
|
||||
public class BaseController<M extends BaseEntity> {
|
||||
public class BaseController {
|
||||
protected final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,34 +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>cloud-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-common-kafka</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- 项目公共核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- kafka客户端 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -1,102 +0,0 @@
|
|||
package com.muyu.common.kafka.config;
|
||||
|
||||
import com.muyu.common.core.text.StrFormatter;
|
||||
import com.muyu.common.kafka.constant.KafkaConfigConstants;
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import org.apache.kafka.common.serialization.Deserializer;
|
||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Author: wangXin
|
||||
* @Date 2024/9/28 20:32
|
||||
* @Description Kafka消费者配置
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaConsumerConfig {
|
||||
|
||||
/**
|
||||
* 服务端IP
|
||||
*/
|
||||
@Value("${kafka.consumer.bootstrap-servers-ip}")
|
||||
private String bootstrapServersIP;
|
||||
|
||||
/**
|
||||
* 服务端口号
|
||||
*/
|
||||
@Value("${kafka.consumer.bootstrap-servers-port}")
|
||||
private String bootstrapServersPort;
|
||||
|
||||
/**
|
||||
* 开启消费者偏移量
|
||||
*/
|
||||
@Value("${kafka.consumer.enable-auto-commit}")
|
||||
private Boolean enableAutoCommit;
|
||||
|
||||
/**
|
||||
* 自动提交时间间隔
|
||||
*/
|
||||
@Value("${kafka.consumer.auto-commit-interval}")
|
||||
private Integer autoCommitInterval;
|
||||
|
||||
/**
|
||||
* 自动重置偏移量
|
||||
*/
|
||||
@Value("${kafka.consumer.auto-offset-reset}")
|
||||
private String autoOffsetReset;
|
||||
|
||||
/**
|
||||
* 请求阻塞的最大时间
|
||||
*/
|
||||
@Value("${kafka.consumer.fetch-max-wait}")
|
||||
private Integer fetchMaxWait;
|
||||
|
||||
/**
|
||||
* 请求应答的最小字节数
|
||||
*/
|
||||
@Value("${kafka.consumer.fetch-min-size}")
|
||||
private Integer fetchMinSize;
|
||||
|
||||
/**
|
||||
* 心跳间隔时间
|
||||
*/
|
||||
@Value("${kafka.consumer.heartbeat-interval}")
|
||||
private Integer heartbeatInterval;
|
||||
|
||||
/**
|
||||
* 一次调用poll返回的最大记录条数
|
||||
*/
|
||||
@Value("${kafka.consumer.max-poll-records}")
|
||||
private Integer maxPollRecords;
|
||||
|
||||
/**
|
||||
* 指定消费组
|
||||
*/
|
||||
@Value("${kafka.consumer.group-id}")
|
||||
private String groupId;
|
||||
|
||||
/**
|
||||
* Kafka消费者初始化配置
|
||||
* @return Kafka消费者实例
|
||||
*/
|
||||
@Bean
|
||||
public KafkaConsumer<String, String> kafkaConsumer() {
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put(KafkaConfigConstants.BOOTSTRAP_SERVERS,
|
||||
StrFormatter.format("{}:{}", bootstrapServersIP, bootstrapServersPort));
|
||||
configs.put(KafkaConfigConstants.ENABLE_AUTO_COMMIT, enableAutoCommit);
|
||||
configs.put(KafkaConfigConstants.AUTO_COMMIT_INTERVAL, autoCommitInterval);
|
||||
configs.put(KafkaConfigConstants.AUTO_OFFSET_RESET, autoOffsetReset);
|
||||
configs.put(KafkaConfigConstants.FETCH_MAX_WAIT, fetchMaxWait);
|
||||
configs.put(KafkaConfigConstants.FETCH_MIN_SIZE, fetchMinSize);
|
||||
configs.put(KafkaConfigConstants.HEARTBEAT_INTERVAL, heartbeatInterval);
|
||||
configs.put(KafkaConfigConstants.MAX_POLL_RECORDS, maxPollRecords);
|
||||
configs.put(KafkaConfigConstants.GROUP_ID, groupId);
|
||||
Deserializer<String> keyDeserializer = new StringDeserializer();
|
||||
Deserializer<String> valueDeserializer = new StringDeserializer();
|
||||
return new KafkaConsumer<>(configs, keyDeserializer, valueDeserializer);
|
||||
}
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.common.kafka.config;
|
||||
|
||||
import com.muyu.common.core.text.StrFormatter;
|
||||
import com.muyu.common.kafka.constant.KafkaConfigConstants;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.common.serialization.Serializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Author: wangXin
|
||||
* @Date 2024/9/28 16:35
|
||||
* @Description Kafka生产者配置
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaProducerConfig {
|
||||
|
||||
/**
|
||||
* 服务端IP
|
||||
*/
|
||||
@Value("${kafka.producer.bootstrap-servers-ip}")
|
||||
private String bootstrapServersIP;
|
||||
|
||||
/**
|
||||
* 服务端口号
|
||||
*/
|
||||
@Value("${kafka.producer.bootstrap-servers-port}")
|
||||
private String bootstrapServersPort;
|
||||
|
||||
/**
|
||||
* 重试次数
|
||||
*/
|
||||
@Value("${kafka.producer.retries}")
|
||||
private Integer retries;
|
||||
|
||||
/**
|
||||
* 默认批量大小
|
||||
*/
|
||||
@Value("${kafka.producer.batch-size}")
|
||||
private Integer batchSize;
|
||||
|
||||
/**
|
||||
* 总内存字节数
|
||||
*/
|
||||
@Value("${kafka.producer.buffer-memory}")
|
||||
private Integer bufferMemory;
|
||||
|
||||
/**
|
||||
* 偏移量
|
||||
*/
|
||||
@Value("${kafka.producer.acks}")
|
||||
private String acks;
|
||||
|
||||
/**
|
||||
* Kafka生产者初始化配置
|
||||
* @return kafka生产者实例
|
||||
*/
|
||||
@Bean
|
||||
public KafkaProducer<String, String> kafkaProducer() {
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put(KafkaConfigConstants.BOOTSTRAP_SERVERS,
|
||||
StrFormatter.format("{}:{}", bootstrapServersIP, bootstrapServersPort));
|
||||
configs.put(KafkaConfigConstants.RETRIES, retries);
|
||||
configs.put(KafkaConfigConstants.BATCH_SIZE, batchSize);
|
||||
configs.put(KafkaConfigConstants.BUFFER_MEMORY, bufferMemory);
|
||||
configs.put(KafkaConfigConstants.ACKS, acks);
|
||||
Serializer<String> keySerializer = new StringSerializer();
|
||||
Serializer<String> valueSerializer = new StringSerializer();
|
||||
return new KafkaProducer<>(configs, keySerializer, valueSerializer);
|
||||
}
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
package com.muyu.common.kafka.constant;
|
||||
|
||||
/**
|
||||
* @Author: wangXin
|
||||
* @Date 2024/9/28 20:07
|
||||
* @Description Kafka配置通用常量
|
||||
*/
|
||||
public class KafkaConfigConstants {
|
||||
|
||||
/**
|
||||
* 服务端ip+端口号
|
||||
*/
|
||||
public static final String BOOTSTRAP_SERVERS = "bootstrap.servers";
|
||||
|
||||
/**
|
||||
* 重试次数
|
||||
*/
|
||||
public static final String RETRIES = "retries";
|
||||
|
||||
/**
|
||||
* 默认批量大小
|
||||
*/
|
||||
public static final String BATCH_SIZE = "batch.size";
|
||||
|
||||
/**
|
||||
* 总内存字节数
|
||||
*/
|
||||
public static final String BUFFER_MEMORY = "buffer-memory";
|
||||
|
||||
/**
|
||||
* 偏移量
|
||||
*/
|
||||
public static final String ACKS = "acks";
|
||||
|
||||
/**
|
||||
* 开启消费者偏移量
|
||||
*/
|
||||
public static final String ENABLE_AUTO_COMMIT = "enable.auto.commit";
|
||||
|
||||
/**
|
||||
* 自动提交时间间隔
|
||||
*/
|
||||
public static final String AUTO_COMMIT_INTERVAL = "auto.commit.interval";
|
||||
|
||||
/**
|
||||
* 自动重置偏移量
|
||||
*/
|
||||
public static final String AUTO_OFFSET_RESET = "auto.offset.reset";
|
||||
|
||||
/**
|
||||
* 请求阻塞的最大时间
|
||||
*/
|
||||
public static final String FETCH_MAX_WAIT = "fetch.max.wait";
|
||||
|
||||
/**
|
||||
* 请求应答的最小字节数
|
||||
*/
|
||||
public static final String FETCH_MIN_SIZE = "fetch.min.size";
|
||||
|
||||
/**
|
||||
* 心跳间隔时间
|
||||
*/
|
||||
public static final String HEARTBEAT_INTERVAL = "heartbeat-interval";
|
||||
|
||||
/**
|
||||
* 一次调用poll返回的最大记录条数
|
||||
*/
|
||||
public static final String MAX_POLL_RECORDS = "max.poll.records";
|
||||
|
||||
/**
|
||||
* 指定消费组
|
||||
*/
|
||||
public static final String GROUP_ID = "group.id";
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
com.muyu.common.kafka.config.KafkaProducerConfig
|
||||
com.muyu.common.kafka.config.KafkaConsumerConfig
|
|
@ -20,8 +20,6 @@
|
|||
<module>cloud-common-system</module>
|
||||
<module>cloud-common-xxl</module>
|
||||
<module>cloud-common-rabbit</module>
|
||||
<module>cloud-common-cache</module>
|
||||
<module>cloud-common-kafka</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-common</artifactId>
|
||||
|
|
|
@ -9,13 +9,17 @@
|
|||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-parse</artifactId>
|
||||
<artifactId>cloud-modules-fault</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<description>
|
||||
cloud-modules-fault故障模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
|
@ -72,46 +76,11 @@
|
|||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <!– XllJob定时任务 –>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.muyu</groupId>-->
|
||||
<!-- <artifactId>cloud-common-xxl</artifactId>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- mqtt监控者 -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 远调 -->
|
||||
<!-- XllJob定时任务 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-remote</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
</dependency>
|
||||
<!-- 实体类 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
</dependency>
|
||||
<!-- 缓存框架 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-cache</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
<!-- kafka 公共配置 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.muyu</groupId>-->
|
||||
<!-- <artifactId>cloud-common-kafka</artifactId>-->
|
||||
<!-- <version>${muyu.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
@ -131,4 +100,6 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.Random;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* @className: SysCarFaultApplication ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/21 11:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class SysCarFaultApplication {
|
||||
public static void main (String[] args) throws ParseException {
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT+08"));
|
||||
String format = simpleDateFormat.format(new Date());
|
||||
System.out.println("故障模块启动成功"+format);
|
||||
SpringApplication.run(SysCarFaultApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.service.CarTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @className: CarTypeController ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@RequestMapping("/cartype")
|
||||
@RestController
|
||||
public class CarTypeController {
|
||||
|
||||
@Autowired
|
||||
private CarTypeService carTypeService;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "车辆类型",description = "车辆类型信息")
|
||||
public Result carTypeList(){
|
||||
return Result.success(carTypeService.selectcarType());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeListReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeUpdReq;
|
||||
import com.muyu.fault.domain.resp.FaultCodeTotalListResp;
|
||||
import com.muyu.fault.service.FaultCodeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @className: CarTypeController ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 车辆故障码
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/faultcode")
|
||||
public class FaultCodeController {
|
||||
|
||||
@Autowired
|
||||
private FaultCodeService faultCodeService;
|
||||
|
||||
/**
|
||||
* 故障码展示(仅故障码单表)
|
||||
* @param faultCodeListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(path = "/list")
|
||||
@Operation(summary = "故障码列表(单)",description = "展示故障码信息")
|
||||
public Result<FaultCodeTotalListResp> selectlist(@Validated @RequestBody FaultCodeListReq faultCodeListReq){
|
||||
return Result.success(faultCodeService.selectlist(faultCodeListReq));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
* @param faultCodeListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultcodelist")
|
||||
@Operation(summary = "故障码列表(多)",description = "展示故障码信息")
|
||||
public Result<FaultCodeTotalListResp> selectfaultcodelist(@Validated @RequestBody FaultCodeListReq faultCodeListReq){
|
||||
return Result.success(faultCodeService.selectfaultcodelist(faultCodeListReq));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增故障码
|
||||
* @param faultCodeAddReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultcodeadd")
|
||||
@Operation(summary = "新增故障码",description = "新增故障码信息")
|
||||
public Result insertfaultcode(@Validated @RequestBody FaultCodeAddReq faultCodeAddReq){
|
||||
faultCodeService.insert(faultCodeAddReq);
|
||||
return Result.success(null,"新增成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改故障码
|
||||
* @param faultCodeUpdReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultcodeupd")
|
||||
@Operation(summary = "修改故障码",description = "修改故障码信息")
|
||||
public Result updfaultcode(@Validated @RequestBody FaultCodeUpdReq faultCodeUpdReq){
|
||||
faultCodeService.upd(faultCodeUpdReq);
|
||||
return Result.success(null,"修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除故障码
|
||||
* @param messageTypeId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultcodedel/{messageTypeId}")
|
||||
@Operation(summary = "删除故障码",description = "删除故障码信息")
|
||||
public Result delfaultcode(@PathVariable("messageTypeId") Integer messageTypeId){
|
||||
faultCodeService.del(messageTypeId);
|
||||
return Result.success(null,"删除成功");
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.domain.FaultCondition;
|
||||
import com.muyu.fault.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.fault.domain.req.FaultConditionListReq;
|
||||
import com.muyu.fault.domain.req.FaultConditionUpdReq;
|
||||
import com.muyu.fault.service.FaultConditionService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: CarTypeController ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/faultcondition")
|
||||
public class FaultConditionController {
|
||||
|
||||
@Autowired
|
||||
private FaultConditionService faultConditionService;
|
||||
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @param faultConditionListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "故障规则列表展示",description = "故障规则列表展示")
|
||||
public Result getfaultrulelist(@RequestBody @Validated FaultConditionListReq faultConditionListReq){
|
||||
return Result.success(faultConditionService.getfaultrulelist(faultConditionListReq));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 故障规则添加
|
||||
* @param faultConditionAddReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultconditionadd")
|
||||
@Operation(summary = "添加规则",description = "添加故障规则")
|
||||
public Result faultconditionadd(@RequestBody FaultConditionAddReq faultConditionAddReq){
|
||||
//判断车辆类型是否已存在所对应的故障规则
|
||||
List<FaultCondition> faultConditionList = faultConditionService.selectBytypeAndlabel(faultConditionAddReq);
|
||||
if (faultConditionList.size()>0){
|
||||
return Result.error("此车辆类型已存在所对应的故障规则,无需重新制定,可在原规则上进行修改");
|
||||
}
|
||||
faultConditionService.save(FaultCondition.faultConditionadd(faultConditionAddReq));
|
||||
return Result.success(null,"规则制定成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 故障规则修改
|
||||
* @param
|
||||
* @param faultConditionUpdReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultconditionupd")
|
||||
@Operation(summary = "修改规则",description = "修改故障规则")
|
||||
public Result faultconditionupd(
|
||||
@RequestBody @Validated FaultConditionUpdReq faultConditionUpdReq){
|
||||
faultConditionService.updateById(FaultCondition.faultConditionupd(faultConditionUpdReq,()->faultConditionUpdReq.getCarconditionId()));
|
||||
return Result.success(null,"规则修改成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 故障规则删除
|
||||
* @param carconditionId
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/faultconditiondel/{carconditionId}")
|
||||
@Operation(summary = "删除规则",description = "删除故障规则")
|
||||
public Result faultconditiondel(@PathVariable("carconditionId") long carconditionId){
|
||||
faultConditionService.removeById(carconditionId);
|
||||
return Result.success(null,"规则删除成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
import com.muyu.fault.service.FaultDetectionStrategyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @className: FaultDetectionStrategyController ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 车辆故障码
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/faultdetectionstrategy")
|
||||
public class FaultDetectionStrategyController {
|
||||
|
||||
@Autowired
|
||||
private FaultDetectionStrategyService faultDetectionStrategyService;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.service.FaultLabelService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 故障码分类
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/faultlabel")
|
||||
public class FaultLabelController {
|
||||
|
||||
@Autowired
|
||||
private FaultLabelService faultLabelService;
|
||||
|
||||
|
||||
/**
|
||||
* 故障名称
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "故障名称查询",description = "故障名称信息")
|
||||
public Result findfaulttype(){
|
||||
return Result.success(faultLabelService.select());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.fault.controller;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.domain.req.FaultLogListReq;
|
||||
import com.muyu.fault.service.FaultLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/faultlog")
|
||||
public class FaultLogController {
|
||||
@Autowired
|
||||
private FaultLogService faultLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 故障日志列表
|
||||
* @param faultLogListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "故障日志列表",description = "故障日志列表展示")
|
||||
public Result selectfaultlog(@Validated @RequestBody FaultLogListReq faultLogListReq){
|
||||
return Result.success(faultLogService.selectfaultlog(faultLogListReq));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.domain.CarFaultRule;
|
||||
import com.muyu.fault.domain.FaultRule;
|
||||
import com.muyu.fault.service.FaultRuleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/faultrule")
|
||||
public class FaultRuleController {
|
||||
|
||||
@Autowired
|
||||
private FaultRuleService faultRuleService;
|
||||
|
||||
|
||||
/**
|
||||
* 车辆故障检测
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/check-faults")
|
||||
@Operation(summary = "检查故障",description = "进行故障检查")
|
||||
public Result checkfault(@Validated FaultRule faultRule){
|
||||
String checkfaults = faultRuleService.checkfaults(faultRule);
|
||||
return Result.success(checkfaults);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/cheakfaults")
|
||||
@Operation(summary = "故障参数匹配检查",description = "获取报文数据与故障参数进行比较")
|
||||
public Result cheakfaults(@Validated @RequestBody CarFaultRule carFaultRule){
|
||||
// faultRuleService.checkfaults(carFaultRule);
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.service.FaultTypeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 故障码分类
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/faulttype")
|
||||
public class FaultTypeController {
|
||||
|
||||
@Autowired
|
||||
private FaultTypeService faultTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 故障码分类查询
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "故障码分类查询",description = "故障码分类信息")
|
||||
public Result findfaulttype(){
|
||||
return Result.success(faultTypeService.select());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fault.domain.message.Message;
|
||||
import com.muyu.fault.domain.message.MessageReq;
|
||||
import com.muyu.fault.domain.message.MessageSendReq;
|
||||
import com.muyu.fault.service.MessageService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/message")
|
||||
public class MessageController {
|
||||
|
||||
@Autowired
|
||||
private MessageService messageService;
|
||||
|
||||
/**
|
||||
* 消息发送
|
||||
* @param messageSendReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/sendmessage")
|
||||
@Operation(summary = "发送消息",description = "站内信消息发送")
|
||||
public Result sendmessage(@Validated MessageSendReq messageSendReq){
|
||||
messageService.sendmessage(messageSendReq);
|
||||
return Result.success(null,"发送成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息查看
|
||||
* @param messageReq
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/messagelist")
|
||||
@Operation(summary = "消息查看(能根据登录人新的信息查看当前登录人的消息栏)",description = "消息查看")
|
||||
public Result selectmessage(@Validated @RequestBody MessageReq messageReq){
|
||||
return Result.success(messageService.selectmessage(messageReq));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看消息改变状态
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/changestatus")
|
||||
@Operation(summary = "状态改变",description = "状态改变")
|
||||
public Result changestatus(@RequestBody Message message){
|
||||
messageService.changestatus(message);
|
||||
return Result.success(null,"成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看未读的消息
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/unread")
|
||||
@Operation(summary = "查看未读的消息",description = "查看未读的消息")
|
||||
public Result unread(){
|
||||
return Result.success(messageService.unread());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
package com.muyu.fault.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.fault.domain.SysCarFault;
|
||||
import com.muyu.fault.service.ISysCarFaultService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 车辆故障Controller
|
||||
*
|
||||
* @author Yang鹏
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fault")
|
||||
public class SysCarFaultController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ISysCarFaultService sysCarFaultService;
|
||||
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<SysCarFault>> list(SysCarFault sysCarFault)
|
||||
{
|
||||
startPage();
|
||||
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出车辆故障列表
|
||||
*/
|
||||
@RequiresPermissions("syscarfault:fault:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SysCarFault sysCarFault)
|
||||
{
|
||||
List<SysCarFault> list = sysCarFaultService.selectSysCarFaultList(sysCarFault);
|
||||
ExcelUtil<SysCarFault> util = new ExcelUtil<SysCarFault>(SysCarFault.class);
|
||||
util.exportExcel(response, list, "车辆故障数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取车辆故障详细信息
|
||||
*/
|
||||
@RequiresPermissions("syscarfault:fault:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result<List<SysCarFault>> getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(sysCarFaultService.selectSysCarFaultById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增车辆故障
|
||||
*/
|
||||
@RequiresPermissions("syscarfault:fault:add")
|
||||
@PostMapping
|
||||
public Result<Integer> add(
|
||||
@Validated @RequestBody SysCarFault sysCarFault)
|
||||
{
|
||||
if (sysCarFaultService.checkIdUnique(sysCarFault)) {
|
||||
return error("新增 车辆故障 '" + sysCarFault + "'失败,车辆故障已存在");
|
||||
}
|
||||
sysCarFault.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(sysCarFaultService.save(sysCarFault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆故障
|
||||
*/
|
||||
@RequiresPermissions("syscarfault:fault:edit")
|
||||
@PutMapping
|
||||
public Result<Integer> edit(
|
||||
@Validated @RequestBody SysCarFault sysCarFault)
|
||||
{
|
||||
if (!sysCarFaultService.checkIdUnique(sysCarFault)) {
|
||||
return error("修改 车辆故障 '" + sysCarFault + "'失败,车辆故障不存在");
|
||||
}
|
||||
sysCarFault.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(sysCarFaultService.updateById(sysCarFault));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆故障
|
||||
*/
|
||||
@RequiresPermissions("syscarfault:fault:remove")
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
||||
{
|
||||
sysCarFaultService.removeBatchByIds(Arrays.asList(ids));
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,206 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
/**
|
||||
* @className: CarFaultRule ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class CarFaultRule {/**
|
||||
* VIN码VIN码VIN码
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
* 时间戳时间戳时间戳
|
||||
*/
|
||||
private long timestamp;
|
||||
/**
|
||||
* 经度经度经度
|
||||
*/
|
||||
private double longitude;
|
||||
/**
|
||||
* 纬度纬度纬度
|
||||
*/
|
||||
private double latitude;
|
||||
/**
|
||||
* 车速车速车速
|
||||
*/
|
||||
private double speed;
|
||||
/**
|
||||
* 总里程总里程总里程
|
||||
*/
|
||||
private long TM;
|
||||
/**
|
||||
* 总电压总电压总电压
|
||||
*/
|
||||
private double TV;
|
||||
/**
|
||||
* 总电流总电流总电流
|
||||
*/
|
||||
private double CC;
|
||||
/**
|
||||
* 绝缘电阻绝缘电阻绝缘电阻
|
||||
*/
|
||||
private double IR;
|
||||
/**
|
||||
* 档位档位档位
|
||||
*/
|
||||
private String GP;
|
||||
/**
|
||||
* 加速踏板行程值加速踏板行程值加速踏板行程值
|
||||
*/
|
||||
private double APTV;
|
||||
/**
|
||||
* 制动踏板行程值制动踏板行程值制动踏板行程值
|
||||
*/
|
||||
private double BPTV;
|
||||
/**
|
||||
* 燃料消耗率燃料消耗率燃料消耗率
|
||||
*/
|
||||
private double SFC;
|
||||
/**
|
||||
* 电机控制器温度电机控制器温度电机控制器温度
|
||||
*/
|
||||
private double MCT;
|
||||
/**
|
||||
* 电机转速电机转速电机转速
|
||||
*/
|
||||
private int MS;
|
||||
/**
|
||||
* 电机转矩电机转矩电机转矩
|
||||
*/
|
||||
private double MTO;
|
||||
/**
|
||||
* 电机温度电机温度电机温度
|
||||
*/
|
||||
private double MTE;
|
||||
/**
|
||||
* 电机电压电机电压电机电压
|
||||
*/
|
||||
private double MV;
|
||||
/**
|
||||
* 电机电流电机电流电机电流
|
||||
*/
|
||||
private double MC;
|
||||
/**
|
||||
* 动力电池剩余电量SOC动力电池剩余电量SOC动力电池剩余电量SOC
|
||||
*/
|
||||
private double PBRSOC;
|
||||
/**
|
||||
* 当前状态允许的最大反馈功率当前状态允许的最大反馈功率当前状态允许的最大反馈功率
|
||||
*/
|
||||
private double MACSFP;
|
||||
/**
|
||||
* 当前状态允许最大放电功率当前状态允许最大放电功率当前状态允许最大放电功率
|
||||
*/
|
||||
private double CSATMDP;
|
||||
/**
|
||||
* BMS自检计数器BMS自检计数器BMS自检计数器
|
||||
*/
|
||||
private int BMS;
|
||||
/**
|
||||
* 动力电池充放电电流动力电池充放电电流动力电池充放电电流
|
||||
*/
|
||||
private double CADC;
|
||||
/**
|
||||
* 动力电池负载端总电压V3动力电池负载端总电压V3动力电池负载端总电压V3
|
||||
*/
|
||||
private double PBLETVV3;
|
||||
/**
|
||||
* 单次最大电压单次最大电压单次最大电压
|
||||
*/
|
||||
private double SMV;
|
||||
/**
|
||||
* 单体电池最低电压单体电池最低电压单体电池最低电压
|
||||
*/
|
||||
private double MVOAB;
|
||||
/**
|
||||
* 单体电池最高温度单体电池最高温度单体电池最高温度
|
||||
*/
|
||||
private double MAXBT;
|
||||
/**
|
||||
* 单体电池最低温度单体电池最低温度单体电池最低温度
|
||||
*/
|
||||
private double MINBT;
|
||||
/**
|
||||
* 动力电池可用容量动力电池可用容量动力电池可用容量
|
||||
*/
|
||||
private double PBAC;
|
||||
/**
|
||||
* 车辆状态车辆状态车辆状态
|
||||
*/
|
||||
private String VS;
|
||||
/**
|
||||
* 充电状态充电状态充电状态
|
||||
*/
|
||||
private String CS;
|
||||
/**
|
||||
* 运行状态运行状态运行状态
|
||||
*/
|
||||
private String RS;
|
||||
/**
|
||||
* SOCSOCSOC
|
||||
*/
|
||||
private double SOC;
|
||||
/**
|
||||
* 可充电储能装置工作状态可充电储能装置工作状态可充电储能装置工作状态
|
||||
*/
|
||||
private String RESDWC;
|
||||
/**
|
||||
* EASEASEAS
|
||||
*/
|
||||
private String EAS;
|
||||
/**
|
||||
* PTCPTCPTC
|
||||
*/
|
||||
private String PTC;
|
||||
/**
|
||||
* EPSEPSEPS
|
||||
*/
|
||||
private String EPS;
|
||||
/**
|
||||
* ABSABSABS
|
||||
*/
|
||||
private String ABS;
|
||||
/**
|
||||
* MCUMCUMCU
|
||||
*/
|
||||
private String MCU;
|
||||
/**
|
||||
* 动力电池加热状态动力电池加热状态动力电池加热状态
|
||||
*/
|
||||
private String PBHS;
|
||||
/**
|
||||
* 动力电池当前状态动力电池当前状态动力电池当前状态
|
||||
*/
|
||||
private String PBCS;
|
||||
/**
|
||||
* 动力电池保温状态动力电池保温状态动力电池保温状态
|
||||
*/
|
||||
private String PBIS;
|
||||
/**
|
||||
* DCDCDCDCDCDC
|
||||
*/
|
||||
private String DCDC;
|
||||
/**
|
||||
* CHGCHGCHG
|
||||
*/
|
||||
private String CHG;
|
||||
/**
|
||||
* 校验位校验位校验位
|
||||
*/
|
||||
private byte CHB;
|
||||
/**
|
||||
* 截止位截止位截止位
|
||||
*/
|
||||
private byte CUB;
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: CarType ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:01 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_type",autoResultMap = true)
|
||||
public class CarType {
|
||||
/**
|
||||
* 车辆类型ID
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
* 车辆类型名
|
||||
*/
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 车辆规则外键ID
|
||||
*/
|
||||
private long carTypeRules;
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.fault.domain.req.FaultCodeAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: FaultCode ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:21 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_faultcode", autoResultMap = true)
|
||||
public class FaultCode {
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
@TableId(value = "faultcode_id", type = IdType.AUTO)
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
* 故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
* 故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
* 是否警告
|
||||
*/
|
||||
private Integer isWarning;
|
||||
|
||||
private String faulttypeName;
|
||||
private String messageTypeName;
|
||||
private String messageTypeCode;
|
||||
private String messageTypeBelongs;
|
||||
|
||||
public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq) {
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(0)
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeAddReq.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeAddReq.getFaultGroup())
|
||||
.faultBit(faultCodeAddReq.getFaultBit())
|
||||
.faultValue(faultCodeAddReq.getFaultValue())
|
||||
.isWarning(faultCodeAddReq.getIsWarning())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,87 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.fault.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.fault.domain.req.FaultConditionUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @className: FaultCondition ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:07 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_condition",autoResultMap = true)
|
||||
public class FaultCondition {
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
@TableId(value = "carcondition_id",type = IdType.AUTO)
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
/**
|
||||
* 车辆类型名称
|
||||
*/
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
|
||||
|
||||
public static FaultCondition faultConditionadd(FaultConditionAddReq faultConditionAddReq){
|
||||
return FaultCondition.builder()
|
||||
.carTypeId(faultConditionAddReq.getCarTypeId())
|
||||
.messageTypeId(faultConditionAddReq.getMessageTypeId())
|
||||
.faultconditionIdentification(faultConditionAddReq.getFaultconditionIdentification())
|
||||
.faultconditionParameter(faultConditionAddReq.getFaultconditionParameter())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static FaultCondition faultConditionupd(FaultConditionUpdReq faultConditionUpdReq, Supplier<Long> idSupplier){
|
||||
return FaultCondition.builder()
|
||||
.carconditionId(faultConditionUpdReq.getCarconditionId())
|
||||
.carTypeId(faultConditionUpdReq.getCarTypeId())
|
||||
.messageTypeId(faultConditionUpdReq.getMessageTypeId())
|
||||
.faultconditionIdentification(faultConditionUpdReq.getFaultconditionIdentification())
|
||||
.faultconditionParameter(faultConditionUpdReq.getFaultconditionParameter())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: FaultLabel ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:07 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_label",autoResultMap = true)
|
||||
public class FaultLabel {
|
||||
|
||||
/**
|
||||
*自增主键
|
||||
*/
|
||||
@TableId(value = "message_type_id",type = IdType.AUTO)
|
||||
private String messageTypeId;
|
||||
/**
|
||||
*报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_log",autoResultMap = true)
|
||||
public class FaultLog {
|
||||
|
||||
/**
|
||||
* 故障日志Id
|
||||
*/
|
||||
@TableId(value = "log_id",type = IdType.AUTO)
|
||||
private long logId;
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 车辆Id
|
||||
*/
|
||||
private long carInformationId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date startwarningTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date endwarningTime;
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 车辆vin
|
||||
*/
|
||||
private String carInformationVIN;
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.fault.domain;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: FaultReport ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:05 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class FaultReport {
|
||||
private String VehicleType;
|
||||
private String FaultDescription;
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @className: FaultRule ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:05 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_condition",autoResultMap = true)
|
||||
public class FaultRule {
|
||||
/**
|
||||
* 触发条件Id
|
||||
*/
|
||||
private long conditionId;
|
||||
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
|
||||
/**
|
||||
* 触发条件描述
|
||||
*/
|
||||
private String conditionContent;
|
||||
|
||||
/**
|
||||
* 单个参数的阈值
|
||||
*/
|
||||
private BigDecimal singleThreshold;
|
||||
|
||||
/**
|
||||
* 区间参数的阈值的最小值
|
||||
*/
|
||||
private BigDecimal minThreshold;
|
||||
|
||||
/**
|
||||
* 区间参数的阈值的最大值
|
||||
*/
|
||||
private BigDecimal maxThreshold;
|
||||
|
||||
/**
|
||||
* 触发条件是否激活
|
||||
*/
|
||||
private Integer isActive;
|
||||
|
||||
/**
|
||||
* 车辆数据值
|
||||
*/
|
||||
private BigDecimal Threshold;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: FaultType ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:04 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_type",autoResultMap = true)
|
||||
public class FaultType {
|
||||
/**
|
||||
*故障类型Id
|
||||
*/
|
||||
@TableId(value = "faulttype_id",type = IdType.AUTO)
|
||||
private long faulttypeId;
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
private String faulttypeName;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.muyu.fault.domain.message.Message;
|
||||
import lombok.Data;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
|
||||
/**
|
||||
* @className: MessageDao ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 20:58 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
public class MessageDao {
|
||||
private Connection connection;
|
||||
|
||||
public MessageDao(Connection connection){
|
||||
this.connection=connection;
|
||||
}
|
||||
|
||||
public void sendMessage(Message message) throws Exception{
|
||||
String sql="INSERT INTO `eight`.`car_fault_message` (`id`, `sender`, `receiver`, `content`, `status`, `create_time`, `user_id`) " +
|
||||
"VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL)";
|
||||
try(PreparedStatement pstmt=connection.prepareStatement(sql)){
|
||||
pstmt.setString(1, message.getContent());
|
||||
pstmt.setString(2, message.getSender());
|
||||
pstmt.setString(3, message.getReceiver());
|
||||
pstmt.setObject(4, message.getCreateTime());
|
||||
pstmt.executeUpdate();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.muyu.fault.domain.message.Message;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className: MessageService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:01 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 业务逻辑层将负责实现消息的发送逻辑
|
||||
*/
|
||||
|
||||
public class MessageService {
|
||||
private MessageDao messageDao;
|
||||
|
||||
public MessageService(MessageDao messageDao){
|
||||
this.messageDao=messageDao;
|
||||
}
|
||||
|
||||
public void sendMessage(String content,String sender,String receiver){
|
||||
|
||||
// 定义一个DateTimeFormatter对象,用于格式化日期时间为yyyy-MM-dd HH:mm:ss
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 获取当前日期和时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 使用formatter格式化当前日期和时间
|
||||
String formattedDateTime = now.format(formatter);
|
||||
// 使用formatter将字符串解析回LocalDateTime
|
||||
LocalDateTime parsedDateTime = LocalDateTime.parse(formattedDateTime, formatter);
|
||||
// 然后按照上面的步骤将LocalDateTime转换为Date
|
||||
ZonedDateTime zdt = parsedDateTime.atZone(ZoneId.systemDefault());
|
||||
Date date = Date.from(zdt.toInstant());
|
||||
|
||||
|
||||
Message message = new Message();
|
||||
message.setContent(content);
|
||||
message.setSender(sender);
|
||||
message.setReceiver(receiver);
|
||||
message.setCreateTime(date);
|
||||
|
||||
try {
|
||||
messageDao.sendMessage(message);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* 车辆故障对象 sys_car_fault
|
||||
*
|
||||
* @author Yang鹏
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("sys_car_fault")
|
||||
public class SysCarFault extends BaseEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 自增主键 */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 车辆故障编码; */
|
||||
@Excel(name = "车辆故障编码;")
|
||||
private String faultCode;
|
||||
|
||||
/** 车辆故障名称 */
|
||||
@Excel(name = "车辆故障名称")
|
||||
private String faultName;
|
||||
|
||||
/** 车辆故障类型 */
|
||||
@Excel(name = "车辆故障类型")
|
||||
private String faultType;
|
||||
|
||||
/** 故障VIN编码 */
|
||||
@Excel(name = "故障VIN编码")
|
||||
private String carVin;
|
||||
|
||||
/** 车辆故障标签 */
|
||||
@Excel(name = "车辆故障标签")
|
||||
private String faultLabel;
|
||||
|
||||
/** 车辆故障位 */
|
||||
@Excel(name = "车辆故障位")
|
||||
private String faultBit;
|
||||
|
||||
/** 车辆故障值 */
|
||||
@Excel(name = "车辆故障值")
|
||||
private String faultValue;
|
||||
|
||||
/** 故障级别; */
|
||||
@Excel(name = "故障级别;")
|
||||
private String faultWarn;
|
||||
|
||||
/** 报警状态(Y.是,N.否) */
|
||||
@Excel(name = "报警状态", readConverterExp = "Y=.是,N.否")
|
||||
private String warnStatus;
|
||||
|
||||
/** 故障描述信息 */
|
||||
@Excel(name = "故障描述信息")
|
||||
private String faultDesc;
|
||||
|
||||
/** 启用状态(1.待处理 2.处理中 3.已处理 4.忽略) */
|
||||
@Excel(name = "启用状态(1.待处理 2.处理中 3.已处理 4.忽略)")
|
||||
private String state;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("faultCode", getFaultCode())
|
||||
.append("faultName", getFaultName())
|
||||
.append("faultType", getFaultType())
|
||||
.append("carVin", getCarVin())
|
||||
.append("faultLabel", getFaultLabel())
|
||||
.append("faultBit", getFaultBit())
|
||||
.append("faultValue", getFaultValue())
|
||||
.append("faultWarn", getFaultWarn())
|
||||
.append("warnStatus", getWarnStatus())
|
||||
.append("faultDesc", getFaultDesc())
|
||||
.append("state", getState())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
package com.muyu.fault.domain;
|
||||
|
||||
public enum WarnLevel {
|
||||
LOW, MEDIUM, HIGH
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.fault.domain.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className: Message ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/22 10:55 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_message",autoResultMap = true)
|
||||
public class Message {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private long id;
|
||||
|
||||
/**
|
||||
* 发送者
|
||||
*/
|
||||
private String sender;
|
||||
|
||||
/**
|
||||
* 接收者
|
||||
*/
|
||||
private String receiver;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 消息状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
private long userId;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.fault.domain.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: MessageReq ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 20:59 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class MessageReq {
|
||||
/**
|
||||
* 消息状态
|
||||
*/
|
||||
@TableId(type = IdType.AUTO,value = "status")
|
||||
private Integer status;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
@Excel(name = "登录人Id")
|
||||
private long userId;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.muyu.fault.domain.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className: MessageSendReq ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:00 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MessageSendReq {
|
||||
/**
|
||||
* 发送者
|
||||
*/
|
||||
@TableId(type = IdType.AUTO,value = "id")
|
||||
private String sender;
|
||||
/**
|
||||
* 接收者
|
||||
*/
|
||||
@Excel(name = "接收者")
|
||||
private String receiver;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
@Excel(name = "消息内容")
|
||||
private String content;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
@Excel(name = "登录人Id")
|
||||
private long userId;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "String")
|
||||
private Date createTime;
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.fault.domain.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: User ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 20:56 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class User {
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Excel(name = "用户名")
|
||||
private String username;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Excel(name="邮箱")
|
||||
private String email;
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
package com.muyu.fault.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultCodeAddReq {
|
||||
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 故障分类Id
|
||||
*/
|
||||
private long faulttypeId;
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
private Integer isWarning;
|
||||
/**
|
||||
* 故障描述
|
||||
*/
|
||||
private String faultContent;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.muyu.fault.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
@Tag(name = "故障码列表请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultCodeListReq {
|
||||
/**
|
||||
*故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
|
||||
|
||||
}
|
|
@ -1,14 +1,11 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.fault.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
|
@ -17,83 +14,63 @@ import lombok.experimental.SuperBuilder;
|
|||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
|
||||
/**
|
||||
* 更新故障码的请求参数
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "fault_code_upd_req", autoResultMap = true)
|
||||
@Tag(name = "故障码更新请求参数")
|
||||
@Builder
|
||||
public class FaultCodeUpdReq {
|
||||
|
||||
/**
|
||||
*故障码Id
|
||||
*/
|
||||
@TableId(value = "faultcode_id", type = IdType.AUTO)
|
||||
@Schema(title = "故障码Id")
|
||||
private long faultcodeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
@Schema(name = "故障名称Id")
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
@Schema(name = "故障名称")
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
@Schema(name = "报文编码")
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
@Schema(name = "故障码")
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 故障分类Id
|
||||
*/
|
||||
@Schema(name = "故障分类Id")
|
||||
private long faulttypeId;
|
||||
/**
|
||||
* 是否产生报警
|
||||
*/
|
||||
@Schema(name = "是否产生报警")
|
||||
private Integer isWarning;
|
||||
/**
|
||||
* 故障描述
|
||||
*/
|
||||
@Schema(name = "故障描述")
|
||||
private String faultContent;
|
||||
/**
|
||||
*故障状态
|
||||
*/
|
||||
@Schema(name = "故障状态")
|
||||
private Integer faultStatus;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
@Schema(name = "故障组")
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
@Schema(name = "故障位")
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
@Schema(name = "故障值")
|
||||
private String faultValue;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
@Schema(name = "报文所属类别")
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.fault.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultConditionAddReq {
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
package com.muyu.fault.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Tag(name = "故障规则列表请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultConditionListReq {
|
||||
|
||||
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.muyu.fault.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultConditionUpdReq {
|
||||
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.muyu.fault.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Tag(name = "故障日志列表请求对象")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FaultLogListReq {
|
||||
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date startwarningTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date endwarningTime;
|
||||
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package com.muyu.fault.domain.resp;
|
||||
|
||||
import com.muyu.fault.domain.vo.FaultCodeVo;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className: Messages ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/22 10:55 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@Tag(name="故障码信息响应对象",description = "故障码查询的响应结果")
|
||||
public class FaultCodeListResp {
|
||||
|
||||
/**
|
||||
*故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
*故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
*是否警告
|
||||
*/
|
||||
private Integer isWarning;
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
private String faulttypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
/**
|
||||
* 数据库对象构建为返回结果对象
|
||||
* @param faultCodeVO
|
||||
* @return
|
||||
*/
|
||||
public static FaultCodeListResp faultCodeListResp(FaultCodeVo faultCodeVO){
|
||||
return FaultCodeListResp.builder()
|
||||
.faultcodeId(faultCodeVO.getFaultcodeId())
|
||||
.messageTypeId(faultCodeVO.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeVO.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeVO.getFaultGroup())
|
||||
.faultBit(faultCodeVO.getFaultBit())
|
||||
.faultValue(faultCodeVO.getFaultValue())
|
||||
.isWarning(faultCodeVO.getIsWarning())
|
||||
.faulttypeName(faultCodeVO.getFaulttypeName())
|
||||
.messageTypeName(faultCodeVO.getMessageTypeName())
|
||||
.messageTypeCode(faultCodeVO.getMessageTypeCode())
|
||||
.messageTypeBelongs(faultCodeVO.getMessageTypeBelongs())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.fault.domain.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: Messages ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/22 10:55 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name="数据总数列表",description = "数据和总数的响应")
|
||||
public class FaultCodeTotalListResp {
|
||||
|
||||
|
||||
private List<FaultCodeListResp> faultCodeListRespList;
|
||||
|
||||
private long total;
|
||||
|
||||
public static FaultCodeTotalListResp faultCodeTotalListResp(List<FaultCodeListResp> faultCodeListRespList,long total){
|
||||
FaultCodeTotalListResp faultCodeTotalListResp = new FaultCodeTotalListResp();
|
||||
faultCodeTotalListResp.setFaultCodeListRespList(faultCodeListRespList);
|
||||
faultCodeTotalListResp.setTotal(total);
|
||||
return faultCodeTotalListResp;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.muyu.fault.domain.resp;
|
||||
|
||||
|
||||
import com.muyu.fault.domain.FaultCondition;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@Tag(name="故障规则信息响应对象",description = "故障规则查询的响应结果")
|
||||
public class FaultConditionListResp {
|
||||
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
/**
|
||||
* 车辆类型名称
|
||||
*/
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
|
||||
/**
|
||||
* 数据库对象构建为返回结果对象
|
||||
* @param faultCondition
|
||||
* @return
|
||||
*/
|
||||
public static FaultConditionListResp faultConditionListResp(FaultCondition faultCondition){
|
||||
return FaultConditionListResp.builder()
|
||||
.carconditionId(faultCondition.getCarconditionId())
|
||||
.carTypeId(faultCondition.getCarTypeId())
|
||||
.messageTypeId(faultCondition.getMessageTypeId())
|
||||
.faultconditionParameter(faultCondition.getFaultconditionParameter())
|
||||
.faultconditionIdentification(faultCondition.getFaultconditionIdentification())
|
||||
.carTypeName(faultCondition.getCarTypeName())
|
||||
.messageTypeName(faultCondition.getMessageTypeName())
|
||||
.messageTypeCode(faultCondition.getMessageTypeCode())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.fault.domain.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name="故障规则数据总数列表",description = "数据和总数的响应")
|
||||
public class FaultConditionTotalListResp {
|
||||
|
||||
private List<FaultConditionListResp> faultConditionListRespList;
|
||||
|
||||
private long total;
|
||||
|
||||
public static FaultConditionTotalListResp faultConditionTotalListResp(List<FaultConditionListResp> faultConditionListRespList,long total){
|
||||
FaultConditionTotalListResp faultConditionTotalListResp = new FaultConditionTotalListResp();
|
||||
faultConditionTotalListResp.setFaultConditionListRespList(faultConditionListRespList);
|
||||
faultConditionTotalListResp.setTotal(total);
|
||||
return faultConditionTotalListResp;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.muyu.fault.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.muyu.fault.domain.FaultLog;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @className: Messages ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/22 10:55 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@Tag(name="故障日志信息响应对象",description = "故障日志的响应结果")
|
||||
public class FaultLogListResp {
|
||||
|
||||
|
||||
/**
|
||||
* 故障日志Id
|
||||
*/
|
||||
private long logId;
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 车辆Id
|
||||
*/
|
||||
private long carInformationId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date startwarningTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date endwarningTime;
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 车辆vin
|
||||
*/
|
||||
private String carInformationVIN;
|
||||
|
||||
|
||||
/**
|
||||
* 数据库对象构建为返回结果对象
|
||||
* @param faultLog
|
||||
* @return
|
||||
*/
|
||||
public static FaultLogListResp faultLogListResp(FaultLog faultLog){
|
||||
return FaultLogListResp.builder()
|
||||
.logId(faultLog.getLogId())
|
||||
.faultcodeId(faultLog.getFaultcodeId())
|
||||
.carInformationId(faultLog.getCarInformationId())
|
||||
.carVin(faultLog.getCarVin())
|
||||
.startwarningTime(faultLog.getStartwarningTime())
|
||||
.endwarningTime(faultLog.getEndwarningTime())
|
||||
.faultcodeNumber(faultLog.getFaultcodeNumber())
|
||||
.carInformationVIN(faultLog.getCarInformationVIN())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.fault.domain.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: Messages ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/22 10:55 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name="故障日志数据总数列表",description = "数据和总数的响应")
|
||||
public class FaultLogTotalListResp {
|
||||
|
||||
private List<FaultLogListResp> faultLogListRespList;
|
||||
|
||||
private long total;
|
||||
|
||||
public static FaultLogTotalListResp faultLogTotalListResp(List<FaultLogListResp> faultLogListRespList,long total){
|
||||
FaultLogTotalListResp faultLogTotalListResp = new FaultLogTotalListResp();
|
||||
faultLogTotalListResp.setFaultLogListRespList(faultLogListRespList);
|
||||
faultLogTotalListResp.setTotal(total);
|
||||
return faultLogTotalListResp;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.fault.domain.vo;
|
||||
|
||||
import com.muyu.fault.domain.FaultCode;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
/**
|
||||
* @className: FaultCodeVo ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:18 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class FaultCodeVo extends FaultCode {
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
private String faulttypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.domain.CarType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @className: CarTypeMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface CarTypeMapper extends BaseMapper<CarType> {
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.muyu.fault.domain.FaultCode;
|
||||
|
||||
import com.muyu.fault.domain.FaultLabel;
|
||||
import com.muyu.fault.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeListReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeUpdReq;
|
||||
import com.muyu.fault.domain.vo.FaultCodeVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultCodeMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultCodeMapper extends BaseMapper<FaultCodeVo> {
|
||||
|
||||
List<FaultCodeVo> selectfaultcodelist(FaultCodeListReq faultCodeListReq);
|
||||
|
||||
|
||||
|
||||
//新增故障码
|
||||
FaultLabel selectfaultName(@Param("messageTypeName") String messageTypeName);
|
||||
FaultCode selectfaultCode(@Param("faultcodeNumber") String faultcodeNumber);
|
||||
Integer insertfaultlabel(FaultCodeAddReq faultCodeAddReq);
|
||||
Integer insertfaultcode(FaultCodeAddReq faultCodeAddReq);
|
||||
|
||||
//修改故障码
|
||||
Integer updfaultlabel(FaultCodeUpdReq faultCodeUpdReq);
|
||||
Integer updfaultcode(FaultCodeUpdReq faultCodeUpdReq);
|
||||
|
||||
|
||||
|
||||
Integer delfaultcode(@Param("messageTypeId") long messageTypeId);
|
||||
Integer delfaultlabel(@Param("messageTypeId") long messageTypeId);
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.muyu.fault.domain.FaultCondition;
|
||||
import com.muyu.fault.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.fault.domain.req.FaultConditionListReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultConditionMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultConditionMapper extends BaseMapper<FaultCondition> {
|
||||
|
||||
List<FaultCondition> selectfaultconditionlist(FaultConditionListReq faultConditionListReq);
|
||||
|
||||
|
||||
List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq);
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
/**
|
||||
* @className: FaultDetectionStrategyMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 23:59 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
public interface FaultDetectionStrategyMapper {
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.domain.FaultLabel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @className: FaultLabelMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultLabelMapper extends BaseMapper<FaultLabel> {
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.muyu.fault.domain.FaultLog;
|
||||
import com.muyu.fault.domain.req.FaultLogListReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultLogMapper extends BaseMapper<FaultLog> {
|
||||
|
||||
|
||||
List<FaultLog> selectfaultLogMapper(FaultLogListReq faultLogListReq);
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.fault.domain.FaultRule;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @className: FaultRuleMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultRuleMapper extends BaseMapper<FaultRule> {
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.muyu.fault.domain.FaultType;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @className: FaultTypeMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface FaultTypeMapper extends BaseMapper<FaultType> {
|
||||
Integer add(FaultType faultType);
|
||||
|
||||
Integer update(FaultType faultType);
|
||||
|
||||
Integer delete(Integer id);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import com.muyu.fault.domain.message.Message;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: MessageMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Mapper
|
||||
public interface MessageMapper extends BaseMapper<Message> {
|
||||
void changestatus(Message message);
|
||||
|
||||
List<Message> unread();
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.muyu.fault.mapper;
|
||||
|
||||
import com.muyu.fault.domain.SysCarFault;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @className: MessageMapper ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024-09-18 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 车辆故障Mapper接口
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysCarFaultMapper extends BaseMapper<SysCarFault>{
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.CarType;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: CarTypeService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
public interface CarTypeService extends IService<CarType> {
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
* @return
|
||||
*/
|
||||
List<CarType> selectcarType();
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeListReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeUpdReq;
|
||||
import com.muyu.fault.domain.resp.FaultCodeTotalListResp;
|
||||
import com.muyu.fault.domain.vo.FaultCodeVo;
|
||||
|
||||
/**
|
||||
* @className: FaultCodeService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
public interface FaultCodeService extends IService<FaultCodeVo> {
|
||||
|
||||
/**
|
||||
* 故障码展示
|
||||
* @param faultCodeListReq
|
||||
* @return
|
||||
*/
|
||||
FaultCodeTotalListResp selectlist(FaultCodeListReq faultCodeListReq);
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
* @param faultCodeListReq
|
||||
* @return
|
||||
*/
|
||||
FaultCodeTotalListResp selectfaultcodelist(FaultCodeListReq faultCodeListReq);
|
||||
|
||||
/**
|
||||
* 新增故障码
|
||||
* @param faultCodeAddReq
|
||||
* @return
|
||||
*/
|
||||
void insert(FaultCodeAddReq faultCodeAddReq);
|
||||
|
||||
|
||||
/**
|
||||
* 修改故障码
|
||||
* @param faultCodeUpdReq
|
||||
* @return
|
||||
*/
|
||||
void upd(FaultCodeUpdReq faultCodeUpdReq);
|
||||
|
||||
|
||||
/**
|
||||
* 删除故障码
|
||||
* @param messageTypeId
|
||||
* @return
|
||||
*/
|
||||
void del(Integer messageTypeId);
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.FaultCondition;
|
||||
import com.muyu.fault.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.fault.domain.req.FaultConditionListReq;
|
||||
import com.muyu.fault.domain.resp.FaultConditionTotalListResp;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultConditionService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
public interface FaultConditionService extends IService<FaultCondition> {
|
||||
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @param faultConditionListReq
|
||||
* @return
|
||||
*/
|
||||
FaultConditionTotalListResp getfaultrulelist(FaultConditionListReq faultConditionListReq);
|
||||
|
||||
/**
|
||||
* 故障规则添加
|
||||
* @param faultConditionAddReq
|
||||
* @return
|
||||
*/
|
||||
List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.muyu.fault.domain.CarFaultRule;
|
||||
import com.muyu.fault.domain.FaultReport;
|
||||
/**
|
||||
* @className: FaultDetectionStrategy ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测策略的接口
|
||||
*/
|
||||
public interface FaultDetectionStrategy {
|
||||
|
||||
FaultReport detectFaults(CarFaultRule carFaultRule);
|
||||
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
public interface FaultDetectionStrategyService {
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.FaultLabel;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLabelService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
public interface FaultLabelService extends IService<FaultLabel> {
|
||||
/**
|
||||
* 故障名称
|
||||
* @return
|
||||
*/
|
||||
List<FaultLabel> select();
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.FaultLog;
|
||||
import com.muyu.fault.domain.req.FaultLogListReq;
|
||||
import com.muyu.fault.domain.resp.FaultLogTotalListResp;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLogService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
public interface FaultLogService extends IService<FaultLog> {
|
||||
|
||||
/**
|
||||
* 故障日志列表
|
||||
* @param faultLogListReq
|
||||
* @return
|
||||
*/
|
||||
FaultLogTotalListResp selectfaultlog(FaultLogListReq faultLogListReq);
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.FaultRule;
|
||||
|
||||
|
||||
/**
|
||||
* @className: FaultRuleService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
public interface FaultRuleService extends IService<FaultRule> {
|
||||
|
||||
/**
|
||||
* 车辆故障检测
|
||||
* @return
|
||||
*/
|
||||
String checkfaults(FaultRule faultRule);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.FaultType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultTypeService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
public interface FaultTypeService extends IService<FaultType> {
|
||||
|
||||
/**
|
||||
* 故障码分类查询
|
||||
* @return
|
||||
*/
|
||||
List<FaultType> select();
|
||||
|
||||
Integer add(FaultType faultType);
|
||||
|
||||
Integer update(FaultType faultType);
|
||||
|
||||
Integer delete(Integer id);
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.fault.domain.SysCarFault;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 车辆故障Service接口
|
||||
*
|
||||
* @author Yang鹏
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
public interface ISysCarFaultService extends IService<SysCarFault> {
|
||||
/**
|
||||
* 精确查询车辆故障
|
||||
*
|
||||
* @param id 车辆故障主键
|
||||
* @return 车辆故障
|
||||
*/
|
||||
public SysCarFault selectSysCarFaultById(Long id);
|
||||
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 车辆故障集合
|
||||
*/
|
||||
public List<SysCarFault> selectSysCarFaultList(SysCarFault sysCarFault);
|
||||
|
||||
/**
|
||||
* 判断 车辆故障 id是否唯一
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean checkIdUnique(SysCarFault sysCarFault);
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.muyu.fault.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.fault.domain.message.Message;
|
||||
import com.muyu.fault.domain.message.MessageReq;
|
||||
import com.muyu.fault.domain.message.MessageSendReq;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: MessageService ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
public interface MessageService extends IService<Message> {
|
||||
|
||||
/**
|
||||
* 消息发送
|
||||
* @param messageSendReq
|
||||
* @return
|
||||
*/
|
||||
void sendmessage(MessageSendReq messageSendReq);
|
||||
|
||||
/**
|
||||
* 消息查看
|
||||
* @param messageReq
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<Message> selectmessage(MessageReq messageReq);
|
||||
|
||||
|
||||
/**
|
||||
* 查看消息改变状态
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
void changestatus(Message message);
|
||||
|
||||
|
||||
/**
|
||||
* 查看未读的消息
|
||||
* @return
|
||||
*/
|
||||
List<Message> unread();
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.muyu.fault.domain.CarType;
|
||||
import com.muyu.fault.mapper.CarTypeMapper;
|
||||
import com.muyu.fault.service.CarTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: CarFaultRule ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Service
|
||||
public class CarTypeServiceImpl extends ServiceImpl<CarTypeMapper, CarType> implements CarTypeService {
|
||||
|
||||
@Autowired
|
||||
private CarTypeMapper carTypeMapper;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<CarType> selectcarType() {
|
||||
LambdaQueryWrapper<CarType> carTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
List<CarType> list = this.list(carTypeLambdaQueryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.fault.domain.FaultCode;
|
||||
import com.muyu.fault.domain.FaultLabel;
|
||||
import com.muyu.fault.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeListReq;
|
||||
import com.muyu.fault.domain.req.FaultCodeUpdReq;
|
||||
import com.muyu.fault.domain.resp.FaultCodeListResp;
|
||||
import com.muyu.fault.domain.resp.FaultCodeTotalListResp;
|
||||
import com.muyu.fault.domain.vo.FaultCodeVo;
|
||||
import com.muyu.fault.mapper.FaultCodeMapper;
|
||||
import com.muyu.fault.service.FaultCodeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCodeVo> implements FaultCodeService {
|
||||
@Autowired
|
||||
private FaultCodeMapper faultCodeMapper;
|
||||
|
||||
/**
|
||||
* 故障码展示
|
||||
* @param faultCodeListReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public FaultCodeTotalListResp selectlist(FaultCodeListReq faultCodeListReq) {
|
||||
Integer pageNum = faultCodeListReq.getPageNum();
|
||||
Integer pageSize = faultCodeListReq.getPageSize();
|
||||
LambdaQueryWrapper<FaultCodeVo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(faultCodeListReq.getFaultcodeNumber()),
|
||||
FaultCodeVo::getFaultcodeNumber,faultCodeListReq.getFaultcodeNumber());
|
||||
queryWrapper.eq(StringUtils.isNotEmpty(faultCodeListReq.getFaultBit()),
|
||||
FaultCodeVo::getFaultBit,faultCodeListReq.getFaultBit());
|
||||
long count = this.count(queryWrapper);
|
||||
queryWrapper.last("LIMIT "+ ((pageNum-1)*pageSize)+", "+pageSize);
|
||||
List<FaultCodeVo> faultCodeVOList = this.list(queryWrapper);
|
||||
List<FaultCodeListResp> faultCodeListRespList = faultCodeVOList.stream()
|
||||
.map(FaultCodeListResp::faultCodeListResp)
|
||||
.toList();
|
||||
return FaultCodeTotalListResp.faultCodeTotalListResp(faultCodeListRespList,count);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 故障码展示(故障码联查)
|
||||
* @param faultCodeListReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public FaultCodeTotalListResp selectfaultcodelist(FaultCodeListReq faultCodeListReq) {
|
||||
LambdaQueryWrapper<FaultCodeVo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
long count = this.count(queryWrapper);
|
||||
int offset = (faultCodeListReq.getPageNum() - 1) * faultCodeListReq.getPageSize();
|
||||
faultCodeListReq.setPageNum(offset);
|
||||
List<FaultCodeVo> selectfaultcodelist = faultCodeMapper.selectfaultcodelist(faultCodeListReq);
|
||||
List<FaultCodeListResp> faultCodeListRespList = selectfaultcodelist.stream()
|
||||
.map(FaultCodeListResp::faultCodeListResp)
|
||||
.toList();
|
||||
return FaultCodeTotalListResp.faultCodeTotalListResp(faultCodeListRespList,count);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增故障码
|
||||
* @param faultCodeAddReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void insert(FaultCodeAddReq faultCodeAddReq) {
|
||||
//判断故障名称或故障码是否存在,若都不存在先添加故障名称表,在添加故障码表
|
||||
//1.判断故障名称是否存在
|
||||
String messageTypeName = faultCodeAddReq.getMessageTypeName();
|
||||
FaultLabel faultLabel = faultCodeMapper.selectfaultName(messageTypeName);
|
||||
//2.判断故障码是否存在
|
||||
String faultcodeNumber = faultCodeAddReq.getFaultcodeNumber();
|
||||
FaultCode faultCode = faultCodeMapper.selectfaultCode(faultcodeNumber);
|
||||
if (faultLabel==null && faultCode==null){
|
||||
faultCodeMapper.insertfaultlabel(faultCodeAddReq);
|
||||
faultCodeMapper.insertfaultcode(faultCodeAddReq);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改故障码
|
||||
* @param faultCodeUpdReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void upd(FaultCodeUpdReq faultCodeUpdReq) {
|
||||
//修改故障名称表信息和故障码表信息
|
||||
// faultCodeMapper.updfaultlabel(faultCodeUpdReq);
|
||||
faultCodeMapper.updfaultcode(faultCodeUpdReq);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除故障码
|
||||
* @param messageTypeId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void del(Integer messageTypeId) {
|
||||
|
||||
//删除故障码表信息
|
||||
faultCodeMapper.delfaultcode(messageTypeId);
|
||||
//删除对应的故障名称表信息
|
||||
faultCodeMapper.delfaultlabel(messageTypeId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.fault.domain.FaultCondition;
|
||||
import com.muyu.fault.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.fault.domain.req.FaultConditionListReq;
|
||||
import com.muyu.fault.domain.resp.FaultConditionListResp;
|
||||
import com.muyu.fault.domain.resp.FaultConditionTotalListResp;
|
||||
import com.muyu.fault.mapper.FaultConditionMapper;
|
||||
import com.muyu.fault.service.FaultConditionService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class FaultConditionServiceImpl extends ServiceImpl<FaultConditionMapper, FaultCondition> implements FaultConditionService {
|
||||
|
||||
@Autowired
|
||||
private FaultConditionMapper faultConditionMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @param faultConditionListReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public FaultConditionTotalListResp getfaultrulelist(FaultConditionListReq faultConditionListReq) {
|
||||
LambdaQueryWrapper<FaultCondition> queryWrapper = new LambdaQueryWrapper<>();
|
||||
long count = this.count(queryWrapper);
|
||||
int offset = (faultConditionListReq.getPageNum() - 1) * faultConditionListReq.getPageSize();
|
||||
faultConditionListReq.setPageNum(offset);
|
||||
|
||||
List<FaultCondition> selectfaultconditionlist = faultConditionMapper.selectfaultconditionlist(faultConditionListReq);
|
||||
List<FaultConditionListResp> faultConditionListRespList = selectfaultconditionlist.stream()
|
||||
.map(FaultConditionListResp::faultConditionListResp)
|
||||
.toList();
|
||||
return FaultConditionTotalListResp.faultConditionTotalListResp(faultConditionListRespList,count);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 故障规则添加 判断故障规则是否存在
|
||||
* @param faultConditionAddReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq) {
|
||||
List<FaultCondition> faultConditionList = faultConditionMapper.selectBytypeAndlabel(faultConditionAddReq);
|
||||
return faultConditionList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.muyu.fault.mapper.FaultDetectionStrategyMapper;
|
||||
import com.muyu.fault.service.FaultDetectionStrategyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @className: FaultDetectionStrategyServiceImpl ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 23:58 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
@Service
|
||||
public class FaultDetectionStrategyServiceImpl implements FaultDetectionStrategyService {
|
||||
|
||||
@Autowired
|
||||
private FaultDetectionStrategyMapper faultDetectionStrategyMapper;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.muyu.fault.domain.FaultLabel;
|
||||
import com.muyu.fault.mapper.FaultLabelMapper;
|
||||
import com.muyu.fault.service.FaultLabelService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class FaultLabelServiceImpl extends ServiceImpl<FaultLabelMapper, FaultLabel> implements FaultLabelService {
|
||||
@Autowired
|
||||
private FaultLabelMapper faultLabelMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 故障信息查询
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FaultLabel> select() {
|
||||
LambdaQueryWrapper<FaultLabel> queryWrapper = new LambdaQueryWrapper<>();
|
||||
List<FaultLabel> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.muyu.fault.domain.FaultLog;
|
||||
import com.muyu.fault.domain.req.FaultLogListReq;
|
||||
import com.muyu.fault.domain.resp.FaultLogListResp;
|
||||
import com.muyu.fault.domain.resp.FaultLogTotalListResp;
|
||||
import com.muyu.fault.mapper.FaultLogMapper;
|
||||
import com.muyu.fault.service.FaultLogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> implements FaultLogService {
|
||||
@Autowired
|
||||
private FaultLogMapper faultLogMapper;
|
||||
|
||||
/**
|
||||
* 故障日志列表
|
||||
* @param faultLogListReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public FaultLogTotalListResp selectfaultlog(FaultLogListReq faultLogListReq) {
|
||||
LambdaQueryWrapper<FaultLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||
long count = this.count(queryWrapper);
|
||||
int offset = (faultLogListReq.getPageNum() - 1) * faultLogListReq.getPageSize();
|
||||
faultLogListReq.setPageNum(offset);
|
||||
List<FaultLog> faultLogListResps = faultLogMapper.selectfaultLogMapper(faultLogListReq);
|
||||
List<FaultLogListResp> faultLogListRespList = faultLogListResps.stream()
|
||||
.map(FaultLogListResp::faultLogListResp)
|
||||
.toList();
|
||||
return FaultLogTotalListResp.faultLogTotalListResp(faultLogListRespList,count);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.muyu.fault.domain.FaultRule;
|
||||
import com.muyu.fault.mapper.FaultRuleMapper;
|
||||
import com.muyu.fault.service.FaultRuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class FaultRuleServiceImpl extends ServiceImpl<FaultRuleMapper, FaultRule> implements FaultRuleService {
|
||||
|
||||
@Autowired
|
||||
private FaultRuleMapper faultRuleMapper;
|
||||
|
||||
/**
|
||||
* 车辆故障检测
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String checkfaults(FaultRule faultRule) {
|
||||
//获取触发条件
|
||||
LambdaQueryWrapper<FaultRule> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (Long.valueOf(faultRule.getFaultcodeId())!=null && faultRule.getFaultcodeId()!=0){
|
||||
queryWrapper.eq(FaultRule::getFaultcodeId, faultRule.getFaultcodeId());
|
||||
}
|
||||
List<FaultRule> faultRuleList = this.list(queryWrapper);
|
||||
for (FaultRule rule : faultRuleList) {
|
||||
//单个值比较
|
||||
if (faultRule.getSingleThreshold()!=null && faultRule.getMaxThreshold()==null && faultRule.getMinThreshold()==null){
|
||||
//大于阈值
|
||||
if (faultRule.getConditionContent().contains(">") || faultRule.getConditionContent().contains("大于")){
|
||||
if (faultRule.getThreshold().compareTo(rule.getSingleThreshold())>0){
|
||||
return "数据超过阈值,出现异常";
|
||||
}
|
||||
}
|
||||
//小于阈值
|
||||
if (faultRule.getConditionContent().contains("<") || faultRule.getConditionContent().contains("小于")){
|
||||
if (faultRule.getThreshold().compareTo(rule.getSingleThreshold())<0){
|
||||
return "数据过低,出现异常";
|
||||
}
|
||||
}
|
||||
}else { //区间值比较
|
||||
if (faultRule.getThreshold().compareTo(rule.getMinThreshold())<0 || faultRule.getThreshold().compareTo(rule.getMaxThreshold())>0){
|
||||
return "数据不在可控范围内,出现异常";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "判断出现异常";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import com.muyu.fault.domain.FaultType;
|
||||
import com.muyu.fault.mapper.FaultTypeMapper;
|
||||
import com.muyu.fault.service.FaultTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class FaultTypeServiceImpl extends ServiceImpl<FaultTypeMapper, FaultType> implements FaultTypeService {
|
||||
@Autowired
|
||||
private FaultTypeMapper faultTypeMapper;
|
||||
/**
|
||||
* 故障码分类查询
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<FaultType> select() {
|
||||
LambdaQueryWrapper<FaultType> queryWrapper = new LambdaQueryWrapper<>();
|
||||
List<FaultType> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer add(FaultType faultType) {
|
||||
return faultTypeMapper.add(faultType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer update(FaultType faultType) {
|
||||
return faultTypeMapper.update(faultType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer delete(Integer id) {
|
||||
return faultTypeMapper.delete(id);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.security.service.TokenService;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
import com.muyu.fault.domain.message.Message;
|
||||
import com.muyu.fault.domain.message.MessageReq;
|
||||
import com.muyu.fault.domain.message.MessageSendReq;
|
||||
import com.muyu.fault.mapper.MessageMapper;
|
||||
import com.muyu.fault.service.MessageService;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @className: FaultLog ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 21:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description: 故障检测
|
||||
*/
|
||||
@Service
|
||||
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService {
|
||||
@Autowired
|
||||
private TokenService tokenService;
|
||||
@Autowired
|
||||
private HttpServletRequest request;
|
||||
@Autowired
|
||||
private MessageMapper messageMapper;
|
||||
/**
|
||||
* 消息发送
|
||||
* @param messageSendReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void sendmessage(MessageSendReq messageSendReq) {
|
||||
String token = SecurityUtils.getToken();// 获取当前Token
|
||||
LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
|
||||
if (loginUser == null) {
|
||||
throw new RuntimeException("用户未登录或Token无效");
|
||||
}
|
||||
Long userid = loginUser.getUserid();
|
||||
messageSendReq.setUserId(userid);
|
||||
|
||||
// 定义一个DateTimeFormatter对象,用于格式化日期时间为yyyy-MM-dd HH:mm:ss
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
// 获取当前日期和时间
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
// 使用formatter格式化当前日期和时间
|
||||
String formattedDateTime = now.format(formatter);
|
||||
// 使用formatter将字符串解析回LocalDateTime
|
||||
LocalDateTime parsedDateTime = LocalDateTime.parse(formattedDateTime, formatter);
|
||||
// 然后按照上面的步骤将LocalDateTime转换为Date
|
||||
ZonedDateTime zdt = parsedDateTime.atZone(ZoneId.systemDefault());
|
||||
Date date = Date.from(zdt.toInstant());
|
||||
// 现在date是一个包含了字符串中日期和时间的Date对象
|
||||
messageSendReq.setCreateTime(date);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 消息查看
|
||||
* @param messageReq
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Message> selectmessage(MessageReq messageReq) {
|
||||
String token = SecurityUtils.getToken();// 获取当前Token
|
||||
LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
|
||||
if (loginUser == null) {
|
||||
throw new RuntimeException("用户未登录或Token无效");
|
||||
}
|
||||
Long userid = loginUser.getUserid();
|
||||
messageReq.setUserId(userid);
|
||||
LambdaQueryWrapper<Message> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.eq(StringUtils.isNotEmpty(String.valueOf(messageReq.getStatus())),
|
||||
// Message::getStatus,messageReq.getStatus());
|
||||
// queryWrapper.eq(StringUtils.isNotEmpty(String.valueOf(messageReq.getUserId())),
|
||||
// Message::getUserId,messageReq.getUserId());
|
||||
if (messageReq.getStatus() != null) {
|
||||
queryWrapper.eq(Message::getStatus, messageReq.getStatus());
|
||||
}
|
||||
queryWrapper.eq(Message::getUserId, messageReq.getUserId());
|
||||
List<Message> list = this.list(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看消息改变状态
|
||||
* @param message
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void changestatus(Message message) {
|
||||
messageMapper.changestatus(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看未读的消息
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Message> unread() {
|
||||
// return messageMapper.unread();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.muyu.fault.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.fault.domain.SysCarFault;
|
||||
import com.muyu.fault.mapper.SysCarFaultMapper;
|
||||
import com.muyu.fault.service.ISysCarFaultService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆故障Service业务层处理
|
||||
*
|
||||
* @author Yang鹏
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
@Service
|
||||
public class SysCarFaultServiceImpl
|
||||
extends ServiceImpl<SysCarFaultMapper, SysCarFault>
|
||||
implements ISysCarFaultService {
|
||||
|
||||
/**
|
||||
* 精确查询车辆故障
|
||||
*
|
||||
* @param id 车辆故障主键
|
||||
* @return 车辆故障
|
||||
*/
|
||||
@Override
|
||||
public SysCarFault selectSysCarFaultById(Long id)
|
||||
{
|
||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(id, "id不可为空");
|
||||
queryWrapper.eq(SysCarFault::getId, id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆故障列表
|
||||
*
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 车辆故障
|
||||
*/
|
||||
@Override
|
||||
public List<SysCarFault> selectSysCarFaultList(SysCarFault sysCarFault)
|
||||
{
|
||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultCode())){
|
||||
queryWrapper.eq(SysCarFault::getFaultCode, sysCarFault.getFaultCode());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultName())){
|
||||
queryWrapper.like(SysCarFault::getFaultName, sysCarFault.getFaultName());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultType())){
|
||||
queryWrapper.eq(SysCarFault::getFaultType, sysCarFault.getFaultType());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getCarVin())){
|
||||
queryWrapper.eq(SysCarFault::getCarVin, sysCarFault.getCarVin());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultLabel())){
|
||||
queryWrapper.eq(SysCarFault::getFaultLabel, sysCarFault.getFaultLabel());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultBit())){
|
||||
queryWrapper.eq(SysCarFault::getFaultBit, sysCarFault.getFaultBit());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultValue())){
|
||||
queryWrapper.eq(SysCarFault::getFaultValue, sysCarFault.getFaultValue());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultWarn())){
|
||||
queryWrapper.eq(SysCarFault::getFaultWarn, sysCarFault.getFaultWarn());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getWarnStatus())){
|
||||
queryWrapper.eq(SysCarFault::getWarnStatus, sysCarFault.getWarnStatus());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getFaultDesc())){
|
||||
queryWrapper.eq(SysCarFault::getFaultDesc, sysCarFault.getFaultDesc());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarFault.getState())){
|
||||
queryWrapper.eq(SysCarFault::getState, sysCarFault.getState());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 唯一 判断
|
||||
* @param sysCarFault 车辆故障
|
||||
* @return 车辆故障
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkIdUnique(SysCarFault sysCarFault) {
|
||||
LambdaQueryWrapper<SysCarFault> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysCarFault::getId, sysCarFault.getId());
|
||||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.muyu.fault.service.impl.faultDetectionStrategy;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @className: CarFaultRule ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* 针对燃油车的故障检测逻辑
|
||||
*/
|
||||
@Service(value = "FuelVehicleCar")
|
||||
public class FuelVehicleCarFaultDetectionStrategy {
|
||||
}
|
|
@ -0,0 +1,199 @@
|
|||
package com.muyu.fault.service.impl.faultDetectionStrategy;
|
||||
|
||||
|
||||
import com.muyu.fault.domain.CarFaultRule;
|
||||
import com.muyu.fault.domain.FaultReport;
|
||||
import com.muyu.fault.service.FaultDetectionStrategy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @className: CarFaultRule ️✈️
|
||||
* @author: Yang 鹏 🦅
|
||||
* @date: 2024/9/23 22:06 ⏰
|
||||
* @Version: 1.0
|
||||
* @description:
|
||||
*/
|
||||
|
||||
/**
|
||||
* 针对纯电车的故障检测逻辑
|
||||
*/
|
||||
@Service(value = "PureElectricCar")
|
||||
public class PureElectricCarFaultDetectionStrategy implements FaultDetectionStrategy {
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public FaultReport detectFaults(CarFaultRule carFaultRule) {
|
||||
|
||||
|
||||
//检测车速是否处于正常范围
|
||||
if (carFaultRule.getSpeed()>200 || carFaultRule.getSpeed()<0){
|
||||
return new FaultReport("纯电车","车速不在正常范围内,请注意");
|
||||
}
|
||||
//检测总里程数是否超过正常数
|
||||
if (carFaultRule.getTM()>5000000){
|
||||
return new FaultReport("纯电车","总里程数已超标,请注意");
|
||||
}
|
||||
//检测总电压是否正常
|
||||
if (carFaultRule.getTV()>650){
|
||||
return new FaultReport("纯电车","总电压过高,请注意");
|
||||
}
|
||||
//检测电流是否超标
|
||||
if (carFaultRule.getCC()>50){
|
||||
return new FaultReport("纯电车","电流过高,请注意");
|
||||
}
|
||||
//检测绝缘电阻
|
||||
if (carFaultRule.getIR()>100000){
|
||||
return new FaultReport("纯电车","绝缘电阻过高,请注意");
|
||||
}
|
||||
// //检测加速踏板行程值
|
||||
// if (carFaultRule.getAPTV()){
|
||||
//
|
||||
// }
|
||||
// //检测制动踏板行程值
|
||||
// if (carFaultRule.getBPTV()){
|
||||
//
|
||||
// }
|
||||
// //检测燃料消耗率
|
||||
// if (carFaultRule.getSFC()){
|
||||
//
|
||||
// }
|
||||
// //检测电机控制器温度
|
||||
// if (carFaultRule.getMCT()){
|
||||
//
|
||||
// }
|
||||
// //检测电机转速
|
||||
// if (carFaultRule.getMS()){
|
||||
//
|
||||
// }
|
||||
// //检测电机转矩
|
||||
// if (carFaultRule.getMTO()){
|
||||
//
|
||||
// }
|
||||
// //检测电机温度
|
||||
// if (carFaultRule.getMTE()){
|
||||
//
|
||||
// }
|
||||
// //检测电机电压
|
||||
// if (carFaultRule.getMV()){
|
||||
//
|
||||
// }
|
||||
// //检测电机电流
|
||||
// if (carFaultRule.getMC()){
|
||||
//
|
||||
// }
|
||||
// //检测动力电池剩余电量SOC
|
||||
// if (carFaultRule.getPBRSOC()){
|
||||
//
|
||||
// }
|
||||
// //检测当前状态允许的最大反馈功率
|
||||
// if (carFaultRule.getMACSFP()){
|
||||
//
|
||||
// }
|
||||
// //检测当前状态允许最大放电功率
|
||||
// if (carFaultRule.getCSATMDP()) {
|
||||
//
|
||||
// }
|
||||
// //检测BMS自检计数器
|
||||
// if (carFaultRule.getBMS()) {
|
||||
//
|
||||
// }
|
||||
// //检测动力电池充放电电流
|
||||
// if (carFaultRule.getCADC()) {
|
||||
//
|
||||
// }
|
||||
// //检测动力电池负载端总电压V3
|
||||
// if (carFaultRule.getPBLETVV3()) {
|
||||
//
|
||||
// }
|
||||
// //检测单次最大电压
|
||||
// if (carFaultRule.getSMV()) {
|
||||
//
|
||||
// }
|
||||
// //检测单体电池最低电压
|
||||
// if (carFaultRule.getMVOAB()) {
|
||||
//
|
||||
// }
|
||||
// //检测单体电池最高温度
|
||||
// if (carFaultRule.getMAXBT()) {
|
||||
//
|
||||
// }
|
||||
// //检测单体电池最低温度
|
||||
// if (carFaultRule.getMINBT()) {
|
||||
//
|
||||
// }
|
||||
// //检测动力电池可用容量
|
||||
// if (carFaultRule.getPBAC()) {
|
||||
//
|
||||
// }
|
||||
// //检测车辆状态
|
||||
// if (carFaultRule.getVS()) {
|
||||
//
|
||||
// }
|
||||
// //检测充电状态
|
||||
// if (carFaultRule.getCS()) {
|
||||
//
|
||||
// }
|
||||
// //检测运行状态
|
||||
// if (carFaultRule.getRS()) {
|
||||
//
|
||||
// }
|
||||
// //检测SOC
|
||||
// if (carFaultRule.getSOC()) {
|
||||
//
|
||||
// }
|
||||
// //检测可充电储能装置工作状态
|
||||
// if (carFaultRule.getRESDWC()) {
|
||||
//
|
||||
// }
|
||||
// //检测驱动电机状态
|
||||
// if (carFaultRule.getEAS()) {
|
||||
//
|
||||
// }
|
||||
// //检测定位是否有效
|
||||
// if (carFaultRule.getPTC()) {
|
||||
//
|
||||
// }
|
||||
// //检测EAS
|
||||
// if (carFaultRule.getEPS()) {
|
||||
//
|
||||
// }
|
||||
// //检测PTC
|
||||
// if (carFaultRule.getABS()) {
|
||||
//
|
||||
// }
|
||||
// //检测EPS
|
||||
// if (carFaultRule.getMCU()) {
|
||||
//
|
||||
// }
|
||||
// //检测ABS
|
||||
// if (carFaultRule.getPBHS()) {
|
||||
//
|
||||
// }
|
||||
// //检测MCU
|
||||
// if (carFaultRule.getPBCS()) {
|
||||
//
|
||||
// }
|
||||
// //检测动力电池加热状态
|
||||
// if (carFaultRule.getPBIS()) {
|
||||
//
|
||||
// }
|
||||
// //检测动力电池当前状态
|
||||
// if (carFaultRule.getDCDC()) {
|
||||
//
|
||||
// }
|
||||
// //检测动力电池保温状态
|
||||
// if (carFaultRule.getCHG()) {
|
||||
//
|
||||
// }
|
||||
// //检测DCDC
|
||||
// if (carFaultRule.getCHB()) {
|
||||
//
|
||||
// }
|
||||
// //检测CHG
|
||||
// if (carFaultRule.getCUB()) {
|
||||
//
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -1,25 +1,19 @@
|
|||
# Tomcat
|
||||
#server:
|
||||
# port: 9703
|
||||
server:
|
||||
port: 9434
|
||||
|
||||
# nacos线上地址
|
||||
nacos:
|
||||
addr: 123.57.152.124:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: lhd
|
||||
# SPRING_AMQP_DESERIALIZATION_TRUST_ALL=true spring.amqp.deserialization.trust.all
|
||||
namespace: five
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
amqp:
|
||||
deserialization:
|
||||
trust:
|
||||
all: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
application:
|
||||
# 应用名称
|
||||
name: cloud-vehicleGateway
|
||||
name: cloud-fault
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
@ -51,6 +45,5 @@ spring:
|
|||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
# 系统环境Config共享配置
|
||||
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
||||
# xxl-job 配置文件
|
||||
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-parse"/>
|
||||
<property name="log.path" value="logs/cloud-fault"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-parse"/>
|
||||
<property name="log.path" value="logs/cloud-fault"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-parse"/>
|
||||
<property name="log.path" value="logs/cloud-fault"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
|
@ -0,0 +1,102 @@
|
|||
<?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.muyu.fault.mapper.FaultCodeMapper">
|
||||
<resultMap id="FaultCodeVoResult" type="com.muyu.fault.domain.FaultCode">
|
||||
<id property="faultcodeId" column="faultcode_id"></id>
|
||||
<result property="messageTypeId" column="message_type_id"></result>
|
||||
<result property="faultcodeNumber" column="faultcode_number"></result>
|
||||
<result property="faultGroup" column="fault_group"></result>
|
||||
<result property="faultBit" column="fault_bit"></result>
|
||||
<result property="faultValue" column="fault_value"></result>
|
||||
<result property="isWarning" column="is_warning"></result>
|
||||
<result property="faulttypeName" column="faulttype_name"></result>
|
||||
<result property="messageTypeName" column="message_type_name"></result>
|
||||
<result property="messageTypeCode" column="message_type_code"></result>
|
||||
<result property="messageTypeBelongs" column="message_type_belongs"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectfaultcodelist" >
|
||||
SELECT
|
||||
car_faultcode.faultcode_id,
|
||||
car_faultcode.message_type_id,
|
||||
car_fault_label.message_type_code,
|
||||
car_faultcode.faultcode_number,
|
||||
car_faultcode.fault_group,
|
||||
car_faultcode.fault_bit,
|
||||
car_faultcode.fault_value,
|
||||
car_fault_label.message_type_name,
|
||||
car_faultcode.is_warning
|
||||
FROM
|
||||
car_faultcode
|
||||
LEFT JOIN car_fault_label ON car_faultcode.message_type_id = car_fault_label.message_type_id
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<!--故障码列表展示-->
|
||||
<select id="selectfaultcodelist" resultMap="FaultCodeVoResult">
|
||||
<include refid="selectfaultcodelist"></include>
|
||||
<where>
|
||||
<if test="faultcodeNumber!=null and faultcodeNumber!=''">
|
||||
and car_faultcode.faultcode_number=#{faultcodeNumber}
|
||||
</if>
|
||||
<if test="faultBit!=null and faultBit!=''">
|
||||
and car_faultcode.fault_bit=#{faultBit}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageNum},#{pageSize}
|
||||
</select>
|
||||
|
||||
<!--新增故障码-->
|
||||
<select id="selectfaultName" resultType="com.muyu.fault.domain.FaultLabel">
|
||||
select * from car_fault_label where message_type_name=#{messageTypeName}
|
||||
</select>
|
||||
<select id="selectfaultCode" resultType="com.muyu.fault.domain.FaultCode">
|
||||
select * from car_faultcode where faultcode_number=#{faultcodeNumber}
|
||||
</select>
|
||||
<insert id="insertfaultlabel" keyProperty="messageTypeId" useGeneratedKeys="true">
|
||||
INSERT INTO `eight`.`car_fault_label`
|
||||
(`message_type_id`, `message_type_code`, `message_type_name`, `message_type_belongs`) VALUES
|
||||
(0, #{messageTypeCode}, #{messageTypeName}, '车辆基础');
|
||||
</insert>
|
||||
<insert id="insertfaultcode">
|
||||
INSERT INTO `eight`.`car_faultcode`
|
||||
(`faultcode_id`, `message_type_id`, `faultcode_number`, `fault_group`, `fault_bit`, `fault_value`, `is_warning`) VALUES
|
||||
(0, #{messageTypeId}, #{faultcodeNumber}, #{faultGroup}, #{faultBit}, #{faultValue}, #{isWarning});
|
||||
|
||||
</insert>
|
||||
|
||||
|
||||
<!--修改故障码-->
|
||||
<update id="updfaultlabel">
|
||||
UPDATE `eight`.`car_fault_label`
|
||||
SET `message_type_code` = #{messageTypeCode},
|
||||
`message_type_name` = #{messageTypeName},
|
||||
`message_type_belongs` =#{messageTypeBelongs}
|
||||
WHERE `message_type_id` = #{messageTypeId};
|
||||
</update>
|
||||
<update id="updfaultcode">
|
||||
UPDATE `eight`.`car_faultcode`
|
||||
SET `message_type_id` = #{messageTypeId},
|
||||
`faultcode_number` = #{faultcodeNumber},
|
||||
`fault_group` = #{faultGroup},
|
||||
`fault_bit` = #{faultBit},
|
||||
`fault_value` = #{faultValue},
|
||||
`is_warning` = #{isWarning}
|
||||
WHERE `faultcode_id` = #{faultcodeId};
|
||||
</update>
|
||||
|
||||
<!--删除故障码-->
|
||||
<select id="findByfaultcodeId" resultType="com.muyu.fault.domain.FaultCode">
|
||||
select * from car_faultcode where faultcode_id=#{faultcodeId}
|
||||
</select>
|
||||
<delete id="delfaultcode">
|
||||
delete from car_faultcode where message_type_id=#{messageTypeId}
|
||||
</delete>
|
||||
<delete id="delfaultlabel">
|
||||
delete from car_fault_label where message_type_id=#{messageTypeId}
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,56 @@
|
|||
<?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.muyu.fault.mapper.FaultConditionMapper">
|
||||
<resultMap id="FaultConditionResult" type="com.muyu.fault.domain.FaultCondition">
|
||||
<id property="carconditionId" column="carcondition_id"></id>
|
||||
<result property="carTypeId" column="car_type_id"></result>
|
||||
<result property="messageTypeId" column="message_type_id"></result>
|
||||
<result property="faultconditionIdentification" column="faultcondition_identification"></result>
|
||||
<result property="faultconditionParameter" column="faultcondition_parameter"></result>
|
||||
<result property="carTypeName" column="car_type_name"></result>
|
||||
<result property="messageTypeName" column="message_type_name"></result>
|
||||
<result property="messageTypeCode" column="message_type_code"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectfaultconditionlist" >
|
||||
SELECT
|
||||
car_fault_condition.*,
|
||||
car_type.car_type_name,
|
||||
car_fault_label.message_type_name,
|
||||
car_fault_label.message_type_code
|
||||
FROM
|
||||
car_fault_condition
|
||||
LEFT JOIN car_type ON car_fault_condition.car_type_id = car_type.car_type_id
|
||||
LEFT JOIN car_fault_label ON car_fault_condition.message_type_id = car_fault_label.message_type_id
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectfaultconditionlist" resultType="com.muyu.fault.domain.FaultCondition">
|
||||
<include refid="selectfaultconditionlist"></include>
|
||||
<where>
|
||||
<if test="carTypeId!=null and carTypeId!=''">
|
||||
and car_type.car_type_id=#{carTypeId}
|
||||
</if>
|
||||
<if test="messageTypeId!=null and messageTypeId!=''">
|
||||
and car_fault_label.message_type_id=#{messageTypeId}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageNum},#{pageSize}
|
||||
</select>
|
||||
|
||||
<select id="selectBytypeAndlabel" resultType="com.muyu.fault.domain.FaultCondition">
|
||||
SELECT
|
||||
car_fault_condition.*
|
||||
FROM
|
||||
car_fault_condition
|
||||
where
|
||||
car_fault_condition.car_type_id=#{carTypeId}
|
||||
and car_fault_condition.message_type_id=#{messageTypeId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,45 @@
|
|||
<?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.muyu.fault.mapper.FaultLogMapper">
|
||||
<resultMap id="FaultCodeLogResult" type="com.muyu.fault.domain.FaultLog">
|
||||
<id property="logId" column="log_id"></id>
|
||||
<result property="faultcodeId" column="faultcode_id"></result>
|
||||
<result property="carInformationId" column="car_information_id"></result>
|
||||
<result property="carVin" column="car_vin"></result>
|
||||
<result property="startwarningTime" column="startwarning_time"></result>
|
||||
<result property="endwarningTime" column="endwarning_time"></result>
|
||||
<result property="carInformationVIN" column="car_information_VIN"></result>
|
||||
<result property="faultcodeNumber" column="faultcode_number"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectfaultloglist">
|
||||
SELECT
|
||||
car_fault_log.*,
|
||||
car_faultcode.faultcode_number,
|
||||
car_information.car_information_VIN
|
||||
FROM
|
||||
car_fault_log
|
||||
LEFT JOIN car_faultcode ON car_fault_log.faultcode_id = car_faultcode.faultcode_id
|
||||
LEFT JOIN car_information ON car_fault_log.car_information_id = car_information.car_information_id
|
||||
</sql>
|
||||
|
||||
<!--日志列表-->
|
||||
<select id="selectfaultLogMapper" resultType="com.muyu.fault.domain.FaultLog">
|
||||
<include refid="selectfaultloglist"></include>
|
||||
<where>
|
||||
<if test="carVin!=null and carVin!=''">
|
||||
and car_fault_log.car_vin=#{carVin}
|
||||
</if>
|
||||
<if test="startwarningTime!=null and startwarningTime!=''">
|
||||
and car_fault_log.startwarning_time=#{startwarningTime}
|
||||
</if>
|
||||
<if test="endwarningTime!=null and endwarningTime!=''">
|
||||
and car_fault_log.endwarning_time=#{endwarningTime}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageNum},#{pageSize}
|
||||
</select>
|
||||
</mapper>
|
|
@ -0,0 +1,16 @@
|
|||
<?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.muyu.fault.mapper.MessageMapper">
|
||||
|
||||
<select id="unread" resultType="com.muyu.fault.domain.message.Message">
|
||||
select * from car_fault_message where status=0
|
||||
</select>
|
||||
|
||||
<update id="changestatus">
|
||||
update car_fault_message set status=1 where id=#{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
|
@ -5,11 +5,15 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>enterpise-service</artifactId>
|
||||
<artifactId>cloud-module-enterprise</artifactId>
|
||||
|
||||
<description>
|
||||
cloud-modules-enterprise
|
||||
</description>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
|
@ -20,8 +24,9 @@
|
|||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-common</artifactId>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
|
@ -84,13 +89,6 @@
|
|||
<artifactId>cloud-common-xxl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- cache缓存框架 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>enterpise-cache</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
|
@ -15,8 +15,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
//@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class CloudEnterpiseApplication {
|
||||
public class CloudWarnApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CloudEnterpiseApplication.class, args);
|
||||
SpringApplication.run(CloudWarnApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,8 @@
|
|||
package com.muyu.enterpise.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
package com.muyu.controller;
|
||||
|
||||
import com.muyu.domain.CarFenceClazz;
|
||||
import com.muyu.enterpise.service.CarFenceClazzService;
|
||||
import com.muyu.service.CarFenceClazzService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
@ -15,14 +14,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 从围栏信息表中查询数据
|
||||
* * @Author:yang
|
||||
* * @Package:com.muyu.server.controller
|
||||
* * @ClassName:CarFenceClazzController
|
||||
* * @Project:cloud-electronic
|
||||
* * @name:CarFenceClazzController
|
||||
* * @Date:2024/9/20 14:31
|
||||
* * @Description:从围栏信息表中查询数据
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.server.controller
|
||||
* @Project:cloud-electronic
|
||||
* @name:CarFenceClazzController
|
||||
* @Date:2024/9/20 14:31
|
||||
*/
|
||||
@RequestMapping("/carFenceClazz")
|
||||
@RestController
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue