Compare commits
80 Commits
4c6ce87e8c
...
4ca2fd7e7e
Author | SHA1 | Date |
---|---|---|
|
4ca2fd7e7e | |
|
4f52c6c4ac | |
|
0534db9f37 | |
|
7207dcc01c | |
|
b74b18a615 | |
|
ec41019824 | |
|
b491045ebf | |
|
580172aa76 | |
|
3202af6ebb | |
|
c08a1376d6 | |
|
9bb39ec32a | |
|
6e0ed3b883 | |
|
94d04e3a35 | |
|
a9bfdc1670 | |
|
111129e777 | |
|
0bafed3671 | |
|
0db37dc190 | |
|
22e068cfc5 | |
|
9f0f373594 | |
|
a2f2d2ec52 | |
|
26c0d3d4c8 | |
|
7fa71097fd | |
|
e018d60115 | |
|
20977536e3 | |
|
222b2ad30f | |
|
eef7d19aeb | |
|
19f67a389c | |
|
f7f54bf0c1 | |
|
a1894bb013 | |
|
ca8bd65148 | |
|
a0c2d916f2 | |
|
8888b7430c | |
|
a8222a4c88 | |
|
98fa19923d | |
|
3378b4c216 | |
|
688527037d | |
|
d896e9b26d | |
|
3fb0158cfa | |
|
5d66ce181f | |
|
46689d02e1 | |
|
576befa0ee | |
|
6f95055a6b | |
|
17245c91b3 | |
|
ff3f1e8ac2 | |
|
147dbe2c99 | |
|
b9529234e9 | |
|
0ed0f872e9 | |
|
7e2ad67a64 | |
|
c67d648a8a | |
|
5203c69a90 | |
|
3ebd1d2c39 | |
|
0c7795ea71 | |
|
add31c49fa | |
|
7100bf71bf | |
|
497de4ade9 | |
|
940e41b297 | |
|
514c94b398 | |
|
7e02675028 | |
|
22675757b3 | |
|
6594363a91 | |
|
517c18f215 | |
|
e2d710fbb6 | |
|
9f01b76182 | |
|
fedc3c4ea7 | |
|
423836afb7 | |
|
cb79600bc0 | |
|
a18ba509d8 | |
|
5979dbea8f | |
|
782f31446b | |
|
47567ff055 | |
|
1378aeeb06 | |
|
51cfc6ab2d | |
|
681c88db28 | |
|
2d0f557398 | |
|
9c059750b6 | |
|
38a096ea72 | |
|
cd46940e70 | |
|
b70a552b6a | |
|
d054119692 | |
|
e9a19e94e9 |
|
@ -26,6 +26,7 @@ logs
|
||||||
*.iws
|
*.iws
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
|
*.yml
|
||||||
|
|
||||||
### JRebel ###
|
### JRebel ###
|
||||||
rebel.xml
|
rebel.xml
|
||||||
|
|
|
@ -76,19 +76,18 @@ public class SysLoginService {
|
||||||
if (Result.FAIL == userResult.getCode()) {
|
if (Result.FAIL == userResult.getCode()) {
|
||||||
throw new ServiceException(userResult.getMsg());
|
throw new ServiceException(userResult.getMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginUser userInfo = userResult.getData();
|
LoginUser userInfo = userResult.getData();
|
||||||
SysUser user = userResult.getData().getSysUser();
|
SysUser user = userResult.getData().getSysUser();
|
||||||
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) {
|
if(UserStatus.DELETED.getCode().equals(user.getDelFlag())){
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
|
recordLogService.recordLogininfor(username,Constants.LOGIN_FAIL,"对不起,您的账号已被删除");
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
throw new ServiceException("对不起,您的账号:" + username + " 已被删除 ");
|
||||||
}
|
}
|
||||||
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) {
|
if(UserStatus.DISABLE.getCode().equals(user.getStatus())){
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员");
|
recordLogService.recordLogininfor(username,Constants.LOGIN_FAIL,"用户已停用,请联系管理官");
|
||||||
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||||
}
|
}
|
||||||
passwordService.validate(user, password);
|
passwordService.validate(user,password);
|
||||||
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
recordLogService.recordLogininfor(username,Constants.LOGIN_SUCCESS,"登录成功");
|
||||||
return userInfo;
|
return userInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,16 +127,16 @@ public class SysLoginService {
|
||||||
throw new ServiceException("密码长度必须在5到20个字符之间");
|
throw new ServiceException("密码长度必须在5到20个字符之间");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 注册用户信息
|
//注册用户信息
|
||||||
SysUser sysUser = new SysUser();
|
SysUser sysUser = new SysUser();
|
||||||
sysUser.setUserName(username);
|
sysUser.setUserName(username);
|
||||||
sysUser.setNickName(username);
|
sysUser.setNickName(username);
|
||||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
Result<?> registerResult = remoteUserService.registerUserInfo(registerBody, SecurityConstants.INNER);
|
Result<Boolean> registerResult = remoteUserService.registerUserInfo(registerBody, SecurityConstants.INNER);
|
||||||
|
|
||||||
if (Result.FAIL == registerResult.getCode()) {
|
if (Result.FAIL == registerResult.getCode()) {
|
||||||
throw new ServiceException(registerResult.getMsg());
|
throw new ServiceException(registerResult.getMsg());
|
||||||
}
|
}
|
||||||
recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功");
|
|
||||||
|
recordLogService.recordLogininfor(username,Constants.REGISTER,"注册成功");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
server:
|
server:
|
||||||
port: 9500
|
port: 9500
|
||||||
|
|
||||||
|
# nacos线上地址
|
||||||
nacos:
|
nacos:
|
||||||
addr: 106.15.136.7:8848
|
addr: 106.15.136.7:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.common.cache.config;
|
package com.muyu.common.cache.config;
|
||||||
|
|
||||||
|
import com.muyu.common.core.text.StrFormatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键基础
|
* 主键基础
|
||||||
* @ClassName PrimaryKeyBasic
|
* @ClassName PrimaryKeyBasic
|
||||||
|
@ -13,13 +15,18 @@ public interface PrimaryKeyBasic <K>{
|
||||||
*/
|
*/
|
||||||
public String keyPre();
|
public String keyPre();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* key 后缀
|
||||||
|
*/
|
||||||
|
public String keyPost();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编码
|
* 编码
|
||||||
* @param key 缓存键
|
* @param key 缓存键
|
||||||
* @return 装修键
|
* @return 装修键
|
||||||
*/
|
*/
|
||||||
public default String encode(K key){
|
public default String encode(K key){
|
||||||
return keyPre() + key.toString();
|
return StrFormatter.format("{}:vin{}:{}", keyPre(), key.toString(), keyPost());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.common.core.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* kafka常量信息
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.common.core.constant
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:KafkaConstants
|
||||||
|
* @Date:2024/9/29 16:41
|
||||||
|
*/
|
||||||
|
public class KafkaConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 协议解析报文传递数据(队列名称)
|
||||||
|
*/
|
||||||
|
public final static String MESSAGE_PARSING = "MessageParsing";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.muyu.common.core.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis常量信息
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.common.core.constant
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:RedisConstants
|
||||||
|
* @Date:2024/9/29 17:28
|
||||||
|
*/
|
||||||
|
public class RedisConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redisKey(协议解析报文传递)
|
||||||
|
*/
|
||||||
|
public final static String MESSAGE_TEMPLATE = "messageTemplate";
|
||||||
|
}
|
|
@ -20,9 +20,9 @@ public class ServiceNameConstants {
|
||||||
* 文件服务的serviceid
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "cloud-file";
|
public static final String FILE_SERVICE = "cloud-file";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件服务的serviceid
|
* 企业平台服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String ENTERPRISE_SERVICE = "cloud-enterprise";
|
public static final String ENTERPRISE_SERVICE = "cloud-enterprise";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?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>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
cloud-common-kafka模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</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>
|
|
@ -0,0 +1,102 @@
|
||||||
|
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: zi run
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
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: zi run
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.muyu.common.kafka.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @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";
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
com.muyu.common.kafka.config.KafkaProducerConfig
|
||||||
|
com.muyu.common.kafka.config.KafkaConsumerConfig
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?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-mqtt</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
cloud-common-mqtt消息队列遥测传输协议
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- 项目公共核心模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.muyu.common.mqtt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mqtt连接配置
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.common.mqtt
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MQTTConnect
|
||||||
|
* @Date:2024/10/2 9:40
|
||||||
|
*/
|
||||||
|
public class MQTTConnect
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* String topic = "vehicle";
|
||||||
|
* String broker = "tcp://106.15.136.7:1883";
|
||||||
|
* String clientId = "JavaSample";
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义主题字符串,用于MQTT消息交换的频道
|
||||||
|
*/
|
||||||
|
public static final String TOPIC="vehicle";
|
||||||
|
/**
|
||||||
|
*定义代理服务器的连接字符串,格式通常为协议名称,IP地址和端口号
|
||||||
|
*/
|
||||||
|
public static final String BROKER="tcp://106.15.136.7:1883";
|
||||||
|
/**
|
||||||
|
*定义客户端ID,用于在MQTT代理服务器中标识客户端
|
||||||
|
*/
|
||||||
|
public static final String CLIENT_ID ="JavaSample";
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.common.rabbit.callback;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 9:26
|
||||||
|
* @Description 消息发送到broker确认回调
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class ConfirmCallback implements RabbitTemplate.ConfirmCallback {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
this.rabbitTemplate.setConfirmCallback(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回调确认方法(消息发送之后 消息无论发送成功还是失败都会执行这个回调方法)
|
||||||
|
* @param correlationData 回调的相关数据
|
||||||
|
* @param ack 确认结果(true表示消息已经被broker接收,false表示消息未被broker接收)
|
||||||
|
* @param cause 失败原因(当ack为false时,表示拒绝接收消息的原因;当ack为true时,该值为空)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
||||||
|
if (ack) {
|
||||||
|
log.info("消息发送到broker成功!");
|
||||||
|
} else {
|
||||||
|
log.info("消息发送到broker失败,失败原因:{}", cause);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.common.rabbit.callback;
|
||||||
|
|
||||||
|
import jakarta.annotation.PostConstruct;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.amqp.core.ReturnedMessage;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 9:33
|
||||||
|
* @Description 消息发送失败时回调
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class ReturnsCallback implements RabbitTemplate.ReturnsCallback {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化
|
||||||
|
*/
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
rabbitTemplate.setReturnsCallback(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息发送到队列失败时执行
|
||||||
|
* @param returnedMessage 返回的消息和元数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void returnedMessage(ReturnedMessage returnedMessage) {
|
||||||
|
log.info("消息:{}被交换机:{}回退!回退原因:{}", returnedMessage.getMessage().toString(),
|
||||||
|
returnedMessage.getExchange(), returnedMessage.getReplyText());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.muyu.common.rabbit.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
||||||
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
|
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 16:41
|
||||||
|
* @Description RabbitMQ连接和管理功能配置
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class RabbitAdminConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ服务器的主机地址
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.host}")
|
||||||
|
private String host;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ的用户名
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.username}")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ的密码
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.password}")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RabbitMQ的虚拟主机
|
||||||
|
*/
|
||||||
|
@Value("${spring.rabbitmq.virtualhost}")
|
||||||
|
private String virtualhost;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建并初始化RabbitAdmin实例
|
||||||
|
*
|
||||||
|
* @return RabbitAdmin 实例
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public RabbitAdmin rabbitAdmin() {
|
||||||
|
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory());
|
||||||
|
rabbitAdmin.setAutoStartup(true);
|
||||||
|
return rabbitAdmin;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建RabbitMQ连接工厂
|
||||||
|
*
|
||||||
|
* @return ConnectionFactory 实例
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public ConnectionFactory connectionFactory() {
|
||||||
|
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
|
||||||
|
connectionFactory.setAddresses(host);
|
||||||
|
connectionFactory.setUsername(username);
|
||||||
|
connectionFactory.setPassword(password);
|
||||||
|
connectionFactory.setVirtualHost(virtualhost);
|
||||||
|
|
||||||
|
// 配置发送确认回调时,次配置必须配置,否则即使在RabbitTemplate配置了ConfirmCallback也不会生效
|
||||||
|
connectionFactory.setPublisherConfirmType(CachingConnectionFactory.ConfirmType.CORRELATED);
|
||||||
|
connectionFactory.setPublisherReturns(true);
|
||||||
|
return connectionFactory;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,28 +1,41 @@
|
||||||
package com.muyu.common.rabbit;
|
package com.muyu.common.rabbit.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer;
|
||||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||||
import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar;
|
import org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistrar;
|
||||||
|
import org.springframework.amqp.support.converter.MessageConverter;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
|
import org.springframework.messaging.converter.MappingJackson2MessageConverter;
|
||||||
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
|
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 10:06
|
||||||
|
* @Description rabbitMQ的监听器配置
|
||||||
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class RabbitListenerConfigurer implements org.springframework.amqp.rabbit.annotation.RabbitListenerConfigurer {
|
public class RabbitListenerConfig implements RabbitListenerConfigurer {
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
// 设置为信任所有类型的反序列化,确保消息能够正确反序列化
|
||||||
System.setProperty("spring.amqp.deserialization.trust.all", "true");
|
System.setProperty("spring.amqp.deserialization.trust.all", "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
//以下配置RabbitMQ消息服务
|
/**
|
||||||
|
* RabbitMQ连接工厂,用于创建连接
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public ConnectionFactory connectionFactory;
|
public ConnectionFactory connectionFactory;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageConverter jsonMessageConverter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理器方法工厂
|
* 创建处理器方法工厂的bean
|
||||||
* @return
|
*
|
||||||
|
* @return DefaultMessageHandlerMethodFactory 实例,用于处理消息的转换和方法调用
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public DefaultMessageHandlerMethodFactory handlerMethodFactory() {
|
public DefaultMessageHandlerMethodFactory handlerMethodFactory() {
|
||||||
|
@ -32,8 +45,14 @@ public class RabbitListenerConfigurer implements org.springframework.amqp.rabbit
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置RabbitMQ监听器的消息处理方法工厂。
|
||||||
|
*
|
||||||
|
* @param rabbitListenerEndpointRegistrar 实例,用于注册监听器的配置
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void configureRabbitListeners(RabbitListenerEndpointRegistrar rabbitListenerEndpointRegistrar) {
|
public void configureRabbitListeners(RabbitListenerEndpointRegistrar rabbitListenerEndpointRegistrar) {
|
||||||
|
// 注册自定义的消息处理方法工厂
|
||||||
rabbitListenerEndpointRegistrar.setMessageHandlerMethodFactory(handlerMethodFactory());
|
rabbitListenerEndpointRegistrar.setMessageHandlerMethodFactory(handlerMethodFactory());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
|
||||||
|
package com.muyu.common.rabbit.config;
|
||||||
|
|
||||||
|
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||||
|
import org.springframework.amqp.support.converter.MessageConverter;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: zi run
|
||||||
|
* @Date 2024/10/2 9:17
|
||||||
|
* @Description rabbitMQ消息转换器配置
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class RabbitMQMessageConverterConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息转换配置
|
||||||
|
*
|
||||||
|
* @return 消息转换器
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public MessageConverter jsonMessageConverter() {
|
||||||
|
return new Jackson2JsonMessageConverter();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1,3 @@
|
||||||
com.muyu.common.rabbit.RabbitListenerConfigurer
|
com.muyu.common.rabbit.config.RabbitAdminConfig
|
||||||
|
com.muyu.common.rabbit.config.RabbitListenerConfig
|
||||||
|
com.muyu.common.rabbit.config.RabbitMQMessageConverterConfig
|
|
@ -91,21 +91,19 @@ public class ManyDataSource implements ApplicationRunner {
|
||||||
@Bean
|
@Bean
|
||||||
public DynamicDataSource dynamicDataSource(DruidDataSourceFactory druidDataSourceFactory) {
|
public DynamicDataSource dynamicDataSource(DruidDataSourceFactory druidDataSourceFactory) {
|
||||||
List<EntInfo> entInfoList = dataSourceInfoList();
|
List<EntInfo> entInfoList = dataSourceInfoList();
|
||||||
if(StringUtils.isEmpty(entInfoList)){
|
if (StringUtils.isNotEmpty(entInfoList)) {
|
||||||
throw new SaaSException("数据源信息列表为空或为null");
|
throw new SaaSException("数据元信息列表为空或为null");
|
||||||
}
|
}
|
||||||
Map<Object, Object> dataSourceMap = dataSourceInfoList().stream()
|
Map<Object,Object> dataSourceMap = dataSourceInfoList().stream()
|
||||||
.map(entInfo -> DataSourceInfo.hostAndPortBuild(
|
.map(entInfo -> DataSourceInfo.hostAndPortBuild(
|
||||||
entInfo.getEntCode(),
|
entInfo.getEntCode(),
|
||||||
entInfo.getIp(),
|
entInfo.getIp(),
|
||||||
entInfo.getPort()
|
entInfo.getPort()
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.collect(Collectors.toMap(
|
).collect(Collectors.toMap(
|
||||||
dataSourceInfo -> dataSourceInfo.getKey(),
|
dataSourceInfo -> dataSourceInfo.getKey(),
|
||||||
dataSourceInfo -> druidDataSourceFactory.create(dataSourceInfo)
|
dataSourceInfo -> druidDataSourceFactory.create(dataSourceInfo)
|
||||||
));
|
));
|
||||||
|
|
||||||
//设置动态数据源
|
//设置动态数据源
|
||||||
DynamicDataSource dynamicDataSource = new DynamicDataSource();
|
DynamicDataSource dynamicDataSource = new DynamicDataSource();
|
||||||
dynamicDataSource.setTargetDataSources(dataSourceMap);
|
dynamicDataSource.setTargetDataSources(dataSourceMap);
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package com.muyu.cloud.common.many.datasource.constents;
|
package com.muyu.cloud.common.many.datasource.constents;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: zi run
|
* 数据源常量
|
||||||
* @Date 2024/9/20 14:52
|
* @Author chenruijia
|
||||||
|
* @Date 2024/9/29 17:52
|
||||||
* @Description 数据源常量
|
* @Description 数据源常量
|
||||||
*/
|
*/
|
||||||
public class DatasourceContent {
|
public class DatasourceContent {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 数据源实体类
|
||||||
* @Author: zi run
|
* @Author: zi run
|
||||||
* @Date 2024/9/20 14:52
|
* @Date 2024/9/20 14:52
|
||||||
* @Description 数据源实体类
|
* @Description 数据源实体类
|
||||||
|
|
|
@ -8,6 +8,7 @@ import org.springframework.stereotype.Component;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Druid工厂
|
||||||
* @Author: zi run
|
* @Author: zi run
|
||||||
* @Date 2024/9/20 14:52
|
* @Date 2024/9/20 14:52
|
||||||
* @Description Druid工厂
|
* @Description Druid工厂
|
||||||
|
|
|
@ -4,6 +4,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 数据源切换处理
|
||||||
* @Author: zi run
|
* @Author: zi run
|
||||||
* @Date 2024/9/20 14:52
|
* @Date 2024/9/20 14:52
|
||||||
* @Description 数据源切换处理
|
* @Description 数据源切换处理
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.springframework.context.annotation.Import;
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 接口文档
|
||||||
* @ClassName EnableCustomSwagger2
|
* @ClassName EnableCustomSwagger2
|
||||||
* @Description EnableCustomSwagger2:类的描述
|
* @Description EnableCustomSwagger2:类的描述
|
||||||
* @Date 2024/10/6 22:16
|
* @Date 2024/10/6 22:16
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.util.function.Predicate;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 安全模块
|
||||||
* @ClassName SwaggerAutoConfiguration
|
* @ClassName SwaggerAutoConfiguration
|
||||||
* @Description SwaggerAutoConfiguration:类的描述
|
* @Description SwaggerAutoConfiguration:类的描述
|
||||||
* @Date 2024/10/6 22:16
|
* @Date 2024/10/6 22:16
|
||||||
|
|
|
@ -13,6 +13,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* BEAN
|
||||||
* @ClassName SwaggerBeanPostProcessor
|
* @ClassName SwaggerBeanPostProcessor
|
||||||
* @Description SwaggerBeanPostProcessor:类的描述
|
* @Description SwaggerBeanPostProcessor:类的描述
|
||||||
* @Date 2024/10/6 22:16
|
* @Date 2024/10/6 22:16
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* SWAGGER
|
||||||
* @ClassName SwaggerProperties
|
* @ClassName SwaggerProperties
|
||||||
* @Description SwaggerProperties:类的描述
|
* @Description SwaggerProperties:类的描述
|
||||||
* @Date 2024/10/6 22:16
|
* @Date 2024/10/6 22:16
|
||||||
|
|
|
@ -5,6 +5,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 前台页面
|
||||||
* @ClassName SwaggerWebConfiguration
|
* @ClassName SwaggerWebConfiguration
|
||||||
* @Description SwaggerWebConfiguration:类的描述
|
* @Description SwaggerWebConfiguration:类的描述
|
||||||
* @Date 2024/10/6 22:16
|
* @Date 2024/10/6 22:16
|
||||||
|
|
|
@ -21,8 +21,10 @@
|
||||||
<module>cloud-common-system</module>
|
<module>cloud-common-system</module>
|
||||||
<module>cloud-common-xxl</module>
|
<module>cloud-common-xxl</module>
|
||||||
<module>cloud-common-rabbit</module>
|
<module>cloud-common-rabbit</module>
|
||||||
|
<module>cloud-common-kafka</module>
|
||||||
<module>cloud-common-cache</module>
|
<module>cloud-common-cache</module>
|
||||||
<module>cloud-common-swagger</module>
|
<module>cloud-common-swagger</module>
|
||||||
|
<module>cloud-common-mqtt</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>cloud-common</artifactId>
|
<artifactId>cloud-common</artifactId>
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringCloud Gateway -->
|
<!-- SpringCloud Gateway -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-gateway</artifactId>
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
server:
|
server:
|
||||||
port: 8080
|
port: 8080
|
||||||
|
|
||||||
|
# nacos线上地址
|
||||||
nacos:
|
nacos:
|
||||||
addr: 106.15.136.7:8848
|
addr: 106.15.136.7:8848
|
||||||
user-name: nacos
|
user-name: nacos
|
||||||
|
@ -59,4 +60,4 @@ spring:
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
data-type: json
|
data-type: json
|
||||||
rule-type: gw-flow
|
rule-type: gw-flow
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
package com.muyu.enterprise.cache;
|
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* redis企业业务层
|
|
||||||
* @ClassName CarCompanyCacheService
|
|
||||||
* @Description CarCompanyCacheService:类的描述
|
|
||||||
* @Date 2024/10/3 15:22
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class CarCompanyCacheService extends CacheAbsBasic<String, CarCompany> {
|
|
||||||
@Override
|
|
||||||
public String keyPre() {
|
|
||||||
return "CarCompany:info:";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String decode(String key) {
|
|
||||||
return key.replace("CarCompany:info:","");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -16,13 +16,18 @@ import com.muyu.enterprise.domain.SysCarFault;
|
||||||
public class CarFaultCacheService extends CacheAbsBasic<String, SysCarFault> {
|
public class CarFaultCacheService extends CacheAbsBasic<String, SysCarFault> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "sysCarFault:info:";
|
return "vehicleDeterminationStandard";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "fault";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("faultType:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,33 @@
|
||||||
package com.muyu.enterprise.cache;
|
package com.muyu.enterprise.cache;
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
|
||||||
import com.muyu.enterprise.domain.vo.CarVO;
|
import com.muyu.enterprise.domain.vo.CarVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redis报文业务层
|
* redis车辆业务层
|
||||||
* @ClassName CarManageCacheService
|
* @ClassName CarManageCacheService
|
||||||
* @Description CarManageCacheService:类的描述
|
* @Description CarManageCacheService:类的描述
|
||||||
* @Date 2024/10/3 15:22
|
* @Date 2024/10/3 15:22
|
||||||
* @author MingWei.Zong(微醺)
|
* @author MingWei.Zong(微醺)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CarManageCacheService extends CacheAbsBasic<String, List<CarManage>> {
|
public class CarManageCacheService extends CacheAbsBasic<String, List<CarVO>> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "carManage:info:";
|
return "vehicleDeterminationStandard";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "carManage";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("carManage:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
package com.muyu.enterprise.cache;
|
|
||||||
|
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
|
||||||
import com.muyu.enterprise.domain.CarMessage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* redis车辆管理业务层
|
|
||||||
* @ClassName CarMessageCacheService
|
|
||||||
* @Description CarMessageCacheService:类的描述
|
|
||||||
* @Date 2024/9/30 11:42
|
|
||||||
* @author MingWei.Zong(微醺)
|
|
||||||
*/
|
|
||||||
public class CarMessageCacheService extends CacheAbsBasic<String, CarMessage> {
|
|
||||||
@Override
|
|
||||||
public String keyPre() {
|
|
||||||
return "carMessage:info:";
|
|
||||||
}
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public String encode(String key) {
|
|
||||||
// return super.encode(key);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String decode(String key) {
|
|
||||||
return key.replace("carMessage:info:","");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@ package com.muyu.enterprise.cache;
|
||||||
import com.muyu.common.cache.config.CacheAbsBasic;
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
import com.muyu.enterprise.domain.CarCompany;
|
import com.muyu.enterprise.domain.CarCompany;
|
||||||
import com.muyu.enterprise.domain.CarTemplate;
|
import com.muyu.enterprise.domain.CarTemplate;
|
||||||
|
import com.muyu.enterprise.domain.vo.CarTemplateVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* redis报文模版业务层
|
* redis报文模版业务层
|
||||||
|
@ -12,17 +13,21 @@ import com.muyu.enterprise.domain.CarTemplate;
|
||||||
* @author MingWei.Zong(微醺)
|
* @author MingWei.Zong(微醺)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CarTemplateCacheService extends CacheAbsBasic<String, CarTemplate> {
|
public class CarTemplateCacheService extends CacheAbsBasic<String, CarTemplateVO> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "carTemplate:info:";
|
return "vehicleDeterminationStandard";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "messageTemplate";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("carTemplate:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,18 @@ import com.muyu.enterprise.domain.vo.WarnVo;
|
||||||
public class CarWarnCacheService extends CacheAbsBasic<String, WarnVo> {
|
public class CarWarnCacheService extends CacheAbsBasic<String, WarnVo> {
|
||||||
@Override
|
@Override
|
||||||
public String keyPre() {
|
public String keyPre() {
|
||||||
return "warnStrategy:info:";
|
return "vehicleDeterminationStandard";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "warn";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String decode(String key) {
|
public String decode(String key) {
|
||||||
return key.replace("warnStrategy:info:","");
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.muyu.enterprise.cache;
|
||||||
|
|
||||||
|
import com.muyu.common.cache.config.CacheAbsBasic;
|
||||||
|
import com.muyu.enterprise.domain.CarCompany;
|
||||||
|
import com.muyu.enterprise.domain.dateBase.ElectronicFence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* redis电子围栏业务层
|
||||||
|
* @ClassName ElectronicFenceCacheService
|
||||||
|
* @Description ElectronicFenceCacheService:类的描述
|
||||||
|
* @Date 2024/10/3 15:22
|
||||||
|
* @author MingWei.Zong
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ElectronicFenceCacheService extends CacheAbsBasic<String, ElectronicFence> {
|
||||||
|
@Override
|
||||||
|
public String keyPre() {
|
||||||
|
return "vehicleDeterminationStandard";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String keyPost() {
|
||||||
|
return "electronicFence";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String decode(String key) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
com.muyu.enterprise.cache.CarCompanyCacheService
|
|
||||||
com.muyu.enterprise.cache.CarFaultCacheService
|
com.muyu.enterprise.cache.CarFaultCacheService
|
||||||
com.muyu.enterprise.cache.CarManageCacheService
|
|
||||||
com.muyu.enterprise.cache.CarMessageCacheService
|
|
||||||
com.muyu.enterprise.cache.CarTemplateCacheService
|
com.muyu.enterprise.cache.CarTemplateCacheService
|
||||||
com.muyu.enterprise.cache.CarWarnCacheService
|
com.muyu.enterprise.cache.CarWarnCacheService
|
||||||
|
com.muyu.enterprise.cache.ElectronicFenceCacheService
|
||||||
|
com.muyu.enterprise.cache.CarManageCacheService
|
||||||
|
|
|
@ -11,6 +11,10 @@
|
||||||
|
|
||||||
<artifactId>cloud-modules-enterprise-common</artifactId>
|
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
cloud-modules-enterprise-common企业业务平台服务
|
||||||
|
</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
@ -25,9 +29,10 @@
|
||||||
<artifactId>cloud-common-core</artifactId>
|
<artifactId>cloud-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!--swagger3依赖-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger.core.v3</groupId>
|
<groupId>io.swagger.core.v3</groupId>
|
||||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -28,7 +28,7 @@ public class CarType {
|
||||||
* 车辆类型id
|
* 车辆类型id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "car_type_id",type = IdType.AUTO)
|
@TableId(value = "car_type_id",type = IdType.AUTO)
|
||||||
private Integer carTypeId;
|
private long carTypeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 车辆类型名称
|
* 车辆类型名称
|
||||||
|
@ -38,7 +38,7 @@ public class CarType {
|
||||||
/**
|
/**
|
||||||
* 模板id
|
* 模板id
|
||||||
*/
|
*/
|
||||||
private Integer templateId;
|
private long templateId;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
* 故障规则
|
* 故障规则
|
||||||
* @Author: chenruijia
|
* @Author: chenruijia
|
||||||
* @Date 2024/9/28 12.23
|
* @Date 2024/9/28 12.23
|
||||||
* @Description FaultrRule:故障规则
|
* @Description FaultRule:故障规则
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
@ -21,7 +21,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@TableName(value = "fault_rule",autoResultMap = true)
|
@TableName(value = "fault_rule",autoResultMap = true)
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Tag(name = "故障规则")
|
@Tag(name = "故障规则")
|
||||||
public class FaultrRule extends BaseEntity {
|
public class FaultRule extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 故障规则ID
|
* 故障规则ID
|
||||||
*/
|
*/
|
||||||
|
@ -29,18 +29,40 @@ public class FaultrRule extends BaseEntity {
|
||||||
@Schema(defaultValue = "故障规则ID",type = "Long",description = "故障规则ID")
|
@Schema(defaultValue = "故障规则ID",type = "Long",description = "故障规则ID")
|
||||||
private Long faultRuleId;
|
private Long faultRuleId;
|
||||||
/**
|
/**
|
||||||
* 故障规则名称
|
* 车辆类型ID
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "故障规则名称",type = "String",description = "故障规则名称")
|
@Schema(defaultValue = "车辆类型ID",type = "Integer",description = "车辆类型ID")
|
||||||
private String faultRuleName;
|
private Integer carTypeId;
|
||||||
|
/**
|
||||||
|
* 故障名称ID
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障名称ID",type = "Integer",description = "故障名称ID")
|
||||||
|
private Integer faultId;
|
||||||
|
/**
|
||||||
|
* 故障条件
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障条件",type = "String",description = "故障条件")
|
||||||
|
private String faultConditions;
|
||||||
/**
|
/**
|
||||||
* 故障规则参数
|
* 故障规则参数
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "故障规则参数",type = "String",description = "故障规则参数")
|
@Schema(defaultValue = "故障规则参数",type = "String",description = "故障规则参数")
|
||||||
private String faultRuleParameter;
|
private String ruleParameters;
|
||||||
/**
|
/**
|
||||||
* 故障规则描述
|
* 车辆类型名称
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "故障规则描述",type = "String",description = "故障规则描述")
|
@Schema(defaultValue = "车辆类型名称",type = "String",description = "车辆类型名称")
|
||||||
private String faultRuleDescription;
|
private String carTypeName;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障名称",type = "String",description = "故障名称")
|
||||||
|
private String faultName;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆VIN",type = "String",description = "车辆VIN")
|
||||||
|
private String carVin;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -3,6 +3,7 @@ package com.muyu.enterprise.domain;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
@ -42,6 +43,11 @@ public class SysCarFault extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
@Schema(defaultValue = "车辆故障类型ID",type = "Integer",description = "车辆故障类型ID")
|
@Schema(defaultValue = "车辆故障类型ID",type = "Integer",description = "车辆故障类型ID")
|
||||||
private Integer faultTypeId;
|
private Integer faultTypeId;
|
||||||
|
/**
|
||||||
|
* 车辆故障规则ID
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障规则ID",type = "Integer",description = "车辆故障规则ID")
|
||||||
|
public Integer faultRuleId;
|
||||||
/**
|
/**
|
||||||
* 故障VIN编码
|
* 故障VIN编码
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.muyu.enterprise.domain.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.enterprise.domain.req.car.MessageTemplateAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版实体类
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageTemplate
|
||||||
|
* @Date:2024/9/26 20:27
|
||||||
|
* @Description: 报文模版
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName(value = "message_template", autoResultMap = true)
|
||||||
|
public class MessageTemplate extends BaseEntity
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 报文模版主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "message_template_id", type = IdType.AUTO)
|
||||||
|
private String messageTemplateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版名称
|
||||||
|
*/
|
||||||
|
private String messageTemplateName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版描述
|
||||||
|
*/
|
||||||
|
private String messageTemplateDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版添加数据转换
|
||||||
|
* @param messageTemplateAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static MessageTemplate addBuild(MessageTemplateAddReq messageTemplateAddReq){
|
||||||
|
return MessageTemplate.builder()
|
||||||
|
.messageTemplateName(messageTemplateAddReq.getMessageTemplateName())
|
||||||
|
.messageTemplateDescribe(messageTemplateAddReq.getMessageTemplateDescribe())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.muyu.enterprise.domain.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.enterprise.domain.req.car.MessageValueAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageValue
|
||||||
|
* @Date:2024/9/26 20:29
|
||||||
|
*
|
||||||
|
* 报文类型对象 message_type
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文类型实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName(value = "message_value", autoResultMap = true)
|
||||||
|
public class MessageValue extends BaseEntity
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 报文数据主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "message_id", type = IdType.AUTO)
|
||||||
|
private Long messageId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模版主键
|
||||||
|
*/
|
||||||
|
private Long templateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文类别
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文标签
|
||||||
|
*/
|
||||||
|
private String messageLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起始下标
|
||||||
|
*/
|
||||||
|
private Integer messageStartIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止下标
|
||||||
|
*/
|
||||||
|
private Integer messageEndIndex;
|
||||||
|
|
||||||
|
public static MessageValue addBuild(MessageValueAddReq messageValueAddReq){
|
||||||
|
return MessageValue.builder()
|
||||||
|
.templateId(messageValueAddReq.getTemplateId())
|
||||||
|
.messageType(messageValueAddReq.getMessageType())
|
||||||
|
.messageCode(messageValueAddReq.getMessageCode())
|
||||||
|
.messageLabel(messageValueAddReq.getMessageLabel())
|
||||||
|
.messageStartIndex(messageValueAddReq.getMessageStartIndex())
|
||||||
|
.messageEndIndex(messageValueAddReq.getMessageEndIndex())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,145 @@
|
||||||
|
package com.muyu.enterprise.domain.car;
|
||||||
|
|
||||||
|
|
||||||
|
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 com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.enterprise.domain.req.car.VehicleAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.car.VehicleUpdReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆信息实体类
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:Vehicle
|
||||||
|
* @Date:2024/9/26 20:30
|
||||||
|
* @Description: 车辆信息实体类
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "vehicle", autoResultMap = true)
|
||||||
|
public class Vehicle extends BaseEntity
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 车辆主键
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆主键", cellType = ColumnType.NUMERIC)
|
||||||
|
@TableId(value = "vehicle_id", type = IdType.AUTO)
|
||||||
|
private Long vehicleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
@Excel(name = "车牌号")
|
||||||
|
private String licenceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆颜色")
|
||||||
|
private String vehicleColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
private String vehicleVin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆类型外键")
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆品牌")
|
||||||
|
private String vehicleBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆型号")
|
||||||
|
private String vehicleModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆行驶证
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆行驶证")
|
||||||
|
private String vehicleLicense;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行驶证到期日期
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date vehicleLicenseDueDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆状态")
|
||||||
|
private String vehicleStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆所属企业外键
|
||||||
|
*/
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏外键
|
||||||
|
*/
|
||||||
|
private Integer fenceGroupId;
|
||||||
|
|
||||||
|
public static Vehicle addBuild(VehicleAddReq vehicleAddReq){
|
||||||
|
return Vehicle.builder()
|
||||||
|
.licenceNumber(vehicleAddReq.getLicenceNumber())
|
||||||
|
.vehicleColor(vehicleAddReq.getVehicleColor())
|
||||||
|
.vehicleVin(vehicleAddReq.getVehicleVin())
|
||||||
|
.vehicleTypeId(vehicleAddReq.getVehicleTypeId())
|
||||||
|
.vehicleBrand(vehicleAddReq.getVehicleBrand())
|
||||||
|
.vehicleModel(vehicleAddReq.getVehicleModel())
|
||||||
|
.vehicleLicense(vehicleAddReq.getVehicleLicense())
|
||||||
|
.vehicleLicenseDueDate(vehicleAddReq.getVehicleLicenseDueDate())
|
||||||
|
.vehicleStatus(vehicleAddReq.getVehicleStatus())
|
||||||
|
.companyId(vehicleAddReq.getCompanyId())
|
||||||
|
.fenceGroupId(vehicleAddReq.getFenceGroupId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Vehicle updBuild(VehicleUpdReq vehicleUpdReq, Supplier<Long> idSupplier){
|
||||||
|
return Vehicle.builder()
|
||||||
|
.vehicleId(idSupplier.get())
|
||||||
|
.licenceNumber(vehicleUpdReq.getLicenceNumber())
|
||||||
|
.vehicleColor(vehicleUpdReq.getVehicleColor())
|
||||||
|
.vehicleVin(vehicleUpdReq.getVehicleVin())
|
||||||
|
.vehicleTypeId(vehicleUpdReq.getVehicleTypeId())
|
||||||
|
.vehicleBrand(vehicleUpdReq.getVehicleBrand())
|
||||||
|
.vehicleModel(vehicleUpdReq.getVehicleModel())
|
||||||
|
.vehicleLicense(vehicleUpdReq.getVehicleLicense())
|
||||||
|
.vehicleLicenseDueDate(vehicleUpdReq.getVehicleLicenseDueDate())
|
||||||
|
.vehicleStatus(vehicleUpdReq.getVehicleStatus())
|
||||||
|
.companyId(vehicleUpdReq.getCompanyId())
|
||||||
|
.fenceGroupId(vehicleUpdReq.getFenceGroupId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muyu.enterprise.domain.car;
|
||||||
|
|
||||||
|
|
||||||
|
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 com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.annotation.Excel.ColumnType;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型实体类
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleType
|
||||||
|
* @Date:2024/9/26 20:31
|
||||||
|
* @Description: 车辆类型实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@TableName(value = "vehicle_type", autoResultMap = true)
|
||||||
|
public class VehicleType
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 车辆类型主键
|
||||||
|
*/
|
||||||
|
|
||||||
|
@TableId(value = "vehicle_type_id", type = IdType.AUTO)
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型名称
|
||||||
|
*/
|
||||||
|
private String vehicleTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版外键
|
||||||
|
*/
|
||||||
|
private Long messageTemplateId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,127 @@
|
||||||
|
package com.muyu.enterprise.domain.dateBase;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectroicFenceAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectroicFenceUpdReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFence
|
||||||
|
* @Date:2024/9/17 16:34
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "electronic_fence",autoResultMap = true)
|
||||||
|
public class ElectronicFence extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏类型
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*经纬度信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String longitudeLatitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏状态(正常,停用)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 电子围栏的开始时间
|
||||||
|
// */
|
||||||
|
//
|
||||||
|
// private Date startTime;
|
||||||
|
// /**
|
||||||
|
// * 电子围栏的结束时间
|
||||||
|
// */
|
||||||
|
// private Date endTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceDesc;
|
||||||
|
|
||||||
|
public static ElectronicFenceResp bullerResp(ElectronicFence electronicFence){
|
||||||
|
|
||||||
|
return ElectronicFenceResp.builder()
|
||||||
|
.id(electronicFence.getId())
|
||||||
|
.name(electronicFence.getName())
|
||||||
|
.status(electronicFence.getStatus())
|
||||||
|
.fenceType(electronicFence.getFenceType())
|
||||||
|
.longitudeLatitude(electronicFence.getLongitudeLatitude())
|
||||||
|
.desc(electronicFence.getFenceDesc())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static ElectronicFence buildElectroicAdd(ElectroicFenceAddReq electroicFenceAddReq){
|
||||||
|
|
||||||
|
return ElectronicFence.builder()
|
||||||
|
.name(electroicFenceAddReq.getName())
|
||||||
|
.fenceDesc(electroicFenceAddReq.getFenceDesc())
|
||||||
|
.status(electroicFenceAddReq.getStatus())
|
||||||
|
.longitudeLatitude(electroicFenceAddReq.getLongitudeLatitude())
|
||||||
|
.fenceType(electroicFenceAddReq.getFenceType())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ElectronicFence buildByElectronicUpd(ElectroicFenceUpdReq electroicFenceUpdReq, Supplier<Long> longSupplier){
|
||||||
|
|
||||||
|
return ElectronicFence.builder()
|
||||||
|
.id(longSupplier.get())
|
||||||
|
.name(electroicFenceUpdReq.getName())
|
||||||
|
.status(electroicFenceUpdReq.getStatus())
|
||||||
|
.fenceDesc(electroicFenceUpdReq.getFenceDesc())
|
||||||
|
.longitudeLatitude(electroicFenceUpdReq.getLongitudeLatitude())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,118 @@
|
||||||
|
package com.muyu.enterprise.domain.dateBase;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectronicFenceGroupAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectronicFenceGroupUpdReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceGroupResp;
|
||||||
|
import com.muyu.enterprise.domain.resp.GroupFenceListresp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceGroup
|
||||||
|
* @Date:2024/9/18 11:14
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "electronic_fence_group",autoResultMap = true)
|
||||||
|
public class ElectronicFenceGroup extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
public static GroupFenceListresp buildGroupFence(ElectronicFenceGroup electronicFenceGroup){
|
||||||
|
|
||||||
|
return GroupFenceListresp.builder()
|
||||||
|
.id(electronicFenceGroup.getId())
|
||||||
|
.groupName(electronicFenceGroup.groupName)
|
||||||
|
.priority(electronicFenceGroup.getPriority())
|
||||||
|
.status(electronicFenceGroup.getStatus())
|
||||||
|
.groupType(electronicFenceGroup.groupType)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static ElectronicFenceGroupResp buildElectronicFenceGroupResp (ElectronicFenceGroup electronicFenceGroup){
|
||||||
|
|
||||||
|
return ElectronicFenceGroupResp.builder()
|
||||||
|
.id(electronicFenceGroup.getId())
|
||||||
|
.groupName(electronicFenceGroup.groupName)
|
||||||
|
.priority(electronicFenceGroup.getPriority())
|
||||||
|
.status(electronicFenceGroup.getStatus())
|
||||||
|
.groupType(electronicFenceGroup.groupType)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ElectronicFenceGroup buildByAdd(ElectronicFenceGroupAddReq addReq){
|
||||||
|
|
||||||
|
|
||||||
|
return ElectronicFenceGroup.builder()
|
||||||
|
.groupName(addReq.getGroupName())
|
||||||
|
.groupType(addReq.getGroupType())
|
||||||
|
.status(addReq.getStatus())
|
||||||
|
.priority(addReq.getPriority())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ElectronicFenceGroup buildByUpd(ElectronicFenceGroupUpdReq updReq, Supplier<Long> ids){
|
||||||
|
|
||||||
|
|
||||||
|
return ElectronicFenceGroup.builder()
|
||||||
|
.id(ids.get())
|
||||||
|
.groupName(updReq.getGroupName())
|
||||||
|
.groupType(updReq.getGroupType())
|
||||||
|
.status(updReq.getStatus())
|
||||||
|
.priority(updReq.getPriority())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.enterprise.domain.dateBase;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:FenceGroupMid
|
||||||
|
* @Date:2024/9/19 21:01
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 链表实体类
|
||||||
|
*/
|
||||||
|
@Tag(name = "围栏组连接表")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "fence_group_mid",autoResultMap = true)
|
||||||
|
public class FenceGroupMid {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 中间表的自增
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
private Long groupId;
|
||||||
|
private Long fenceId;
|
||||||
|
}
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectroicAdd
|
||||||
|
* @Date:2024/9/17 20:53
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏添加请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectroicFenceAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏类型(驶入,驶出)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*经纬度信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String longitudeLatitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏状态(正常,停用)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏的开始时间
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Date startTime;
|
||||||
|
/**
|
||||||
|
* 电子围栏的结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectroicFenceReq
|
||||||
|
* @Date:2024/9/17 20:04
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 电子围栏列表请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectroicFenceListReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏类型(驶入,驶出)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*经纬度信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String longitudeLatitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏状态(正常,停用)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏的开始时间
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Date startTime;
|
||||||
|
/**
|
||||||
|
* 电子围栏的结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectroicFenceUpdReq
|
||||||
|
* @Date:2024/9/17 21:03
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 电子围栏修改请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectroicFenceUpdReq {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏类型(驶入,驶出)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*经纬度信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String longitudeLatitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏状态(正常,停用)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceDesc;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceGroupAddReq
|
||||||
|
* @Date:2024/9/20 19:14
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组添加请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectronicFenceGroupAddReq {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选中围栏
|
||||||
|
*/
|
||||||
|
|
||||||
|
List<ElectronicFenceResp> electronicFenceRespList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceGroupListReq
|
||||||
|
* @Date:2024/9/20 16:06
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 围栏组列表请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectronicFenceGroupListReq {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceGroupAddReq
|
||||||
|
* @Date:2024/9/20 19:14
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 围栏组修改请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectronicFenceGroupUpdReq {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选中围栏
|
||||||
|
*/
|
||||||
|
List<ElectronicFenceResp> electronicFenceRespList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:FenceAndGroupBoundReq
|
||||||
|
* @Date:2024/9/21 9:05
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 链表请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name = "用于绑定围栏和围栏组的请求")
|
||||||
|
public class FenceAndGroupBoundReq {
|
||||||
|
/**
|
||||||
|
* 围栏组的主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选中的围栏
|
||||||
|
*/
|
||||||
|
|
||||||
|
private List<ElectronicFenceResp> electronicFenceRespList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.enterprise.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:FenceWay
|
||||||
|
* @Date:2024/9/20 9:27
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏位置请求对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class FenceWayReq {
|
||||||
|
private Long id;
|
||||||
|
private String longitudeLatitude;
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.muyu.enterprise.domain.req.car;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版添加参数请求对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageTemplateAddReq
|
||||||
|
* @Date:2024/9/26 20:34
|
||||||
|
* @Description: 报文模版添加参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "新增报文模版请求参数", description = "根据入参进行报文模版的添加")
|
||||||
|
public class MessageTemplateAddReq
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 报文模版名称
|
||||||
|
*/
|
||||||
|
private String messageTemplateName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版描述
|
||||||
|
*/
|
||||||
|
private String messageTemplateDescribe;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.muyu.enterprise.domain.req.car;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文类型参数添加请求对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageValueAddReq
|
||||||
|
* @Date:2024/9/26 20:35
|
||||||
|
* @Description: 报文类型参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "新增报文数据请求参数", description = "根据入参进行报文数据的添加")
|
||||||
|
public class MessageValueAddReq
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 模版主键
|
||||||
|
*/
|
||||||
|
private Long templateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文类别
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文标签
|
||||||
|
*/
|
||||||
|
private String messageLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起始下标
|
||||||
|
*/
|
||||||
|
private Integer messageStartIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止下标
|
||||||
|
*/
|
||||||
|
private Integer messageEndIndex;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.muyu.enterprise.domain.req.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文类型列表参数请求对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageValueReq
|
||||||
|
* @Date:2024/9/26 20:39
|
||||||
|
* @Description: 报文类型列表参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "报文数据请求参数", description = "根据入参进行报文数据的查询")
|
||||||
|
public class MessageValueReq
|
||||||
|
{
|
||||||
|
/** 报文模版主键 */
|
||||||
|
@Schema(title = "报文模版主键", type = "Long", defaultValue = "1", description = "报文模版主键")
|
||||||
|
private Long messageTemplateId;
|
||||||
|
|
||||||
|
/** 报文分类 */
|
||||||
|
@Schema(title = "报文分类", type = "String", defaultValue = "basics", description = "报文分类")
|
||||||
|
private String messageType;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.muyu.enterprise.domain.req.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增车辆参数请求对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleAddReq
|
||||||
|
* @Date:2024/9/26 20:39
|
||||||
|
* @Description: 新增车辆参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "录入车辆请求参数", description = "根据入参进行车辆管理的添加")
|
||||||
|
public class VehicleAddReq
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "车牌号不可为空")
|
||||||
|
@Schema(title = "车牌号", type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||||
|
private String licenceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆颜色", type = "String", defaultValue = "RED", description = "车牌颜色")
|
||||||
|
private String vehicleColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆VIN", type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||||
|
private String vehicleVin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆类型", type = "BigInt", defaultValue = "1", description = "车辆类型")
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆品牌", type = "String", defaultValue = "1", description = "车辆品牌")
|
||||||
|
private String vehicleBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆型号", type = "String", defaultValue = "1", description = "车辆型号")
|
||||||
|
private String vehicleModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆行驶证
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆行驶证", type = "String", defaultValue = "111111", description = "车辆行驶证")
|
||||||
|
private String vehicleLicense;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行驶证到期日期
|
||||||
|
*/
|
||||||
|
@Schema(title = "行驶证到期日期", type = "Date", defaultValue = "2024-01-01 00:00:00", description = "行驶证到期日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date vehicleLicenseDueDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆状态", type = "String", defaultValue = "OFFLINE", description = "车辆状态")
|
||||||
|
private String vehicleStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆所属企业外键
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆所属企业外键", type = "BigInt", defaultValue = "1", description = "车辆所属企业外键")
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏外键
|
||||||
|
*/
|
||||||
|
@Schema(title = "电子围栏外键", type = "Integer", defaultValue = "1", description = "电子围栏外键")
|
||||||
|
private Integer fenceGroupId;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.muyu.enterprise.domain.req.car;
|
||||||
|
|
||||||
|
//import com.muyu.common.core.domain.req.PageReq;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理查询条件请求对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleManageReq
|
||||||
|
* @Date:2024/9/26 20:41
|
||||||
|
* @Description: 车辆管理查询条件实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "车辆管理查询条件", description = "负责车辆查询条件的实体类")
|
||||||
|
public class VehicleManageReq
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||||
|
private String licenceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||||
|
private String vehicleVin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "", description = "车辆状态")
|
||||||
|
private String vehicleStatus;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,100 @@
|
||||||
|
package com.muyu.enterprise.domain.req.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆信息参数请求对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleUpdReq
|
||||||
|
* @Date:2024/9/26 20:57
|
||||||
|
* @Description: 修改车辆信息参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "修改车辆信息参数", description = "根据入参信息修改车辆信息")
|
||||||
|
public class VehicleUpdReq
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "车牌号不可为空")
|
||||||
|
@Schema(title = "车牌号", type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||||
|
private String licenceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
@Schema(title = "车牌颜色", type = "String", defaultValue = "RED", description = "车牌颜色")
|
||||||
|
private String vehicleColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆VIN", type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||||
|
private String vehicleVin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆类型", type = "BigInt", defaultValue = "1", description = "车辆类型")
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆品牌", type = "String", defaultValue = "1", description = "车辆品牌")
|
||||||
|
private String vehicleBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆型号", type = "String", defaultValue = "1", description = "车辆型号")
|
||||||
|
private String vehicleModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆行驶证
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆行驶证", type = "String", defaultValue = "111111", description = "车辆行驶证")
|
||||||
|
private String vehicleLicense;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行驶证到期日期
|
||||||
|
*/
|
||||||
|
@Schema(title = "行驶证到期日期", type = "Date", defaultValue = "2024-01-01 00:00:00", description = "行驶证到期日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date vehicleLicenseDueDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆状态", type = "String", defaultValue = "OFFLINE", description = "车辆状态")
|
||||||
|
private String vehicleStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆所属企业外键
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆所属企业外键", type = "BigInt", defaultValue = "1", description = "车辆所属企业外键")
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏外键
|
||||||
|
*/
|
||||||
|
@Schema(title = "电子围栏外键", type = "Integer", defaultValue = "1", description = "电子围栏外键")
|
||||||
|
private Integer fenceGroupId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.muyu.enterprise.domain.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.resp
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceGroupResp
|
||||||
|
* @Date:2024/9/22 10:22
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显围栏组及绑定的电子围栏响应对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "回显围栏组及绑定的电子围栏")
|
||||||
|
public class ElectronicFenceGroupResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定的电子围栏
|
||||||
|
*/
|
||||||
|
List<ElectronicFenceResp> electronicFenceRespList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.muyu.enterprise.domain.resp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFence
|
||||||
|
* @Date:2024/9/17 16:34
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏列表响应对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ElectronicFenceResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏名称
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏类型(驶入,驶出)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String fenceType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*经纬度信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String longitudeLatitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏状态(正常,停用)
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 描述信息
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
//private String groupType;
|
||||||
|
//
|
||||||
|
//private int priority;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.muyu.enterprise.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.enterprise.domain.SysCarFault;
|
||||||
|
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.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障返回
|
||||||
|
* @author chenruijia
|
||||||
|
* @Date 2024/9/28 21:11
|
||||||
|
* @Description FaultResp:故障返回
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name = "故障返回")
|
||||||
|
public class FaultResp {
|
||||||
|
/**
|
||||||
|
* 车辆故障码
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障码",type = "String",description = "车辆故障码")
|
||||||
|
private String faultCode;
|
||||||
|
/**
|
||||||
|
* 车辆故障那类型ID
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障那类型ID",type = "Integer",description = "车辆故障类型ID")
|
||||||
|
private Integer faultTypeId;
|
||||||
|
/**
|
||||||
|
* 车辆故障规则ID
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障规则ID",type = "Integer",description = "车辆故障规则ID")
|
||||||
|
public Integer faultRuleId;
|
||||||
|
/**
|
||||||
|
* 故障VIN编码
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障VIN编码",type = "String",description = "故障VIN编码")
|
||||||
|
public String carVin;
|
||||||
|
/**
|
||||||
|
* 车辆故障标签
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障标签",type = "String",description = "车辆故障标签")
|
||||||
|
public String faultLabel;
|
||||||
|
/**
|
||||||
|
* 车辆故障位
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障位",type = "String",description = "车辆故障位")
|
||||||
|
public String faultBit;
|
||||||
|
/**
|
||||||
|
* 车辆故障值
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "车辆故障值",type = "String",description = "车辆故障值")
|
||||||
|
public String faultValue;
|
||||||
|
/**
|
||||||
|
* v
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障级别",type = "String",description = "故障级别")
|
||||||
|
public String faultWarn;
|
||||||
|
/**
|
||||||
|
* 报警状态
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "报警状态",type = "String",description = "报警状态")
|
||||||
|
public String warnStatus;
|
||||||
|
/**
|
||||||
|
* 故障描述信息
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障描述信息",type = "String",description = "故障描述信息")
|
||||||
|
public String faultDesc;
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "启用状态",type = "Integer",description = "启用状态")
|
||||||
|
public Integer state;
|
||||||
|
/**
|
||||||
|
* 故障规则名称
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障规则名称",type = "String",description = "故障规则名称")
|
||||||
|
public String faultRuleName;
|
||||||
|
/**
|
||||||
|
* 故障规则参数
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障规则参数",type = "String",description = "故障规则参数")
|
||||||
|
public String faultRuleParameter;
|
||||||
|
/**
|
||||||
|
* 故障规则描述
|
||||||
|
*/
|
||||||
|
@Schema(defaultValue = "故障规则描述",type = "String",description = "故障规则描述")
|
||||||
|
public String faultRuleDescription;
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.enterprise.domain.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain.req
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:GroupFenceListresp
|
||||||
|
* @Date:2024/9/20 9:04
|
||||||
|
* 围栏组列表
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组列表响应对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "围栏组列表")
|
||||||
|
public class GroupFenceListresp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 围栏组优先级
|
||||||
|
*/
|
||||||
|
private Integer priority;
|
||||||
|
/**
|
||||||
|
* 围栏组名称
|
||||||
|
*/
|
||||||
|
private String groupName;
|
||||||
|
/**
|
||||||
|
* 围栏组类型
|
||||||
|
*/
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
package com.muyu.enterprise.domain.resp.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.enterprise.domain.car.MessageTemplate;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版响应数据响应对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.resp
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageTemplateListResp
|
||||||
|
* @Date:2024/9/26 20:32
|
||||||
|
* @Description: 报文模版响应数据
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "报文模版列表", description = "负责报文模版管理列表的相应数据")
|
||||||
|
public class MessageTemplateListResp
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 报文模版主键
|
||||||
|
*/
|
||||||
|
private String messageTemplateId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版名称
|
||||||
|
*/
|
||||||
|
private String messageTemplateName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版描述
|
||||||
|
*/
|
||||||
|
private String messageTemplateDescribe;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库对象构建为返回结果对象
|
||||||
|
* @param messageTemplate
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static MessageTemplateListResp messageTemplateBuild(MessageTemplate messageTemplate) {
|
||||||
|
return MessageTemplateListResp.builder()
|
||||||
|
.messageTemplateId(messageTemplate.getMessageTemplateId())
|
||||||
|
.messageTemplateName(messageTemplate.getMessageTemplateName())
|
||||||
|
.messageTemplateDescribe(messageTemplate.getMessageTemplateDescribe())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.muyu.enterprise.domain.resp.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.enterprise.domain.car.MessageValue;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文数据响应数据响应对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.resp
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageValueListResp
|
||||||
|
* @Date:2024/9/26 20:33
|
||||||
|
* @Description: 报文数据响应数据
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name = "报文数据列表", description = "负责报文数据管理列表的相应数据")
|
||||||
|
public class MessageValueListResp
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 报文数据主键
|
||||||
|
*/
|
||||||
|
private Long messageId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文类别
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文标签
|
||||||
|
*/
|
||||||
|
private String messageLabel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 起始下标
|
||||||
|
*/
|
||||||
|
private Integer messageStartIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 终止下标
|
||||||
|
*/
|
||||||
|
private Integer messageEndIndex;
|
||||||
|
|
||||||
|
public static MessageValueListResp valueBuild(MessageValue messageValue){
|
||||||
|
return MessageValueListResp.builder()
|
||||||
|
.messageId(messageValue.getMessageId())
|
||||||
|
.messageType(messageValue.getMessageType())
|
||||||
|
.messageCode(messageValue.getMessageCode())
|
||||||
|
.messageLabel(messageValue.getMessageLabel())
|
||||||
|
.messageStartIndex(messageValue.getMessageStartIndex())
|
||||||
|
.messageEndIndex(messageValue.getMessageEndIndex())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.muyu.enterprise.domain.resp.car;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理列表响应对象
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.domain.resp
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleManageResp
|
||||||
|
* @Date:2024/9/26 20:33
|
||||||
|
* 车辆管理列表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "车辆管理列表",description = "负责车辆管理列表的相应数据")
|
||||||
|
public class VehicleManageResp
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 车辆主键
|
||||||
|
*/
|
||||||
|
@Schema(type = "Long",defaultValue = "1",description = "车辆主键")
|
||||||
|
private Long vehicleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "冀A93827", description = "车牌号")
|
||||||
|
private String licenceNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "", description = "车辆颜色")
|
||||||
|
private String vehicleColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "LDC913L2240606423", description = "车辆VIN")
|
||||||
|
private String vehicleVin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型
|
||||||
|
*/
|
||||||
|
@Schema(type = "Long", defaultValue = "新能源", description = "车辆类型")
|
||||||
|
private String vehicleTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆品牌", type = "String", defaultValue = "1", description = "车辆品牌")
|
||||||
|
private String vehicleBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆型号
|
||||||
|
*/
|
||||||
|
@Schema(title = "车辆型号", type = "String", defaultValue = "1", description = "车辆型号")
|
||||||
|
private String vehicleModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
@Schema(type = "String", defaultValue = "", description = "车辆状态")
|
||||||
|
private String vehicleStatus;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.muyu.enterprise.domain.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectricFenceModel
|
||||||
|
* @Date:2024/9/17 17:27
|
||||||
|
*/
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏规则计算模型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectricFenceModel implements Comparable<ElectricFenceModel> {
|
||||||
|
//车架号
|
||||||
|
private String vin = "";
|
||||||
|
//电子围栏结果表UUID
|
||||||
|
private Long uuid = -999999L;
|
||||||
|
//上次状态 0 里面 1 外面
|
||||||
|
private int lastStatus = -999999;
|
||||||
|
//当前状态 0 里面 1 外面
|
||||||
|
private int nowStatus = -999999;
|
||||||
|
//位置时间 yyyy-MM-dd HH:mm:ss
|
||||||
|
private String gpsTime = "";
|
||||||
|
//位置纬度--
|
||||||
|
private Double lat = -999999D;
|
||||||
|
//位置经度--
|
||||||
|
private Double lng = -999999D;
|
||||||
|
//电子围栏ID
|
||||||
|
private int eleId = -999999;
|
||||||
|
//电子围栏名称
|
||||||
|
private String eleName = "";
|
||||||
|
//中心点地址
|
||||||
|
private String address = "";
|
||||||
|
//中心点纬度
|
||||||
|
private Double latitude;
|
||||||
|
//中心点经度
|
||||||
|
private Double longitude = -999999D;
|
||||||
|
//电子围栏半径
|
||||||
|
private Float radius = -999999F;
|
||||||
|
//出围栏时间
|
||||||
|
private String outEleTime = null;
|
||||||
|
//进围栏时间
|
||||||
|
private String inEleTime = null;
|
||||||
|
//是否在mysql结果表中
|
||||||
|
private Boolean inMysql = false;
|
||||||
|
//状态报警 0:出围栏 1:进围栏
|
||||||
|
private int statusAlarm = -999999;
|
||||||
|
//报警信息
|
||||||
|
private String statusAlarmMsg = "";
|
||||||
|
//终端时间
|
||||||
|
private String terminalTime = "";
|
||||||
|
// 扩展字段 终端时间
|
||||||
|
private Long terminalTimestamp = -999999L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int compareTo(ElectricFenceModel o) {
|
||||||
|
if(this.getTerminalTimestamp() > o.getTerminalTimestamp()){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if(this.getTerminalTimestamp() < o.getTerminalTimestamp()){
|
||||||
|
return -1;
|
||||||
|
}else{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
package com.muyu.enterprise.domain.utils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectricFenceResultTmp
|
||||||
|
* @Date:2024/9/17 17:57
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 电子围栏转换临时对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ElectricFenceResultTmp {
|
||||||
|
//电子围栏id
|
||||||
|
private int id;
|
||||||
|
//电子围栏名称
|
||||||
|
private String name;
|
||||||
|
//电子围栏中心地址
|
||||||
|
private String address;
|
||||||
|
//电子围栏半径
|
||||||
|
private float radius;
|
||||||
|
//电子围栏中心点的经度
|
||||||
|
private double longitude;
|
||||||
|
//电子围栏中心点的维度
|
||||||
|
private double latitude;
|
||||||
|
//电子围栏的开始时间
|
||||||
|
private Date startTime;
|
||||||
|
//电子围栏的结束时间
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ElectricFenceResultTmp{" +
|
||||||
|
"id=" + id +
|
||||||
|
", name='" + name + '\'' +
|
||||||
|
", address='" + address + '\'' +
|
||||||
|
", radius=" + radius +
|
||||||
|
", longitude=" + longitude +
|
||||||
|
", latitude=" + latitude +
|
||||||
|
", startTime=" + startTime +
|
||||||
|
", endTime=" + endTime +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.muyu.enterprise.domain.utils;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceResult
|
||||||
|
* @Date:2024/9/17 17:43
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏分析结果数据结构
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ElectronicFenceResult {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 车辆唯一标识
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private String inTime;
|
||||||
|
private String outTime;
|
||||||
|
/**
|
||||||
|
* gps定位时间
|
||||||
|
*/
|
||||||
|
private Date gpsTime;
|
||||||
|
|
||||||
|
private Double lat;
|
||||||
|
private Double lng;
|
||||||
|
private Integer eleId;
|
||||||
|
private String eleName;
|
||||||
|
private String address;
|
||||||
|
private Double latitude;
|
||||||
|
private Double longitude;
|
||||||
|
private Double radius;
|
||||||
|
private String terminalTime;
|
||||||
|
private Date processTime;
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.muyu.enterprise.domain.utils;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏经纬度工具类
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.domain
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:ElectronicFenceSetting
|
||||||
|
* @Date:2024/9/17 16:47
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@TableName(value = "electronic_fence_setting",autoResultMap = true)
|
||||||
|
public class ElectronicFenceSetting {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 电子围栏名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 电子围栏中心地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
/**
|
||||||
|
* 电子围栏半径
|
||||||
|
*/
|
||||||
|
private String radius;
|
||||||
|
/**
|
||||||
|
* 电子围栏中心点经度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
/**
|
||||||
|
* 电子围栏围栏中心点维度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
/**
|
||||||
|
* 电子围栏的开始时间
|
||||||
|
*/
|
||||||
|
private String startTime;
|
||||||
|
/**
|
||||||
|
* 电子围栏的结束时间
|
||||||
|
*/
|
||||||
|
private String endTime;
|
||||||
|
/**
|
||||||
|
* 电子围栏的状态(开启,关闭)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.enterprise.domain.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文分割工具类
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.utils
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleConstant
|
||||||
|
* @Date:2024/9/26 20:26
|
||||||
|
*/
|
||||||
|
public class VehicleConstant
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 分包符
|
||||||
|
*/
|
||||||
|
public static final String DATA_PACK_SEPARATOR = "#$&";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文起始位
|
||||||
|
*/
|
||||||
|
public static final String MSG_START = "7E";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文结束位
|
||||||
|
*/
|
||||||
|
public static final String MSG_END = "7E";
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.muyu.enterprise.domain.vo;
|
||||||
|
/**
|
||||||
|
* 控制层
|
||||||
|
* 业务实现层
|
||||||
|
* @ClassName CarTemplateVO
|
||||||
|
* @PATH com.muyu.enterprise.domain.vo:类的路径
|
||||||
|
* @Date 2024/10/9 20:42
|
||||||
|
* @author MingWei.Zong(微醺)
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@TableName(value = "car_template",autoResultMap = true)
|
||||||
|
public class CarTemplateVO {
|
||||||
|
/**
|
||||||
|
* 报文模版表
|
||||||
|
*/
|
||||||
|
@TableId(value = "template_id",type = IdType.AUTO)
|
||||||
|
private Long templateId;
|
||||||
|
/**
|
||||||
|
* 报文模版名称
|
||||||
|
*/
|
||||||
|
private String templateName;
|
||||||
|
/**
|
||||||
|
* 报文模版描述
|
||||||
|
*/
|
||||||
|
private String templateDescribe;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文表
|
||||||
|
*/
|
||||||
|
private Long messageId;
|
||||||
|
/**
|
||||||
|
* 车辆报文类别
|
||||||
|
*/
|
||||||
|
private String messageType;
|
||||||
|
/**
|
||||||
|
* 开始位下标
|
||||||
|
*/
|
||||||
|
private Integer messageStartIndex;
|
||||||
|
/**
|
||||||
|
* 结束位下标
|
||||||
|
*/
|
||||||
|
private Integer messageEndIndex;
|
||||||
|
/**
|
||||||
|
* 报文标签
|
||||||
|
*/
|
||||||
|
private String messageLabel;
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?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-modules-enterprise</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-modules-enterprise-remote</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-enterprise-remote 企业远程调用模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- 企业公共模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.muyu.enterprise.remote;
|
||||||
|
|
||||||
|
import com.muyu.enterprise.remote.factory.RemoteMessageValueServiceFactory;
|
||||||
|
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文数据服务
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.analysis.parsing.feign
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:RemoteServiceClient
|
||||||
|
* @Date:2024/9/28 20:38
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
path = "/messageValue",
|
||||||
|
contextId = "remoteMessageValueService",
|
||||||
|
value = ServiceNameConstants.ENTERPRISE_SERVICE,
|
||||||
|
fallbackFactory= RemoteMessageValueServiceFactory.class
|
||||||
|
)
|
||||||
|
public interface RemoteMessageValueService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据报文模版id查询报文数据
|
||||||
|
* @param templateId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/findByTemplateId/{templateId}")
|
||||||
|
// @Operation(summary = "根据报文模版id查询报文数据", description = "根据报文模版id查询报文数据")
|
||||||
|
public Result<List<MessageValueListResp>> findByTemplateId(@PathVariable("templateId") Long templateId);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.muyu.enterprise.remote;
|
||||||
|
|
||||||
|
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.enterprise.remote.factory.RemoteVehicleServiceFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理服务
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.enterprise.remote
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:RemoteVehicleService
|
||||||
|
* @Date:2024/10/7 20:53
|
||||||
|
*/
|
||||||
|
@FeignClient(
|
||||||
|
path = "/vehicleManage",
|
||||||
|
contextId = "remoteVehicleService",
|
||||||
|
value = ServiceNameConstants.ENTERPRISE_SERVICE,
|
||||||
|
fallbackFactory= RemoteVehicleServiceFactory.class
|
||||||
|
)
|
||||||
|
public interface RemoteVehicleService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过车辆vin码查询模板id
|
||||||
|
* @param vehicleVin 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/findByVehicleVin/{vehicleVin}")
|
||||||
|
public Result<Long> findByVehicleVin(@PathVariable("vehicleVin") String vehicleVin);
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.muyu.enterprise.remote.factory;
|
||||||
|
|
||||||
|
import com.muyu.enterprise.remote.RemoteMessageValueService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文数据服务降级处理
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.analysis.parsing.remote.factory
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:RemoteServiceClientFactory
|
||||||
|
* @Date:2024/9/28 21:16
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class RemoteMessageValueServiceFactory
|
||||||
|
implements FallbackFactory<RemoteMessageValueService>
|
||||||
|
{
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RemoteMessageValueServiceFactory.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RemoteMessageValueService create(Throwable throwable) {
|
||||||
|
log.error("报文模版传参调用失败:{}", throwable.getMessage());
|
||||||
|
return new RemoteMessageValueService(){
|
||||||
|
@Override
|
||||||
|
public Result<List<MessageValueListResp>> findByTemplateId(Long templateId) {
|
||||||
|
return Result.error("报文模版传参调用失败" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.muyu.enterprise.remote.factory;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
||||||
|
import com.muyu.enterprise.remote.RemoteVehicleService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理服务降级处理
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.enterprise.remote.factory
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:RemoteVehicleServiceFactory
|
||||||
|
* @Date:2024/10/7 20:57
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class RemoteVehicleServiceFactory implements FallbackFactory<RemoteVehicleService> {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RemoteVehicleServiceFactory.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RemoteVehicleService create(Throwable throwable) {
|
||||||
|
return new RemoteVehicleService() {
|
||||||
|
@Override
|
||||||
|
public Result<Long> findByVehicleVin(String vehicleVin) {
|
||||||
|
return Result.error("报文模版传参调用失败" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
com.muyu.enterprise.remote.factory.RemoteVehicleServiceFactory
|
||||||
|
com.muyu.enterprise.remote.factory.RemoteMessageValueServiceFactory
|
|
@ -22,6 +22,12 @@
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- mybatis-plus-join依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.yulichang</groupId>
|
||||||
|
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||||
|
<version>1.4.11</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -95,7 +101,7 @@
|
||||||
<artifactId>cloud-modules-enterprise-common</artifactId>
|
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- MyBatisPlus - 依赖包 -->
|
<!-- MyBatisPlusJoin 依赖包 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.yulichang</groupId>
|
<groupId>com.github.yulichang</groupId>
|
||||||
<artifactId>mybatis-plus-join</artifactId>
|
<artifactId>mybatis-plus-join</artifactId>
|
||||||
|
|
|
@ -8,7 +8,8 @@ import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 企业模块
|
* 企业平台微服务启动类
|
||||||
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
|
@ -24,4 +25,7 @@ public class CloudEnterpriseApplication {
|
||||||
public RestTemplate restTemplate() {
|
public RestTemplate restTemplate() {
|
||||||
return new RestTemplate();
|
return new RestTemplate();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,17 @@
|
||||||
package com.muyu.enterprise.controller;
|
package com.muyu.enterprise.controller;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
|
||||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
import com.muyu.enterprise.cache.CarManageCacheService;
|
||||||
import com.muyu.enterprise.domain.CarManage;
|
import com.muyu.enterprise.domain.CarManage;
|
||||||
import com.muyu.enterprise.domain.CarMessage;
|
|
||||||
import com.muyu.enterprise.domain.dto.CarDTO;
|
import com.muyu.enterprise.domain.dto.CarDTO;
|
||||||
import com.muyu.enterprise.domain.vo.CarVO;
|
import com.muyu.enterprise.domain.vo.CarVO;
|
||||||
import com.muyu.enterprise.service.CarCompanyService;
|
import com.muyu.enterprise.service.CarCompanyService;
|
||||||
import com.muyu.enterprise.service.CarManageService;
|
import com.muyu.enterprise.service.CarManageService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -100,7 +94,8 @@ public class CarManageController extends BaseController {
|
||||||
// 随机生成VIN码
|
// 随机生成VIN码
|
||||||
String key2 = RandomUtil.randomNumbers(17);
|
String key2 = RandomUtil.randomNumbers(17);
|
||||||
carVO.setCarVin(key2);
|
carVO.setCarVin(key2);
|
||||||
carManageService.insertCar(carVO);
|
// carVO
|
||||||
|
// carManageService.insertCar();
|
||||||
return Result.success("添加成功");
|
return Result.success("添加成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,11 @@ package com.muyu.enterprise.controller;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.enterprise.cache.CarManageCacheService;
|
|
||||||
import com.muyu.enterprise.cache.CarMessageCacheService;
|
|
||||||
import com.muyu.enterprise.domain.CarMessage;
|
import com.muyu.enterprise.domain.CarMessage;
|
||||||
import com.muyu.enterprise.service.CarMessageService;
|
import com.muyu.enterprise.service.CarMessageService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -27,8 +26,10 @@ import java.util.List;
|
||||||
@Tag(name = "报文",description = "报文模块")
|
@Tag(name = "报文",description = "报文模块")
|
||||||
public class CarMessageController extends BaseController {
|
public class CarMessageController extends BaseController {
|
||||||
|
|
||||||
private final CarMessageCacheService carMessageCacheService;
|
// private final CarMessageCacheService carMessageCacheService;
|
||||||
private final CarMessageService sysCarMessageService;
|
private final CarMessageService sysCarMessageService;
|
||||||
|
@Autowired
|
||||||
|
private CarMessageService carMessageService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有报文信息
|
* 查询所有报文信息
|
||||||
|
@ -67,7 +68,7 @@ public class CarMessageController extends BaseController {
|
||||||
public Result insertMessage(@RequestBody CarMessage carMessage){
|
public Result insertMessage(@RequestBody CarMessage carMessage){
|
||||||
sysCarMessageService.save(carMessage);
|
sysCarMessageService.save(carMessage);
|
||||||
//报文 redis
|
//报文 redis
|
||||||
carMessageCacheService.put(carMessage.getMessageType(),new CarMessage());
|
// carMessageCacheService.put(carMessage.getMessageType(),new CarMessage());
|
||||||
return Result.success("添加成功");
|
return Result.success("添加成功");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -45,10 +45,20 @@ public class CarTypeController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/catTypeId")
|
@PostMapping("/catTypeId")
|
||||||
private Result<CarType> catTypeId(@RequestParam("catTypeId") Integer catTypeId) {
|
private Result<CarType> catTypeId(@RequestParam("catTypeId") Long catTypeId) {
|
||||||
CarType carType = carTypeService.findById(catTypeId);
|
CarType carType = carTypeService.findById(catTypeId);
|
||||||
return Result.success(carType);
|
return Result.success(carType);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 通过报文模版id查询车辆类型表
|
||||||
|
* @param templateId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectCarTemplateByTemplateId")
|
||||||
|
private Result<CarType> selectCarTemplateByTemplateId(@RequestParam("templateId") Long templateId) {
|
||||||
|
CarType carType = carTypeService.SelectCarTemplateByTemplateId(templateId);
|
||||||
|
return Result.success(carType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,145 @@
|
||||||
|
package com.muyu.enterprise.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.enterprise.domain.dateBase.ElectronicFence;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectroicFenceAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectroicFenceListReq;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectroicFenceUpdReq;
|
||||||
|
import com.muyu.enterprise.domain.req.FenceWayReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceResp;
|
||||||
|
import com.muyu.enterprise.service.ElectronicFenceService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.controller
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:FenceEtlController
|
||||||
|
* @Date:2024/9/17 16:28
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏控制层
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@Tag(name = "电子围栏控制层")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/fence")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class ElectronicFenceController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Resource
|
||||||
|
private ElectronicFenceService electronicFenceService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/fenceArray")
|
||||||
|
@Operation(description = "查询所有可用的围栏")
|
||||||
|
public Result<List<ElectronicFenceResp>> fenceArray() {
|
||||||
|
System.out.println("=====>" + "hgfvhgjy");
|
||||||
|
return Result.success(electronicFenceService.fenceArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/fenceselectList")
|
||||||
|
@Operation(description = "列表")
|
||||||
|
public Result<List<ElectronicFenceResp>> fenceselectList(@RequestBody ElectroicFenceListReq electroicFenceListReq) {
|
||||||
|
System.out.println("=====>" + "hgfvhgjy");
|
||||||
|
return Result.success(electronicFenceService.fenceselectList(electroicFenceListReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@Operation(description = "添加")
|
||||||
|
public Result AddFence(@RequestBody ElectroicFenceAddReq electroicFenceAddReq) {
|
||||||
|
|
||||||
|
electronicFenceService.unquireFence(electroicFenceAddReq.getName());
|
||||||
|
electronicFenceService.AddFence(electroicFenceAddReq);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/upd/{id}")
|
||||||
|
@Operation(description = "修改")
|
||||||
|
public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectroicFenceUpdReq electroicFenceUpdReq) {
|
||||||
|
|
||||||
|
electronicFenceService.updateById(ElectronicFence.buildByElectronicUpd(electroicFenceUpdReq, () -> id));
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/findElectronicByid/{id}")
|
||||||
|
@Operation(description = "通过id回显围栏信息")
|
||||||
|
public Result<ElectronicFence> findElectronicByid(@PathVariable("id") Long id) {
|
||||||
|
|
||||||
|
ElectronicFence electronicFence= electronicFenceService.findElectronicByid(id);
|
||||||
|
return Result.success(electronicFence);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// @PostMapping("/delElectronById/{id}")
|
||||||
|
// @Operation(description = "通过id删除围栏")
|
||||||
|
// public Result delElectronById(@PathVariable("id") Long id) {
|
||||||
|
//
|
||||||
|
// electronicFenceService.delElectronById(id);
|
||||||
|
//
|
||||||
|
// return Result.success();
|
||||||
|
// }
|
||||||
|
/**
|
||||||
|
* 电子围栏表信息表删除
|
||||||
|
* @param electronicFenceId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{electronicFenceId}")
|
||||||
|
@Operation(summary = "电子围栏表信息表删除",
|
||||||
|
description = "通过ID删除电子围栏表信息")
|
||||||
|
public Result<String> remove(@PathVariable("electronicFenceId") Long electronicFenceId)
|
||||||
|
{
|
||||||
|
boolean b = electronicFenceService.removeById(electronicFenceId);
|
||||||
|
return Result.success(null, "操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/open/{id}")
|
||||||
|
@Operation(description = "开启围栏")
|
||||||
|
public Result openFence(@PathVariable("id") Long id) {
|
||||||
|
|
||||||
|
electronicFenceService.openFence(id);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/close/{id}")
|
||||||
|
@Operation(description = "关闭围栏")
|
||||||
|
public Result closeFence(@PathVariable("id") Long id) {
|
||||||
|
|
||||||
|
electronicFenceService.closeFence(id);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/setFenceWay")
|
||||||
|
@Operation(description = "设置电子围栏的位置")
|
||||||
|
public Result setFenceWay(@RequestBody FenceWayReq fenceWayReq) {
|
||||||
|
|
||||||
|
Long id = fenceWayReq.getId();
|
||||||
|
|
||||||
|
String longitudeLatitude = fenceWayReq.getLongitudeLatitude();
|
||||||
|
|
||||||
|
log.info("接收到的数据,:{}" + id + "====" + longitudeLatitude);
|
||||||
|
|
||||||
|
electronicFenceService.setFenceWay(id, longitudeLatitude);
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,132 @@
|
||||||
|
package com.muyu.enterprise.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.enterprise.domain.dateBase.ElectronicFenceGroup;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectronicFenceGroupAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectronicFenceGroupListReq;
|
||||||
|
import com.muyu.enterprise.domain.req.ElectronicFenceGroupUpdReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.ElectronicFenceGroupResp;
|
||||||
|
import com.muyu.enterprise.domain.resp.GroupFenceListresp;
|
||||||
|
import com.muyu.enterprise.service.ElectronicFenceGroupService;
|
||||||
|
import com.muyu.enterprise.service.FenceGroupMidService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.fence.controller
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:FenceGroupController
|
||||||
|
* @Date:2024/9/18 15:15
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组控制层
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/group")
|
||||||
|
@Tag(name = "围栏组控制层")
|
||||||
|
public class ElectronicFenceGroupController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务
|
||||||
|
*/
|
||||||
|
@Autowired
|
||||||
|
private ElectronicFenceGroupService electronicFenceGroupService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FenceGroupMidService fenceGroupMidService;
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/selectGroupList")
|
||||||
|
public Result<List<GroupFenceListresp>> selectGroupList(@RequestBody ElectronicFenceGroupListReq req) {
|
||||||
|
//查询所有的围栏组
|
||||||
|
List<ElectronicFenceGroup> fenceListList = electronicFenceGroupService.selectGroupList(req);
|
||||||
|
|
||||||
|
List<GroupFenceListresp> list = fenceListList.stream().map(ElectronicFenceGroup::buildGroupFence).toList();
|
||||||
|
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@PostMapping("/addGroup")
|
||||||
|
public Result addGroup(@RequestBody ElectronicFenceGroupAddReq addReq) {
|
||||||
|
|
||||||
|
ElectronicFenceGroup electronicFenceGroup = ElectronicFenceGroup.buildByAdd(addReq);
|
||||||
|
//添加围栏组返回添加后的主键自增id
|
||||||
|
electronicFenceGroupService.save(electronicFenceGroup);
|
||||||
|
Long id = electronicFenceGroup.getId();
|
||||||
|
//添加中间表
|
||||||
|
fenceGroupMidService.addGroupAndFenceMid(id, addReq.getElectronicFenceRespList());
|
||||||
|
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/findGroupByid/{id}")
|
||||||
|
@Operation(description = "通过id回显围栏组信息")
|
||||||
|
public Result<ElectronicFenceGroupResp> findGroupByid(@PathVariable("id") Long id) {
|
||||||
|
|
||||||
|
ElectronicFenceGroupResp fenceGroupResp = electronicFenceGroupService.findGroupByid(id);
|
||||||
|
return Result.success(fenceGroupResp);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@PostMapping("/updGroup/{id}")
|
||||||
|
@Operation(description = "修改")
|
||||||
|
public Result UpdFence(@PathVariable("id") Long id, @RequestBody ElectronicFenceGroupUpdReq req) {
|
||||||
|
|
||||||
|
electronicFenceGroupService.updateById(ElectronicFenceGroup.buildByUpd(req, () -> id));
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(req.getElectronicFenceRespList())) {
|
||||||
|
//删除中间表
|
||||||
|
fenceGroupMidService.deliteMid(id);
|
||||||
|
//增加中间表
|
||||||
|
fenceGroupMidService.addGroupAndFenceMid(id, req.getElectronicFenceRespList());
|
||||||
|
}
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏组表信息表删除
|
||||||
|
* @param findGroupId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{findGroupId}")
|
||||||
|
@Operation(summary = "围栏组表信息表删除",
|
||||||
|
description = "通过ID删除围栏组表信息")
|
||||||
|
public Result<String> remove(@PathVariable("findGroupId") Long findGroupId)
|
||||||
|
{
|
||||||
|
boolean b = electronicFenceGroupService.removeById(findGroupId);
|
||||||
|
|
||||||
|
|
||||||
|
return Result.success(null, "操作成功");
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 围栏链信息表删除
|
||||||
|
* @param findId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/findId/{findId}")
|
||||||
|
@Operation(summary = "围栏链信息表删除",
|
||||||
|
description = "通过ID删除围栏链表信息")
|
||||||
|
public Result<String> findId(@PathVariable("findId") Long findId)
|
||||||
|
{
|
||||||
|
boolean b = fenceGroupMidService.removeById(findId);
|
||||||
|
|
||||||
|
|
||||||
|
return Result.success(null, "操作成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -2,8 +2,8 @@ package com.muyu.enterprise.controller;
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.enterprise.domain.FaultrRule;
|
import com.muyu.enterprise.domain.FaultRule;
|
||||||
import com.muyu.enterprise.service.FaultrRuleService;
|
import com.muyu.enterprise.service.FaultRuleService;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -14,42 +14,44 @@ import java.util.List;
|
||||||
* 故障的规则控制层
|
* 故障的规则控制层
|
||||||
* @author chenruijia
|
* @author chenruijia
|
||||||
* @Date 2024/9/28 11:58
|
* @Date 2024/9/28 11:58
|
||||||
* @Description FaultrRuleController:故障的规则控制层
|
* @Description FaultRuleController:故障的规则控制层
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/rule")
|
@RequestMapping("/rule")
|
||||||
@Tag(name = "故障的规则",description = "对故障数据规则的判断")
|
@Tag(name = "故障的规则",description = "对故障数据规则的判断")
|
||||||
public class FaultrRuleController {
|
public class FaultRuleController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FaultrRuleService faultrRuleService;
|
private FaultRuleService faultRuleList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询车辆故障列表
|
* 查询车辆故障列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/faultRuleList", method = RequestMethod.GET)
|
@RequestMapping(value = "/faultRuleList", method = RequestMethod.GET)
|
||||||
public Result<List<FaultrRule>> faultRuleList(FaultrRule faultrRule)
|
public Result<List<FaultRule>> faultRuleList(FaultRule faultRule)
|
||||||
{
|
{
|
||||||
List<FaultrRule> list = faultrRuleService.faultRuleList(faultrRule);
|
List<FaultRule> list = faultRuleList.faultRuleList(faultRule);
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加车辆规则
|
* 添加车辆规则
|
||||||
* @param faultrRule
|
* @param faultRule
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/insertRule",method = RequestMethod.POST)
|
@RequestMapping(value = "/insertRule",method = RequestMethod.POST)
|
||||||
public Result insertRule(@RequestBody FaultrRule faultrRule){
|
public Result insertRule(@RequestBody FaultRule faultRule){
|
||||||
return Result.success(faultrRuleService.save(faultrRule));
|
return Result.success(faultRuleList.save(faultRule));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改车辆规则
|
* 修改车辆规则
|
||||||
* @param faultrRule
|
* @param faultRule
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/updateRule",method = RequestMethod.POST)
|
@RequestMapping(value = "/updateRule",method = RequestMethod.POST)
|
||||||
public Result updateRule(@RequestBody FaultrRule faultrRule){
|
public Result updateRule(@RequestBody FaultRule faultRule){
|
||||||
return Result.success(faultrRuleService.updateById(faultrRule));
|
return Result.success(faultRuleList.updateById(faultRule));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +61,7 @@ public class FaultrRuleController {
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/byidRuleId/{faultRuleId}",method = RequestMethod.GET)
|
@RequestMapping(value = "/byidRuleId/{faultRuleId}",method = RequestMethod.GET)
|
||||||
public Result byidRuleId(@PathVariable Long faultRuleId){
|
public Result byidRuleId(@PathVariable Long faultRuleId){
|
||||||
FaultrRule byid = faultrRuleService.byidRuleId(faultRuleId);
|
FaultRule byid = faultRuleList.byidRuleId(faultRuleId);
|
||||||
return Result.success(byid);
|
return Result.success(byid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +71,7 @@ public class FaultrRuleController {
|
||||||
@RequestMapping(value = "/remove/{ids}",method = RequestMethod.DELETE)
|
@RequestMapping(value = "/remove/{ids}",method = RequestMethod.DELETE)
|
||||||
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
public Result<Integer> remove(@PathVariable("ids") Long[] ids)
|
||||||
{
|
{
|
||||||
faultrRuleService.removeBatchByIds(Arrays.asList(ids));
|
faultRuleList.removeBatchByIds(Arrays.asList(ids));
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.enterprise.domain.WarnLogs;
|
import com.muyu.enterprise.domain.WarnLogs;
|
||||||
import com.muyu.enterprise.service.IWarnLogsService;
|
import com.muyu.enterprise.service.IWarnLogsService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -23,6 +24,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/logs")
|
@RequestMapping("/logs")
|
||||||
|
@Tag(name = "车辆预警日志",description = "用来记录车辆预警的日志")
|
||||||
public class WarnLogsController extends BaseController
|
public class WarnLogsController extends BaseController
|
||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.enterprise.domain.WarnRule;
|
import com.muyu.enterprise.domain.WarnRule;
|
||||||
import com.muyu.enterprise.service.IWarnRuleService;
|
import com.muyu.enterprise.service.IWarnRuleService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -24,6 +25,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/rule")
|
@RequestMapping("/rule")
|
||||||
|
@Tag(name = "车辆预警规则",description = "用来客户添加或者修改规则")
|
||||||
public class WarnRuleController extends BaseController
|
public class WarnRuleController extends BaseController
|
||||||
{
|
{
|
||||||
@Resource
|
@Resource
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.enterprise.service.IWarnStrategyService;
|
import com.muyu.enterprise.service.IWarnStrategyService;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -22,6 +23,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/strategy")
|
@RequestMapping("/strategy")
|
||||||
|
@Tag(name = "故障策略",description = "故障策略对应车辆类型用来客户选择")
|
||||||
public class WarnStrategyController extends BaseController
|
public class WarnStrategyController extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
package com.muyu.enterprise.controller.car;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.enterprise.domain.car.MessageTemplate;
|
||||||
|
import com.muyu.enterprise.domain.req.car.MessageTemplateAddReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.car.MessageTemplateListResp;
|
||||||
|
import com.muyu.enterprise.service.car.MessageTemplateService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版控制层
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.controller
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageTemplateController
|
||||||
|
* @Date:2024/9/26 22:08
|
||||||
|
* @Description: 报文模版控制层
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("messageTemplate")
|
||||||
|
@Tag(name = "报文模版控制层", description = "进行报文模版操作")
|
||||||
|
public class MessageTemplateController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MessageTemplateService messageTemplateService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文模版列表查询
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||||
|
@Operation(summary = "报文模版列表查询", description = "报文模版列表查询")
|
||||||
|
public Result<List<MessageTemplateListResp>> findAll() {
|
||||||
|
List<MessageTemplate> list = messageTemplateService.list();
|
||||||
|
List<MessageTemplateListResp> messageTemplateListRespList = list.stream()
|
||||||
|
.map(template -> MessageTemplateListResp.messageTemplateBuild(
|
||||||
|
template
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.toList();
|
||||||
|
return Result.success(messageTemplateListRespList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增添加报文模版
|
||||||
|
* @param messageTemplateAddReq 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@PostMapping("/")
|
||||||
|
@Operation(summary = "新增添加报文模版", description = "新增添加报文模版")
|
||||||
|
public Result<String> save(@RequestBody MessageTemplateAddReq messageTemplateAddReq) {
|
||||||
|
messageTemplateService.save(MessageTemplate.addBuild(messageTemplateAddReq));
|
||||||
|
return Result.success("添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除报文模版
|
||||||
|
* @param messageTemplateId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@DeleteMapping("/{messageTemplateId}")
|
||||||
|
@Operation(summary = "删除报文模版", description = "删除报文模版")
|
||||||
|
public Result<String> delete(@PathVariable("messageTemplateId") Long messageTemplateId) {
|
||||||
|
messageTemplateService.removeById(messageTemplateId);
|
||||||
|
return Result.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
package com.muyu.enterprise.controller.car;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.enterprise.domain.car.MessageValue;
|
||||||
|
import com.muyu.enterprise.domain.req.car.MessageValueAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.car.MessageValueReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
|
||||||
|
import com.muyu.enterprise.service.car.MessageValueService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文数据控制层
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.controller
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:MessageValueController
|
||||||
|
* @Date:2024/9/26 22:11
|
||||||
|
* @Description: 报文数据控制层
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/messageValue")
|
||||||
|
@Tag(name = "报文数据控制层", description = "进行报文数据操作")
|
||||||
|
public class MessageValueController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private MessageValueService messageValueService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 报文数据列表查询
|
||||||
|
* @param messageValueReq 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
||||||
|
@Operation(summary = "报文数据列表", description = "根据报文类别, 报文模版筛选报文数据")
|
||||||
|
public Result<List<MessageValueListResp>> findAll(@RequestBody MessageValueReq messageValueReq) {
|
||||||
|
List<MessageValueListResp> list = messageValueService.findAll(messageValueReq);
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提供预警和故障使用
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/allList")
|
||||||
|
@Operation(summary = "报文数据下拉框", description = "全部报文数据下拉框")
|
||||||
|
public Result<List<MessageValueListResp>> findAllList() {
|
||||||
|
List<MessageValueListResp> list = messageValueService.list().stream().map(
|
||||||
|
value -> MessageValueListResp.valueBuild(
|
||||||
|
value
|
||||||
|
)
|
||||||
|
).toList();
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增添加报文数据
|
||||||
|
* @param messageValueAddReq 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
@PostMapping("/add")
|
||||||
|
@Operation(summary = "添加报文数据", description = "新增报文数据")
|
||||||
|
public Result<String> save(@RequestBody MessageValueAddReq messageValueAddReq) {
|
||||||
|
messageValueService.save(MessageValue.addBuild(messageValueAddReq));
|
||||||
|
return Result.success("添加成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过报文id删除数据
|
||||||
|
* @param messageId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{messageId}")
|
||||||
|
@Operation(summary = "删除报文数据", description = "删除报文数据")
|
||||||
|
public Result<String> delete(@PathVariable Long messageId) {
|
||||||
|
messageValueService.removeById(messageId);
|
||||||
|
return Result.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
//7E 56 49 4e 31 32 33 34 35 36 37 38 39 31 32 33 34 35 32 33 35 36 37 38 39 31 32 33 34 35 31 31 36 2e 36 36 34 30 35 33 30 33 39 2e 35 33 31 37 39 31 30 32 30 30 2e 30 30 35 38 36 37 38 33 37 2e 33 32 34 36 33 35 2e 31 32 33 39 2e 34 39 31 36 38 37 39 38 2e 35 36 50 30 39 30 38 31 39 2e 39 39 39 39 2e 38 36 30 39 39 39 39 39 31 30 30 30 31 33 39 2e 34 36 31 34 2e 36 38 31 31 33 36 39 2e 38 39 31 30 30 2e 30 30 31 30 30 2e 30 30 31 30 30 2e 30 30 31 33 31 34 2e 36 35 33 36 30 2e 35 38 34 2e 35 36 33 2e 32 35 31 30 30 2e 30 30 39 38 2e 32 33 30 33 36 2e 32 36 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 76 7E
|
||||||
|
/**
|
||||||
|
* 报文转换测试
|
||||||
|
* @param testStr 请求参数
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/analysis/{testStr}")
|
||||||
|
@Operation(summary = "测试解析报文", description = "解析报文测试")
|
||||||
|
public Result<JSONObject> analysis(@PathVariable("testStr") String testStr){
|
||||||
|
JSONObject messageValue = messageValueService.analysis(testStr);
|
||||||
|
return Result.success(messageValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据报文模版id查询报文数据
|
||||||
|
* @param templateId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/findByTemplateId/{templateId}")
|
||||||
|
@Operation(summary = "根据报文模版id查询报文数据", description = "根据报文模版id查询报文数据")
|
||||||
|
public Result<List<MessageValueListResp>> findByTemplateId(@PathVariable("templateId") Long templateId){
|
||||||
|
List<MessageValueListResp> list = messageValueService.findByTemplateId(templateId);
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,142 @@
|
||||||
|
package com.muyu.enterprise.controller.car;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.common.log.annotation.Log;
|
||||||
|
import com.muyu.enterprise.domain.car.Vehicle;
|
||||||
|
import com.muyu.enterprise.domain.req.car.VehicleAddReq;
|
||||||
|
import com.muyu.enterprise.domain.req.car.VehicleManageReq;
|
||||||
|
import com.muyu.enterprise.domain.req.car.VehicleUpdReq;
|
||||||
|
import com.muyu.enterprise.domain.resp.car.VehicleManageResp;
|
||||||
|
import com.muyu.enterprise.service.car.VehicleService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆管理控制层
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.controller
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleController
|
||||||
|
* @Date:2024/9/26 22:17
|
||||||
|
* @Description: 车辆管理控制层
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicleManage")
|
||||||
|
@Tag(name = "车辆管理控制层", description = "进行车辆管理操作")
|
||||||
|
public class VehicleController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private VehicleService vehicleService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询车辆管理列表
|
||||||
|
* @param vehicleManageReq 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@RequestMapping(path = "/list", method = RequestMethod.POST)
|
||||||
|
@Operation(summary = "车辆管理列表", description = "根据车牌号、VIN码、车辆状态筛选车辆")
|
||||||
|
public Result<TableDataInfo<VehicleManageResp>> getVehicleList(@RequestBody VehicleManageReq vehicleManageReq) {
|
||||||
|
startPage();
|
||||||
|
List<VehicleManageResp> list = vehicleService.getVehicleList(vehicleManageReq);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆录入(添加车辆)
|
||||||
|
* @param vehicleAddReq 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/")
|
||||||
|
@Operation(summary = "新增车辆", description = "录入车辆信息")
|
||||||
|
public Result<String> save(@RequestBody VehicleAddReq vehicleAddReq) {
|
||||||
|
vehicleService.save(Vehicle.addBuild(vehicleAddReq));
|
||||||
|
return Result.success("录入成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过车辆id获取车辆信息
|
||||||
|
* @param vehicleId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/{vehicleId}")
|
||||||
|
@Operation(summary = "通过id查询车辆信息", description = "通过id查询车辆信息")
|
||||||
|
public Result<Vehicle> findById(@PathVariable("vehicleId") Long vehicleId) {
|
||||||
|
return Result.success(vehicleService.getById(vehicleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆信息
|
||||||
|
* @param vehicleId 请求对象
|
||||||
|
* @param vehicleUpdReq 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@PutMapping("/{vehicleId}")
|
||||||
|
@Operation(summary = "修改车辆信息", description = "修改车辆信息")
|
||||||
|
public Result<String> update(
|
||||||
|
@PathVariable("vehicleId") Long vehicleId,
|
||||||
|
@RequestBody @Validated VehicleUpdReq vehicleUpdReq) {
|
||||||
|
vehicleService.updateById(Vehicle.updBuild(vehicleUpdReq, () -> vehicleId));
|
||||||
|
return Result.success("修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过车辆id删除车辆信息
|
||||||
|
* @param vehicleId 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{vehicleId}")
|
||||||
|
@Operation(summary = "通过车辆id删除车辆信息", description = "通过车辆id删除车辆信息")
|
||||||
|
public Result<String> delete(@PathVariable("vehicleId") Long vehicleId) {
|
||||||
|
vehicleService.removeById(vehicleId);
|
||||||
|
return Result.success("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除车辆
|
||||||
|
* @param vehicleIds 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/batchDelete")
|
||||||
|
@Operation(summary = "批量删除车辆")
|
||||||
|
public Result<String> batchDelete(@RequestBody List<Long> vehicleIds) {
|
||||||
|
vehicleService.removeBatchByIds(vehicleIds);
|
||||||
|
return Result.success("批量删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出所有车辆数据
|
||||||
|
* @param response 请求对象
|
||||||
|
*/
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response) {
|
||||||
|
List<Vehicle> list = vehicleService.list();
|
||||||
|
ExcelUtil<Vehicle> util = new ExcelUtil<>(Vehicle.class);
|
||||||
|
util.exportExcel(response, list, "车辆数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过车辆vin码查询模板id
|
||||||
|
* @param vehicleVin 请求对象
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/findByVehicleVin/{vehicleVin}")
|
||||||
|
@Operation(description = "通过车辆vin码查询模板id")
|
||||||
|
public Result<Long> findByVehicleVin(@PathVariable("vehicleVin") String vehicleVin) {
|
||||||
|
Long byVehicleVin = vehicleService.findByVehicleVin(vehicleVin);
|
||||||
|
return Result.success(byVehicleVin);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.muyu.enterprise.controller.car;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.enterprise.domain.car.VehicleType;
|
||||||
|
import com.muyu.enterprise.service.car.VehicleTypeService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型控制层
|
||||||
|
* @Author:李庆帅
|
||||||
|
* @Package:com.muyu.car.controller
|
||||||
|
* @Project:cloud-server
|
||||||
|
* @name:VehicleTypeController
|
||||||
|
* @Date:2024/9/26 22:23
|
||||||
|
* @Description: 车辆类型实体类
|
||||||
|
*/
|
||||||
|
@Log4j2
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicleType")
|
||||||
|
@Tag(name = "车辆类型控制层", description = "车辆类型控制层")
|
||||||
|
public class VehicleTypeController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private VehicleTypeService vehicleTypeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型查询
|
||||||
|
* @return 返回结果
|
||||||
|
*/
|
||||||
|
@RequestMapping(path = "/", method = RequestMethod.POST)
|
||||||
|
@Operation(summary = "车辆类型列表",description = "车辆类型列表")
|
||||||
|
public Result<List<VehicleType>> findAll(){
|
||||||
|
return Result.success(vehicleTypeService.list());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue