diff --git a/cloud-auth/src/main/resources/bootstrap.yml b/cloud-auth/src/main/resources/bootstrap.yml
index 9a56e49..c286e94 100644
--- a/cloud-auth/src/main/resources/bootstrap.yml
+++ b/cloud-auth/src/main/resources/bootstrap.yml
@@ -7,7 +7,7 @@ nacos:
addr: 127.0.0.1:8848
user-name: nacos
password: nacos
- namespace: eight
+ namespace: xxy
# Spring
spring:
application:
diff --git a/cloud-gateway/src/main/resources/bootstrap.yml b/cloud-gateway/src/main/resources/bootstrap.yml
index a9335ac..202ab69 100644
--- a/cloud-gateway/src/main/resources/bootstrap.yml
+++ b/cloud-gateway/src/main/resources/bootstrap.yml
@@ -7,7 +7,7 @@ nacos:
addr: 127.0.0.1:8848
user-name: nacos
password: nacos
- namespace: eight
+ namespace: xxy
# Spring
spring:
diff --git a/cloud-modules/cloud-modules-carData/src/main/resources/banner.txt b/cloud-modules/cloud-modules-carData/src/main/resources/banner.txt
new file mode 100644
index 0000000..0dd5eee
--- /dev/null
+++ b/cloud-modules/cloud-modules-carData/src/main/resources/banner.txt
@@ -0,0 +1,2 @@
+Spring Boot Version: ${spring-boot.version}
+Spring Application Name: ${spring.application.name}
diff --git a/cloud-modules/cloud-modules-carData/src/main/resources/logback/dev.xml b/cloud-modules/cloud-modules-carData/src/main/resources/logback/dev.xml
new file mode 100644
index 0000000..8f19f70
--- /dev/null
+++ b/cloud-modules/cloud-modules-carData/src/main/resources/logback/dev.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+ ${log.pattern}
+
+
+
+
+
+ ${log.path}/info.log
+
+
+
+ ${log.path}/info.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ INFO
+
+ ACCEPT
+
+ DENY
+
+
+
+
+ ${log.path}/error.log
+
+
+
+ ${log.path}/error.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ ERROR
+
+ ACCEPT
+
+ DENY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cloud-modules/cloud-modules-carData/src/main/resources/logback/prod.xml b/cloud-modules/cloud-modules-carData/src/main/resources/logback/prod.xml
new file mode 100644
index 0000000..260f145
--- /dev/null
+++ b/cloud-modules/cloud-modules-carData/src/main/resources/logback/prod.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+ ${log.sky.pattern}
+
+
+
+
+
+ ${log.path}/info.log
+
+
+
+ ${log.path}/info.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+
+
+ INFO
+
+ ACCEPT
+
+ DENY
+
+
+
+
+ ${log.path}/error.log
+
+
+
+ ${log.path}/error.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+
+
+ ERROR
+
+ ACCEPT
+
+ DENY
+
+
+
+
+
+
+
+ ${log.sky.pattern}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cloud-modules/cloud-modules-carData/src/main/resources/logback/test.xml b/cloud-modules/cloud-modules-carData/src/main/resources/logback/test.xml
new file mode 100644
index 0000000..260f145
--- /dev/null
+++ b/cloud-modules/cloud-modules-carData/src/main/resources/logback/test.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+ ${log.sky.pattern}
+
+
+
+
+
+ ${log.path}/info.log
+
+
+
+ ${log.path}/info.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+
+
+ INFO
+
+ ACCEPT
+
+ DENY
+
+
+
+
+ ${log.path}/error.log
+
+
+
+ ${log.path}/error.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+
+
+ ERROR
+
+ ACCEPT
+
+ DENY
+
+
+
+
+
+
+
+ ${log.sky.pattern}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/CarMessage.java b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/CarMessage.java
index 41df8b4..6de2217 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/CarMessage.java
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/CarMessage.java
@@ -11,6 +11,7 @@ import java.util.function.Supplier;
/**
* 车辆报文模板实体类
+ *
* @author 17353
*/
@Data
@@ -18,7 +19,7 @@ import java.util.function.Supplier;
@NoArgsConstructor
@Builder
@Tag(name = "车辆报文模板实体类")
-@TableName(value = "car_message",autoResultMap = true)
+@TableName(value = "car_message", autoResultMap = true)
public class CarMessage {
//报文类型模块表
/**
@@ -68,8 +69,11 @@ public class CarMessage {
*/
private Integer carMessageState;
+ private String carMessageName;
+
/**
* 修改方法
+ *
* @param carMessage
* @param supplier
* @return
@@ -92,6 +96,7 @@ public class CarMessage {
/**
* 添加方法
+ *
* @param carMessage
* @return
*/
@@ -127,7 +132,4 @@ public class CarMessage {
*/
-
-
-
}
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/KafKaData.java b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/KafKaData.java
new file mode 100644
index 0000000..66f4683
--- /dev/null
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-common/src/main/java/com/muyu/domain/KafKaData.java
@@ -0,0 +1,17 @@
+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;
+}
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/pom.xml b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/pom.xml
index b7bfbc8..7dde0dc 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/pom.xml
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/pom.xml
@@ -28,6 +28,12 @@
com.alibaba.cloud
spring-cloud-starter-alibaba-nacos-discovery
+
+
+ org.eclipse.paho
+ org.eclipse.paho.client.mqttv3
+ 1.2.2
+
com.alibaba.cloud
@@ -38,17 +44,6 @@
org.apache.kafka
kafka-clients
-
-
- org.springframework.cloud
- spring-cloud-starter-openfeign
-
-
-
- org.eclipse.paho
- org.eclipse.paho.client.mqttv3
- 1.2.2
-
com.alibaba.cloud
@@ -103,7 +98,6 @@
com.muyu
cloud-common-kafka
3.6.3
- compile
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/feign/KafkaClient.java b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/feign/KafkaClient.java
deleted file mode 100644
index 24e4999..0000000
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/feign/KafkaClient.java
+++ /dev/null
@@ -1,18 +0,0 @@
-//package com.muyu.server.feign;
-//
-//import org.springframework.cloud.openfeign.FeignClient;
-//import org.springframework.web.bind.annotation.GetMapping;
-//
-//@FeignClient(name = "cloud-modules-carData",value = "KafkaProducerController")
-//public abstract class KafkaClient {
-// /**
-// * 处理"/produceTest"的GET请求,用于执行特定的测试任务
-// * 此方法的具体实现将在子类中定义
-// * @return 返回类型为String,表示该方法的执行结果
-// * @return
-// */
-// @GetMapping("/produceTest")
-// public abstract String produceTest();
-//
-//
-//}
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/CarMessageService.java b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/CarMessageService.java
index 598f6f7..8a194d7 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/CarMessageService.java
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/CarMessageService.java
@@ -53,11 +53,4 @@ public interface CarMessageService extends IService {
* 获取报文最终信息
*/
JSONObject inciseCarMessage(String testString);
-
-
- List selectCarMessageList(int i, int i1);
-
-
-
-
}
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/impl/CarMessageServiceImpl.java b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/impl/CarMessageServiceImpl.java
index 404db2d..b23e154 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/impl/CarMessageServiceImpl.java
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/impl/CarMessageServiceImpl.java
@@ -110,14 +110,6 @@ public class CarMessageServiceImpl
return null;
}
- @Override
- public List selectCarMessageList(int id, int modelCode) {
- LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>();
- queryWrapper.eq(CarMessage::getCarMessageId, id);
- queryWrapper.eq(CarMessage::getCarMessageType, modelCode);
- return this.list(queryWrapper);
- }
-
//报文处理
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/message/MessageDao.java b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/message/MessageDao.java
index 8bf4173..afeb878 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/message/MessageDao.java
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/service/message/MessageDao.java
@@ -26,7 +26,7 @@ public class MessageDao {
}
public void sendMessage(Message message) throws Exception{
- String sql="INSERT INTO `eight`.`car_fault_message` (`id`, `sender`, `receiver`, `content`, `status`, `create_time`, `user_id`) " +
+ String sql="INSERT INTO `xxy`.`car_fault_message` (`id`, `sender`, `receiver`, `content`, `status`, `create_time`, `user_id`) " +
"VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL)";
try(PreparedStatement pstmt=connection.prepareStatement(sql)){
pstmt.setString(1, message.getContent());
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/resources/bootstrap.yml
index 574393e..0616949 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/resources/bootstrap.yml
+++ b/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/resources/bootstrap.yml
@@ -4,7 +4,7 @@ server:
# nacos线上地址
nacos:
- addr: 127.0.0.1:8848
+ addr: 159.75.188.178:8848
user-name: nacos
password: nacos
namespace: eight
diff --git a/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml
index 2863945..b2d27b0 100644
--- a/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml
+++ b/cloud-modules/cloud-modules-file/src/main/resources/bootstrap.yml
@@ -7,7 +7,7 @@ nacos:
addr: 127.0.0.1:8848
user-name: nacos
password: nacos
- namespace: eight
+ namespace: xxy
# Spring
spring:
diff --git a/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml b/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml
index 5735ae2..d00587b 100644
--- a/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml
+++ b/cloud-modules/cloud-modules-gen/src/main/resources/bootstrap.yml
@@ -7,7 +7,7 @@ nacos:
addr: 127.0.0.1:8848
user-name: nacos
password: nacos
- namespace: eight
+ namespace: xxy
# Spring
spring:
diff --git a/cloud-modules/cloud-modules-protocolparsing/pom.xml b/cloud-modules/cloud-modules-protocolparsing/pom.xml
new file mode 100644
index 0000000..13b771d
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/pom.xml
@@ -0,0 +1,102 @@
+
+
+ 4.0.0
+
+ com.muyu
+ cloud-modules
+ 3.6.3
+
+
+ cloud-modules-protocolparsing
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+
+ org.eclipse.paho
+ org.eclipse.paho.client.mqttv3
+ 1.2.2
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+ org.apache.kafka
+ kafka-clients
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-sentinel
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+
+ com.mysql
+ mysql-connector-j
+
+
+
+ com.muyu
+ cloud-common-datasource
+
+
+
+ com.muyu
+ cloud-common-datascope
+
+
+
+ com.muyu
+ cloud-common-log
+
+
+
+ com.muyu
+ cloud-common-api-doc
+
+
+ com.muyu
+ cloud-modules-enterprise-common
+ 1.0.0
+
+
+ com.github.yulichang
+ mybatis-plus-join-boot-starter
+ 1.4.13
+
+
+ com.github.pagehelper
+ pagehelper
+ 6.0.0
+
+
+ com.muyu
+ cloud-common-kafka
+ 3.6.3
+
+
+
+ 17
+ 17
+ UTF-8
+
+
+
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/ProtocolApplication.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/ProtocolApplication.java
new file mode 100644
index 0000000..ce6cf59
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/ProtocolApplication.java
@@ -0,0 +1,15 @@
+package com.muyu;
+
+import com.muyu.common.security.annotation.EnableMyFeignClients;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+
+@EnableMyFeignClients
+@SpringBootApplication
+public class ProtocolApplication {
+ public static void main(String[] args) {
+ SpringApplication.run(ProtocolApplication.class, args);
+ }
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/controller/CarMessageController.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/controller/CarMessageController.java
new file mode 100644
index 0000000..ed34b86
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/controller/CarMessageController.java
@@ -0,0 +1,38 @@
+package com.muyu.controller;
+
+
+import com.muyu.common.core.domain.Result;
+
+import com.muyu.domain.CarMessage;
+import com.muyu.service.CarMessageService;
+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 {
+
+
+ /**
+ * 测试分割字符
+ */
+
+
+
+
+
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/CarMessage.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/CarMessage.java
new file mode 100644
index 0000000..6de2217
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/CarMessage.java
@@ -0,0 +1,135 @@
+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 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 ;
+ */
+
+
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/CarMessageType.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/CarMessageType.java
new file mode 100644
index 0000000..7bc7b48
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/CarMessageType.java
@@ -0,0 +1,43 @@
+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 ;
+
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/KafKaData.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/KafKaData.java
new file mode 100644
index 0000000..66f4683
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/KafKaData.java
@@ -0,0 +1,17 @@
+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;
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/resp/CarMessageResp.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/resp/CarMessageResp.java
new file mode 100644
index 0000000..e682ed0
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/domain/resp/CarMessageResp.java
@@ -0,0 +1,57 @@
+package com.muyu.domain.resp;
+
+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:resp
+ * @Date:2024/9/22 下午7:12
+ */
+@Data
+@Builder
+@AllArgsConstructor
+@NoArgsConstructor
+@Tag(name = "车辆报文信息")
+public class CarMessageResp {
+
+ /**
+ * 自增主键
+ */
+ private Integer carMessageId ;
+ /**
+ * 车辆类型外键
+ */
+ private Integer carMessageCartype ;
+ /**
+ * 车辆报文外键
+ */
+ private Integer carMessageType ;
+ /**
+ * 报文名称
+ */
+ private String messageTypeName ;
+ /**
+ * 开始位下标
+ */
+ private Integer carMessageStartIndex ;
+ /**
+ * 结束位下标
+ */
+ private Integer carMessageEndIndex ;
+ /**
+ * 报文数据类型 (固定值 区间随机值)
+ */
+ private String messageTypeClass ;
+ /**
+ * 报文是否开启故障检测(0默认未开启 1开启)
+ */
+ private Integer carMessageState ;
+
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/feign/KafkaClient.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/feign/KafkaClient.java
new file mode 100644
index 0000000..c74984c
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/feign/KafkaClient.java
@@ -0,0 +1,19 @@
+package com.muyu.feign;
+
+import com.alibaba.fastjson2.JSONObject;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+
+@FeignClient(name = "cloud-modules-carData")
+public interface KafkaClient {
+ /**
+ * 处理"/produceTest"的GET请求,用于执行特定的测试任务
+ * 此方法的具体实现将在子类中定义
+ * @return 返回类型为String,表示该方法的执行结果
+ * @return
+ */
+ @GetMapping("/produce/producer")
+ public abstract String producerKafka(JSONObject data);
+
+
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarInformationMapper.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarInformationMapper.java
new file mode 100644
index 0000000..1a1c380
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarInformationMapper.java
@@ -0,0 +1,24 @@
+package com.muyu.mapper;
+
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.muyu.domain.CarInformation;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * 车辆信息管理持久层
+ */
+@Mapper
+public interface CarInformationMapper extends MPJBaseMapper {
+
+
+ /**
+ * 根据车辆VIN码获取车辆类型(报文模板分类用的值)
+ * @param carInformationVIN
+ * @return
+ */
+ @Select("SELECT `car_information`.car_Information_Type FROM `car_information` WHERE `car_information`.car_information_VIN = #{carInformationVIN}")
+ Long selectcarMessageCartype(@Param("carInformationVIN") String carInformationVIN);
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessageMapper.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessageMapper.java
new file mode 100644
index 0000000..b219bd9
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessageMapper.java
@@ -0,0 +1,17 @@
+package com.muyu.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.muyu.domain.CarMessage;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 报文模板展示列表持久层
+ */
+@Mapper
+public interface CarMessageMapper extends MPJBaseMapper {
+
+
+
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessagePlusMapper.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessagePlusMapper.java
new file mode 100644
index 0000000..2e0981b
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessagePlusMapper.java
@@ -0,0 +1,12 @@
+package com.muyu.mapper;
+
+import com.muyu.domain.CarMessage;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+@Mapper
+public interface CarMessagePlusMapper {
+
+ List selectCarMessageList(@Param("carMessageCartype") Integer carMessageCartype);
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessageTypeMapper.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessageTypeMapper.java
new file mode 100644
index 0000000..3b65c1d
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mapper/CarMessageTypeMapper.java
@@ -0,0 +1,8 @@
+package com.muyu.mapper;
+
+import com.github.yulichang.base.MPJBaseMapper;
+import com.muyu.domain.CarMessageType;
+
+
+public interface CarMessageTypeMapper extends MPJBaseMapper {
+}
diff --git a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/mqtt/Demo.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/Demo.java
similarity index 95%
rename from cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/mqtt/Demo.java
rename to cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/Demo.java
index 007c82e..c30d6db 100644
--- a/cloud-modules/cloud-modules-enterprise/cloud-modules-enterprise-server/src/main/java/com/muyu/server/mqtt/Demo.java
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/Demo.java
@@ -1,15 +1,14 @@
-package com.muyu.server.mqtt;
+package com.muyu.mqtt;
import com.alibaba.fastjson.JSONObject;
-
import com.muyu.common.kafka.constants.KafkaConstants;
+
import com.muyu.domain.CarMessage;
-import com.muyu.server.service.CarMessageService;
+import com.muyu.service.CarMessageService;
import jakarta.annotation.PostConstruct;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.eclipse.paho.client.mqttv3.*;
-import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
@@ -17,7 +16,7 @@ import java.util.List;
import java.util.concurrent.CompletableFuture;
-@Component
+//@Component
public class Demo {
@Resource
private CarMessageService service;
@@ -25,11 +24,10 @@ public class Demo {
private KafkaProducer kafkaProducer;
@PostConstruct
public void test() {
-
String topic = "vehicle";
String content = "Message from MqttPublishSample";
int qos = 2;
- String broker = "tcp://106.15.136.7:1883";
+ String broker = "tcp://60.204.221.52:1883";
String clientId = "JavaSample";
try {
@@ -50,7 +48,7 @@ public class Demo {
@Override
public void messageArrived(String s, MqttMessage mqttMessage) throws Exception {
- List list= service.selectCarMessageList(1,2);
+ List list= service.selectCarMessage(1);
String str = new String( mqttMessage.getPayload() );
System.out.println(str);
String[] test = str.split(" ");
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/MqttTest.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/MqttTest.java
new file mode 100644
index 0000000..0f0f5de
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/MqttTest.java
@@ -0,0 +1,118 @@
+package com.muyu.mqtt;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.muyu.common.kafka.constants.KafkaConstants;
+
+import com.muyu.domain.CarMessage;
+import com.muyu.domain.KafKaData;
+import com.muyu.service.CarMessageService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.kafka.clients.producer.KafkaProducer;
+import org.apache.kafka.clients.producer.ProducerRecord;
+import org.eclipse.paho.client.mqttv3.*;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * mqtt
+ *
+ * @ClassName MqttTest
+ * @Description
+ * @Date 2024/9/28 23:49
+ */
+@Slf4j
+@Component
+public class MqttTest {
+ private static final Integer ID = 1;
+ private static final Integer CODE = 1;
+
+ @Resource
+ private KafkaProducer kafkaProducer;
+ @Resource
+ private CarMessageService sysCarMessageService;
+
+ @PostConstruct
+ public void Test() {
+ String topic = "vehicle";
+ String content = "Message from MqttPublishSample";
+ int qos = 2;
+ String broker = "tcp://60.204.221.52: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 {
+ List list = sysCarMessageService.selectCarMessage(1);
+ String string = new String(mqttMessage.getPayload());
+ log.info(new String(mqttMessage.getPayload()));
+ List kafKaDataList = new ArrayList<>();
+ String[] test = string.split(" ");
+// String[] results = new String[list.size()];
+ for (CarMessage carMessage : list) {
+ int startIndex = Integer.parseInt(String.valueOf(carMessage.getCarMessageStartIndex())) - 1;
+ int endIndex = Integer.parseInt(String.valueOf(carMessage.getCarMessageEndIndex()));
+ StringBuilder hexBuilder = new StringBuilder();
+ for (int i = startIndex; i < endIndex; i++) {
+ hexBuilder.append(test[i]);
+ }
+ String hex = hexBuilder.toString();
+ char[] result = new char[hex.length() / 2];
+ for (int x = 0; x < hex.length(); x += 2) {
+ int high = Character.digit(hex.charAt(x), 16);
+ int low = Character.digit(hex.charAt(x + 1), 16);
+ result[x / 2] = (char) ((high << 4) + low);
+ }
+ String value = new String(result);
+ kafKaDataList.add(KafKaData.builder()
+ .key(carMessage.getMessageTypeCode())
+ .label(carMessage.getMessageTypeCode())
+ .value(value)
+ .type("String")
+ .build());
+ }
+ String jsonString = JSONObject.toJSONString(kafKaDataList);
+ ProducerRecord producerRecord = new ProducerRecord<>(KafkaConstants.KafkaTopic, jsonString);
+ kafkaProducer.send(producerRecord);
+ log.info("kafka投产:{}", jsonString);
+// HashMap stringStringHashMap = new HashMap<>();
+// kafKaDataList.forEach(data -> stringStringHashMap.put(data.getKey(), data.getValue()));
+// jsonString = JSONObject.toJSONString(stringStringHashMap);
+// System.out.println(jsonString);
+ }
+
+ // 接收信息
+ @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();
+ }
+ }
+}
diff --git a/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/ParsingMQTT.java b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/ParsingMQTT.java
new file mode 100644
index 0000000..c41f07b
--- /dev/null
+++ b/cloud-modules/cloud-modules-protocolparsing/src/main/java/com/muyu/mqtt/ParsingMQTT.java
@@ -0,0 +1,166 @@
+package com.muyu.mqtt;//package com.muyu.server.mqtt;
+//
+//import com.muyu.analysis.parsing.remote.RemoteClientService;
+//import com.muyu.common.core.constant.KafkaConstants;
+//import com.muyu.common.core.constant.RedisConstants;
+//import com.muyu.common.core.domain.Result;
+//import com.muyu.enterprise.domain.resp.car.MessageValueListResp;
+//import com.muyu.server.feign.KafkaClient;
+//import jakarta.annotation.PostConstruct;
+//import jakarta.annotation.Resource;
+//import cn.hutool.json.JSONObject;
+//import com.alibaba.fastjson.JSON;
+//import lombok.extern.log4j.Log4j2;
+//import org.apache.kafka.clients.producer.KafkaProducer;
+//import org.apache.kafka.clients.producer.ProducerRecord;
+//import org.eclipse.paho.client.mqttv3.*;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.data.redis.core.RedisTemplate;
+//import org.springframework.stereotype.Component;
+//
+//import java.util.List;
+//
+///**
+// * 协议解析处理数据发送传送到队列
+// * @Author:李庆帅
+// * @Package:com.muyu.analysis.parsing.MQTT
+// * @Project:cloud-server
+// * @name:ParsingMQTT
+// * @Date:2024/9/29 16:08
+// */
+//@Log4j2
+//@Component
+//public class ParsingMQTT {
+//
+// @Resource
+// private RedisTemplate redisTemplate;
+//
+// @Autowired
+// private KafkaClient remoteServiceClient;
+//
+// @Resource
+// private KafkaProducer kafkaProducer;
+//
+// /**
+// * 协议解析
+// */
+// @PostConstruct
+// public void mqttClient() {
+// String topic = "vehicle";
+// String broker = "tcp://106.15.136.7: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()));
+// JSONObject entries = this.protocolParsing(new String(mqttMessage.getPayload()));
+//
+// ProducerRecord producerRecord = new ProducerRecord<>(KafkaConstants.MESSAGE_PARSING,
+// entries.toString() );
+// kafkaProducer.send(producerRecord);
+// log.info("解析之后的数据"+entries);
+//
+// }
+//
+// /**
+// * 协议解析
+// * @param messageStr
+// * @return
+// */
+// public JSONObject protocolParsing(String messageStr) {
+// //根据空格切割数据
+// String[] hexArray = messageStr.split(" ");
+// StringBuilder result = new StringBuilder();
+// //遍历十六进制数据转换为字符
+// for (String hex : hexArray) {
+// int decimal = Integer.parseInt(hex, 16);
+// result.append((char) decimal);
+// }
+// //取出车辆VIN码
+// String vehicleVin = result.substring(1, 18);
+// log.info("车辆VIN码: " + vehicleVin);
+// //根据车辆VIN码查询报文模板ID
+// Result byVehicleVin = remoteServiceClient.findByVehicleVin(vehicleVin);
+// Long templateId = byVehicleVin.getData();
+// List templateList;
+// //从redis缓存中获取报文模板数据
+// try {
+// String redisKey = RedisConstants.MESSAGE_TEMPLATE + templateId;
+// if (redisTemplate.hasKey(redisKey)) {
+// List