Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
d88c10e453 | |
|
27a4900926 | |
|
0aa9c5f3e3 | |
|
64b015626e |
|
@ -66,7 +66,7 @@ public class TokenController {
|
|||
@PostMapping("register")
|
||||
public Result<?> register (@RequestBody RegisterBody registerBody) {
|
||||
// 用户注册
|
||||
sysLoginService.register(registerBody);
|
||||
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ package com.muyu.auth.form;
|
|||
* @author muyu
|
||||
*/
|
||||
public class LoginBody {
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
|
@ -17,8 +16,6 @@ public class LoginBody {
|
|||
*/
|
||||
private String password;
|
||||
|
||||
|
||||
|
||||
public String getUsername () {
|
||||
return username;
|
||||
}
|
||||
|
|
|
@ -1,39 +1,10 @@
|
|||
package com.muyu.auth.form;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 用户注册对象
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class RegisterBody extends LoginBody {
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String firmName;
|
||||
|
||||
/**
|
||||
* 邮件地址
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phonenumber;
|
||||
/**
|
||||
* 公司注册人名称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.auth.service;
|
||||
|
||||
import com.muyu.auth.form.RegisterBody;
|
||||
import com.muyu.common.core.constant.CacheConstants;
|
||||
import com.muyu.common.core.constant.Constants;
|
||||
import com.muyu.common.core.constant.SecurityConstants;
|
||||
|
@ -13,8 +12,6 @@ import com.muyu.common.core.utils.StringUtils;
|
|||
import com.muyu.common.core.utils.ip.IpUtils;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.common.system.domain.Firm;
|
||||
import com.muyu.common.system.remote.RemoteFirmService;
|
||||
import com.muyu.common.system.remote.RemoteUserService;
|
||||
import com.muyu.common.system.domain.SysUser;
|
||||
import com.muyu.common.system.domain.LoginUser;
|
||||
|
@ -31,9 +28,6 @@ public class SysLoginService {
|
|||
@Autowired
|
||||
private RemoteUserService remoteUserService;
|
||||
|
||||
@Autowired
|
||||
private RemoteFirmService remoteFirmService;
|
||||
|
||||
@Autowired
|
||||
private SysPasswordService passwordService;
|
||||
|
||||
|
@ -104,47 +98,31 @@ public class SysLoginService {
|
|||
/**
|
||||
* 注册
|
||||
*/
|
||||
public void register (RegisterBody registerBody) {
|
||||
public void register (String username, String password) {
|
||||
// 用户名或密码为空 错误
|
||||
if (StringUtils.isAnyBlank(registerBody.getUsername(), registerBody.getPassword())) {
|
||||
if (StringUtils.isAnyBlank(username, password)) {
|
||||
throw new ServiceException("用户/密码必须填写");
|
||||
}
|
||||
if (registerBody.getUsername().length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| registerBody.getUsername().length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) {
|
||||
throw new ServiceException("账户长度必须在2到20个字符之间");
|
||||
}
|
||||
if (registerBody.getPassword().length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| registerBody.getPassword().length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH) {
|
||||
throw new ServiceException("密码长度必须在5到20个字符之间");
|
||||
}
|
||||
String firmName = registerBody.getFirmName();
|
||||
Result<Firm> byFirmName = remoteFirmService.findByFirmName(firmName);
|
||||
Firm data = byFirmName.getData();
|
||||
if (null != data){
|
||||
throw new ServiceException("公司名称已经存在");
|
||||
}
|
||||
|
||||
|
||||
// 注册用户信息
|
||||
SysUser sysUser = new SysUser();
|
||||
//公司账号
|
||||
sysUser.setUserName(registerBody.getUsername());
|
||||
//公司邮箱
|
||||
sysUser.setEmail(registerBody.getEmail());
|
||||
//公司号码
|
||||
sysUser.setPhonenumber(registerBody.getPhonenumber());
|
||||
//密码
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(registerBody.getPassword()));
|
||||
//公司注册人名称
|
||||
sysUser.setNickName(registerBody.getNickName());
|
||||
//企业名称
|
||||
sysUser.setFirmName(registerBody.getFirmName());
|
||||
sysUser.setUserName(username);
|
||||
sysUser.setNickName(username);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||
Result<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
|
||||
if (Result.FAIL == registerResult.getCode()) {
|
||||
throw new ServiceException(registerResult.getMsg());
|
||||
}
|
||||
recordLogService.recordLogininfor(registerBody.getUsername(), Constants.REGISTER, "注册成功");
|
||||
recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
|||
addr: 159.75.188.178:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: xxy
|
||||
namespace: psr
|
||||
# Spring
|
||||
spring:
|
||||
application:
|
||||
|
|
|
@ -16,11 +16,6 @@ public class SecurityConstants {
|
|||
*/
|
||||
public static final String DETAILS_FIRM_ID = "firm_id";
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
public static final String DETAILS_DEPT_ID = "dept_id";
|
||||
|
||||
/**
|
||||
* 用户名字段
|
||||
*/
|
||||
|
@ -56,5 +51,5 @@ public class SecurityConstants {
|
|||
*/
|
||||
public static final String ROLE_PERMISSION = "role_permission";
|
||||
|
||||
public static final String SAAS_KEY = "ent-code";
|
||||
public static final String SAAS_KEY = "ent_code";
|
||||
}
|
||||
|
|
|
@ -151,16 +151,6 @@ public class JwtUtils {
|
|||
return getValue(claims, SecurityConstants.DETAILS_USERNAME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据身份信息获取SAAS标识
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return SAAS标识
|
||||
*/
|
||||
public static String getSaaSKey(Claims claims) {
|
||||
return getValue(claims, SecurityConstants.SAAS_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据身份信息获取键值
|
||||
*
|
||||
|
@ -172,13 +162,4 @@ public class JwtUtils {
|
|||
public static String getValue (Claims claims, String key) {
|
||||
return Convert.toStr(claims.get(key), "");
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param claims 身份信息
|
||||
* @return 值
|
||||
*/
|
||||
public static String getDeptId(Claims claims) {
|
||||
return getValue(claims, SecurityConstants.DETAILS_DEPT_ID);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -501,5 +501,4 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.common.core.web;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.common.core.web
|
||||
* @Project:cloud-server-8
|
||||
* @name:PageList
|
||||
* @Date:2024/9/26 下午10:28
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PageList<T> {
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*/
|
||||
private List<T> rows;
|
||||
/**
|
||||
* 总条数
|
||||
*/
|
||||
private long total;
|
||||
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-common-kafka</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 项目公共核心 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,54 +0,0 @@
|
|||
package com.muyu.common.kafka.config;
|
||||
|
||||
import com.muyu.common.kafka.constants.KafkaConstants;
|
||||
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.boot.SpringBootConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* kafka 消息的消费者 配置类
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaConsumerConfig {
|
||||
|
||||
@Bean
|
||||
public KafkaConsumer kafkaConsumer() {
|
||||
Map<String, Object> configs = new HashMap<>();
|
||||
//kafka服务端的IP和端口,格式:(ip:port)
|
||||
configs.put("bootstrap.servers", "60.204.221.52:9092");
|
||||
//开启consumer的偏移量(offset)自动提交到Kafka
|
||||
configs.put("enable.auto.commit", true);
|
||||
//consumer的偏移量(offset) 自动提交的时间间隔,单位毫秒
|
||||
configs.put("auto.commit.interval", 5000);
|
||||
//在Kafka中没有初始化偏移量或者当前偏移量不存在情况
|
||||
//earliest, 在偏移量无效的情况下, 自动重置为最早的偏移量
|
||||
//latest, 在偏移量无效的情况下, 自动重置为最新的偏移量
|
||||
//none, 在偏移量无效的情况下, 抛出异常.
|
||||
configs.put("auto.offset.reset", "latest");
|
||||
//请求阻塞的最大时间(毫秒)
|
||||
configs.put("fetch.max.wait", 500);
|
||||
//请求应答的最小字节数
|
||||
configs.put("fetch.min.size", 1);
|
||||
//心跳间隔时间(毫秒)
|
||||
configs.put("heartbeat-interval", 3000);
|
||||
//一次调用poll返回的最大记录条数
|
||||
configs.put("max.poll.records", 500);
|
||||
//指定消费组
|
||||
configs.put("group.id", KafkaConstants.KafkaGrop);
|
||||
//指定key使用的反序列化类
|
||||
Deserializer keyDeserializer = new StringDeserializer();
|
||||
//指定value使用的反序列化类
|
||||
Deserializer valueDeserializer = new StringDeserializer();
|
||||
//创建Kafka消费者
|
||||
KafkaConsumer kafkaConsumer = new KafkaConsumer(configs, keyDeserializer, valueDeserializer);
|
||||
return kafkaConsumer;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package com.muyu.common.kafka.config;
|
||||
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.common.serialization.Serializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.springframework.boot.SpringBootConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* kafka 消息的生产者 配置类
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaProviderConfig {
|
||||
|
||||
@Bean
|
||||
public KafkaProducer kafkaProducer() {
|
||||
Map<String, Object> configs = new HashMap<>();
|
||||
//#kafka服务端的IP和端口,格式:(ip:port)
|
||||
configs.put("bootstrap.servers", "47.116.173.119:9092");
|
||||
//客户端发送服务端失败的重试次数
|
||||
configs.put("retries", 2);
|
||||
//多个记录被发送到同一个分区时,生产者将尝试将记录一起批处理成更少的请求.
|
||||
//此设置有助于提高客户端和服务器的性能,配置控制默认批量大小(以字节为单位)
|
||||
configs.put("batch.size", 16384);
|
||||
//生产者可用于缓冲等待发送到服务器的记录的总内存字节数(以字节为单位)
|
||||
configs.put("buffer-memory", 33554432);
|
||||
//生产者producer要求leader节点在考虑完成请求之前收到的确认数,用于控制发送记录在服务端的持久化
|
||||
//acks=0,设置为0,则生产者producer将不会等待来自服务器的任何确认.该记录将立即添加到套接字(socket)缓冲区并视为已发送.在这种情况下,无法保证服务器已收到记录,并且重试配置(retries)将不会生效(因为客户端通常不会知道任何故障),每条记录返回的偏移量始终设置为-1.
|
||||
//acks=1,设置为1,leader节点会把记录写入本地日志,不需要等待所有follower节点完全确认就会立即应答producer.在这种情况下,在follower节点复制前,leader节点确认记录后立即失败的话,记录将会丢失.
|
||||
//acks=all,acks=-1,leader节点将等待所有同步复制副本完成再确认记录,这保证了只要至少有一个同步复制副本存活,记录就不会丢失.
|
||||
configs.put("acks", "-1");
|
||||
//指定key使用的序列化类
|
||||
Serializer keySerializer = new StringSerializer();
|
||||
//指定value使用的序列化类
|
||||
Serializer valueSerializer = new StringSerializer();
|
||||
//创建Kafka生产者
|
||||
KafkaProducer kafkaProducer = new KafkaProducer(configs, keySerializer, valueSerializer);
|
||||
return kafkaProducer;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
package com.muyu.common.kafka.constants;
|
||||
|
||||
|
||||
public class KafkaConstants {
|
||||
|
||||
public final static String KafkaTopic = "carJsons";
|
||||
|
||||
// public final static String KafkaGrop = "kafka_grop";
|
||||
}
|
|
@ -1,76 +0,0 @@
|
|||
package com.muyu.kafkaconfig;
|
||||
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.common.serialization.StringDeserializer;
|
||||
import org.apache.kafka.common.serialization.StringSerializer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.config.kafkaconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:KafkaConfig
|
||||
* @Date:2024/9/28 12:19
|
||||
*/
|
||||
@Configuration
|
||||
public class KafkaConfig {
|
||||
|
||||
@Bean
|
||||
public KafkaProducer kafkaProducer(){
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put("bootstrap.servers","60.204.221.52:9092");
|
||||
configs.put("retries",2);
|
||||
configs.put("batch.size",16384);
|
||||
//生产者可用于缓冲等待发送到服务器的记录的总内存字节数
|
||||
configs.put("buffer-memory",3554432);
|
||||
/**
|
||||
* ,用于控制发送记录在服务端的持久化
|
||||
*acks=0,设置为0,则生产者producer将不会等待来自服务器的任何确认.该记录将立即添加到套接字(socket)缓冲区并视为已发送
|
||||
* .在这种情况下,无法保证服务器已收到记录,并且重试配置(retries)将不会生效(因为客户端通常不会知道任何故障),每条记录返回的偏移量始终设置为-1.
|
||||
*acks=1,设置为1,leader节点会把记录写入本地日志,不需要等待所有follower节点完全确认就会立即应答producer.在这种情况下,
|
||||
* 在follower节点复制前,leader节点确认记录后立即失败的话,记录将会丢失.
|
||||
*/
|
||||
configs.put("acks","-1");
|
||||
//指定key使用的序列化类
|
||||
StringSerializer keySerializer = new StringSerializer();
|
||||
//指定value使用的序列化类
|
||||
StringSerializer valueSerializer = new StringSerializer();
|
||||
//创建kafka生产者
|
||||
return new KafkaProducer(configs, keySerializer, valueSerializer);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public KafkaConsumer kafkaConsumer(){
|
||||
HashMap<String, Object> configs = new HashMap<>();
|
||||
configs.put("bootstrap.servers","60.204.221.52:9092");
|
||||
//开启consumer的偏移量(offset)自动提交到kafka
|
||||
configs.put("enable.auto.commit",true);
|
||||
//偏移量自动提交的时间间隔,单位毫秒
|
||||
configs.put("auto.commit.interval",5000);
|
||||
//在Kafka中没有初始化偏移量或者当前偏移量不存在情况
|
||||
//earliest, 在偏移量无效的情况下, 自动重置为最早的偏移量
|
||||
//latest, 在偏移量无效的情况下, 自动重置为最新的偏移量
|
||||
//none, 在偏移量无效的情况下, 抛出异常.
|
||||
configs.put("auto.offset.reset","latest");
|
||||
//请求阻塞的最大时间(毫秒)
|
||||
configs.put("fetch.max.wait",500);
|
||||
//请求应答的最小字节数
|
||||
configs.put("fetch.min.size",1);
|
||||
//心跳间隔时间(毫秒)
|
||||
configs.put("heartbeat-interval",3000);
|
||||
//一次调用poll返回的最大记录条数
|
||||
configs.put("max.poll.records",500);
|
||||
//指定消费组
|
||||
configs.put("group.id","firstGroup");
|
||||
//指定key使用的反序列化类
|
||||
StringDeserializer keyDeserializer = new StringDeserializer();
|
||||
//指定value使用的反序列化类
|
||||
StringDeserializer valueDeserializer = new StringDeserializer();
|
||||
//创建kafka消费者
|
||||
return new KafkaConsumer(configs,keyDeserializer,valueDeserializer);
|
||||
}
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
com.muyu.kafkaconfig.KafkaConfig
|
|
@ -20,7 +20,10 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
|
|||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author: DongZeLiang
|
||||
|
@ -63,7 +66,7 @@ public class ManyDataSource implements ApplicationRunner{
|
|||
public DynamicDataSource dynamicDataSource(DruidDataSourceFactory druidDataSourceFactory) {
|
||||
// 企业列表 企业CODE,端口,IP
|
||||
Map<Object, Object> dataSourceMap = new HashMap<>();
|
||||
Objects.requireNonNull(dataSourceInfoList())
|
||||
dataSourceInfoList()
|
||||
.stream()
|
||||
.map(entInfo -> DataSourceInfo.hostAndPortBuild(entInfo.getEntCode(), entInfo.getIp(), entInfo.getPort()))
|
||||
.forEach(dataSourceInfo -> {
|
||||
|
|
|
@ -11,7 +11,7 @@ public class DatasourceContent {
|
|||
|
||||
public final static String USER_NAME = "root";
|
||||
|
||||
public final static String PASSWORD = "bwie-8666";
|
||||
public final static String PASSWORD = "root";
|
||||
|
||||
public final static String IP = "159.75.188.178";
|
||||
|
||||
|
|
|
@ -56,7 +56,6 @@ public class TokenService {
|
|||
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
|
||||
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
|
||||
claimsMap.put(SecurityConstants.SAAS_KEY,loginUser.getSysUser().getDatabaseName());
|
||||
claimsMap.put(SecurityConstants.DETAILS_DEPT_ID,loginUser.getSysUser().getDeptId());
|
||||
|
||||
// 接口返回信息
|
||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
package com.muyu.common.system.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.common.system.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:Firm
|
||||
* @Date:2024/9/25 22:03
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Firm {
|
||||
|
||||
/**
|
||||
* 公司编号
|
||||
*/
|
||||
private Integer firmId;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String firmName;
|
||||
|
||||
/**
|
||||
* 公司所属数据库
|
||||
*/
|
||||
private String databaseName;
|
||||
}
|
|
@ -87,6 +87,7 @@ public class SysUser extends BaseEntity {
|
|||
* 企业ID
|
||||
*/
|
||||
private Integer firmId;
|
||||
|
||||
/**
|
||||
* 所属数据库
|
||||
*/
|
||||
|
@ -144,12 +145,6 @@ public class SysUser extends BaseEntity {
|
|||
*/
|
||||
private Long roleId;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
* @param userId
|
||||
*/
|
||||
private String firmName;
|
||||
|
||||
public SysUser (Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
package com.muyu.common.system.remote;
|
||||
|
||||
import com.muyu.common.core.constant.ServiceNameConstants;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.system.domain.Firm;
|
||||
import com.muyu.common.system.remote.factory.RemoteFirmFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.common.system.remote
|
||||
* @Project:cloud-server-8
|
||||
* @name:RemoteFirmService
|
||||
* @Date:2024/9/25 22:21
|
||||
*/
|
||||
@FeignClient(contextId = "remoteFirmService", value = ServiceNameConstants.SYSTEM_SERVICE,fallbackFactory = RemoteFirmFallbackFactory.class)
|
||||
public interface RemoteFirmService {
|
||||
|
||||
@RequestMapping("/firm/findByFirmName/{firmName}")
|
||||
public Result<Firm> findByFirmName(@PathVariable("firmName") String firmName);
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.muyu.common.system.remote.factory;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.system.domain.Firm;
|
||||
import com.muyu.common.system.remote.RemoteFirmService;
|
||||
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.common.system.remote.factory
|
||||
* @Project:cloud-server-8
|
||||
* @name:RemoteFirmFallbackFactory
|
||||
* @Date:2024/9/25 22:22
|
||||
*/
|
||||
@Component
|
||||
public class RemoteFirmFallbackFactory implements FallbackFactory<RemoteFirmService> {
|
||||
@Override
|
||||
public RemoteFirmService create(Throwable cause) {
|
||||
|
||||
return new RemoteFirmService() {
|
||||
@Override
|
||||
public Result<Firm> findByFirmName(String firmName) {
|
||||
throw new ServiceException(cause.getCause().toString());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
com.muyu.common.system.remote.factory.RemoteUserFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteLogFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteFileFallbackFactory
|
||||
com.muyu.common.system.remote.factory.RemoteFirmFallbackFactory
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<module>cloud-common-rabbit</module>
|
||||
<module>cloud-common-saas</module>
|
||||
<module>cloud-common-wechat</module>
|
||||
<module>cloud-common-kafka</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>cloud-common</artifactId>
|
||||
|
|
|
@ -66,15 +66,11 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) {
|
||||
return unauthorizedResponse(exchange, "令牌验证失败");
|
||||
}
|
||||
String saaSKey = JwtUtils.getSaaSKey(claims);
|
||||
String deptId = JwtUtils.getDeptId(claims);
|
||||
|
||||
// 设置用户信息到请求
|
||||
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
|
||||
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
||||
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
||||
addHeader(mutate, SecurityConstants.SAAS_KEY,saaSKey);
|
||||
addHeader(mutate,SecurityConstants.DETAILS_DEPT_ID,deptId);
|
||||
// 内部请求来源参数清除
|
||||
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
||||
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
||||
|
|
|
@ -7,7 +7,7 @@ nacos:
|
|||
addr: 159.75.188.178:8848
|
||||
user-name: nacos
|
||||
password: nacos
|
||||
namespace: xxy
|
||||
namespace: psr
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
|
|
@ -1,107 +1,113 @@
|
|||
<?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"
|
||||
<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>
|
||||
<artifactId>cloud-modules</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-enterprise-server</artifactId>
|
||||
<description>
|
||||
cloud-modules-enterprise-server 企业业务服务
|
||||
cloud-modules-car-gateway车辆网关模块
|
||||
</description>
|
||||
<artifactId>cloud-modules-car-gateway</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>cloud-modules-car-gateway</name>
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>com.muyu</groupId> -->
|
||||
<!-- <artifactId>cloud-common-rabbit</artifactId> -->
|
||||
<!-- </dependency> -->
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<!-- mqttv3 -->
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.2</version>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
|
||||
<!-- SpringCloud Alibaba Nacos Config -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!--apache.kafka<-->
|
||||
<dependency>
|
||||
<groupId>org.apache.kafka</groupId>
|
||||
<artifactId>kafka-clients</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
|
||||
<!-- SpringCloud Alibaba Sentinel -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||
</dependency>
|
||||
<!-- SpringBoot Actuator -->
|
||||
|
||||
<!-- SpringBoot Actuator -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<!-- Mysql Connector -->
|
||||
|
||||
<!-- Mysql Connector -->
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataSource -->
|
||||
|
||||
<!-- MuYu Common DataSource -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datasource</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common DataScope -->
|
||||
|
||||
<!-- MuYu Common DataScope -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
<!-- MuYu Common Log -->
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
<!-- 接口模块 -->
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
<version>1.4.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper</artifactId>
|
||||
<version>6.0.0</version>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-kafka</artifactId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-car</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>ecs20140526</artifactId>
|
||||
<version>5.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.eclipse.paho</groupId>
|
||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>cloud-electronic</finalName>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@ -114,15 +120,6 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<!-- <!– 加入maven deploy插件,当在deploy时,忽略些model–> -->
|
||||
<!-- <plugin> -->
|
||||
<!-- <groupId>org.apache.maven.plugins</groupId> -->
|
||||
<!-- <artifactId>maven-deploy-plugin</artifactId> -->
|
||||
<!-- <version>3.1.1</version> -->
|
||||
<!-- <configuration> -->
|
||||
<!-- <skip>true</skip> -->
|
||||
<!-- </configuration> -->
|
||||
<!-- </plugin> -->
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.car;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.car
|
||||
* @Project:cloud-server-8
|
||||
* @name:CloudCarGatewayApplication
|
||||
* @Date:2024/9/29 上午10:50
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class CloudCarGatewayApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CloudCarGatewayApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.car;
|
||||
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
|
||||
public class MqttPublishSample {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
String topic = "vehicle";
|
||||
String content = "Message from MqttPublishSample";
|
||||
int qos = 2;
|
||||
String broker = "tcp://120.55.62.0:1883";
|
||||
String clientId = "JavaSample";
|
||||
|
||||
try {
|
||||
// 第三个参数为空,默认持久化策略
|
||||
MqttClient sampleClient = new MqttClient(broker, clientId);
|
||||
MqttConnectOptions connOpts = new MqttConnectOptions();
|
||||
connOpts.setCleanSession(true);
|
||||
System.out.println("Connecting to broker: "+broker);
|
||||
sampleClient.connect(connOpts);
|
||||
sampleClient.subscribe(topic,0);
|
||||
sampleClient.setCallback(new MqttCallback() {
|
||||
// 连接丢失
|
||||
@Override
|
||||
public void connectionLost(Throwable throwable) {
|
||||
|
||||
}
|
||||
// 连接成功
|
||||
@Override
|
||||
public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {
|
||||
System.out.println(new String(mqttMessage.getPayload()));
|
||||
}
|
||||
// 接收信息
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||
|
||||
}
|
||||
});
|
||||
} catch(MqttException me) {
|
||||
System.out.println("reason "+me.getReasonCode());
|
||||
System.out.println("msg "+me.getMessage());
|
||||
System.out.println("loc "+me.getLocalizedMessage());
|
||||
System.out.println("cause "+me.getCause());
|
||||
System.out.println("excep "+me);
|
||||
me.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.car.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 实例基础信息
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:ExampleInformation
|
||||
* @Date:2024/9/29 下午10:01
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ExampleInformation {
|
||||
|
||||
/**
|
||||
* 实例ID
|
||||
*/
|
||||
private String InstanceId;
|
||||
/**
|
||||
* 实例IP
|
||||
*/
|
||||
private String IpAddress;
|
||||
/**
|
||||
* 实例状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.car.instance;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:CreateClient
|
||||
* @Date:2024/9/29 上午10:41
|
||||
*/
|
||||
@Component
|
||||
public class CreateClient {
|
||||
|
||||
/**
|
||||
* <b>description</b> :
|
||||
* <p>使用AK&SK初始化账号Client</p>
|
||||
* @return Client
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static com.aliyun.ecs20140526.Client createClient() throws Exception {
|
||||
// 工程代码泄露可能会导致 AccessKey 泄露,并威胁账号下所有资源的安全性。以下代码示例仅供参考。
|
||||
// 建议使用更安全的 STS 方式,更多鉴权访问方式请参见:https://help.aliyun.com/document_detail/378657.html。
|
||||
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config()
|
||||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID。
|
||||
.setAccessKeyId("LTAI5tFtQk1KbwRBXM5pHVWw")
|
||||
// 必填,请确保代码运行环境设置了环境变量 ALIBABA_CLOUD_ACCESS_KEY_SECRET。
|
||||
.setAccessKeySecret("GLByUZqUqgR600eTpGmfb52ZT93mu9");
|
||||
// Endpoint 请参考 https://api.aliyun.com/product/Ecs
|
||||
config.endpoint = "ecs-cn-hangzhou.aliyuncs.com";
|
||||
return new com.aliyun.ecs20140526.Client(config);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.muyu.car.instance;
|
||||
|
||||
import com.aliyun.ecs20140526.models.DescribeInstancesRequest;
|
||||
import com.aliyun.ecs20140526.models.DescribeInstancesResponse;
|
||||
import com.aliyun.ecs20140526.models.DescribeInstancesResponseBody;
|
||||
import com.aliyun.ecs20140526.models.RunInstancesResponseBody;
|
||||
import com.aliyun.tea.*;
|
||||
import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:DelInstance
|
||||
* @Date:2024/9/29 上午10:42
|
||||
*/
|
||||
@Log4j2
|
||||
@Component
|
||||
@Tag(name = "程序停止删除实例")
|
||||
public class DelInstance implements DisposableBean {
|
||||
|
||||
public static void delInstance() throws Exception {
|
||||
// 创建ECS客户端对象,用于后续调用ECS相关API
|
||||
com.aliyun.ecs20140526.Client client = CreateClient.createClient();
|
||||
DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest()
|
||||
.setRegionId("cn-hangzhou");
|
||||
//创建运行时选择对象,用于配置运行时的选项参数
|
||||
RuntimeOptions runtimeOptions = new RuntimeOptions();
|
||||
|
||||
//获取实例列表
|
||||
DescribeInstancesResponse describeInstancesResponse = client.describeInstancesWithOptions(describeInstancesRequest, runtimeOptions);
|
||||
|
||||
//提取实例ID集合
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
DescribeInstancesResponseBody body = describeInstancesResponse.getBody();
|
||||
for (DescribeInstancesResponseBody.DescribeInstancesResponseBodyInstancesInstance instance : body.getInstances().getInstance()) {
|
||||
list.add(instance.getInstanceId());
|
||||
}
|
||||
log.info("Instance IDs: " + list);
|
||||
// 创建删除实例请求对象,并设置请求参数
|
||||
com.aliyun.ecs20140526.models.DeleteInstancesRequest deleteInstancesRequest = new com.aliyun.ecs20140526.models.DeleteInstancesRequest()
|
||||
//设置地域ID,指定删除实例的地域
|
||||
.setRegionId("cn-hangzhou")
|
||||
// 设置DryRun为true,用于验证请求是否可以成功,但不实际执行删除操作
|
||||
.setDryRun(false)
|
||||
// 设置Force为true,表示即使实例有正在运行的任务,也强制删除实例
|
||||
.setForce(true)
|
||||
// 设置TerminateSubscription为true,表示删除按订阅付费的实例时终止订阅
|
||||
.setTerminateSubscription(true)
|
||||
.setInstanceId(list);
|
||||
|
||||
//创建运行时选项对象,用于配置运行时的选项参数
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
try {
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
client.deleteInstancesWithOptions(deleteInstancesRequest, runtime);
|
||||
} catch (TeaException error) {
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
log.info(error.getMessage());
|
||||
// 诊断地址
|
||||
log.info(error.getData().get("Recommend"));
|
||||
com.aliyun.teautil.Common.assertAsString(error.message);
|
||||
} catch (Exception _error) {
|
||||
TeaException error = new TeaException(_error.getMessage(), _error);
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
log.info(error.getMessage());
|
||||
// 诊断地址
|
||||
log.info(error.getData().get("Recommend"));
|
||||
com.aliyun.teautil.Common.assertAsString(error.message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
log.info("===============>开始执行删除实例方法");
|
||||
delInstance();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.muyu.car.instance;
|
||||
|
||||
import com.aliyun.ecs20140526.models.*;
|
||||
import com.aliyun.tea.TeaException;
|
||||
import com.aliyun.teautil.models.RuntimeOptions;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.boot.ApplicationArguments;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.car.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:GenerateInstance
|
||||
* @Date:2024/9/29 上午10:42
|
||||
*/
|
||||
@Component
|
||||
@Log4j2
|
||||
@Tag(name = "启动时创建实例")
|
||||
public class GenerateInstance implements ApplicationRunner {
|
||||
|
||||
/**
|
||||
* 启动自动创建实例
|
||||
* @throws Exception
|
||||
*/
|
||||
public static List<String> generateInstance() throws Exception {
|
||||
|
||||
// 创建ECS客户端对象,用于后续调用ECS相关API
|
||||
com.aliyun.ecs20140526.Client client = CreateClient.createClient();
|
||||
|
||||
com.aliyun.ecs20140526.models.RunInstancesRequest.RunInstancesRequestSystemDisk systemDisk = new com.aliyun.ecs20140526.models.RunInstancesRequest.RunInstancesRequestSystemDisk()
|
||||
.setSize("40")
|
||||
.setCategory("cloud_essd");
|
||||
com.aliyun.ecs20140526.models.RunInstancesRequest runInstancesRequest = new com.aliyun.ecs20140526.models.RunInstancesRequest()
|
||||
// 设置地域ID
|
||||
.setRegionId("cn-hangzhou")
|
||||
// 设置镜像ID
|
||||
.setImageId("m-bp10rcc4nsihqfoz0w7s")
|
||||
// 设置实例类型
|
||||
.setInstanceType("ecs.t6-c1m1.large")
|
||||
// 设置安全组ID
|
||||
.setSecurityGroupId("sg-bp1a7fk8js5pn3fw9p2m")
|
||||
// 设置虚拟交换机ID
|
||||
.setVSwitchId("vsw-bp193np7r01vssqxhh24e")
|
||||
// 设置实例名称
|
||||
.setInstanceName("server-mqtt")
|
||||
// 设置实例付费类型为后付费按量付费
|
||||
.setInstanceChargeType("PostPaid")
|
||||
// 设置互联网最大出带宽为1 Mbps
|
||||
.setInternetMaxBandwidthOut(1)
|
||||
// 设置系统盘配置
|
||||
.setSystemDisk(systemDisk)
|
||||
// 设置主机名
|
||||
.setHostName("root")
|
||||
// 设置实例密码
|
||||
.setPassword("EightGroup123.")
|
||||
// 设置创建实例的数量
|
||||
.setAmount(2);
|
||||
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
try {
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
RunInstancesResponse runInstancesResponse = client.runInstancesWithOptions(runInstancesRequest, runtime);
|
||||
// 获取body返回值对象
|
||||
RunInstancesResponseBody body = runInstancesResponse.getBody();
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
// 得到实例ID数组
|
||||
for (String instance : body.getInstanceIdSets().getInstanceIdSet()) {
|
||||
list.add(instance);
|
||||
}
|
||||
log.info("实例ID:{}",list);
|
||||
return list;
|
||||
} catch (TeaException error) {
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
log.info(error.getMessage());
|
||||
// 诊断地址
|
||||
log.info(error.getData().get("Recommend"));
|
||||
com.aliyun.teautil.Common.assertAsString(error.message);
|
||||
} catch (Exception _error) {
|
||||
TeaException error = new TeaException(_error.getMessage(), _error);
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
log.info(error.getMessage());
|
||||
// 诊断地址
|
||||
log.info(error.getData().get("Recommend"));
|
||||
com.aliyun.teautil.Common.assertAsString(error.message);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
generateInstance();
|
||||
log.info("创建实例成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package com.muyu.car.instance;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.ecs20140526.models.DescribeInstancesResponse;
|
||||
import com.aliyun.ecs20140526.models.DescribeInstancesResponseBody;
|
||||
import com.aliyun.tea.TeaException;
|
||||
import com.muyu.car.domain.ExampleInformation;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.car.instance
|
||||
* @Project:cloud-server-8
|
||||
* @name:QueryInstance
|
||||
* @Date:2024/9/29 下午8:58
|
||||
*/
|
||||
@Log4j2
|
||||
public class QueryInstance {
|
||||
|
||||
public static void queryInstance(List<String> instanceIds) throws Exception {
|
||||
com.aliyun.ecs20140526.Client client = CreateClient.createClient();
|
||||
|
||||
com.aliyun.ecs20140526.models.DescribeInstancesRequest describeInstancesRequest = new com.aliyun.ecs20140526.models.DescribeInstancesRequest()
|
||||
// .setInstanceName("server-mqtt")
|
||||
.setInstanceIds(JSON.toJSONString(instanceIds))
|
||||
.setRegionId("cn-hangzhou");
|
||||
|
||||
|
||||
com.aliyun.teautil.models.RuntimeOptions runtime = new com.aliyun.teautil.models.RuntimeOptions();
|
||||
|
||||
try {
|
||||
// 复制代码运行请自行打印 API 的返回值
|
||||
DescribeInstancesResponse describeInstancesResponse = client.describeInstancesWithOptions(describeInstancesRequest, runtime);
|
||||
DescribeInstancesResponseBody body = describeInstancesResponse.getBody();
|
||||
ArrayList<ExampleInformation> exampleInformations = new ArrayList<>();
|
||||
for (DescribeInstancesResponseBody.DescribeInstancesResponseBodyInstancesInstance instance : body.getInstances().getInstance()){
|
||||
ExampleInformation exampleInformation = new ExampleInformation();
|
||||
exampleInformation.setInstanceId(instance.getInstanceId());
|
||||
log.info("实例ID:{}",exampleInformation.getInstanceId());
|
||||
exampleInformation.setStatus(instance.getStatus());
|
||||
log.info("实例状态:{}",exampleInformation.getStatus());
|
||||
exampleInformation.setIpAddress(String.valueOf(instance.getPublicIpAddress().getIpAddress()));
|
||||
log.info("实例IP:{}",exampleInformation.getIpAddress());
|
||||
exampleInformations.add(exampleInformation);
|
||||
}
|
||||
log.info("实例信息:{}",exampleInformations);
|
||||
} catch (TeaException error) {
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
System.out.println(error.getMessage());
|
||||
// 诊断地址
|
||||
System.out.println(error.getData().get("Recommend"));
|
||||
com.aliyun.teautil.Common.assertAsString(error.message);
|
||||
} catch (Exception _error) {
|
||||
TeaException error = new TeaException(_error.getMessage(), _error);
|
||||
// 此处仅做打印展示,请谨慎对待异常处理,在工程项目中切勿直接忽略异常。
|
||||
// 错误 message
|
||||
System.out.println(error.getMessage());
|
||||
// 诊断地址
|
||||
System.out.println(error.getData().get("Recommend"));
|
||||
com.aliyun.teautil.Common.assertAsString(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-electronic"/>
|
||||
<property name="log.path" value="logs/cloud-car-gateway"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-carData"/>
|
||||
<property name="log.path" value="logs/cloud-wechat"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||
<!-- 日志存放路径 -->
|
||||
<property name="log.path" value="logs/cloud-carData"/>
|
||||
<property name="log.path" value="logs/cloud-wechat"/>
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
|
@ -9,19 +9,15 @@
|
|||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-carData</artifactId>
|
||||
|
||||
<description>
|
||||
数据处理模块
|
||||
</description>
|
||||
<artifactId>cloud-modules-car</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>
|
||||
<dependencies>
|
||||
|
||||
<dependencies>
|
||||
<!-- SpringCloud Alibaba Nacos -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
|
@ -70,34 +66,47 @@
|
|||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- XllJob定时任务 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-xxl</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common System-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-system</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-api-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.ben-manes.caffeine</groupId>
|
||||
<artifactId>caffeine</artifactId>
|
||||
<version>2.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-kafka</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.iotdb</groupId>
|
||||
<artifactId>iotdb-session</artifactId>
|
||||
<version>0.13.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-rabbit</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.car;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@EnableCustomConfig
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class CarApplication {
|
||||
public static void main(String[] args){
|
||||
SpringApplication.run(CarApplication.class,args);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,28 +1,25 @@
|
|||
package com.muyu.server.controller;
|
||||
package com.muyu.car.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import com.muyu.car.domain.CarInformation;
|
||||
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||
import com.muyu.car.domain.req.CarInformationAddStrategyReq;
|
||||
import com.muyu.car.domain.req.CarInformationListReq;
|
||||
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||
import com.muyu.car.service.CarInformationService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.CarInformationListReq;
|
||||
import com.muyu.domain.req.CarInformationUpdReq;
|
||||
import com.muyu.domain.resp.CarInformationResp;
|
||||
import com.muyu.server.service.CarInformationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆信息管理控制层
|
||||
* @author 17353
|
||||
*/
|
||||
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/carinformation")
|
||||
|
@ -31,22 +28,6 @@ public class CarInformationController {
|
|||
@Resource
|
||||
private CarInformationService carInformationService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询围栏业务信息
|
||||
*/
|
||||
@PostMapping("/selectCarInformation")
|
||||
@Operation(summary = "查询数据",description = "查询数据")
|
||||
public Result<List<CarInformation>> selectConnect(){
|
||||
List<CarInformation> connects = carInformationService.list()
|
||||
.stream()
|
||||
.map(CarInformation::carInformationBuilder)
|
||||
.toList();
|
||||
return Result.success(
|
||||
connects, "操作成功"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业车辆管理列表
|
||||
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||
|
@ -67,8 +48,8 @@ public class CarInformationController {
|
|||
*/
|
||||
@PostMapping("/selectCarInformationList")
|
||||
@Operation(summary = "企业车辆管理列表")
|
||||
public Result<Page<CarInformationResp>> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) {
|
||||
Page<CarInformationResp> pageInfo = carInformationService.selectCarInformationList(carInformationListReq);
|
||||
public Result<PageInfo<CarInformation>> selectCarInformationList(@Validated @RequestBody CarInformationListReq carInformationListReq) {
|
||||
PageInfo<CarInformation> pageInfo = carInformationService.selectCarInformationList(carInformationListReq);
|
||||
log.info("企业车辆管理列表查询",carInformationListReq,pageInfo);
|
||||
return Result.success(pageInfo);
|
||||
|
||||
|
@ -83,9 +64,7 @@ public class CarInformationController {
|
|||
@PostMapping("/addCarInformation")
|
||||
@Operation(summary = "企业车辆添加管理")
|
||||
public Result addCarInformation(@Validated @RequestBody CarInformationAddReq carInformationAddReq){
|
||||
return carInformationService.addCarInformation(carInformationAddReq)
|
||||
?Result.success("添加车辆成功")
|
||||
:Result.error(402,"添加车辆失败");
|
||||
return carInformationService.addCarInformation(carInformationAddReq);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -95,12 +74,8 @@ public class CarInformationController {
|
|||
*/
|
||||
@GetMapping("/delBycarInformationId/{carInformationId}")
|
||||
@Operation(summary = "企业车辆删除")
|
||||
public Result delBycarInformationId(@Validated @RequestParam(name = "carInformationId") Integer carInformationId){
|
||||
boolean delBycarInformationId = carInformationService.delBycarInformationId(carInformationId);
|
||||
if (delBycarInformationId){
|
||||
return Result.success(delBycarInformationId ,"删除车辆成功");
|
||||
}
|
||||
return Result.error(402,"删除车辆失败");
|
||||
public Result delBycarInformationId(@Validated @PathVariable("carInformationId") Integer carInformationId){
|
||||
return carInformationService.delBycarInformationId(carInformationId);
|
||||
}
|
||||
|
||||
|
||||
|
@ -111,15 +86,9 @@ public class CarInformationController {
|
|||
*/
|
||||
@PostMapping("/updatecarInformation")
|
||||
@Operation(summary = "企业车辆修改管理")
|
||||
public Result updateCarMessage(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq){
|
||||
boolean updatecarInformation = carInformationService.updatecarInformation(carInformationUpdReq);
|
||||
log.info(updatecarInformation);
|
||||
System.out.println("我在这个里:"+updatecarInformation);
|
||||
if(updatecarInformation)
|
||||
{
|
||||
return Result.success(carInformationUpdReq,"修改成功");
|
||||
}
|
||||
return Result.error( 402,"修改失败");
|
||||
public Result updatecarInformation(@Validated @RequestBody CarInformationUpdReq carInformationUpdReq) {
|
||||
log.info(carInformationUpdReq);
|
||||
return carInformationService.updatecarInformation(carInformationUpdReq);
|
||||
}
|
||||
|
||||
|
||||
|
@ -132,11 +101,17 @@ public class CarInformationController {
|
|||
*/
|
||||
@GetMapping("/selectCarInformationIdAndLicensePlate")
|
||||
@Operation(summary = "查询企业车辆 carInformationID 和 carInformationLicensePlate")
|
||||
public Result<List<CarInformationResp>> selectCarInformationIdAndLicensePlate(){
|
||||
List<CarInformationResp> carInformations = carInformationService.selectBycarInformationIDAndLicensePlate();
|
||||
public Result<List<CarInformation>> selectCarInformationIdAndLicensePlate(){
|
||||
List<CarInformation> carInformations = carInformationService.selectBycarInformationIDAndLicensePlate();
|
||||
return Result.success(carInformations);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/strategyId")
|
||||
@Operation(summary = "企业接入策略")
|
||||
public Result<String> strategyId(
|
||||
@Validated @RequestBody CarInformationAddStrategyReq carInformationAddStrategyReq
|
||||
){
|
||||
return Result.success(carInformationService.strategyId(carInformationAddStrategyReq));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
package com.muyu.car.controller;
|
||||
|
||||
import com.muyu.car.domain.CarMessage;
|
||||
import com.muyu.car.service.CarMessageService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Log4j2
|
||||
@RestController
|
||||
@RequestMapping("/carMessage")
|
||||
@Tag(name = "信息报文模块" )
|
||||
public class CarMessageController {
|
||||
@Resource
|
||||
private CarMessageService carMessageService;
|
||||
/**
|
||||
* 根据所属车类别 解析 车辆报文模板
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectCarMessageList")
|
||||
@Operation(summary = "报文模板展示列表")
|
||||
public Result<List<CarMessage>> selectCarMessageList(){
|
||||
List<CarMessage> carMessages = carMessageService.selectCarMessageList();
|
||||
return Result.success(carMessages);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加车辆报文规则
|
||||
*/
|
||||
@PostMapping("/insertCarMessage")
|
||||
@Operation(summary = "添加报文信息")
|
||||
public Result insertCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||
Result carMessage1 = carMessageService.insertCarMessage(carMessage);
|
||||
return Result.success(carMessage1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除车辆报文规则
|
||||
*
|
||||
*/
|
||||
@PostMapping("/delectByCarMessageId")
|
||||
@Operation(summary = "删除报文信息")
|
||||
public Result delectByCarMessageId(Integer carMessageId){
|
||||
Result carMessage1 = carMessageService.delectByCarMessageId(carMessageId);
|
||||
return Result.success(carMessage1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改车辆报文规则
|
||||
*/
|
||||
@PostMapping("/updateCarMessage")
|
||||
@Operation(summary = "修改报文信息")
|
||||
public Result updateCarMessage(@Validated @RequestBody CarMessage carMessage){
|
||||
Result carMessage1 = carMessageService.updateCarMessage(carMessage);
|
||||
return Result.success(carMessage1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,78 +1,62 @@
|
|||
package com.muyu.domain.resp;
|
||||
package com.muyu.car.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 车辆基础信息列表响应对象
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain.resq
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformationResp
|
||||
* @Date:2024/9/28 12:08
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆基础信息列表")
|
||||
public class CarInformationResp {
|
||||
@SuperBuilder
|
||||
@TableName(value = "企业车辆管理实体类",autoResultMap = true)
|
||||
public class CarInformation {
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
@TableId(value = "car_information_id",type = IdType.AUTO)
|
||||
private Long carInformationId;
|
||||
|
||||
/**
|
||||
* 车辆唯一VIN
|
||||
* 固定(不可修改)
|
||||
*/
|
||||
// @TableName(value = "car_information_VIN")
|
||||
@TableField(value = "car_information_VIN")
|
||||
private String carInformationVin;
|
||||
private String carInformationVIN;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
* 固定(不可修改)
|
||||
*/
|
||||
private String carInformationLicensePlate;
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String carInformationColor;
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
private String carInformationDriver;
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
private Integer carInformationFence;
|
||||
/**
|
||||
* 车检到期日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||
private Date carInformationExamineEnddata;
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
private Integer carInformationType;
|
||||
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String carInformationBrand;
|
||||
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
* 车辆颜色
|
||||
*/
|
||||
private Integer carInformationFocus;
|
||||
private String carInformationColor;
|
||||
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
private String carInformationDriver;
|
||||
|
||||
/**
|
||||
* 车检到期日期
|
||||
* 固定(不可修改)
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||
private Date carInformationExamineEnddata;
|
||||
|
||||
/**
|
||||
* 车辆电机厂商
|
||||
|
@ -94,35 +78,46 @@ public class CarInformationResp {
|
|||
*/
|
||||
private String carInformationBatteryModel;
|
||||
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
private Integer carInformationFence;
|
||||
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
private Integer carInformationType;
|
||||
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
*/
|
||||
private Integer carInformationFocus;
|
||||
|
||||
/**
|
||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||
*/
|
||||
private Integer carInformationState;
|
||||
|
||||
|
||||
//车辆类型表
|
||||
/**
|
||||
* 车辆类型ID
|
||||
*/
|
||||
@TableField(value = "car_information_type")
|
||||
private Integer carTypeId;
|
||||
/**
|
||||
* 车辆类型名
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 车辆规则外键ID
|
||||
*/
|
||||
private long carTypeRules;
|
||||
|
||||
//电子围栏
|
||||
/**
|
||||
*电子围栏ID
|
||||
*/
|
||||
private Integer id;
|
||||
private Integer fenceid;
|
||||
|
||||
/**
|
||||
* 电子围栏名
|
||||
*/
|
||||
private String name;
|
||||
private String fencename;
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
package com.muyu.car.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "车辆报文模板实体类",autoResultMap = true)
|
||||
public class CarMessage {
|
||||
//报文类型模块表
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long messageTypeId;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
* 报文名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
//报文拆分位置主表
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long carMessageId;
|
||||
/**
|
||||
* 车辆类型外键
|
||||
*/
|
||||
private Integer carMessageCartype;
|
||||
/**
|
||||
* 车辆报文类型外键
|
||||
*/
|
||||
private Integer carMessageType;
|
||||
/**
|
||||
* 开始位下标
|
||||
*/
|
||||
private Integer carMessageStartIndex;
|
||||
/**
|
||||
* 结束位下标
|
||||
*/
|
||||
private Integer carMessageEndIndex;
|
||||
/**
|
||||
* 报文数据类型 (固定值 区间随机值)
|
||||
*/
|
||||
private String messageTypeClass;
|
||||
/**
|
||||
* 报文是否开启故障检测(0默认未开启 1开启)
|
||||
*/
|
||||
private Integer carMessageState;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
private Long messageTypeId ;
|
||||
private String messageTypeCode ;
|
||||
private String messageTypeName ;
|
||||
private String messageTypeBelongs ;
|
||||
private String messageTypeClass ;
|
||||
private Long carMessageId ;
|
||||
private Integer carMessageCartype ;
|
||||
private Integer carMessageType ;
|
||||
private Integer carMessageStartIndex ;
|
||||
private Integer carMessageEndIndex ;
|
||||
private Integer carMessageState ;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.car.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -8,14 +8,11 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* 车辆管理信息添加请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆管理信息添加请求对象")
|
||||
@Tag(name = "车辆管理信息添加对象")
|
||||
public class CarInformationAddReq {
|
||||
|
||||
/**
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.car.domain.req;
|
||||
|
||||
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-8
|
||||
* @name:CarInformationAddStategyReq
|
||||
* @Date:2024/9/26 下午3:57
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "车辆接入策略对象")
|
||||
public class CarInformationAddStrategyReq {
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
private Long carInformationId;
|
||||
/**
|
||||
* 车辆车辆ID
|
||||
*/
|
||||
private Long carStrategyId;
|
||||
|
||||
}
|
|
@ -1,16 +1,14 @@
|
|||
package com.muyu.domain.req;
|
||||
|
||||
package com.muyu.car.domain.req;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 车辆管理列表请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
|
@ -1,4 +1,4 @@
|
|||
package com.muyu.domain.req;
|
||||
package com.muyu.car.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -7,9 +7,6 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 车辆管理修改操作请求对象
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
|
@ -0,0 +1,66 @@
|
|||
package com.muyu.car.mapper;
|
||||
|
||||
|
||||
import com.muyu.car.domain.CarInformation;
|
||||
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||
import com.muyu.car.domain.req.CarInformationAddStrategyReq;
|
||||
import com.muyu.car.domain.req.CarInformationListReq;
|
||||
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CarInformationMapper {
|
||||
/**
|
||||
* 企业车辆管理列表
|
||||
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||
* 搜索-->(车辆唯一VIN carInformationVIN 精确查
|
||||
* 车辆类型ID carTypeId 精确查
|
||||
* 车辆电子围栏外键ID carInformationFence 精确查
|
||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||
* carInformationState 精确查
|
||||
* 车辆电机厂商 carInformationMotorManufacturer 模糊查
|
||||
* 车辆电机型号 carInformationMotorModel 精确查
|
||||
* 车辆电池厂商 carInformationBatteryManufacturer 模糊查
|
||||
* 车辆电池型号 carInformationBatteryModel 精确查
|
||||
* )
|
||||
* 分页--> 分页页数 pageNum 分页条数 pageSize
|
||||
* @param carInformationListReq
|
||||
* @return
|
||||
*/
|
||||
List<CarInformation> selectCarInformationList(CarInformationListReq carInformationListReq);
|
||||
|
||||
/**
|
||||
* 企业车辆添加管理
|
||||
* @param carInformationAddReq
|
||||
* @return
|
||||
*/
|
||||
Integer addCarInformation(CarInformationAddReq carInformationAddReq);
|
||||
|
||||
/**
|
||||
* 企业车辆删除
|
||||
* @param carInformationId
|
||||
* @return
|
||||
*/
|
||||
Integer delBycarInformationId(Integer carInformationId);
|
||||
|
||||
|
||||
/**
|
||||
* 企业车辆修改管理
|
||||
* @param carInformationUpdReq
|
||||
* @return
|
||||
*/
|
||||
Integer updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
||||
|
||||
/**
|
||||
* To 电子围栏负责人
|
||||
* 查询企业车辆 carInformationID 和 carInformationLicensePlate
|
||||
* 无参
|
||||
* @return
|
||||
*/
|
||||
List<CarInformation> selectBycarInformationIDAndLicensePlate();
|
||||
|
||||
|
||||
String strategyId(CarInformationAddStrategyReq carInformationAddStrategyReq);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.car.mapper;
|
||||
|
||||
import com.muyu.car.domain.CarMessage;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface CarMessageMapper {
|
||||
/**
|
||||
* 根据所属车类别 解析 车辆报文模板
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<CarMessage> selectCarMessageList();
|
||||
|
||||
|
||||
/**
|
||||
* 添加车辆报文规则
|
||||
*/
|
||||
Integer insertCarMessage(CarMessage carMessage);
|
||||
|
||||
|
||||
/**
|
||||
* 删除车辆报文规则
|
||||
*/
|
||||
Integer deleteByCarMessageId(Integer carMessageId);
|
||||
|
||||
/**
|
||||
* 修改车辆报文规则
|
||||
*/
|
||||
Integer updateCarMessage(CarMessage carMessage);
|
||||
|
||||
}
|
|
@ -1,22 +1,16 @@
|
|||
package com.muyu.server.service;
|
||||
package com.muyu.car.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import com.muyu.car.domain.CarInformation;
|
||||
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||
import com.muyu.car.domain.req.CarInformationAddStrategyReq;
|
||||
import com.muyu.car.domain.req.CarInformationListReq;
|
||||
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.domain.CarInformation;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.CarInformationListReq;
|
||||
import com.muyu.domain.req.CarInformationUpdReq;
|
||||
import com.muyu.domain.resp.CarInformationResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 车辆信息管理业务层
|
||||
*/
|
||||
public interface CarInformationService extends IService<CarInformation> {
|
||||
public interface CarInformationService {
|
||||
/**
|
||||
* 企业车辆管理列表
|
||||
* 联查--> 车辆管理--车辆类型表--车辆电子围栏
|
||||
|
@ -34,7 +28,7 @@ public interface CarInformationService extends IService<CarInformation> {
|
|||
* @param carInformationListReq
|
||||
* @return
|
||||
*/
|
||||
Page<CarInformationResp> selectCarInformationList(CarInformationListReq carInformationListReq);
|
||||
PageInfo<CarInformation> selectCarInformationList(CarInformationListReq carInformationListReq);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -42,14 +36,14 @@ public interface CarInformationService extends IService<CarInformation> {
|
|||
* @param carInformationAddReq
|
||||
* @return
|
||||
*/
|
||||
boolean addCarInformation(CarInformationAddReq carInformationAddReq);
|
||||
Result addCarInformation(CarInformationAddReq carInformationAddReq);
|
||||
|
||||
/**
|
||||
* 企业车辆删除
|
||||
* @param carInformationId
|
||||
* @return
|
||||
*/
|
||||
boolean delBycarInformationId(Integer carInformationId);
|
||||
Result delBycarInformationId(Integer carInformationId);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -57,7 +51,7 @@ public interface CarInformationService extends IService<CarInformation> {
|
|||
* @param carInformationUpdReq
|
||||
* @return
|
||||
*/
|
||||
boolean updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
||||
Result updatecarInformation(CarInformationUpdReq carInformationUpdReq);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -66,6 +60,7 @@ public interface CarInformationService extends IService<CarInformation> {
|
|||
* 无参
|
||||
* @return
|
||||
*/
|
||||
List<CarInformationResp> selectBycarInformationIDAndLicensePlate();
|
||||
List<CarInformation> selectBycarInformationIDAndLicensePlate();
|
||||
|
||||
String strategyId(CarInformationAddStrategyReq carInformationAddStrategyReq);
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.car.service;
|
||||
|
||||
import com.muyu.car.domain.CarMessage;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CarMessageService {
|
||||
|
||||
/**
|
||||
* 根据所属车类别 解析 车辆报文模板
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<CarMessage> selectCarMessageList();
|
||||
|
||||
|
||||
/**
|
||||
* 添加车辆报文规则
|
||||
*/
|
||||
Result insertCarMessage(CarMessage carMessage);
|
||||
|
||||
|
||||
/**
|
||||
* 删除车辆报文规则
|
||||
*/
|
||||
Result delectByCarMessageId(Integer carMessageId);
|
||||
|
||||
|
||||
/**
|
||||
* 修改车辆报文规则
|
||||
*/
|
||||
Result updateCarMessage(CarMessage carMessage);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.muyu.car.service.Impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.car.domain.CarInformation;
|
||||
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||
import com.muyu.car.domain.req.CarInformationAddStrategyReq;
|
||||
import com.muyu.car.domain.req.CarInformationListReq;
|
||||
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||
import com.muyu.car.mapper.CarInformationMapper;
|
||||
import com.muyu.car.service.CarInformationService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CarInformationServiceImpl implements CarInformationService {
|
||||
@Resource
|
||||
private CarInformationMapper carInformationMapper;
|
||||
@Autowired
|
||||
private HttpServletResponse response;
|
||||
|
||||
|
||||
@Override
|
||||
public PageInfo<CarInformation> selectCarInformationList(CarInformationListReq carInformationListReq) {
|
||||
PageHelper.startPage(carInformationListReq.getPageNum(),carInformationListReq.getPageSize());
|
||||
List<CarInformation> carInformations = carInformationMapper.selectCarInformationList(carInformationListReq);
|
||||
PageInfo<CarInformation> pageInfo = new PageInfo<>(carInformations);
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result addCarInformation(CarInformationAddReq carInformationAddReq) {
|
||||
Integer addCarInformation = carInformationMapper.addCarInformation(carInformationAddReq);
|
||||
if(addCarInformation > 0){
|
||||
return Result.success(addCarInformation,"添加车辆成功");
|
||||
}
|
||||
return Result.error(402,"添加车辆失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result delBycarInformationId(Integer carInformationId) {
|
||||
Integer delBycarInformationId = carInformationMapper.delBycarInformationId(carInformationId);
|
||||
if (delBycarInformationId > 0){
|
||||
return Result.success(delBycarInformationId ,"删除车辆成功");
|
||||
}
|
||||
return Result.success(402,"删除车辆失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result updatecarInformation(CarInformationUpdReq carInformationUpdReq) {
|
||||
Integer updatecarInformation = carInformationMapper.updatecarInformation(carInformationUpdReq);
|
||||
if (updatecarInformation > 0){
|
||||
return Result.success(updatecarInformation,"修改车辆信息成功");
|
||||
}
|
||||
return Result.error(402,"修改车辆信息失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CarInformation> selectBycarInformationIDAndLicensePlate() {
|
||||
return carInformationMapper.selectBycarInformationIDAndLicensePlate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String strategyId(CarInformationAddStrategyReq carInformationAddStrategyReq) {
|
||||
return carInformationMapper.strategyId(carInformationAddStrategyReq);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.muyu.car.service.Impl;
|
||||
|
||||
import com.muyu.car.domain.CarMessage;
|
||||
import com.muyu.car.mapper.CarMessageMapper;
|
||||
import com.muyu.car.service.CarMessageService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CarMessageServiceImpl implements CarMessageService {
|
||||
@Resource
|
||||
private CarMessageMapper carMessageMapper;
|
||||
|
||||
@Override
|
||||
public List<CarMessage> selectCarMessageList() {
|
||||
return carMessageMapper.selectCarMessageList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result insertCarMessage(CarMessage carMessage) {
|
||||
Integer inserted = carMessageMapper.insertCarMessage(carMessage);
|
||||
if (inserted > 0){
|
||||
return Result.success(inserted,"添加成功");
|
||||
}
|
||||
return Result.error(402,"添加失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result delectByCarMessageId(Integer carMessageId) {
|
||||
Integer deleteByCarMessageId = carMessageMapper.deleteByCarMessageId(carMessageId);
|
||||
if (deleteByCarMessageId >0){
|
||||
return Result.success(carMessageId ,"删除成功");
|
||||
}
|
||||
return Result.error(402,"删除失败");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result updateCarMessage(CarMessage carMessage) {
|
||||
Integer integer = carMessageMapper.updateCarMessage(carMessage);
|
||||
if(integer > 0)
|
||||
{
|
||||
return Result.success(carMessage,"修改成功");
|
||||
}
|
||||
return Result.error( 402,"修改失败");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,183 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<!-- 1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)-->
|
||||
|
||||
<mapper namespace="com.muyu.car.mapper.CarInformationMapper">
|
||||
|
||||
<resultMap id="carInformationResult" type="com.muyu.car.domain.CarInformation">
|
||||
<result column="car_information_id" property="carInformationId"/>
|
||||
<result column="car_information_VIN" property="carInformationVIN"/>
|
||||
<result column="car_information_license_plate" property="carInformationLicensePlate"/>
|
||||
<result column="car_information_brand" property="carInformationBrand"/>
|
||||
<result column="car_information_color" property="carInformationColor"/>
|
||||
<result column="car_information_driver" property="carInformationDriver"/>
|
||||
<result column="car_information_examine_enddata" property="carInformationExamineEnddata"/>
|
||||
<result column="car_information_motor_manufacturer" property="carInformationMotorManufacturer"/>
|
||||
<result column="car_information_motor_model" property="carInformationMotorModel"/>
|
||||
<result column="car_information_battery_manufacturer" property="carInformationBatteryManufacturer"/>
|
||||
<result column="car_information_battery_model" property="carInformationBatteryModel"/>
|
||||
<result column="car_information_fence" property="carInformationFence"/>
|
||||
<result column="car_information_type" property="carInformationType"/>
|
||||
<result column="car_information_focus" property="carInformationFocus"/>
|
||||
<result column="car_information_state" property="carInformationState"/>
|
||||
<result column="car_type_id" property="carTypeId"/>
|
||||
<result column="car_type_name" property="carTypeName"/>
|
||||
</resultMap>
|
||||
<sql id="carinformationSql">
|
||||
SELECT
|
||||
car_information_id,
|
||||
car_information_VIN,
|
||||
car_information_license_plate,
|
||||
car_information_brand,
|
||||
car_information_color,
|
||||
car_information_driver,
|
||||
car_information_examine_enddata,
|
||||
car_information_motor_manufacturer,
|
||||
car_information_motor_model,
|
||||
car_information_battery_manufacturer,
|
||||
car_information_battery_model,
|
||||
car_information_fence,
|
||||
car_information_type,
|
||||
car_information_focus,
|
||||
car_information_state
|
||||
FROM `car_information`
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="selectCarInformationList" resultMap="carInformationResult" >
|
||||
SELECT
|
||||
car_information_id , car_information_VIN , car_information_license_plate,
|
||||
car_information_brand , car_information_color , car_information_driver,
|
||||
car_information_examine_enddata , car_information_motor_manufacturer , car_information_motor_model,
|
||||
car_information_battery_manufacturer, car_information_battery_model , car_information_fence,
|
||||
car_information_type , car_information_focus , car_information_state,
|
||||
car_type_id , car_type_name ,
|
||||
id , name
|
||||
FROM `car_information`
|
||||
LEFT JOIN `car_type`
|
||||
ON `car_information`.car_information_type = `car_type`.car_type_id
|
||||
LEFT JOIN `car_fence`
|
||||
ON `car_information`.car_information_fence = `car_fence`.id
|
||||
<where>
|
||||
<if test= "carInformationVIN != null and carInformationVIN!='' " >
|
||||
AND `car_information`.car_information_VIN = #{carInformationVIN}
|
||||
</if>
|
||||
|
||||
<if test= "carTypeId != null" >
|
||||
AND `car_information`. car_information_type = #{carTypeId}
|
||||
</if>
|
||||
|
||||
<if test= "carInformationFence != null" >
|
||||
AND `car_information`.car_information_fence = #{carInformationFence}
|
||||
</if>
|
||||
|
||||
<if test= "carInformationState != null " >
|
||||
AND `car_information`.car_information_state = #{carInformationState}
|
||||
</if>
|
||||
|
||||
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer !=''" >
|
||||
AND instr(`car_information`.car_information_motor_manufacturer , #{carInformationMotorManufacturer})
|
||||
</if>
|
||||
|
||||
<if test= "carInformationMotorModel != null and carInformationMotorModel !='' " >
|
||||
AND `car_information`.car_information_motor_model = #{carInformationMotorModel}
|
||||
</if>
|
||||
|
||||
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer != '' " >
|
||||
AND instr(`car_information`.car_information_battery_manufacturer , #{carInformationBatteryManufacturer})
|
||||
</if>
|
||||
|
||||
<if test= "carInformationBatteryModel != null and carInformationBatteryModel != '' " >
|
||||
AND `car_information`.car_information_battery_model = #{carInformationBatteryModel}
|
||||
</if>
|
||||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectBycarInformationIDAndLicensePlate" resultType="com.muyu.car.domain.CarInformation">
|
||||
SELECT
|
||||
car_information_id ,
|
||||
car_information_license_plate
|
||||
FROM `car_information`
|
||||
</select>
|
||||
|
||||
<insert id="addCarInformation">
|
||||
INSERT INTO `car_information`
|
||||
(
|
||||
<if test= "carInformationVIN != null and carInformationVIN!='' " >car_information_VIN,</if>
|
||||
<if test= "carInformationLicensePlate != null and carInformationLicensePlate!='' "> car_information_license_plate,</if>
|
||||
<if test= "carInformationBrand != null and carInformationBrand!='' " >car_information_brand, </if>
|
||||
<if test= "carInformationColor != null and carInformationColor!='' " > car_information_color, </if>
|
||||
<if test= "carInformationDriver != null and carInformationDriver!='' " > car_information_driver, </if>
|
||||
<if test= "carInformationExamineEnddata != null and carInformationExamineEnddata!='' " > car_information_examine_enddata, </if>
|
||||
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer!='' " >car_information_motor_manufacturer, </if>
|
||||
<if test= "carInformationMotorModel != null and carInformationMotorModel!='' " >car_information_motor_model, </if>
|
||||
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer!='' " >car_information_battery_manufacturer, </if>
|
||||
<if test= "carInformationBatteryModel != null and carInformationBatteryModel!='' " >car_information_battery_model, </if>
|
||||
<if test= "carInformationFence != null " >car_information_fence, </if>
|
||||
<if test= "carInformationType != null " >car_information_type </if> )
|
||||
VALUES (
|
||||
<if test= "carInformationVIN != null and carInformationVIN!='' " >#{carInformationVIN},</if>
|
||||
<if test= "carInformationLicensePlate != null and carInformationLicensePlate!='' "> #{carInformationLicensePlate},</if>
|
||||
<if test= "carInformationBrand != null and carInformationBrand!='' " > #{carInformationBrand} , </if>
|
||||
<if test= "carInformationColor != null and carInformationColor!='' " > #{carInformationColor}, </if>
|
||||
<if test= "carInformationDriver != null and carInformationDriver!='' " > #{carInformationDriver}, </if>
|
||||
<if test= "carInformationExamineEnddata != null and carInformationExamineEnddata!='' " > #{carInformationExamineEnddata}, </if>
|
||||
<if test= "carInformationMotorManufacturer != null and carInformationMotorManufacturer!='' " >#{carInformationMotorManufacturer}, </if>
|
||||
<if test= "carInformationMotorModel != null and carInformationMotorModel!='' " > #{carInformationMotorModel}, </if>
|
||||
<if test= "carInformationBatteryManufacturer != null and carInformationBatteryManufacturer!='' " > #{carInformationBatteryManufacturer}, </if>
|
||||
<if test= "carInformationBatteryModel != null and carInformationBatteryModel!='' " > #{carInformationBatteryModel}, </if>
|
||||
<if test= "carInformationFence != null " >#{carInformationFence}, </if>
|
||||
<if test= "carInformationType != null " > #{carInformationType} </if> );
|
||||
</insert>
|
||||
|
||||
<update id="updatecarInformation">
|
||||
UPDATE `car_information`
|
||||
SET
|
||||
`car_information_VIN` = #{carInformationVIN},
|
||||
|
||||
`car_information_license_plate` = #{carInformationLicensePlate},
|
||||
|
||||
`car_information_brand` = #{carInformationBrand},
|
||||
|
||||
`car_information_color` = #{carInformationColor},
|
||||
|
||||
`car_information_driver` = #{carInformationDriver},
|
||||
|
||||
`car_information_examine_enddata` = #{carInformationExamineEnddata},
|
||||
|
||||
`car_information_motor_manufacturer` = #{carInformationMotorManufacturer},
|
||||
|
||||
`car_information_motor_model` = #{carInformationMotorModel} ,
|
||||
|
||||
`car_information_battery_manufacturer` = #{carInformationBatteryManufacturer},
|
||||
|
||||
`car_information_battery_model` = #{carInformationBatteryModel},
|
||||
|
||||
`car_information_fence` = #{carInformationFence},
|
||||
|
||||
`car_information_type` = #{carInformationType}
|
||||
|
||||
WHERE `car_information_id` = #{carInformationId}
|
||||
</update>
|
||||
<update id="strategyId">
|
||||
UPDATE `car_information`
|
||||
SET
|
||||
`car_strategy_id` = #{carStrategyId}
|
||||
WHERE `car_information_id` = #{carInformationId}
|
||||
</update>
|
||||
|
||||
|
||||
<delete id="delBycarInformationId">
|
||||
DELETE FROM `car_information`
|
||||
WHERE `car_information`.car_information_id= #{carInformationId}
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<!-- 1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)-->
|
||||
|
||||
<mapper namespace="com.muyu.car.mapper.CarMessageMapper">
|
||||
<resultMap id="carMessageResult" type="com.muyu.car.domain.CarMessage">
|
||||
<result property="messageTypeId" column="message_type_id"/>
|
||||
<result property="messageTypeCode" column="message_type_code"/>
|
||||
<result property="messageTypeName" column="message_type_name"/>
|
||||
<result property="messageTypeBelongs" column="message_type_belongs"/>
|
||||
<result property="messageTypeClass" column="message_type_class"/>
|
||||
<result property="carMessageId" column="car_message_id"/>
|
||||
<result property="carMessageCartype" column="car_message_cartype"/>
|
||||
<result property="carMessageType" column="car_message_type"/>
|
||||
<result property="carMessageStartIndex" column="car_message_start_index"/>
|
||||
<result property="carMessageEndIndex" column="car_message_end_index"/>
|
||||
<result property="carMessageState" column= "car_message_state"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertCarMessage">
|
||||
INSERT INTO `car_message` (
|
||||
car_message_cartype,
|
||||
car_message_type,
|
||||
car_message_start_index,
|
||||
car_message_end_index,
|
||||
message_type_class,
|
||||
car_message_state
|
||||
)
|
||||
VALUES(
|
||||
#{carMessageCartype},
|
||||
#{carMessageType},
|
||||
#{carMessageStartIndex},
|
||||
#{carMessageEndIndex},
|
||||
#{messageTypeClass},
|
||||
#{carMessageState}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateCarMessage">
|
||||
UPDATE `car_message`
|
||||
SET
|
||||
<if test="carMessageCartype != null" >
|
||||
car_message_cartype = #{carMessageCartype} ,
|
||||
</if>
|
||||
<if test="carMessageType != null">
|
||||
car_message_type = #{carMessageType} ,
|
||||
</if>
|
||||
<if test="carMessageStartIndex != null">
|
||||
car_message_start_index = #{carMessageStartIndex} ,
|
||||
</if>
|
||||
<if test="carMessageEndIndex != null">
|
||||
car_message_end_index = #{carMessageEndIndex} ,
|
||||
</if>
|
||||
<if test="messageTypeClass != null and messageTypeClass !=''">
|
||||
message_type_class = #{messageTypeClass} ,
|
||||
</if>
|
||||
<if test="carMessageState != null ">
|
||||
car_message_state = #{carMessageState}
|
||||
</if>
|
||||
|
||||
</update>
|
||||
|
||||
<delete id="deleteByCarMessageId">
|
||||
DELETE FROM `car_message`
|
||||
WHERE `car_message`.car_message_id = #{carMessageId}
|
||||
|
||||
</delete>
|
||||
|
||||
<select id="selectCarMessageList" resultMap="carMessageResult">
|
||||
SELECT
|
||||
car_message_id,
|
||||
car_message_cartype,
|
||||
car_message_type,
|
||||
car_message_start_index,
|
||||
car_message_end_index,
|
||||
message_type_class,
|
||||
car_message_state,
|
||||
message_type_id,
|
||||
message_type_code,
|
||||
message_type_name,
|
||||
message_type_belongs,
|
||||
car_type_id,
|
||||
car_type_name
|
||||
FROM `car_message`
|
||||
LEFT JOIN `car_message_type`
|
||||
ON `car_message`.car_message_type = `car_message_type`.message_type_id
|
||||
LEFT JOIN `car_type`
|
||||
ON `car_message` .car_message_cartype = `car_type`.car_type_id
|
||||
|
||||
</select>
|
||||
</mapper>
|
|
@ -1,24 +0,0 @@
|
|||
package com.muyu.carData;
|
||||
|
||||
import com.muyu.carData.listener.MyListener;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarDataApplication
|
||||
* @Date:2024/9/26 15:33
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableMyFeignClients
|
||||
public class CarDataApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication application = new SpringApplication(CarDataApplication.class);
|
||||
application.addListeners(new MyListener());
|
||||
application.run(args);
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.muyu.carData.config.cacheconfig;
|
||||
import com.github.benmanes.caffeine.cache.Expiry;
|
||||
import org.checkerframework.checker.index.qual.NonNegative;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.cacheconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:CacheExpiry
|
||||
* @Date:2024/9/26 23:46
|
||||
*/
|
||||
public class CacheExpiry implements Expiry<String,ExpiryTime>{
|
||||
@Override
|
||||
public long expireAfterCreate(String key, ExpiryTime value, long currentTime) {
|
||||
return TimeUnit.SECONDS.toNanos(value.getExpiryTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long expireAfterUpdate(String key, ExpiryTime value, long currentTime, @NonNegative long currentDuration) {
|
||||
return TimeUnit.SECONDS.toNanos(value.getRefreshTime());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long expireAfterRead(String key, ExpiryTime value, long currentTime, @NonNegative long currentDuration) {
|
||||
return TimeUnit.SECONDS.toNanos(value.getRefreshTime());
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.muyu.carData.config.cacheconfig;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.cacheconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:CaffeineConfig
|
||||
* @Date:2024/9/26 23:51
|
||||
*/
|
||||
@Configuration
|
||||
public class CaffeineConfig {
|
||||
|
||||
@Bean
|
||||
public Cache<String, ? extends ExpiryTime> caffeineCache(){
|
||||
CacheExpiry cacheExpiry = new CacheExpiry();
|
||||
return Caffeine.newBuilder()
|
||||
.expireAfter(cacheExpiry)
|
||||
.initialCapacity(128)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,33 +0,0 @@
|
|||
package com.muyu.carData.config.cacheconfig;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.cacheconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:ExpiryTime
|
||||
* @Date:2024/9/26 23:44
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ExpiryTime {
|
||||
|
||||
/**
|
||||
* 过期时间单位(秒)默认30分钟
|
||||
*/
|
||||
@Builder.Default
|
||||
private long expiryTime = 30 * 60;
|
||||
|
||||
/**
|
||||
* 刷新时间单位(秒) 默认15分钟
|
||||
*/
|
||||
@Builder.Default
|
||||
private long refreshTime = 15 * 60;
|
||||
}
|
|
@ -1,86 +0,0 @@
|
|||
package com.muyu.carData.config.lotdbconfig;
|
||||
|
||||
import org.apache.iotdb.rpc.IoTDBConnectionException;
|
||||
import org.apache.iotdb.session.Session;
|
||||
import org.apache.iotdb.session.pool.SessionPool;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.lotdbconfig
|
||||
* @Project:cloud-server-8
|
||||
* @name:IotDBSessionConfig
|
||||
* @Date:2024/9/27 12:25
|
||||
* IotDB线程池
|
||||
*/
|
||||
@Component
|
||||
@Configuration
|
||||
public class IotDBSessionConfig {
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(IotDBSessionConfig.class);
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
@Value("${spring.iotdb.username}")
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
@Value("${spring.iotdb.password}")
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* ip地址
|
||||
*/
|
||||
@Value("${spring.iotdb.ip}")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
* 端口号
|
||||
*/
|
||||
@Value("${spring.iotdb.port}")
|
||||
private Integer port;
|
||||
|
||||
/**
|
||||
* 最大连接数
|
||||
*/
|
||||
@Value("${spring.iotdb.maxSize}")
|
||||
private Integer maxSize;
|
||||
|
||||
|
||||
/**
|
||||
* 默认每次查询的条数
|
||||
*/
|
||||
@Value("${spring.iotdb.fetchSize}")
|
||||
private int fetchSize;
|
||||
|
||||
|
||||
@Bean
|
||||
public Session iotSession(){
|
||||
Session session = new Session(ip, port, username, password);
|
||||
try {
|
||||
session.open();
|
||||
} catch (IoTDBConnectionException e) {
|
||||
logger.error(String.valueOf(e.getCause()));
|
||||
}
|
||||
return session;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,56 +0,0 @@
|
|||
package com.muyu.carData.consumer;
|
||||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.nacos.shaded.com.google.common.collect.Lists;
|
||||
import com.muyu.carData.pojo.Student;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecord;
|
||||
import org.apache.kafka.clients.consumer.ConsumerRecords;
|
||||
import org.apache.kafka.clients.consumer.KafkaConsumer;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Collection;
|
||||
|
||||
/**卡夫卡消费者
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.consumer
|
||||
* @Project:cloud-server-8
|
||||
* @name:MyKafkaConsumer
|
||||
* @Date:2024/9/26 15:42
|
||||
*/
|
||||
@Component
|
||||
@Log4j2
|
||||
public class MyKafkaConsumer implements InitializingBean {
|
||||
|
||||
@Autowired
|
||||
private KafkaConsumer kafkaConsumer;
|
||||
|
||||
private final String topicName = "carJsons";
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
log.info("启动线程开始监听topic:{}",topicName);
|
||||
Thread thread = new Thread(() -> {
|
||||
ThreadUtil.sleep(1000);
|
||||
Collection<String> topics = Lists.newArrayList(topicName);
|
||||
kafkaConsumer.subscribe(topics);
|
||||
while (true){
|
||||
ConsumerRecords<String,String> consumerRecords = kafkaConsumer.poll(Duration.ofMillis(1000));
|
||||
for (ConsumerRecord<String, String> consumerRecord : consumerRecords) {
|
||||
//从consumerRecord中获取消费数据
|
||||
String value = consumerRecord.value();
|
||||
log.info("从Kafka中消费的原始数据===============>>:{}",value);
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.start();
|
||||
|
||||
log.info("启动线程结束监听topic:{}",topicName);
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
package com.muyu.carData.controller;
|
||||
|
||||
import com.github.benmanes.caffeine.cache.Cache;
|
||||
import com.muyu.carData.config.cacheconfig.CaffeineConfig;
|
||||
import com.muyu.carData.pojo.Student;
|
||||
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.RestController;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.controller
|
||||
* @Project:cloud-server-8
|
||||
* @name:TestController
|
||||
* @Date:2024/9/26 23:56
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/testCache")
|
||||
@Log4j2
|
||||
public class CacheController {
|
||||
|
||||
@Autowired
|
||||
private CaffeineConfig caffeineConfig;
|
||||
|
||||
@RequestMapping("/caffeine")
|
||||
public String caffeine() throws InterruptedException {
|
||||
Cache<String, Student> stringCache = (Cache<String, Student>) caffeineConfig.caffeineCache();
|
||||
Student build = Student.builder().id(1)
|
||||
.name("小马")
|
||||
.sex("男")
|
||||
.expiryTime(20 * 60)
|
||||
.refreshTime(15 * 30)
|
||||
.build();
|
||||
stringCache.put("1", build);
|
||||
Thread.sleep(1000);
|
||||
//返回缓存的个数
|
||||
log.info(stringCache.estimatedSize());
|
||||
//返回缓存的数据
|
||||
log.info(stringCache.getIfPresent("1"));
|
||||
return "111";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
package com.muyu.carData.controller;
|
||||
|
||||
import com.muyu.carData.config.lotdbconfig.IotDBSessionConfig;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.iotdb.rpc.IoTDBConnectionException;
|
||||
import org.apache.iotdb.rpc.StatementExecutionException;
|
||||
import org.apache.iotdb.session.Session;
|
||||
import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
|
||||
import org.apache.iotdb.tsfile.write.record.Tablet;
|
||||
import org.apache.iotdb.tsfile.write.schema.MeasurementSchema;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.testcontroller
|
||||
* @Project:cloud-server-8
|
||||
* @name:IotDBController
|
||||
* @Date:2024/9/28 23:58
|
||||
*/
|
||||
@RequestMapping("/iotdb")
|
||||
@RestController
|
||||
@Log4j2
|
||||
public class IotDBController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IotDBSessionConfig iotDBSessionConfig;
|
||||
|
||||
/**
|
||||
* 批量插入数据
|
||||
* @param insertSize 每次插入的条数
|
||||
* @param count 插入的总条数
|
||||
* @return
|
||||
* @throws IoTDBConnectionException
|
||||
* @throws StatementExecutionException
|
||||
*/
|
||||
@GetMapping("/insertData/{insertSize}/{count}")
|
||||
public String insert(@PathVariable(name = "insertSize") int insertSize,@PathVariable(name = "count") int count) throws IoTDBConnectionException, StatementExecutionException {
|
||||
Session session = iotDBSessionConfig.iotSession();
|
||||
//schemaList 属性及类型
|
||||
List<MeasurementSchema> schemaList = new ArrayList<>();
|
||||
schemaList.add(new MeasurementSchema("id", TSDataType.INT32));
|
||||
schemaList.add(new MeasurementSchema("name", TSDataType.TEXT));
|
||||
schemaList.add(new MeasurementSchema("sex", TSDataType.TEXT));
|
||||
|
||||
//tablet 封装数据
|
||||
Tablet tablet = new Tablet("root.yang.baling", schemaList);
|
||||
|
||||
//以当前时间戳作为插入的起始时间戳
|
||||
long timestamp = System.currentTimeMillis();
|
||||
long beginTime = System.currentTimeMillis();
|
||||
for (long row = 0;row < count; row++){
|
||||
int rowIndex = tablet.rowSize++;
|
||||
tablet.addTimestamp(rowIndex,timestamp); //批量插入的时间戳是数组形式,所以需要使用rowIndex来指定插入的位置
|
||||
tablet.addValue("id", rowIndex, ((row & 1) == 0 ? 1 : 0));
|
||||
tablet.addValue("name", rowIndex, "name<=>" + row);
|
||||
tablet.addValue("sex", rowIndex, "男");
|
||||
if (tablet.rowSize == insertSize){
|
||||
long bg = System.currentTimeMillis();
|
||||
session.insertTablet(tablet);
|
||||
tablet.reset();
|
||||
log.info("已经插入了"+(row + 1)+",插入耗时:" + (System.currentTimeMillis() - bg));
|
||||
}
|
||||
timestamp++;
|
||||
}
|
||||
|
||||
if (tablet.rowSize != 0){
|
||||
session.insertTablet(tablet);
|
||||
log.info("插入完成,耗时:" + (System.currentTimeMillis() - beginTime));
|
||||
tablet.reset();
|
||||
}
|
||||
long endTime = System.currentTimeMillis();
|
||||
log.info("插入了"+insertSize+"条数据,每次插入"+count+"条数据,总耗时:"+(endTime - beginTime));
|
||||
return "时序性数据库测试success";
|
||||
}
|
||||
|
||||
|
||||
/* @GetMapping("/batchInsertRecords/{num}")
|
||||
public String batchInsertRecords(@PathVariable Integer num){
|
||||
String deviceId = "root.yang";
|
||||
|
||||
//属性(字段)
|
||||
List<String> schemaList = new ArrayList<>();
|
||||
schemaList.add("id");
|
||||
schemaList.add("name");
|
||||
schemaList.add("age");
|
||||
|
||||
ArrayList<TSDataType> tsDataTypes = new ArrayList<>();
|
||||
tsDataTypes.add(TSDataType.INT32);
|
||||
tsDataTypes.add(TSDataType.TEXT);
|
||||
tsDataTypes.add(TSDataType.INT32);
|
||||
|
||||
List<Object> value = new ArrayList<>();
|
||||
value.add(1);
|
||||
value.add("张腾");
|
||||
value.add(18);
|
||||
|
||||
ArrayList<String> deviceIds = new ArrayList<>();
|
||||
ArrayList<Long> times = new ArrayList<>();
|
||||
ArrayList<List<TSDataType>> typeList = new ArrayList<>();
|
||||
ArrayList<List<Object>> valueList = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
deviceIds.add()
|
||||
}
|
||||
}*/
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
package com.muyu.carData.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.testcontroller
|
||||
* @Project:cloud-server-8
|
||||
* @name:KafkaProducerController
|
||||
* @Date:2024/9/28 15:10
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/produce")
|
||||
@Log4j2
|
||||
public class KafkaProducerController {
|
||||
|
||||
@Autowired
|
||||
private KafkaProducer kafkaProducer;
|
||||
|
||||
private final String topicName = "carJsons";
|
||||
|
||||
@GetMapping("/producer")
|
||||
public String produceTest(JSONObject data) {
|
||||
try {
|
||||
log.info("Topic:{}", topicName);
|
||||
log.info("转换为JSON:{}",data);
|
||||
//使用KafkaProducer发送消息
|
||||
ProducerRecord<String, String> stringProducerRecord = new ProducerRecord(topicName, data);
|
||||
kafkaProducer.send(stringProducerRecord);
|
||||
}catch (Exception e){
|
||||
log.error("Producer写入Topic异常,异常信息是:{}",e.getMessage());
|
||||
}
|
||||
return "消息发送成功";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.carData.event;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**自定义事件
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.event
|
||||
* @Project:cloud-server-8
|
||||
* @name:EsSaveEvent
|
||||
* @Date:2024/9/29 21:15
|
||||
*/
|
||||
public class EsSaveEvent extends ApplicationEvent {
|
||||
|
||||
private JSONObject data;
|
||||
|
||||
|
||||
public EsSaveEvent(JSONObject source) {
|
||||
super(source);
|
||||
this.data = source;
|
||||
}
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package com.muyu.carData.listener;
|
||||
|
||||
import com.muyu.carData.event.EsSaveEvent;
|
||||
import org.springframework.context.event.EventListener;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.listener
|
||||
* @Project:cloud-server-8
|
||||
* @name:CustomEventListener
|
||||
* @Date:2024/9/29 23:49
|
||||
*/
|
||||
@Component
|
||||
public class CustomEventListener {
|
||||
|
||||
@EventListener
|
||||
public void handMyEvent(EsSaveEvent event){
|
||||
//处理事件详情
|
||||
|
||||
}
|
||||
}
|
|
@ -1,20 +0,0 @@
|
|||
package com.muyu.carData.listener;
|
||||
|
||||
import com.muyu.carData.event.EsSaveEvent;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
|
||||
/**自定义监听器
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.listener
|
||||
* @Project:cloud-server-8
|
||||
* @name:MyListener
|
||||
* @Date:2024/9/29 21:18
|
||||
*/
|
||||
@Log4j2
|
||||
public class MyListener implements ApplicationListener<EsSaveEvent> {
|
||||
@Override
|
||||
public void onApplicationEvent(EsSaveEvent event) {
|
||||
log.info("监听到自定义事件........");
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package com.muyu.carData.pojo;
|
||||
|
||||
import com.muyu.carData.config.cacheconfig.ExpiryTime;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.pojo
|
||||
* @Project:cloud-server-8
|
||||
* @name:Student
|
||||
* @Date:2024/9/27 0:40
|
||||
*/
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class Student extends ExpiryTime{
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 插入时间
|
||||
*/
|
||||
private long time = System.currentTimeMillis();
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
package com.muyu.carData.pulisher;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.muyu.carData.event.EsSaveEvent;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**事件发布测试
|
||||
* @Author:张腾
|
||||
* @Package:com.muyu.carData.pulisher
|
||||
* @Project:cloud-server-8
|
||||
* @name:CustomEventPublisher
|
||||
* @Date:2024/9/29 23:51
|
||||
*/
|
||||
@Log4j2
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class CustomEventPublisher {
|
||||
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
public void publish(JSONObject data){
|
||||
EsSaveEvent esSaveEvent = new EsSaveEvent(data);
|
||||
applicationEventPublisher.publishEvent(esSaveEvent);
|
||||
log.info("事件发布成功 - 消息是:{}",data);
|
||||
}
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-modules-enterprise</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>cloud-modules-enterprise-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<description>
|
||||
cloud-modules-enterprise-common 企业业务common
|
||||
</description>
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- MuYu Common Core-->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||
<version>2.2.8</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.dom4j</groupId>
|
||||
<artifactId>dom4j</artifactId>
|
||||
<version>2.1.3</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.thoughtworks.xstream</groupId>
|
||||
<artifactId>xstream</artifactId>
|
||||
<version>1.4.20</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.83</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-system</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,25 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 连接微信服务器(微信公众号)
|
||||
*/
|
||||
@Data
|
||||
@Tag(name = "连接微信服务器")
|
||||
public class AccessToken {
|
||||
|
||||
private String access_token;
|
||||
|
||||
private Long expires_in;
|
||||
|
||||
public void setExpiresTime(Long expiresIn) {
|
||||
this.expires_in = System.currentTimeMillis()+expiresIn*1000;
|
||||
}
|
||||
|
||||
public boolean isExpired(Long expiresIn){
|
||||
long now = System.currentTimeMillis();
|
||||
return now>expiresIn;
|
||||
}
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 发送图文回复消息内容(微信公众号)
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:Articles
|
||||
* @Date:2024/9/18 下午10:14
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("item")
|
||||
@Tag(name = "发送图文回复消息内容")
|
||||
public class Articles {
|
||||
// <Articles>
|
||||
// <item>
|
||||
// <Title><![CDATA[title1]]></Title>
|
||||
// <Description><![CDATA[description1]]></Description>
|
||||
// <PicUrl><![CDATA[picurl]]></PicUrl>
|
||||
// <Url><![CDATA[url]]></Url>
|
||||
// </item>
|
||||
// </Articles>
|
||||
|
||||
@XStreamAlias("Title")
|
||||
private String title ;
|
||||
@XStreamAlias("Description")
|
||||
private String description ;
|
||||
@XStreamAlias("PicUrl")
|
||||
private String picUrl ;
|
||||
@XStreamAlias("Url")
|
||||
private String url ;
|
||||
|
||||
}
|
|
@ -1,213 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
/**
|
||||
*
|
||||
* 故障规则测试类(故障)
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.faultrule
|
||||
* @Project:cloud-server-8
|
||||
* @name:PureElectricCar
|
||||
* @Date:2024/9/20 20:22
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "故障规则测试类")
|
||||
public class CarFaultRule {
|
||||
|
||||
/**
|
||||
* VIN码VIN码VIN码
|
||||
*/
|
||||
private String vin;
|
||||
/**
|
||||
* 时间戳时间戳时间戳
|
||||
*/
|
||||
private long timestamp;
|
||||
/**
|
||||
* 经度经度经度
|
||||
*/
|
||||
private double longitude;
|
||||
/**
|
||||
* 纬度纬度纬度
|
||||
*/
|
||||
private double latitude;
|
||||
/**
|
||||
* 车速车速车速
|
||||
*/
|
||||
private double speed;
|
||||
/**
|
||||
* 总里程总里程总里程
|
||||
*/
|
||||
private Long tm;
|
||||
/**
|
||||
* 总电压总电压总电压
|
||||
*/
|
||||
private double tv;
|
||||
/**
|
||||
* 总电流总电流总电流
|
||||
*/
|
||||
private double cc;
|
||||
/**
|
||||
* 绝缘电阻绝缘电阻绝缘电阻
|
||||
*/
|
||||
private double ir;
|
||||
/**
|
||||
* 档位档位档位
|
||||
*/
|
||||
private String gp;
|
||||
/**
|
||||
* 加速踏板行程值加速踏板行程值加速踏板行程值
|
||||
*/
|
||||
private double aptv;
|
||||
/**
|
||||
* 制动踏板行程值制动踏板行程值制动踏板行程值
|
||||
*/
|
||||
private double bptv;
|
||||
/**
|
||||
* 燃料消耗率燃料消耗率燃料消耗率
|
||||
*/
|
||||
private double sfc;
|
||||
/**
|
||||
* 电机控制器温度电机控制器温度电机控制器温度
|
||||
*/
|
||||
private double mct;
|
||||
/**
|
||||
* 电机转速电机转速电机转速
|
||||
*/
|
||||
private int ms;
|
||||
/**
|
||||
* 电机转矩电机转矩电机转矩
|
||||
*/
|
||||
private double mto;
|
||||
/**
|
||||
* 电机温度电机温度电机温度
|
||||
*/
|
||||
private double mte;
|
||||
/**
|
||||
* 电机电压电机电压电机电压
|
||||
*/
|
||||
private double mv;
|
||||
/**
|
||||
* 电机电流电机电流电机电流
|
||||
*/
|
||||
private double mc;
|
||||
/**
|
||||
* 动力电池剩余电量SOC动力电池剩余电量SOC动力电池剩余电量SOC
|
||||
*/
|
||||
private double pbrsoc;
|
||||
/**
|
||||
* 当前状态允许的最大反馈功率当前状态允许的最大反馈功率当前状态允许的最大反馈功率
|
||||
*/
|
||||
private double macsfp;
|
||||
/**
|
||||
* 当前状态允许最大放电功率当前状态允许最大放电功率当前状态允许最大放电功率
|
||||
*/
|
||||
private double csatmdp;
|
||||
/**
|
||||
* BMS自检计数器BMS自检计数器BMS自检计数器
|
||||
*/
|
||||
private int bms;
|
||||
/**
|
||||
* 动力电池充放电电流动力电池充放电电流动力电池充放电电流
|
||||
*/
|
||||
private double cadc;
|
||||
/**
|
||||
* 动力电池负载端总电压V3动力电池负载端总电压V3动力电池负载端总电压V3
|
||||
*/
|
||||
private double pbletvv3;
|
||||
/**
|
||||
* 单次最大电压单次最大电压单次最大电压
|
||||
*/
|
||||
private double smv;
|
||||
/**
|
||||
* 单体电池最低电压单体电池最低电压单体电池最低电压
|
||||
*/
|
||||
private double mvoab;
|
||||
/**
|
||||
* 单体电池最高温度单体电池最高温度单体电池最高温度
|
||||
*/
|
||||
private double maxbt;
|
||||
/**
|
||||
* 单体电池最低温度单体电池最低温度单体电池最低温度
|
||||
*/
|
||||
private double minbt;
|
||||
/**
|
||||
* 动力电池可用容量动力电池可用容量动力电池可用容量
|
||||
*/
|
||||
private double pbac;
|
||||
/**
|
||||
* 车辆状态车辆状态车辆状态
|
||||
*/
|
||||
private String vs;
|
||||
/**
|
||||
* 充电状态充电状态充电状态
|
||||
*/
|
||||
private String cs;
|
||||
/**
|
||||
* 运行状态运行状态运行状态
|
||||
*/
|
||||
private String rs;
|
||||
/**
|
||||
* SOCSOCSOC
|
||||
*/
|
||||
private double soc;
|
||||
/**
|
||||
* 可充电储能装置工作状态可充电储能装置工作状态可充电储能装置工作状态
|
||||
*/
|
||||
private String resdwc;
|
||||
/**
|
||||
* EASEASEAS
|
||||
*/
|
||||
private String eas;
|
||||
/**
|
||||
* PTCPTCPTC
|
||||
*/
|
||||
private String ptc;
|
||||
/**
|
||||
* EPSEPSEPS
|
||||
*/
|
||||
private String eps;
|
||||
/**
|
||||
* ABSABSABS
|
||||
*/
|
||||
private String abs;
|
||||
/**
|
||||
* MCUMCUMCU
|
||||
*/
|
||||
private String mcu;
|
||||
/**
|
||||
* 动力电池加热状态动力电池加热状态动力电池加热状态
|
||||
*/
|
||||
private String pbhs;
|
||||
/**
|
||||
* 动力电池当前状态动力电池当前状态动力电池当前状态
|
||||
*/
|
||||
private String pbcs;
|
||||
/**
|
||||
* 动力电池保温状态动力电池保温状态动力电池保温状态
|
||||
*/
|
||||
private String pbis;
|
||||
/**
|
||||
* DCDCDCDCDCDC
|
||||
*/
|
||||
private String dcdc;
|
||||
/**
|
||||
* CHGCHGCHG
|
||||
*/
|
||||
private String chg;
|
||||
/**
|
||||
* 校验位校验位校验位
|
||||
*/
|
||||
private byte chb;
|
||||
/**
|
||||
* 截止位截止位截止位
|
||||
*/
|
||||
private byte cub;
|
||||
|
||||
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电子围栏类
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
* @name:CarFence
|
||||
* @Date:2024/9/17 16:08
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "电子围栏类")
|
||||
@TableName(value = "car_fence",autoResultMap = true)
|
||||
public class CarFence {
|
||||
|
||||
/**
|
||||
* 围栏主键
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 围栏名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 业务类型ID
|
||||
*/
|
||||
private Integer clazzId;
|
||||
/**
|
||||
* 业务类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String clazzName;
|
||||
/**
|
||||
* 围栏类型ID
|
||||
*/
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 围栏类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
/**
|
||||
* 围栏经纬度
|
||||
*/
|
||||
private String fenceText;
|
||||
/**
|
||||
* 围栏开始时间
|
||||
*/
|
||||
@DateTimeFormat(fallbackPatterns = "yyyy-MM-dd hh:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date fenceStart;
|
||||
/**
|
||||
* 围栏结束时间
|
||||
*/
|
||||
@DateTimeFormat(fallbackPatterns = "yyyy-MM-dd hh:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
|
||||
private Date fenceEnd;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat(fallbackPatterns = "yyyy/MM/dd hh:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy/MM/dd hh:mm:ss")
|
||||
private Date fenceCreate;
|
||||
/**
|
||||
* 中间表ID
|
||||
*/
|
||||
private Integer middleId;
|
||||
/**
|
||||
* 围栏组
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<CarFenceGroup> carFenceGroups;
|
||||
|
||||
public static CarFence carFenceBuild(CarFence carFence) {
|
||||
return CarFence.builder()
|
||||
.id(carFence.getId())
|
||||
.name(carFence.getName())
|
||||
.clazzId(carFence.getClazzId())
|
||||
.typeId(carFence.getTypeId())
|
||||
.fenceText(carFence.getFenceText())
|
||||
.fenceStart(carFence.getFenceStart())
|
||||
.fenceCreate(carFence.getFenceCreate())
|
||||
.middleId(carFence.getMiddleId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏业务类型
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
* @name:CarFenceClazz
|
||||
* @Date:2024/9/17 16:41
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "电子业务类型")
|
||||
@TableName(value = "car_fence_clazz",autoResultMap = true)
|
||||
public class CarFenceClazz {
|
||||
/**
|
||||
* 业务类型ID
|
||||
*/
|
||||
private Integer clazzId;
|
||||
/**
|
||||
* 业务类型名称
|
||||
*/
|
||||
private String clazzName;
|
||||
|
||||
public static CarFenceClazz carFenceClazzBuild(CarFenceClazz carFenceClazz) {
|
||||
return CarFenceClazz.builder()
|
||||
.clazzId(carFenceClazz.getClazzId())
|
||||
.clazzName(carFenceClazz.getClazzName())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
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.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏组类
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:carFenceGroup
|
||||
* @Date:2024/9/22 10:20
|
||||
*/
|
||||
//weilabzu
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "电子围栏组类")
|
||||
@TableName(value = "car_fence_group",autoResultMap = true)
|
||||
public class CarFenceGroup {
|
||||
|
||||
/**
|
||||
* 围栏组ID
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 优先级
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 启动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 围栏组类型
|
||||
*/
|
||||
private String groupType;
|
||||
|
||||
public static CarFenceGroup carFenceBuild(CarFenceGroup carFenceGroup) {
|
||||
return CarFenceGroup.builder()
|
||||
.id(carFenceGroup.getId())
|
||||
.priority(carFenceGroup.getPriority())
|
||||
.status(carFenceGroup.getStatus())
|
||||
.groupType(carFenceGroup.getGroupType())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 电子围栏类型
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
* @name:Type
|
||||
* @Date:2024/9/17 16:40
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "电子围栏类型")
|
||||
@TableName(value = "car_fence_type",autoResultMap = true)
|
||||
public class CarFenceType {
|
||||
/**
|
||||
* 围栏类型ID
|
||||
*/
|
||||
private Integer typeId;
|
||||
/**
|
||||
* 围栏类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
public static CarFenceType carFenceTypeBuild(CarFenceType carFenceType) {
|
||||
return CarFenceType.builder()
|
||||
.typeId(carFenceType.getTypeId())
|
||||
.typeName(carFenceType.getTypeName())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,150 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.domain.req.CarInformationAddReq;
|
||||
import com.muyu.domain.req.CarInformationUpdReq;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 企业车辆管理实体类
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarInformation
|
||||
* @Date:2024/9/22 22:18
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "企业车辆管理实体类")
|
||||
@TableName(value = "car_information",autoResultMap = true)
|
||||
public class CarInformation {
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
@TableId(value = "car_information_id",type = IdType.AUTO)
|
||||
private Long carInformationId;
|
||||
/**
|
||||
* 车辆唯一VIN
|
||||
*/
|
||||
// @TableName(value = "car_information_VIN")
|
||||
@TableField(value = "car_information_VIN")
|
||||
private String carInformationVIN;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carInformationLicensePlate;
|
||||
/**
|
||||
* 车辆颜色
|
||||
*/
|
||||
private String carInformationColor;
|
||||
/**
|
||||
* 车辆驾驶员
|
||||
*/
|
||||
private String carInformationDriver;
|
||||
/**
|
||||
* 车辆电子围栏外键ID
|
||||
*/
|
||||
@Schema(title = "车辆电子围栏外键ID", type = "Integer")
|
||||
private Integer carInformationFence;
|
||||
/**
|
||||
* 车检到期日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||
private Date carInformationExamineEnddata;
|
||||
/**
|
||||
* 车辆类型外键ID
|
||||
*/
|
||||
@Schema(title = "车辆类型外键ID", type = "Integer")
|
||||
private Integer carInformationType;
|
||||
/**
|
||||
* 车辆品牌
|
||||
*/
|
||||
private String carInformationBrand;
|
||||
/**
|
||||
* 是否重点车辆 (0否默认 1是 )
|
||||
*/
|
||||
private Integer carInformationFocus;
|
||||
|
||||
/**
|
||||
* 车辆电机厂商
|
||||
*/
|
||||
private String carInformationMotorManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电机型号
|
||||
*/
|
||||
private String carInformationMotorModel;
|
||||
|
||||
/**
|
||||
* 车辆电池厂商
|
||||
*/
|
||||
private String carInformationBatteryManufacturer;
|
||||
|
||||
/**
|
||||
* 车辆电池型号
|
||||
*/
|
||||
private String carInformationBatteryModel;
|
||||
|
||||
/**
|
||||
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||
*/
|
||||
private Integer carInformationState;
|
||||
|
||||
public static CarInformation carInformationBuilder(CarInformation carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(carInformation.getCarInformationId())
|
||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CarInformation carInformationUpdBuilder(CarInformationUpdReq carInformation, Supplier<Long> idSupplier) {
|
||||
return CarInformation.builder()
|
||||
.carInformationId(idSupplier.get())
|
||||
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||
.carInformationColor(carInformation.getCarInformationColor())
|
||||
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||
.carInformationFence(carInformation.getCarInformationFence())
|
||||
.carInformationType(carInformation.getCarInformationType())
|
||||
.carInformationFocus(carInformation.getCarInformationFocus())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CarInformation carInformationAddBuilder(CarInformationAddReq carInformation) {
|
||||
return CarInformation.builder()
|
||||
.carInformationVIN(carInformation.getCarInformationVIN())
|
||||
.carInformationLicensePlate(carInformation.getCarInformationLicensePlate())
|
||||
.carInformationBrand(carInformation.getCarInformationBrand())
|
||||
.carInformationColor(carInformation.getCarInformationColor())
|
||||
.carInformationDriver(carInformation.getCarInformationDriver())
|
||||
.carInformationMotorManufacturer(carInformation.getCarInformationMotorManufacturer())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.carInformationBatteryManufacturer(carInformation.getCarInformationBatteryManufacturer())
|
||||
.carInformationBatteryModel(carInformation.getCarInformationBatteryModel())
|
||||
.carInformationFence(carInformation.getCarInformationFence())
|
||||
.carInformationType(carInformation.getCarInformationType())
|
||||
.carInformationMotorModel(carInformation.getCarInformationMotorModel())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,135 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
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 17353
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆报文模板实体类")
|
||||
@TableName(value = "car_message", autoResultMap = true)
|
||||
public class CarMessage {
|
||||
//报文类型模块表
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long messageTypeId;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
* 报文名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
//报文拆分位置主表
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Long carMessageId;
|
||||
/**
|
||||
* 车辆类型外键
|
||||
*/
|
||||
private Integer carMessageCartype;
|
||||
/**
|
||||
* 车辆报文类型外键
|
||||
*/
|
||||
private Integer carMessageType;
|
||||
/**
|
||||
* 开始位下标
|
||||
*/
|
||||
private Integer carMessageStartIndex;
|
||||
/**
|
||||
* 结束位下标
|
||||
*/
|
||||
private Integer carMessageEndIndex;
|
||||
/**
|
||||
* 报文数据类型 (固定值 区间随机值)
|
||||
*/
|
||||
private String messageTypeClass;
|
||||
/**
|
||||
* 报文是否开启故障检测(0默认未开启 1开启)
|
||||
*/
|
||||
private Integer carMessageState;
|
||||
|
||||
private String carMessageName;
|
||||
|
||||
/**
|
||||
* 修改方法
|
||||
*
|
||||
* @param carMessage
|
||||
* @param supplier
|
||||
* @return
|
||||
*/
|
||||
public static CarMessage carMessageUpdBuilder(CarMessage carMessage, Supplier<Long> supplier) {
|
||||
return CarMessage.builder()
|
||||
.messageTypeId(supplier.get())
|
||||
.messageTypeCode(carMessage.messageTypeCode)
|
||||
.messageTypeName(carMessage.messageTypeName)
|
||||
.messageTypeBelongs(carMessage.messageTypeBelongs)
|
||||
.carMessageId(carMessage.carMessageId)
|
||||
.carMessageCartype(carMessage.carMessageCartype)
|
||||
.carMessageType(carMessage.carMessageType)
|
||||
.carMessageStartIndex(carMessage.carMessageStartIndex)
|
||||
.carMessageEndIndex(carMessage.carMessageEndIndex)
|
||||
.messageTypeClass(carMessage.messageTypeClass)
|
||||
.carMessageState(carMessage.carMessageState)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加方法
|
||||
*
|
||||
* @param carMessage
|
||||
* @return
|
||||
*/
|
||||
public static CarMessage carMessageAddBuilder(CarMessage carMessage) {
|
||||
return CarMessage.builder()
|
||||
.messageTypeCode(carMessage.messageTypeCode)
|
||||
.messageTypeName(carMessage.messageTypeName)
|
||||
.messageTypeBelongs(carMessage.messageTypeBelongs)
|
||||
.carMessageId(carMessage.carMessageId)
|
||||
.carMessageCartype(carMessage.carMessageCartype)
|
||||
.carMessageType(carMessage.carMessageType)
|
||||
.carMessageStartIndex(carMessage.carMessageStartIndex)
|
||||
.carMessageEndIndex(carMessage.carMessageEndIndex)
|
||||
.messageTypeClass(carMessage.messageTypeClass)
|
||||
.carMessageState(carMessage.carMessageState)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
private Long messageTypeId ;
|
||||
private String messageTypeCode ;
|
||||
private String messageTypeName ;
|
||||
private String messageTypeBelongs ;
|
||||
private String messageTypeClass ;
|
||||
private Long carMessageId ;
|
||||
private Integer carMessageCartype ;
|
||||
private Integer carMessageType ;
|
||||
private Integer carMessageStartIndex ;
|
||||
private Integer carMessageEndIndex ;
|
||||
private Integer carMessageState ;
|
||||
*/
|
||||
|
||||
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆报文所属类型
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.warn.domain.car
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarMessage
|
||||
* @Date:2024/9/22 下午3:07
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "车辆报文所属类型")
|
||||
@TableName(value = "car_message_type",autoResultMap = true)
|
||||
public class CarMessageType {
|
||||
|
||||
/**
|
||||
* 自增主键
|
||||
*/
|
||||
private Integer messageTypeId ;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
private String messageTypeCode ;
|
||||
/**
|
||||
* 报文名称
|
||||
*/
|
||||
private String messageTypeName ;
|
||||
/**
|
||||
* 报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs ;
|
||||
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
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.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 车辆电子组中间表
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-electronic
|
||||
* @name:carMiddle
|
||||
* @Date:2024/9/20 16:30
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "车辆电子组中间表")
|
||||
@TableName(value = "car_middle",autoResultMap = true)
|
||||
public class CarMiddle {
|
||||
|
||||
/**
|
||||
* 中间表ID
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 电子围栏ID
|
||||
*/
|
||||
private Integer fenceGroupId;
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
private Long carInformationId;
|
||||
|
||||
public CarMiddle(Integer fenceGroupId, Long carInformationId) {
|
||||
this.fenceGroupId = fenceGroupId;
|
||||
this.carInformationId = carInformationId;
|
||||
}
|
||||
|
||||
public static CarMiddle carMiddleBuilder(CarMiddle carMiddle) {
|
||||
return CarMiddle.builder()
|
||||
.id(carMiddle.getId())
|
||||
.fenceGroupId(carMiddle.getFenceGroupId())
|
||||
.carInformationId(carMiddle.getCarInformationId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
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.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 围栏组中间表围栏
|
||||
* @Author:yang
|
||||
* @Package:com.muyu.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:carMiddleGroup
|
||||
* @Date:2024/9/22 10:35
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "围栏组中间表围栏")
|
||||
@TableName(value = "car_middle_group",autoResultMap = true)
|
||||
public class CarMiddleGroup {
|
||||
|
||||
/**
|
||||
* 中间ID
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 围栏ID
|
||||
*/
|
||||
private Integer carFenceId;
|
||||
/**
|
||||
* 围栏组
|
||||
*/
|
||||
private Integer fenceGroupId;
|
||||
|
||||
public CarMiddleGroup(Integer carFenceId, Integer fenceGroupId) {
|
||||
this.carFenceId = carFenceId;
|
||||
this.fenceGroupId = fenceGroupId;
|
||||
}
|
||||
|
||||
public static CarMiddleGroup carMiddleGroupBuilder(CarMiddleGroup carMiddleGroup) {
|
||||
return CarMiddleGroup.builder()
|
||||
.id(carMiddleGroup.getId())
|
||||
.carFenceId(carMiddleGroup.getCarFenceId())
|
||||
.fenceGroupId(carMiddleGroup.getFenceGroupId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 车辆类型
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:CarType
|
||||
* @Date:2024/9/21 19:01
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_type",autoResultMap = true)
|
||||
@Tag(name ="车辆类型表")
|
||||
public class CarType {
|
||||
|
||||
/**
|
||||
* 车辆类型ID
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
* 车辆类型名
|
||||
*/
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 车辆规则外键ID
|
||||
*/
|
||||
private long carTypeRules;
|
||||
|
||||
}
|
|
@ -1,122 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultCodeAddReq;
|
||||
import com.muyu.domain.req.FaultCodeUpdReq;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultCode
|
||||
* @Date:2024/9/17 14:55
|
||||
*/
|
||||
/**
|
||||
* 故障码
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_faultcode",autoResultMap = true)
|
||||
@Tag(name = "故障码")
|
||||
public class FaultCode {
|
||||
|
||||
/**
|
||||
*故障码Id
|
||||
*/
|
||||
@TableId(value = "faultcode_id",type = IdType.AUTO)
|
||||
private long faultcodeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
*故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
*故障组
|
||||
*/
|
||||
private String faultGroup;
|
||||
/**
|
||||
*故障位
|
||||
*/
|
||||
private String faultBit;
|
||||
/**
|
||||
*故障值
|
||||
*/
|
||||
private String faultValue;
|
||||
/**
|
||||
*是否警告
|
||||
*/
|
||||
private Integer isWarning;
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String faulttypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq){
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(0)
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeAddReq.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeAddReq.getFaultGroup())
|
||||
.faultBit(faultCodeAddReq.getFaultBit())
|
||||
.faultValue(faultCodeAddReq.getFaultValue())
|
||||
.isWarning(faultCodeAddReq.getIsWarning())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static FaultCode updfaultcode(FaultCodeUpdReq faultCodeUpdReq){
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(0)
|
||||
.messageTypeId(faultCodeUpdReq.getMessageTypeId())
|
||||
.faultcodeNumber(faultCodeUpdReq.getFaultcodeNumber())
|
||||
.faultGroup(faultCodeUpdReq.getFaultGroup())
|
||||
.faultBit(faultCodeUpdReq.getFaultBit())
|
||||
.faultValue(faultCodeUpdReq.getFaultValue())
|
||||
.isWarning(faultCodeUpdReq.getIsWarning())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
public static FaultCode faultCodeBuilder(FaultCode faultCode) {
|
||||
return FaultCode.builder()
|
||||
.faultcodeId(faultCode.getFaultcodeId())
|
||||
.messageTypeId(faultCode.getMessageTypeId())
|
||||
.faultcodeNumber(faultCode.getFaultcodeNumber())
|
||||
.faultGroup(faultCode.faultGroup)
|
||||
.faultBit(faultCode.faultBit)
|
||||
.faultValue(faultCode.faultValue)
|
||||
.isWarning(faultCode.isWarning)
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,95 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultConditionAddReq;
|
||||
import com.muyu.domain.req.FaultConditionUpdReq;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 故障规则
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultCondition
|
||||
* @Date:2024/9/21 19:51
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_condition",autoResultMap = true)
|
||||
@Tag(name = "故障规则")
|
||||
public class FaultCondition {
|
||||
/**
|
||||
* 故障规则表Id
|
||||
*/
|
||||
@TableId(value = "carcondition_id",type = IdType.AUTO)
|
||||
private long carconditionId;
|
||||
/**
|
||||
* 车辆类型Id
|
||||
*/
|
||||
private long carTypeId;
|
||||
/**
|
||||
*故障名称Id
|
||||
*/
|
||||
private long messageTypeId;
|
||||
/**
|
||||
* 故障条件
|
||||
*/
|
||||
private String faultconditionIdentification;
|
||||
/**
|
||||
* 故障规则参数
|
||||
*/
|
||||
private BigDecimal faultconditionParameter;
|
||||
/**
|
||||
* 车辆类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String carTypeName;
|
||||
/**
|
||||
* 故障名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeName;
|
||||
/**
|
||||
* 报文编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String messageTypeCode;
|
||||
|
||||
|
||||
public static FaultCondition faultConditionadd(FaultConditionAddReq faultConditionAddReq){
|
||||
return FaultCondition.builder()
|
||||
.carTypeId(faultConditionAddReq.getCarTypeId())
|
||||
.messageTypeId(faultConditionAddReq.getMessageTypeId())
|
||||
.faultconditionIdentification(faultConditionAddReq.getFaultconditionIdentification())
|
||||
.faultconditionParameter(faultConditionAddReq.getFaultconditionParameter())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static FaultCondition faultConditionupd(FaultConditionUpdReq faultConditionUpdReq, Supplier<Long> idSupplier){
|
||||
return FaultCondition.builder()
|
||||
.carconditionId(faultConditionUpdReq.getCarconditionId())
|
||||
.carTypeId(faultConditionUpdReq.getCarTypeId())
|
||||
.messageTypeId(faultConditionUpdReq.getMessageTypeId())
|
||||
.faultconditionIdentification(faultConditionUpdReq.getFaultconditionIdentification())
|
||||
.faultconditionParameter(faultConditionUpdReq.getFaultconditionParameter())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.domain.req.FaultCodeAddReq;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障标签
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultLabel
|
||||
* @Date:2024/9/17 15:06
|
||||
*/
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_label",autoResultMap = true)
|
||||
@Tag(name = "故障标签")
|
||||
public class FaultLabel {
|
||||
/**
|
||||
*自增主键
|
||||
*/
|
||||
@TableId(value = "message_type_id",type = IdType.AUTO)
|
||||
private long messageTypeId;
|
||||
/**
|
||||
*报文编码
|
||||
*/
|
||||
private String messageTypeCode;
|
||||
/**
|
||||
*报文名称
|
||||
*/
|
||||
private String messageTypeName;
|
||||
/**
|
||||
*报文所属类别
|
||||
*/
|
||||
private String messageTypeBelongs;
|
||||
|
||||
|
||||
public static FaultLabel addfaultLabel(FaultCodeAddReq faultCodeAddReq){
|
||||
return FaultLabel.builder()
|
||||
.messageTypeId(0)
|
||||
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||
.messageTypeCode(faultCodeAddReq.getMessageTypeCode())
|
||||
.messageTypeName(faultCodeAddReq.getMessageTypeName())
|
||||
.messageTypeBelongs(faultCodeAddReq.getMessageTypeBelongs())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,73 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 故障日志
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:FaultLog
|
||||
* @Date:2024/9/19 0:42
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_log",autoResultMap = true)
|
||||
@Tag(name = "故障日志")
|
||||
public class FaultLog {
|
||||
|
||||
/**
|
||||
* 故障日志Id
|
||||
*/
|
||||
@TableId(value = "log_id",type = IdType.AUTO)
|
||||
private long logId;
|
||||
/**
|
||||
* 故障码Id
|
||||
*/
|
||||
private long faultcodeId;
|
||||
/**
|
||||
* 车辆Id
|
||||
*/
|
||||
private long carInformationId;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carVin;
|
||||
|
||||
/**
|
||||
* 故障码
|
||||
*/
|
||||
private String faultcodeNumber;
|
||||
/**
|
||||
* 车辆VIN
|
||||
*/
|
||||
private String carInformationVIN;
|
||||
/**
|
||||
* 开始报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date startwarningTime;
|
||||
/**
|
||||
* 结束报警时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date endwarningTime;
|
||||
|
||||
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障类型
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-faultmanage
|
||||
* @name:FaultType
|
||||
* @Date:2024/9/17 15:03
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_type",autoResultMap = true)
|
||||
public class FaultType {
|
||||
/**
|
||||
*故障类型Id
|
||||
*/
|
||||
@TableId(value = "faulttype_id",type = IdType.AUTO)
|
||||
private long faulttypeId;
|
||||
/**
|
||||
*故障类型名称
|
||||
*/
|
||||
private String faulttypeName;
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:Firm
|
||||
* @Date:2024/9/27 12:29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class Firm {
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
@TableId(value = "firm_id")
|
||||
private Long firmId;
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String firmName;
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class KafKaData {
|
||||
private String key;
|
||||
private String type;
|
||||
private String label;
|
||||
private String value;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
package com.muyu.domain ;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
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.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:ImageText
|
||||
* @Date:2024/9/18 下午9:27
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
@Tag(name = "图文信息")
|
||||
public class NewsMessage {
|
||||
// <ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
// <FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
// <CreateTime>12345678</CreateTime>
|
||||
// <MsgType><![CDATA[news]]></MsgType>
|
||||
// <ArticleCount>1</ArticleCount>
|
||||
// <Articles>
|
||||
// <item>
|
||||
// <Title><![CDATA[title1]]></Title>
|
||||
// <Description><![CDATA[description1]]></Description>
|
||||
// <PicUrl><![CDATA[picurl]]></PicUrl>
|
||||
// <Url><![CDATA[url]]></Url>
|
||||
// </item>
|
||||
// </Articles>
|
||||
|
||||
@XStreamAlias("ToUserName")
|
||||
private String toUserName ;
|
||||
@XStreamAlias("FromUserName")
|
||||
private String fromUserName ;
|
||||
@XStreamAlias("CreateTime")
|
||||
private long createTime ;
|
||||
@XStreamAlias("MsgType")
|
||||
private String msgType ;
|
||||
@XStreamAlias("ArticleCount")
|
||||
private Integer articleCount ;
|
||||
@XStreamAlias("Articles")
|
||||
private List<Articles> articles ;
|
||||
|
||||
|
||||
}
|
|
@ -1,119 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:SysUser
|
||||
* @Date:2024/9/28 22:37
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "用户信息")
|
||||
@TableName("sys_user")
|
||||
public class SysUser extends BaseEntity {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户类型(00系统用户)
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别(0男 1女 2未知)
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Long firmId;
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String firmName;
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
package com.muyu.common.wechat.domain;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 文本信息(微信公众号)
|
||||
* @Author:蓬叁
|
||||
* @Package:com.muyu.wxapplication.massage
|
||||
* @Project:WXApplication
|
||||
* @name:TextMessage
|
||||
* @Date:2024/9/18 上午11:33
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@XStreamAlias("xml")
|
||||
@Tag(name = "文本信息")
|
||||
public class TextMessage {
|
||||
|
||||
//起一个别名 因为我们微信返回信息与java代码格式规范发生冲突
|
||||
//微信格式 ToUserName
|
||||
//JAVA格式 toUserName
|
||||
@XStreamAlias("ToUserName")
|
||||
private String toUserName;
|
||||
@XStreamAlias("FromUserName")
|
||||
private String fromUserName;
|
||||
@XStreamAlias("CreateTime")
|
||||
private long createTime;
|
||||
@XStreamAlias("MsgType")
|
||||
private String msgType;
|
||||
@XStreamAlias("Content")
|
||||
private String content;
|
||||
|
||||
}
|
||||
// <ToUserName><![CDATA[toUser]]></ToUserName>
|
||||
// <FromUserName><![CDATA[fromUser]]></FromUserName>
|
||||
// <CreateTime>12345678</CreateTime>
|
||||
// <MsgType><![CDATA[text]]></MsgType>
|
||||
// <Content><![CDATA[你好]]></Content>
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.domain;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 故障查询信息结果返回对象
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain
|
||||
* @Project:cloud-server-8
|
||||
* @name:Vehicle
|
||||
* @Date:2024/9/20 20:44
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@Tag(name = "故障查询信息结果返回对象")
|
||||
public class Vehicle {
|
||||
/**
|
||||
* 车辆VIN 唯一标识
|
||||
*/
|
||||
private String VIN;
|
||||
/**
|
||||
* 故障信息
|
||||
*/
|
||||
private String faultmessage;
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
package com.muyu.domain.message;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 站内信
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||
* @Project:cloud-server-8
|
||||
* @name:Message
|
||||
* @Date:2024/9/22 10:40
|
||||
*/
|
||||
|
||||
@Tag(name = "站内信")
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@TableName(value = "car_fault_message",autoResultMap = true)
|
||||
public class Message {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private long id;
|
||||
|
||||
/**
|
||||
* 发送者
|
||||
*/
|
||||
private String sender;
|
||||
|
||||
/**
|
||||
* 接收者
|
||||
*/
|
||||
private String receiver;
|
||||
|
||||
/**
|
||||
* 消息内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 消息状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 登录人Id
|
||||
*/
|
||||
private long userId;
|
||||
|
||||
|
||||
public static Message messageBuilder(Message message) {
|
||||
return Message.builder()
|
||||
.id(message.getId())
|
||||
.sender(message.getSender())
|
||||
.receiver(message.getReceiver())
|
||||
.content(message.getContent())
|
||||
.status(message.getStatus())
|
||||
.createTime(message.getCreateTime())
|
||||
.userId(message.getUserId())
|
||||
.build();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue