dev.protocol.parsing
parent
04285aea80
commit
aa619a7be0
|
@ -16,7 +16,9 @@
|
|||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<description>
|
||||
车辆管理
|
||||
</description>
|
||||
<dependencies>
|
||||
<!-- MQTT-->
|
||||
<dependency>
|
||||
|
|
|
@ -15,7 +15,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class CloudCarApplication {
|
||||
public static void main (String[] args) {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CloudCarApplication.class, args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.muyu.car.domain.SysCarMessage;
|
||||
import com.muyu.car.domain.SysMessageType;
|
||||
import com.muyu.car.domain.VO.SysMessageVO;
|
||||
|
@ -45,33 +46,29 @@ public class SysCarMessageController extends BaseController {
|
|||
private ISysCarMessageService sysCarMessageService;
|
||||
@Autowired
|
||||
private HttpSession session;
|
||||
static String TEST = "7E 56 45 48 49 43 4C 45 5F 4D 53 47 3A 56 49 4E 31 32 B6 A1 C0 F2 B3 E5 D9 A8 C1 B2 E3 F4 A6 D7 C9 F1 E0 A3 B5 C8 D4 E2 A1 F5 B6 C7 E8 D9 A0 E3 B2 C4 F5 D6 A8 C0 E1 F2 B7 D8 A4 E3 C2 B1 A5 D9 F6 C8 E7 A0 B2 C3 D1 F4 E5 A9 3F 2A 7B D9 1E C8 4D A3 6F 5B 9A 0C 3E 7D F2 8B 46 1A 5E 9F 2D 73 8C 4A B1 6C 5D E2 7E C4 39 0B AD 7C 1F 0E 3C 68 92 B4 5A 7F 6E 81 0D 4B A5 E3 F9 2E 8A 37 6D 14 5C 73 8E D2 04 9B 3A 6C F1 70 BF 29 5F 8C 43 61 24 5D 7A 9C 0A D5 1B 3D 6E F4 78 3E 5B";
|
||||
static String TEST = "56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56";
|
||||
|
||||
/**
|
||||
* 解析
|
||||
*
|
||||
* @return
|
||||
* @throws InterruptedException
|
||||
* @throws ExecutionException
|
||||
* 查询车辆报文记录列表
|
||||
*/
|
||||
@RequiresPermissions("message:message:test")
|
||||
@GetMapping("/test")
|
||||
public Result test() throws InterruptedException, ExecutionException {
|
||||
List<SysCarMessage> list = (List<SysCarMessage>) session.getAttribute("list");
|
||||
// 检查 list 是否为空
|
||||
// @RequiresPermissions("message:message:list")
|
||||
@GetMapping("/list")
|
||||
public Result<List<SysCarMessage>> list(SysCarMessage sysCarMessage) throws ExecutionException, InterruptedException {
|
||||
List<SysCarMessage> list = sysCarMessageService.selectSysCarMessageList(sysCarMessage);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return Result.success(new String[0]); // 或者返回一个适当的错误消息
|
||||
return Result.error(); //为空返回错误信息
|
||||
}
|
||||
String[] test = TEST.split(" ");
|
||||
String[] results = new String[list.size()];
|
||||
List<CompletableFuture<String>> futures = new ArrayList<>();
|
||||
|
||||
for (SysCarMessage carMessage : list) {
|
||||
futures.add(CompletableFuture.supplyAsync(() -> {
|
||||
int startIndex = Integer.parseInt(carMessage.getMessageStartIndex()) - 1;
|
||||
int endIndex = Integer.parseInt(carMessage.getMessageEndIndex());
|
||||
int start = Integer.parseInt(carMessage.getMessageStartIndex()) - 1;
|
||||
int end = Integer.parseInt(carMessage.getMessageEndIndex());
|
||||
StringBuilder hexBuilder = new StringBuilder();
|
||||
for (int j = startIndex; j < endIndex; j++) {
|
||||
hexBuilder.append(test[j]);
|
||||
for (int i = start; i < end; i++) {
|
||||
hexBuilder.append(test[i]);
|
||||
}
|
||||
String hex = hexBuilder.toString();
|
||||
char[] result = new char[hex.length() / 2];
|
||||
|
@ -86,52 +83,9 @@ public class SysCarMessageController extends BaseController {
|
|||
for (int i = 0; i < futures.size(); i++) {
|
||||
results[i] = futures.get(i).get();
|
||||
}
|
||||
return Result.success(results);
|
||||
}
|
||||
|
||||
@GetMapping("/test")
|
||||
public Result test01() throws ExecutionException, InterruptedException {
|
||||
List<SysCarMessage> list = (List<SysCarMessage>) session.getAttribute("list");
|
||||
//检查list是否为空
|
||||
if (list == null || list.isEmpty()) {
|
||||
return Result.success(new String[0]);//或者返回一个适当的错误消息
|
||||
}
|
||||
String[] test = TEST.split(" ");
|
||||
String[] results = new String[list.size()];
|
||||
ArrayList<CompletableFuture<String>> futures = new ArrayList<>();
|
||||
for (SysCarMessage carMessage : list) {
|
||||
futures.add(CompletableFuture.supplyAsync(() -> {
|
||||
int startIndex = Integer.parseInt(carMessage.getMessageStartIndex()) - 1;
|
||||
int endIndex = Integer.parseInt(carMessage.getMessageEndIndex());
|
||||
StringBuilder hexBuilder = new StringBuilder();
|
||||
for (int j = startIndex; j < endIndex; j++) {
|
||||
hexBuilder.append(test[j]);
|
||||
}
|
||||
String hex = hexBuilder.toString();
|
||||
char[] result = new char[hex.length() / 2];
|
||||
for (int x = 0; x < hex.length(); x++) {
|
||||
int high = Character.digit(hex.charAt(x), 16);
|
||||
int low = Character.digit(hex.charAt(x + 1), 16);
|
||||
result[x / 2] = (char) ((high << 4) + low);
|
||||
}
|
||||
return new String(result);
|
||||
}));
|
||||
}
|
||||
for (int i = 0; i < futures.size(); i++) {
|
||||
results[i] = futures.get(i).get();
|
||||
}
|
||||
return Result.success(results);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询车辆报文记录列表
|
||||
*/
|
||||
@RequiresPermissions("message:message:list")
|
||||
@GetMapping("/list")
|
||||
public Result<List<SysCarMessage>> list(SysCarMessage sysCarMessage) {
|
||||
List<SysCarMessage> list = sysCarMessageService.selectSysCarMessageList(sysCarMessage);
|
||||
session.setAttribute("list", list);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("results", results);
|
||||
System.out.println(jsonObject);
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.muyu.car.domain.mqtt;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @ClassName MqttProperties
|
||||
* @Description Mqtt配置类
|
||||
* @Author Chen
|
||||
* @Date 2024/9/27 20:15
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MqttProperties {
|
||||
/**
|
||||
* 节点
|
||||
*/
|
||||
private String broker;
|
||||
/**
|
||||
* 主题
|
||||
*/
|
||||
private String topic;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String userName;
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
/**
|
||||
* 节点ID
|
||||
*/
|
||||
private String clientId;
|
||||
/**
|
||||
* 上报级别
|
||||
*/
|
||||
private int pos = 0;
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.car.domain.mqtt;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MqttServerModel
|
||||
* @Description mqtt服务器模型
|
||||
* @Author Chen
|
||||
* @Date 2024/9/27 21:12
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class MqttServerModel {
|
||||
private static final Logger log = LoggerFactory.getLogger(MqttServerModel.class);
|
||||
/**
|
||||
* MQTT服务节点
|
||||
*/
|
||||
private String broker;
|
||||
|
||||
/**
|
||||
* MQTT订阅主题
|
||||
*/
|
||||
private String topic;
|
||||
|
||||
public String getBroker() {
|
||||
log.info("broker: {}", broker);
|
||||
return broker.contains("tcp://") ? broker : "tcp://" + broker + ":1883";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.car.mqkafka;
|
||||
|
||||
/**
|
||||
* @ClassName CarKafKaProduct
|
||||
* @Description kafka
|
||||
* @Author Chen
|
||||
* @Date 2024/9/28 12:22
|
||||
*/
|
||||
|
||||
public class CarKafKaProduct {
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package com.muyu.car.mqtt;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
|
||||
import org.eclipse.paho.client.mqttv3.MqttCallback;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
|
||||
/**
|
||||
* @ClassName Callback
|
||||
* @Description 描述
|
||||
* @Author Chen
|
||||
* @Date 2024/9/26 19:31
|
||||
*/
|
||||
@Slf4j
|
||||
public class Callback implements MqttCallback {
|
||||
/**
|
||||
* MQTT 断开连接会执行此方法
|
||||
*
|
||||
* @param throwable
|
||||
*/
|
||||
@Override
|
||||
public void connectionLost(Throwable throwable) {
|
||||
log.info("断开了MQTT连接:{}", throwable.getMessage());
|
||||
log.error(throwable.getMessage(), throwable);
|
||||
}
|
||||
|
||||
/**
|
||||
* publish发布成功后会执行到这里
|
||||
* @param
|
||||
* @param mqttMessage
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void messageArrived(String topic, MqttMessage mqttMessage) throws Exception {
|
||||
log.info("收到来自 "+topic+"的消息:{}",new String(mqttMessage.getPayload()));
|
||||
}
|
||||
|
||||
/**
|
||||
* subscribe订阅后得到的消息会执行到这里
|
||||
* @param iMqttDeliveryToken
|
||||
*/
|
||||
@Override
|
||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
||||
log.info("发布消息成功");
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
package com.muyu.car.mqtt;
|
||||
|
||||
|
||||
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.*;
|
||||
import org.eclipse.paho.client.mqttv3.internal.wire.MqttConnect;
|
||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName MqttTest
|
||||
* @Description MQTT
|
||||
* @Author Chen
|
||||
* @Date 2024/9/26 16:01
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MQTTConnect {
|
||||
//mqtt服务器的地址和端口
|
||||
private String HOST = "tcp://127.0.0.1:1883";
|
||||
private final String clientId = "DC" + (int) (Math.random() * 100000000);
|
||||
private MqttClient mqttClient;
|
||||
|
||||
/**
|
||||
* 客户端connect连接mqtt服务器
|
||||
*
|
||||
* @param userName
|
||||
* @param password
|
||||
* @param mqttCallback
|
||||
* @throws MqttException
|
||||
*/
|
||||
public void setMqttClient(String userName, String password, MqttCallback mqttCallback) throws MqttException {
|
||||
MqttConnectOptions options = mqttConnectOptions(userName, password);
|
||||
if (mqttCallback == null) {
|
||||
mqttClient.setCallback(new Callback());
|
||||
} else {
|
||||
mqttClient.setCallback(mqttCallback);
|
||||
}
|
||||
mqttClient.connect(options);
|
||||
}
|
||||
|
||||
/**
|
||||
* MQTT连接参数设置
|
||||
*
|
||||
* @param userName
|
||||
* @param password
|
||||
* @return
|
||||
* @throws MqttException
|
||||
*/
|
||||
private MqttConnectOptions mqttConnectOptions(String userName, String password) throws MqttException {
|
||||
mqttClient = new MqttClient(HOST, clientId, new MemoryPersistence());
|
||||
MqttConnectOptions options = new MqttConnectOptions();
|
||||
options.setUserName(userName);
|
||||
options.setPassword(password.toCharArray());
|
||||
options.setConnectionTimeout(10);
|
||||
options.setAutomaticReconnect(true);
|
||||
options.setCleanSession(true);
|
||||
return options;
|
||||
}
|
||||
|
||||
/**
|
||||
* 消息
|
||||
*/
|
||||
public void put(String topic, String msg) throws MqttException {
|
||||
MqttMessage mqttMessage = new MqttMessage();
|
||||
mqttMessage.setPayload(msg.getBytes());
|
||||
MqttTopic mqttTopic = mqttClient.getTopic(topic);
|
||||
MqttDeliveryToken token = mqttTopic.publish(mqttMessage);
|
||||
token.waitForCompletion();
|
||||
}
|
||||
|
||||
public void pub(String topic, String msg, int qos) throws MqttException {
|
||||
MqttMessage mqttMessage = new MqttMessage();
|
||||
mqttMessage.setQos(qos);
|
||||
mqttMessage.setPayload(msg.getBytes());
|
||||
MqttTopic mqttTopic = mqttClient.getTopic(topic);
|
||||
MqttDeliveryToken token = mqttTopic.publish(mqttMessage);
|
||||
token.waitForCompletion();
|
||||
}
|
||||
|
||||
|
||||
public void sub(String topic) throws MqttException {
|
||||
mqttClient.subscribe(topic);
|
||||
}
|
||||
|
||||
public void sub(String topic, int qos) throws MqttException {
|
||||
mqttClient.subscribe(topic, qos);
|
||||
}
|
||||
public static void main(String[] args) throws MqttException {
|
||||
MQTTConnect mqttConnect = new MQTTConnect();
|
||||
mqttConnect.setMqttClient("admin","public",new Callback());
|
||||
mqttConnect.sub("com/iot/init");
|
||||
// mqttConnect.pub("com/iot/init","aa"+(int)(Math.random()*100000000));
|
||||
mqttConnect.put("com/iot/init", "Mr.Qu" + (int) (Math.random() * 100000000));
|
||||
}
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
package com.muyu.car.mqtt;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.eclipse.paho.client.mqttv3.MqttException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
/**
|
||||
* 项目启动 监听主题
|
||||
*
|
||||
* @author Mr.Qu
|
||||
* @since 2020/1/10
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MQTTListener implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
private final MQTTConnect server;
|
||||
|
||||
@Autowired
|
||||
public MQTTListener(MQTTConnect server) {
|
||||
this.server = server;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
|
||||
try {
|
||||
server.setMqttClient("admin", "public", new Callback());
|
||||
server.sub("com/iot/init");
|
||||
} catch (MqttException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,4 +38,6 @@ public interface ISysCarMessageService extends IService<SysCarMessage> {
|
|||
*/
|
||||
Boolean checkIdUnique(SysCarMessage sysCarMessage);
|
||||
|
||||
// Boolean checkById(SysCarMessage sysCarMessage);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package com.muyu.car.service.impl;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.car.domain.SysCar;
|
||||
import com.muyu.car.domain.SysCarMessage;
|
||||
import com.muyu.car.domain.SysMessageType;
|
||||
import com.muyu.car.domain.VO.SysMessageVO;
|
||||
import com.muyu.car.mapper.SysCarMessageMapper;
|
||||
import com.muyu.car.service.ISysCarMessageService;
|
||||
|
@ -38,8 +40,7 @@ public class SysCarMessageServiceImpl
|
|||
* @return 车辆报文记录
|
||||
*/
|
||||
@Override
|
||||
public SysCarMessage selectSysCarMessageById(Long id)
|
||||
{
|
||||
public SysCarMessage selectSysCarMessageById(Long id) {
|
||||
LambdaQueryWrapper<SysCarMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(id, "id不可为空");
|
||||
queryWrapper.eq(SysCarMessage::getId, id);
|
||||
|
@ -54,13 +55,12 @@ public class SysCarMessageServiceImpl
|
|||
* @return 车辆报文记录
|
||||
*/
|
||||
@Override
|
||||
public List<SysCarMessage> selectSysCarMessageList(SysCarMessage sysCarMessage)
|
||||
{
|
||||
public List<SysCarMessage> selectSysCarMessageList(SysCarMessage sysCarMessage) {
|
||||
LambdaQueryWrapper<SysCarMessage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(sysCarMessage.getModelCode())){
|
||||
if (StringUtils.isNotEmpty(sysCarMessage.getModelCode())) {
|
||||
queryWrapper.eq(SysCarMessage::getModelCode, sysCarMessage.getModelCode());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(sysCarMessage.getMessageType())){
|
||||
if (StringUtils.isNotEmpty(sysCarMessage.getMessageType())) {
|
||||
queryWrapper.eq(SysCarMessage::getMessageType, sysCarMessage.getMessageType());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
|
@ -68,6 +68,7 @@ public class SysCarMessageServiceImpl
|
|||
|
||||
/**
|
||||
* 唯一 判断
|
||||
*
|
||||
* @param sysCarMessage 车辆报文记录
|
||||
* @return 车辆报文记录
|
||||
*/
|
||||
|
@ -77,5 +78,14 @@ public class SysCarMessageServiceImpl
|
|||
queryWrapper.eq(SysCarMessage::getId, sysCarMessage.getId());
|
||||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public Boolean checkById(SysMessageType sysMessageType) {
|
||||
// LambdaQueryWrapper<SysCarMessage> sysCarMessageLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// sysCarMessageLambdaQueryWrapper.eq(SysCarMessage::getMessageType, sysMessageType);
|
||||
//// sysCarMessageLambdaQueryWrapper.eq(SysCarMessage::getMessageType, sysMessageType);
|
||||
// sysCarMessageLambdaQueryWrapper.eq(SysCarMessage::get, sysMessageType);
|
||||
//// return this.count(sysCarMessageLambdaQueryWrapper) > 0;
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -28,19 +28,19 @@ spring:
|
|||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# # nacos用户名
|
||||
# username: ${nacos.user-name}
|
||||
# # nacos密码
|
||||
# password: ${nacos.password}
|
||||
# # nacos用户名
|
||||
# username: ${nacos.user-name}
|
||||
# # nacos密码
|
||||
# password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
config:
|
||||
# 服务注册地址
|
||||
server-addr: ${nacos.addr}
|
||||
# # nacos用户名
|
||||
# username: ${nacos.user-name}
|
||||
# # nacos密码
|
||||
# password: ${nacos.password}
|
||||
# # nacos用户名
|
||||
# username: ${nacos.user-name}
|
||||
# # nacos密码
|
||||
# password: ${nacos.password}
|
||||
# 命名空间
|
||||
namespace: ${nacos.namespace}
|
||||
# 配置文件格式
|
||||
|
@ -58,4 +58,20 @@ spring:
|
|||
logging:
|
||||
level:
|
||||
com.muyu.system.mapper: DEBUG
|
||||
|
||||
#mqtt:
|
||||
# host:tcp://172.0.0.1:1883
|
||||
# userName: root
|
||||
# passWord: 11
|
||||
### MQTT##
|
||||
mqtt:
|
||||
host: tcp://192.168.10.198:1883
|
||||
userName: root
|
||||
passWord: 123456
|
||||
qos: 1
|
||||
clientId: ClientId_local #ClientId_local必须唯一 比如你已经定了叫ABC 那你就一直叫ABC 其他地方就不要使用ABC了
|
||||
timeout: 10
|
||||
keepalive: 20
|
||||
topic1: A/pick/warn/# #符号是代表整个warn下面的全部子主题 没有理解的话 可以百度仔细理解一下
|
||||
topic2: A/cmd/resp
|
||||
topic3: ABCF
|
||||
topic4: ABCH
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
package com.muyu.warning.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName WarnRuleDTO
|
||||
* @Description 描述
|
||||
* @Author Chen
|
||||
* @Date 2024/9/22 11:53
|
||||
*/
|
||||
@Data
|
||||
public class WarnRuleDTO {
|
||||
/** 规则id */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 规则名称 */
|
||||
@Excel(name = "规则名称")
|
||||
private String ruleName;
|
||||
|
||||
/** 策略id */
|
||||
@Excel(name = "策略id")
|
||||
private Long strategyId;
|
||||
|
||||
/** 报文数据类型id */
|
||||
@Excel(name = "报文数据类型id")
|
||||
private Long msgTypeId;
|
||||
|
||||
/** 滑窗时间 */
|
||||
@Excel(name = "滑窗时间")
|
||||
private Long slideTime;
|
||||
|
||||
/** 滑窗频率 */
|
||||
@Excel(name = "滑窗频率")
|
||||
private Long slideFrequency;
|
||||
|
||||
/** 最大值 */
|
||||
@Excel(name = "最大值")
|
||||
private Long maxValue;
|
||||
|
||||
/** 最小值 */
|
||||
@Excel(name = "最小值")
|
||||
private Long minValue;
|
||||
|
||||
/** 车辆类型id */
|
||||
@Excel(name = "车辆类型id")
|
||||
private Long carTypeId;
|
||||
|
||||
/** 策略名称 */
|
||||
@Excel(name = "策略名称")
|
||||
private String strategyName;
|
||||
|
||||
/** 报文模版id */
|
||||
@Excel(name = "报文模版id")
|
||||
private Long msgId;
|
||||
}
|
|
@ -1,23 +1,17 @@
|
|||
package com.muyu.warning.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.github.yulichang.query.MPJLambdaQueryWrapper;
|
||||
import com.github.yulichang.query.MPJQueryWrapper;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.muyu.warning.domain.WarnRuleDTO;
|
||||
import com.muyu.warning.domain.WarnStrategy;
|
||||
import com.muyu.warning.mapper.WarnRuleMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.warning.domain.WarnRule;
|
||||
import com.muyu.warning.service.IWarnRuleService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.warning.domain.WarnRule;
|
||||
import com.muyu.warning.mapper.WarnRuleMapper;
|
||||
import com.muyu.warning.service.IWarnRuleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 预警规则Service业务层处理
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue