Compare commits
No commits in common. "73c2c159e83ec26704646357a1bd68b6bbe321db" and "5148ae5e140bd7c6c7253a4197f1f1dd9ff23fbd" have entirely different histories.
73c2c159e8
...
5148ae5e14
|
@ -1,26 +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.couplet</groupId>
|
|
||||||
<artifactId>couplet-analyze-incident</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-incident-remote</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-incident-remote</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,20 +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.couplet</groupId>
|
|
||||||
<artifactId>couplet-analyze-incident</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-incident-server</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>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,19 +0,0 @@
|
||||||
package com.couplet.analyze.incident.server.controller;
|
|
||||||
|
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* 事件控制器
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/incident")
|
|
||||||
public class IncidentController extends BaseController {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.couplet.analyze.incident.server.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* @Description: 事件系统接口
|
|
||||||
*/
|
|
||||||
public interface IncidentService {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.couplet.analyze.incident.server.service.impl;
|
|
||||||
|
|
||||||
import com.couplet.analyze.incident.server.service.IncidentService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* @Description: 故障事件
|
|
||||||
*/
|
|
||||||
@Service("breakdown")
|
|
||||||
public class BreakdownServiceImpl implements IncidentService {
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
package com.couplet.analyze.incident.server.service.impl;
|
|
||||||
|
|
||||||
import com.couplet.analyze.incident.server.service.IncidentService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* @Description: 电子围栏事件服务实现类
|
|
||||||
*/
|
|
||||||
@Service("electronic-fence")
|
|
||||||
public class ElectronicFenceServiceImpl implements IncidentService {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.couplet.analyze.incident.server.service.impl;
|
|
||||||
|
|
||||||
import com.couplet.analyze.incident.server.service.IncidentService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* @Description: 实时数据事件
|
|
||||||
*/
|
|
||||||
@Service("real-time-data")
|
|
||||||
public class RealTimeDataServiceImpl implements IncidentService {
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.couplet.analyze.incident.server.service.impl;
|
|
||||||
|
|
||||||
import com.couplet.analyze.incident.server.service.IncidentService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* @Description: 事件存储服务
|
|
||||||
*/
|
|
||||||
@Service("stored-event")
|
|
||||||
public class StoredEventServiceImpl implements IncidentService {
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9999
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: couplet-incident
|
|
||||||
|
|
||||||
profiles:
|
|
||||||
# 环境配置
|
|
||||||
active: dev
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: 121.89.211.230:8848
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: 121.89.211.230:8848
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
com.couplet.trouble.mapper: DEBUG
|
|
|
@ -10,11 +10,6 @@
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>couplet-analyze-incident</artifactId>
|
<artifactId>couplet-analyze-incident</artifactId>
|
||||||
<packaging>pom</packaging>
|
|
||||||
<modules>
|
|
||||||
<module>couplet-incident-remote</module>
|
|
||||||
<module>couplet-incident-server</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
|
|
@ -17,87 +17,4 @@
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos Config -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Sentinel -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringBoot Actuator -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Swagger UI -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
|
||||||
<version>${swagger.fox.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Mysql Connector -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common DataSource -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-datasource</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common DataScope -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-datascope</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Log -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-log</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Swagger -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-swagger</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- mqttx依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.paho</groupId>
|
|
||||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
|
||||||
<version>1.2.5</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- RabbitMQ依赖-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Kafka依赖-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.kafka</groupId>
|
|
||||||
<artifactId>spring-kafka</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
package com.couplet.analyze.msg;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 8:39
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@SpringBootApplication
|
|
||||||
@EnableFeignClients(basePackages = "com.couplet.**")
|
|
||||||
public class CoupletMsgApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(CoupletMsgApplication.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.couplet.analyze.msg.contents;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongZl
|
|
||||||
* @description: kafka常量类
|
|
||||||
* @Date 2023/8/25 18:47
|
|
||||||
*/
|
|
||||||
public class MsgContent {
|
|
||||||
|
|
||||||
public static final String BROKER_URL = "tcp://111.229.33.194:1883";
|
|
||||||
|
|
||||||
public static final String CLIENT_ID = "mqttx_32dcaf76";
|
|
||||||
}
|
|
|
@ -1,263 +0,0 @@
|
||||||
package com.couplet.analyze.msg.domain;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 15:26
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class CoupletMsgData {
|
|
||||||
/**
|
|
||||||
* 主键id
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* VIN 车辆编码
|
|
||||||
*/
|
|
||||||
private String vin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 报文创建时间
|
|
||||||
*/
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 经度
|
|
||||||
*/
|
|
||||||
private String longitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 维度
|
|
||||||
*/
|
|
||||||
private String latitude;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 速度
|
|
||||||
*/
|
|
||||||
private String speed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 里程
|
|
||||||
*/
|
|
||||||
private BigDecimal mileage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总电压
|
|
||||||
*/
|
|
||||||
private String voltage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 总电流
|
|
||||||
*/
|
|
||||||
private String current;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绝缘电阻
|
|
||||||
*/
|
|
||||||
private String resistance;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 档位 P:停车 D:运行
|
|
||||||
*/
|
|
||||||
private String gear;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加速踏板行驶值
|
|
||||||
*/
|
|
||||||
private String accelerationPedal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 制动踏板行驶值
|
|
||||||
*/
|
|
||||||
private String brakePedal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 燃料消耗率
|
|
||||||
*/
|
|
||||||
private String fuelConsumptionRate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机控制器温度
|
|
||||||
*/
|
|
||||||
private String motorControllerTemperature;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机转速
|
|
||||||
*/
|
|
||||||
private String motorSpeed;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机转矩
|
|
||||||
*/
|
|
||||||
private String motorTorque;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机温度
|
|
||||||
*/
|
|
||||||
private String motorTemperature;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机电压
|
|
||||||
*/
|
|
||||||
private String motorVoltage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电机电流
|
|
||||||
*/
|
|
||||||
private String motorCurrent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池剩余电量SOC
|
|
||||||
*/
|
|
||||||
private BigDecimal remainingBattery;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前状态允许的最大反馈功率
|
|
||||||
*/
|
|
||||||
private String maximumFeedbackPower;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前状态允许的最大放电功率
|
|
||||||
*/
|
|
||||||
private String maximumDischargePower;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BMS自检计数器
|
|
||||||
*/
|
|
||||||
private String selfCheckCounter;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池充放电电流
|
|
||||||
*/
|
|
||||||
private String totalBatteryCurrent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池负载端电压V3
|
|
||||||
*/
|
|
||||||
private String totalBatteryVoltage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单次最大电压
|
|
||||||
*/
|
|
||||||
private String singleBatteryMaxVoltage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单体电池最低电压
|
|
||||||
*/
|
|
||||||
private String singleBatteryMinVoltage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单体电池最高温度
|
|
||||||
*/
|
|
||||||
private String singleBatteryMaxTemperature;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单体电池最低温度
|
|
||||||
*/
|
|
||||||
private String singleBatteryMinTemperature;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池可用容量
|
|
||||||
*/
|
|
||||||
private String availableBatteryCapacity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 车辆状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int vehicleStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 充电状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int chargingStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 运行状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int operatingStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SOC 状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int socStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 可充电储能装置工作状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int chargingEnergyStorageStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 驱动电机状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int driveMotorStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定位是否有效 1:有效 0:无效
|
|
||||||
*/
|
|
||||||
private int positionStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EAS(汽车防盗系统)状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int easStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PTC(电动加热器)状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int ptcStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* EPS(电动助力系统)状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int epsStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ABS(防抱死)状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int absStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MCU(电机/逆变器)状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int mcuStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池加热状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int heatingStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池当前状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int batteryStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动力电池保温状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int batteryInsulationStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DCDC(电力交换系统) 状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int dcdcStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CHG(充电机)状态 1:正常 0:故障
|
|
||||||
*/
|
|
||||||
private int chgStatus;
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
package com.couplet.analyze.msg.model;
|
|
||||||
|
|
||||||
import com.couplet.analyze.msg.service.CoupletMsgService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.eclipse.paho.client.mqttv3.MqttClient;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 15:41
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class ModelMessage {
|
|
||||||
|
|
||||||
@Scheduled(cron = "0/5 * * * * ?")
|
|
||||||
public void startMsg() {
|
|
||||||
// try {
|
|
||||||
// new MqttClient()
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
package com.couplet.analyze.msg.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 16:44
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
public interface CoupletMsgService {
|
|
||||||
}
|
|
|
@ -0,0 +1,382 @@
|
||||||
|
package com.couplet.msg.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DongXiaoDong
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/3/31 16:01
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class MsgData {
|
||||||
|
/**
|
||||||
|
* VIN
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
/**
|
||||||
|
* 行驶路线
|
||||||
|
*/
|
||||||
|
private String drivingRoute;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维度
|
||||||
|
*/
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 速度
|
||||||
|
*/
|
||||||
|
private String speed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 里程
|
||||||
|
*/
|
||||||
|
private BigDecimal mileage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总电压
|
||||||
|
*/
|
||||||
|
private String voltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总电流
|
||||||
|
*/
|
||||||
|
private String current;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绝缘电阻
|
||||||
|
*/
|
||||||
|
private String resistance;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档位
|
||||||
|
*/
|
||||||
|
private String gear = "P";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加速踏板行程值
|
||||||
|
*/
|
||||||
|
private String accelerationPedal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 制动踏板行程值
|
||||||
|
*/
|
||||||
|
private String brakePedal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 燃料消耗率
|
||||||
|
*/
|
||||||
|
private String fuelConsumptionRate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机控制器温度
|
||||||
|
*/
|
||||||
|
private String motorControllerTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机转速
|
||||||
|
*/
|
||||||
|
private String motorSpeed;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机转矩
|
||||||
|
*/
|
||||||
|
private String motorTorque;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机温度
|
||||||
|
*/
|
||||||
|
private String motorTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机电压
|
||||||
|
*/
|
||||||
|
private String motorVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机电流
|
||||||
|
*/
|
||||||
|
private String motorCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池剩余电量SOC
|
||||||
|
*/
|
||||||
|
private BigDecimal remainingBattery;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电池总容量
|
||||||
|
*/
|
||||||
|
private BigDecimal batteryLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前状态允许的最大反馈功率
|
||||||
|
*/
|
||||||
|
private String maximumFeedbackPower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前状态允许最大放电功率
|
||||||
|
*/
|
||||||
|
private String maximumDischargePower;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BMS自检计数器
|
||||||
|
*/
|
||||||
|
private String selfCheckCounter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池充放电电流
|
||||||
|
*/
|
||||||
|
private String totalBatteryCurrent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池负载端总电压V3
|
||||||
|
*/
|
||||||
|
private String totalBatteryVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单次最大电压
|
||||||
|
*/
|
||||||
|
private String singleBatteryMaxVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体电池最低电压
|
||||||
|
*/
|
||||||
|
private String singleBatteryMinVoltage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体电池最高温度
|
||||||
|
*/
|
||||||
|
private String singleBatteryMaxTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单体电池最低温度
|
||||||
|
*/
|
||||||
|
private String singleBatteryMinTemperature;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池可用容量
|
||||||
|
*/
|
||||||
|
private String availableBatteryCapacity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
private int vehicleStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 充电状态
|
||||||
|
*/
|
||||||
|
private int chargingStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 运行状态
|
||||||
|
*/
|
||||||
|
private int operatingStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SOC
|
||||||
|
*/
|
||||||
|
private int socStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可充电储能装置工作状态
|
||||||
|
*/
|
||||||
|
private int chargingEnergyStorageStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驱动电机状态
|
||||||
|
*/
|
||||||
|
private int driveMotorStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定位是否有效
|
||||||
|
*/
|
||||||
|
private int positionStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EAS(汽车防盗系统)状态
|
||||||
|
*/
|
||||||
|
private int easStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PTC(电动加热器)状态
|
||||||
|
*/
|
||||||
|
private int ptcStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EPS(电动助力系统)状态
|
||||||
|
*/
|
||||||
|
private int epsStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ABS(防抱死)状态
|
||||||
|
*/
|
||||||
|
private int absStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MCU(电机/逆变器)状态
|
||||||
|
*/
|
||||||
|
private int mcuStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池加热状态
|
||||||
|
*/
|
||||||
|
private int heatingStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池当前状态
|
||||||
|
*/
|
||||||
|
private int batteryStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动力电池保温状态
|
||||||
|
*/
|
||||||
|
private int batteryInsulationStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DCDC(电力交换系统)状态
|
||||||
|
*/
|
||||||
|
private int dcdcStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CHG(充电机)状态
|
||||||
|
*/
|
||||||
|
private int chgStatus = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态 报文
|
||||||
|
*/
|
||||||
|
private String vehicleStatusMsg;
|
||||||
|
/**
|
||||||
|
* 智能硬件 报文
|
||||||
|
*/
|
||||||
|
private String smartHardwareMsg;
|
||||||
|
/**
|
||||||
|
* 电池报文
|
||||||
|
*/
|
||||||
|
private String batteryMsg;
|
||||||
|
|
||||||
|
public String getMsg(){
|
||||||
|
//第一位VIN
|
||||||
|
return vin +
|
||||||
|
// 当前时间戳
|
||||||
|
System.currentTimeMillis() +
|
||||||
|
//第二位经度 longitude latitude
|
||||||
|
getValue(longitude, 11) +
|
||||||
|
//第三位维度 longitude latitude
|
||||||
|
getValue(latitude, 10) +
|
||||||
|
//车速
|
||||||
|
getValue(speed, 6) +
|
||||||
|
//总里程
|
||||||
|
getValue(mileage == null ? "" : mileage.toString(), 11) +
|
||||||
|
// 总电压
|
||||||
|
getValue(voltage, 6) +
|
||||||
|
//总电流
|
||||||
|
getValue(current, 5) +
|
||||||
|
//绝缘电阻 79 - 87
|
||||||
|
getValue(resistance, 9) +
|
||||||
|
//档位
|
||||||
|
(gear == null ? "D" : gear) +
|
||||||
|
// 加速踏板行程值
|
||||||
|
getValue(accelerationPedal, 2) +
|
||||||
|
// 制动踏板行程值
|
||||||
|
getValue(brakePedal, 2) +
|
||||||
|
// 燃料消耗率
|
||||||
|
getValue(fuelConsumptionRate, 5) +
|
||||||
|
//电机控制器温度
|
||||||
|
getValue(motorControllerTemperature, 6) +
|
||||||
|
//电机转速
|
||||||
|
getValue(motorSpeed, 5) +
|
||||||
|
//点击转矩
|
||||||
|
getValue(motorTorque, 4) +
|
||||||
|
//电机温度
|
||||||
|
getValue(motorTemperature, 6) +
|
||||||
|
//电机电压
|
||||||
|
getValue(motorVoltage, 5) +
|
||||||
|
//电机电流
|
||||||
|
getValue(motorCurrent, 8) +
|
||||||
|
//动力电池剩余电量SOC
|
||||||
|
getValue(remainingBattery == null ? "" : remainingBattery.toString(), 6) +
|
||||||
|
//当前状态允许的最大反馈功率
|
||||||
|
getValue(maximumFeedbackPower, 6) +
|
||||||
|
//当前状态允许最大放电功率
|
||||||
|
getValue(maximumDischargePower, 6) +
|
||||||
|
//BMS自检计数器
|
||||||
|
getValue(selfCheckCounter, 2) +
|
||||||
|
//动力电池充放电电流
|
||||||
|
getValue(totalBatteryCurrent, 5) +
|
||||||
|
//动力电池负载端总电压V3
|
||||||
|
getValue(totalBatteryVoltage, 6) +
|
||||||
|
//单次最大电压
|
||||||
|
getValue(singleBatteryMaxVoltage, 4) +
|
||||||
|
//单体电池最低电压
|
||||||
|
getValue(singleBatteryMinVoltage, 4) +
|
||||||
|
//单体电池最高温度
|
||||||
|
getValue(singleBatteryMaxTemperature, 6) +
|
||||||
|
//单体电池最低温度
|
||||||
|
getValue(singleBatteryMinTemperature, 6) +
|
||||||
|
//动力电池可用容量
|
||||||
|
getValue(availableBatteryCapacity, 6) +
|
||||||
|
//车辆状态
|
||||||
|
vehicleStatus +
|
||||||
|
//充电状态
|
||||||
|
chargingStatus +
|
||||||
|
//运行状态
|
||||||
|
operatingStatus +
|
||||||
|
//SOC
|
||||||
|
socStatus +
|
||||||
|
//可充电储能装置工作状态
|
||||||
|
chargingEnergyStorageStatus +
|
||||||
|
//驱动电机状态
|
||||||
|
driveMotorStatus +
|
||||||
|
//定位是否有效
|
||||||
|
positionStatus +
|
||||||
|
//EAS
|
||||||
|
easStatus +
|
||||||
|
//PTC
|
||||||
|
ptcStatus +
|
||||||
|
//EPS
|
||||||
|
epsStatus +
|
||||||
|
//ABS
|
||||||
|
absStatus +
|
||||||
|
//MCU
|
||||||
|
mcuStatus +
|
||||||
|
//动力电池加热状态
|
||||||
|
heatingStatus +
|
||||||
|
//动力电池当前状态
|
||||||
|
batteryStatus +
|
||||||
|
//动力电池保温状态
|
||||||
|
batteryInsulationStatus +
|
||||||
|
//DCDC
|
||||||
|
dcdcStatus +
|
||||||
|
//CHG
|
||||||
|
chgStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue(String val , int valLength){
|
||||||
|
if(val == null){
|
||||||
|
val = "";
|
||||||
|
}
|
||||||
|
int length = val.length();
|
||||||
|
if (length > valLength){
|
||||||
|
return val.substring( 0 , valLength);
|
||||||
|
}
|
||||||
|
val = val + "0".repeat(valLength - length);
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,6 @@
|
||||||
package com.couplet.trouble.domain;
|
package com.couplet.msg.domain;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -13,14 +12,14 @@ import java.util.Date;
|
||||||
/**
|
/**
|
||||||
* @author DongXiaoDong
|
* @author DongXiaoDong
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @date 2024/4/2 15:14
|
* @date 2024/3/31 21:18
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class CoupletTroubleLog {
|
public class TroubleLog {
|
||||||
/**
|
/**
|
||||||
* 故障记录Id
|
* 故障记录Id
|
||||||
*/
|
*/
|
||||||
|
@ -32,7 +31,7 @@ public class CoupletTroubleLog {
|
||||||
private String troubleLogCode;
|
private String troubleLogCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障码VIN
|
* 故障记录车辆VIN
|
||||||
*/
|
*/
|
||||||
private String troubleLogVin;
|
private String troubleLogVin;
|
||||||
|
|
||||||
|
@ -49,5 +48,4 @@ public class CoupletTroubleLog {
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
private Date troubleLogEndTime;
|
private Date troubleLogEndTime;
|
||||||
|
|
||||||
}
|
}
|
|
@ -14,7 +14,6 @@
|
||||||
<modules>
|
<modules>
|
||||||
<module>couplet-analyze-incident</module>
|
<module>couplet-analyze-incident</module>
|
||||||
<module>couplet-analyze-msg</module>
|
<module>couplet-analyze-msg</module>
|
||||||
<module>couplet-analyze-incident/couplet-incident-server</module>
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -86,10 +85,5 @@
|
||||||
<artifactId>couplet-common-swagger</artifactId>
|
<artifactId>couplet-common-swagger</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.kafka</groupId>
|
|
||||||
<artifactId>spring-kafka</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -16,9 +16,11 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
|
namespace: 172469
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -96,12 +96,6 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
<artifactId>spring-boot-starter-amqp</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Kafka依赖-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.kafka</groupId>
|
|
||||||
<artifactId>spring-kafka</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class RabbitMQConfig implements RabbitTemplate.ConfirmCallback, RabbitTem
|
||||||
public String exchangeName;
|
public String exchangeName;
|
||||||
|
|
||||||
//路由键
|
//路由键
|
||||||
@Value("${mq.routingKey}")
|
@Value(("${mq.routingKey}"))
|
||||||
public String routingKey;
|
public String routingKey;
|
||||||
|
|
||||||
private RabbitTemplate rabbitTemplate;
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
@ -69,7 +69,7 @@ public class RabbitMQConfig implements RabbitTemplate.ConfirmCallback, RabbitTem
|
||||||
* @Param: []
|
* @Param: []
|
||||||
* @Return: 返回一个配置好的DirectExchange实例。
|
* @Return: 返回一个配置好的DirectExchange实例。
|
||||||
**/
|
**/
|
||||||
@Bean
|
@Bean("exchange")
|
||||||
public DirectExchange directExchange() {
|
public DirectExchange directExchange() {
|
||||||
return new DirectExchange(exchangeName);
|
return new DirectExchange(exchangeName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
package com.couplet.mq.controller;
|
package com.couplet.mq.controller;
|
||||||
|
|
||||||
import com.couplet.common.core.utils.uuid.IdUtils;
|
import com.couplet.common.core.utils.uuid.IdUtils;
|
||||||
import com.couplet.mq.domain.User;
|
import com.couplet.mq.config.RabbitMQConfig;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ProjectName: five-groups-couplet
|
* @ProjectName: five-groups-couplet
|
||||||
|
@ -19,37 +21,17 @@ import org.springframework.web.bind.annotation.*;
|
||||||
@RequestMapping("/mq")
|
@RequestMapping("/mq")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MqController {
|
public class MqController {
|
||||||
// 通过注入的方式获取队列名、交换机名和路由键
|
|
||||||
//队列名
|
|
||||||
@Value("${mq.queueName}")
|
|
||||||
public String queueName;
|
|
||||||
|
|
||||||
//交换机
|
|
||||||
@Value("${mq.exchangeName}")
|
|
||||||
public String exchangeName;
|
|
||||||
|
|
||||||
//路由键
|
|
||||||
@Value("${mq.routingKey}")
|
|
||||||
public String routingKey;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RabbitTemplate rabbitTemplate;
|
private RabbitTemplate rabbitTemplate;
|
||||||
|
|
||||||
/*
|
@GetMapping("/receive/{data}")
|
||||||
* @Author: LiuYunHu
|
public void receive(@PathVariable("data") String data) {
|
||||||
* @Date: 2024/4/1 19:58
|
//创建配置类对象,用于获取配置值
|
||||||
* @Description: 消息发送者
|
RabbitMQConfig config = new RabbitMQConfig();
|
||||||
* @Param: [data]
|
|
||||||
* @Return: void
|
|
||||||
**/
|
|
||||||
@PostMapping("/sout")
|
|
||||||
//接收json字符串
|
|
||||||
public void sout(@RequestBody User param) {
|
|
||||||
rabbitTemplate.convertAndSend(exchangeName, routingKey, param, message -> {
|
|
||||||
message.getMessageProperties().setMessageId(IdUtils.randomUUID());
|
|
||||||
return message;
|
|
||||||
}, new CorrelationData(IdUtils.randomUUID())
|
|
||||||
);
|
|
||||||
|
|
||||||
|
rabbitTemplate.convertAndSend(config.exchangeName, config.routingKey, data , message -> {
|
||||||
|
message.getMessageProperties().setMessageId(IdUtils.randomUUID());
|
||||||
|
return message;
|
||||||
|
}, new CorrelationData(IdUtils.randomUUID()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.couplet.mq.domain;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/29
|
||||||
|
* @Description: 测试 参数类
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Test implements Serializable {
|
||||||
|
public String data;
|
||||||
|
}
|
|
@ -1,22 +0,0 @@
|
||||||
package com.couplet.mq.domain;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@ToString
|
|
||||||
public class User {
|
|
||||||
private String name;
|
|
||||||
private Integer age;
|
|
||||||
private String sex;
|
|
||||||
}
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.couplet.mq.service;
|
package com.couplet.mq.service;
|
||||||
|
|
||||||
import com.couplet.mq.domain.User;
|
|
||||||
import com.rabbitmq.client.Channel;
|
import com.rabbitmq.client.Channel;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.amqp.core.Message;
|
import org.springframework.amqp.core.Message;
|
||||||
|
@ -19,146 +18,53 @@ import java.util.concurrent.TimeUnit;
|
||||||
* @CreateTime: 2024/3/28
|
* @CreateTime: 2024/3/28
|
||||||
* @Description: MQ消费者类
|
* @Description: MQ消费者类
|
||||||
*/
|
*/
|
||||||
|
@RabbitListener(queues = "${mq.queueName}")
|
||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SuppressWarnings("all")
|
|
||||||
@RabbitListener(queues = "${mq.queueName}")
|
|
||||||
public class Consumer {
|
public class Consumer {
|
||||||
@Autowired
|
@Autowired
|
||||||
private StringRedisTemplate redis;
|
private StringRedisTemplate redisTemplate;
|
||||||
|
|
||||||
/* 线程池执行
|
|
||||||
|
|
||||||
//创建一个定长线程池
|
|
||||||
private final Executor executor = Executors.newFixedThreadPool(5);
|
|
||||||
|
|
||||||
@Async
|
|
||||||
@RabbitHandler
|
@RabbitHandler
|
||||||
public void process(User param, Channel channel, Message message) {
|
public void receive(String data, Channel channel, Message message) throws IOException {
|
||||||
executor.execute(() -> {
|
log.info("消费者接受到数据:{}", data);
|
||||||
try {
|
|
||||||
handleMessage(param, channel, message);
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("处理消息失败:{}", e);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//处理信息的方法
|
|
||||||
private void handleMessage(User param, Channel channel, Message message) throws IOException {
|
|
||||||
log.info("消费者收到消息为:{},{}" + param, message.getMessageProperties().getDeliveryTag());
|
|
||||||
|
|
||||||
|
//获取信息的标记
|
||||||
long deliveryTag = message.getMessageProperties().getDeliveryTag();
|
long deliveryTag = message.getMessageProperties().getDeliveryTag();
|
||||||
|
|
||||||
|
//获取到消息的id
|
||||||
String messageId = message.getMessageProperties().getMessageId();
|
String messageId = message.getMessageProperties().getMessageId();
|
||||||
|
|
||||||
if (!redis.hasKey("value:" + messageId)) {
|
Long add = redisTemplate.opsForSet().add("set:" + messageId, "set:" + messageId);
|
||||||
redis.opsForValue().set("value:" + messageId, "" + deliveryTag, 5, TimeUnit.MINUTES);
|
|
||||||
|
if (!redisTemplate.hasKey("value:" + messageId)) {
|
||||||
|
redisTemplate.opsForValue().set("value:" + messageId, String.valueOf(deliveryTag), 10, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1 添加成功新数据 0已有重复值,不允许再添加
|
|
||||||
Long add = redis.opsForSet().add("set:" + messageId, "set:" + messageId);
|
|
||||||
//过期时间
|
|
||||||
redis.expire("set:" + messageId, 5, TimeUnit.MINUTES);
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (add == 1) {
|
if (add == 1) {
|
||||||
//第一次 消费
|
log.info("---------------消费者开始消费---------------");
|
||||||
System.out.println("*****************************");
|
|
||||||
System.out.println("消费者收到消息:" + param);
|
|
||||||
System.out.println("*****************************");
|
|
||||||
log.info("消费结束");
|
|
||||||
|
|
||||||
channel.basicAck(deliveryTag, false);
|
System.out.println(data);
|
||||||
|
|
||||||
} else {
|
log.info("---------------消费者结束消费---------------");
|
||||||
//重复消费
|
}else {
|
||||||
log.error("重复消费");
|
log.error("重复消费!");
|
||||||
channel.basicReject(deliveryTag, false);
|
channel.basicReject(deliveryTag, false);
|
||||||
|
|
||||||
//删除缓存
|
|
||||||
redis.opsForSet().remove("set:" + messageId, "set:" + messageId);
|
|
||||||
}
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
// throw new RuntimeException(e);
|
||||||
} catch (Exception e) {
|
String s = redisTemplate.opsForValue().get("value:" + messageId);
|
||||||
log.error("消息没有成功消费!");
|
|
||||||
|
|
||||||
String s = redis.opsForValue().get("value:" + messageId);
|
|
||||||
|
|
||||||
long oldTag = Long.parseLong(s);
|
long oldTag = Long.parseLong(s);
|
||||||
|
|
||||||
if (deliveryTag == (oldTag + 2)) {
|
if ((oldTag + 2) != deliveryTag) {
|
||||||
log.error("确实消费不了,不入队了!");
|
log.info("重新入队!");
|
||||||
channel.basicNack(deliveryTag, false, false);
|
|
||||||
} else {
|
|
||||||
log.info("消息消费失败,重新入队");
|
|
||||||
channel.basicNack(deliveryTag, false, true);
|
channel.basicNack(deliveryTag, false, true);
|
||||||
}
|
}else {
|
||||||
}
|
log.error("三次无法消费,不再入队!");
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
@RabbitHandler
|
|
||||||
public void process(User param, Channel channel, Message message) throws IOException {
|
|
||||||
log.info("消费者收到消息为:{},{}" + param, message.getMessageProperties().getDeliveryTag());
|
|
||||||
|
|
||||||
long deliveryTag = message.getMessageProperties().getDeliveryTag();
|
|
||||||
String messageId = message.getMessageProperties().getMessageId();
|
|
||||||
|
|
||||||
if (!redis.hasKey("value:" + messageId)) {
|
|
||||||
redis.opsForValue().set("value:" + messageId, "" + deliveryTag, 5, TimeUnit.MINUTES);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 1 添加成功新数据 0已有重复值,不允许再添加
|
|
||||||
Long add = redis.opsForSet().add("set:" + messageId, "set:" + messageId);
|
|
||||||
//过期时间
|
|
||||||
redis.expire("set:" + messageId, 5, TimeUnit.MINUTES);
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (add == 1) {
|
|
||||||
//第一次 消费
|
|
||||||
System.out.println("*****************************");
|
|
||||||
System.out.println("消费者收到消息:" + param);
|
|
||||||
System.out.println("*****************************");
|
|
||||||
log.info("消费结束");
|
|
||||||
|
|
||||||
//确认消费
|
|
||||||
channel.basicAck(deliveryTag, false);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
//重复消费
|
|
||||||
log.error("重复消费");
|
|
||||||
//拒绝消费
|
|
||||||
channel.basicReject(deliveryTag, false);
|
|
||||||
|
|
||||||
//删除缓存
|
|
||||||
redis.opsForSet().remove("set:" + messageId, "set:" + messageId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("消息没有成功消费!");
|
|
||||||
|
|
||||||
String s = redis.opsForValue().get("value:" + messageId);
|
|
||||||
|
|
||||||
long oldTag = Long.parseLong(s);
|
|
||||||
|
|
||||||
if (deliveryTag == (oldTag + 2)) {
|
|
||||||
log.error("确实消费不了,不入队了!");
|
|
||||||
|
|
||||||
|
|
||||||
//拒绝消费
|
|
||||||
channel.basicNack(deliveryTag, false, false);
|
channel.basicNack(deliveryTag, false, false);
|
||||||
} else {
|
|
||||||
log.info("消息消费失败,重新入队");
|
|
||||||
//重新入队
|
|
||||||
channel.basicNack(deliveryTag, false, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.couplet.mq.service;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
|
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/28
|
||||||
|
* @Description: mqtt客户端
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@Slf4j
|
||||||
|
public class MqttListen {
|
||||||
|
/*
|
||||||
|
* 路径
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.broker}")
|
||||||
|
private String BROKER;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 主题
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.topic}")
|
||||||
|
private String TOPIC;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 客户端id
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.clientid}")
|
||||||
|
private String CLIENTID;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 用户名
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.username}")
|
||||||
|
private String USERNAME;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 密码
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.password}")
|
||||||
|
private String PASSWORD;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* qos
|
||||||
|
* */
|
||||||
|
@Value("${mqtt.server.qos}")
|
||||||
|
private Integer QOS;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void connect() {
|
||||||
|
System.out.println("监听者启动");
|
||||||
|
try {
|
||||||
|
|
||||||
|
MqttClient client = new MqttClient(BROKER, CLIENTID, new MemoryPersistence());
|
||||||
|
MqttConnectOptions options = new MqttConnectOptions();
|
||||||
|
options.setUserName(USERNAME);
|
||||||
|
options.setPassword(PASSWORD.toCharArray());
|
||||||
|
|
||||||
|
//连接超时
|
||||||
|
options.setConnectionTimeout(60);
|
||||||
|
|
||||||
|
//心跳
|
||||||
|
options.setKeepAliveInterval(60);
|
||||||
|
|
||||||
|
log.info("连接到:"+BROKER);
|
||||||
|
|
||||||
|
client.connect(options);
|
||||||
|
log.info("连接成功");
|
||||||
|
|
||||||
|
//设置回调
|
||||||
|
client.setCallback(new MqttCallback() {
|
||||||
|
@Override
|
||||||
|
public void connectionLost(Throwable throwable) {
|
||||||
|
log.error("连接断开:" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void messageArrived(String topic, MqttMessage message) {
|
||||||
|
log.info("消息到达");
|
||||||
|
log.info("接收消息主题:" + topic);
|
||||||
|
log.info("接收消息Qos:" + message.getQos());
|
||||||
|
log.info("接收消息内容:" + new String(message.getPayload()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deliveryComplete(IMqttDeliveryToken token) {
|
||||||
|
log.info("消息发送成功----------" + token.isComplete());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
client.subscribe(TOPIC, QOS);
|
||||||
|
|
||||||
|
|
||||||
|
} catch (MqttException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
com.couplet.mq.config.RabbitMQConfig
|
|
|
@ -34,8 +34,7 @@ logging:
|
||||||
# 订阅端配置
|
# 订阅端配置
|
||||||
mqtt:
|
mqtt:
|
||||||
server:
|
server:
|
||||||
broker: tcp://8.130.181.16:1883
|
broker: tcp://115.159.47.13:1883
|
||||||
# broker: tcp://115.159.47.13:1883
|
|
||||||
username:
|
username:
|
||||||
password:
|
password:
|
||||||
clientid: mqttx
|
clientid: mqttx
|
||||||
|
|
|
@ -1,121 +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">
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-modules</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
|
|
||||||
<artifactId>couplet-modules-online</artifactId>
|
|
||||||
|
|
||||||
<!-- <properties>-->
|
|
||||||
<!-- <maven.compiler.source>17</maven.compiler.source>-->
|
|
||||||
<!-- <maven.compiler.target>17</maven.compiler.target>-->
|
|
||||||
<!-- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>-->
|
|
||||||
<!-- </properties>-->
|
|
||||||
|
|
||||||
<description>
|
|
||||||
couplet-modules-online车辆上线的模块
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos Config -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Sentinel -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringBoot Actuator -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Swagger UI -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
|
||||||
<version>${swagger.fox.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Mysql Connector -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common DataSource -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-datasource</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common DataScope -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-datascope</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Log -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-log</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Swagger -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-swagger</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- mqttx依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.paho</groupId>
|
|
||||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
|
||||||
<version>1.2.5</version>
|
|
||||||
</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>
|
|
||||||
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<skip>true</skip>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
|
||||||
</build>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,25 +0,0 @@
|
||||||
package com.couplet.online;
|
|
||||||
|
|
||||||
import com.couplet.common.security.annotation.EnableCustomConfig;
|
|
||||||
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
|
||||||
import com.couplet.common.swagger.annotation.EnableCustomSwagger2;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: Default (Template) Project
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description: 车辆上线的模块启动类
|
|
||||||
*/
|
|
||||||
|
|
||||||
@EnableCustomConfig
|
|
||||||
@EnableCustomSwagger2
|
|
||||||
@EnableMyFeignClients
|
|
||||||
@SpringBootApplication
|
|
||||||
public class OnlineApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(OnlineApplication.class);
|
|
||||||
System.out.println("车辆上线模块启动成功");
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.couplet.online.controller;
|
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description: 车辆上线控制器
|
|
||||||
*/
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/online")
|
|
||||||
public class OnlineController {
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.couplet.online.mapper;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description: 车辆上线mapper
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
@Component
|
|
||||||
public interface OnlineMapper {
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.couplet.online.service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
|
|
||||||
public interface OnlineService {
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
package com.couplet.online.service.impl;
|
|
||||||
|
|
||||||
import com.couplet.online.service.OnlineService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description: 车辆上线service层
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class OnlineServiceImpl implements OnlineService {
|
|
||||||
}
|
|
|
@ -1,123 +0,0 @@
|
||||||
package com.couplet.online.utils;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.eclipse.paho.client.mqttv3.*;
|
|
||||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description: mqtt监听者
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public class MqttMonitor {
|
|
||||||
/*
|
|
||||||
* 路径
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.broker}")
|
|
||||||
private String broker;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 主题
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.topic}")
|
|
||||||
private String topic;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 客户端id
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.clientId}")
|
|
||||||
private String clientId;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 用户名
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.username}")
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 密码
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.password}")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 遗嘱消息qos
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.qos}")
|
|
||||||
private Integer qos;
|
|
||||||
|
|
||||||
|
|
||||||
//随项目启动而执行这个方法
|
|
||||||
@PostConstruct
|
|
||||||
public void connect() {
|
|
||||||
log.info("mqtt监听者启动");
|
|
||||||
try {
|
|
||||||
MqttClient client = new MqttClient(broker, clientId, new MemoryPersistence());
|
|
||||||
|
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
|
||||||
options.setUserName(userName);
|
|
||||||
options.setPassword(password.toCharArray());
|
|
||||||
|
|
||||||
//连接超时
|
|
||||||
options.setConnectionTimeout(10);
|
|
||||||
|
|
||||||
//心跳时间
|
|
||||||
options.setKeepAliveInterval(60);
|
|
||||||
|
|
||||||
log.info("mqtt监听者启动成功,连接到:{}", broker);
|
|
||||||
|
|
||||||
client.connect(options);
|
|
||||||
log.info("连接成功!");
|
|
||||||
|
|
||||||
//设置回调
|
|
||||||
client.setCallback(new MqttCallback() {
|
|
||||||
@Override
|
|
||||||
public void connectionLost(Throwable throwable) {
|
|
||||||
log.error("连接丢失:{}", throwable.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void messageArrived(String topic, MqttMessage mqttMessage) {
|
|
||||||
// log.info("消息已送达");
|
|
||||||
// log.info("接收消息主题:{}",topic);
|
|
||||||
// log.info("接收消息qos:{}", mqttMessage.getQos());
|
|
||||||
|
|
||||||
//接收到的原始报文
|
|
||||||
String message = new String(mqttMessage.getPayload());
|
|
||||||
|
|
||||||
log.info("接收消息原始内容:{}", message);
|
|
||||||
|
|
||||||
//去除空格 得到16进制字符串
|
|
||||||
String replaced = message.replaceAll(" ", "");
|
|
||||||
log.info("接收消息剪切后内容:{}", replaced);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
|
||||||
log.info("消息发送成功!");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
client.subscribe(topic, qos);
|
|
||||||
|
|
||||||
|
|
||||||
} catch (MqttException e) {
|
|
||||||
log.error("mqtt监听者启动失败,{}", e.getMessage());
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
Spring Boot Version: ${spring-boot.version}
|
|
||||||
Spring Application Name: ${spring.application.name}
|
|
||||||
_______ _ _ _________ _ _______
|
|
||||||
( ___ )( ( /|( \ \__ __/( ( /|( ____ \
|
|
||||||
| ( ) || \ ( || ( ) ( | \ ( || ( \/
|
|
||||||
| | | || \ | || | | | | \ | || (__
|
|
||||||
| | | || (\ \) || | | | | (\ \) || __)
|
|
||||||
| | | || | \ || | | | | | \ || (
|
|
||||||
| (___) || ) \ || (____/\___) (___| ) \ || (____/\
|
|
||||||
(_______)|/ )_)(_______/\_______/|/ )_)(_______/
|
|
|
@ -1,43 +0,0 @@
|
||||||
# Tomcat
|
|
||||||
server:
|
|
||||||
port: 9616
|
|
||||||
|
|
||||||
# Spring
|
|
||||||
spring:
|
|
||||||
application:
|
|
||||||
# 应用名称
|
|
||||||
name: couplet-online
|
|
||||||
profiles:
|
|
||||||
# 环境配置
|
|
||||||
active: dev
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
# 服务注册地址
|
|
||||||
server-addr: 121.89.211.230:8848
|
|
||||||
namespace: 172469
|
|
||||||
config:
|
|
||||||
# 配置中心地址
|
|
||||||
server-addr: 121.89.211.230:8848
|
|
||||||
namespace: 172469
|
|
||||||
# 配置文件格式
|
|
||||||
file-extension: yml
|
|
||||||
# 共享配置
|
|
||||||
shared-configs:
|
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
logging:
|
|
||||||
level:
|
|
||||||
com.couplet.system.mapper: DEBUG
|
|
||||||
|
|
||||||
# 订阅端配置
|
|
||||||
mqtt:
|
|
||||||
server:
|
|
||||||
broker: tcp://115.159.47.13:1883
|
|
||||||
username:
|
|
||||||
password:
|
|
||||||
clientId: lyh
|
|
||||||
qos: 0
|
|
||||||
topic: test
|
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
|
||||||
<!-- 日志存放路径 -->
|
|
||||||
<property name="log.path" value="logs/couplet-system"/>
|
|
||||||
<!-- 日志输出格式 -->
|
|
||||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
|
||||||
|
|
||||||
<!-- 控制台输出 -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 系统日志输出 -->
|
|
||||||
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/info.log</file>
|
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 日志文件名格式 -->
|
|
||||||
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<!-- 日志最大的历史 60天 -->
|
|
||||||
<maxHistory>60</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<!-- 过滤的级别 -->
|
|
||||||
<level>INFO</level>
|
|
||||||
<!-- 匹配时的操作:接收(记录) -->
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<!-- 循环政策:基于时间创建日志文件 -->
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|
||||||
<!-- 日志文件名格式 -->
|
|
||||||
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|
||||||
<!-- 日志最大的历史 60天 -->
|
|
||||||
<maxHistory>60</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>${log.pattern}</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
|
||||||
<!-- 过滤的级别 -->
|
|
||||||
<level>ERROR</level>
|
|
||||||
<!-- 匹配时的操作:接收(记录) -->
|
|
||||||
<onMatch>ACCEPT</onMatch>
|
|
||||||
<!-- 不匹配时的操作:拒绝(不记录) -->
|
|
||||||
<onMismatch>DENY</onMismatch>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- 系统模块日志级别控制 -->
|
|
||||||
<logger name="com.couplet" level="info"/>
|
|
||||||
<!-- Spring日志级别控制 -->
|
|
||||||
<logger name="org.springframework" level="warn"/>
|
|
||||||
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="console"/>
|
|
||||||
</root>
|
|
||||||
|
|
||||||
<!--系统操作日志-->
|
|
||||||
<root level="info">
|
|
||||||
<appender-ref ref="file_info"/>
|
|
||||||
<appender-ref ref="file_error"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
|
@ -1,8 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.couplet.online.mapper.OnlineMapper">
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
|
@ -190,11 +190,7 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
//雪花算法生成随机数
|
//雪花算法生成随机数
|
||||||
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
||||||
long randomId = idGenerator.nextId();
|
long randomId = idGenerator.nextId();
|
||||||
//转成字符串,便于切割
|
String vin = "VIN" + randomId;
|
||||||
String vin = "" + randomId;
|
|
||||||
|
|
||||||
//切割,只留后17位
|
|
||||||
vin = vin.substring(vin.length() - 17);
|
|
||||||
|
|
||||||
|
|
||||||
//创建入参对象
|
//创建入参对象
|
||||||
|
|
|
@ -14,20 +14,7 @@ public class IdTest {
|
||||||
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
||||||
|
|
||||||
long l = idGenerator.nextId();
|
long l = idGenerator.nextId();
|
||||||
String s = "VIN" + l;
|
|
||||||
System.out.println(l);
|
System.out.println(l);
|
||||||
System.out.println(s);
|
|
||||||
System.out.println("剪切前长度:" + s.length());
|
|
||||||
|
|
||||||
|
|
||||||
String last17 = s.substring(s.length() - 17);
|
|
||||||
System.out.println("剪切后:"+last17+" 长度:"+last17.length());
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("----------------------");
|
|
||||||
|
|
||||||
String s1 = "1224069209961664512";
|
|
||||||
String substring = s1.substring(s1.length() - 17);
|
|
||||||
System.out.println(substring);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,8 @@ server:
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: couplet-system
|
name: couplet-system
|
||||||
|
|
|
@ -6,8 +6,6 @@ import com.couplet.common.core.annotation.Excel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongXiaoDong
|
* @author DongXiaoDong
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
@ -25,14 +23,12 @@ public class CoupletTroubleCode {
|
||||||
*/
|
*/
|
||||||
@TableId(value = "trouble_id",type = IdType.AUTO)
|
@TableId(value = "trouble_id",type = IdType.AUTO)
|
||||||
@Excel(name = "故障码主键", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "故障码主键", cellType = Excel.ColumnType.NUMERIC)
|
||||||
@NotEmpty(message = "故障码主键不能为空")
|
|
||||||
private Integer troubleId;
|
private Integer troubleId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障码
|
* 故障码
|
||||||
*/
|
*/
|
||||||
@Excel(name = "故障码")
|
@Excel(name = "故障码")
|
||||||
@NotEmpty(message = "故障码不能为空")
|
|
||||||
private String troubleCode;
|
private String troubleCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,13 +53,11 @@ public class CoupletTroubleCode {
|
||||||
* 故障类型Id
|
* 故障类型Id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "故障类型Id")
|
@Excel(name = "故障类型Id")
|
||||||
@NotEmpty(message = "故障类型Id不能为空")
|
|
||||||
private Integer typeId;
|
private Integer typeId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障等级Id
|
* 故障等级Id
|
||||||
*/
|
*/
|
||||||
@Excel(name = "故障等级Id")
|
@Excel(name = "故障等级Id")
|
||||||
@NotEmpty(message = "故障等级Id不能为空")
|
|
||||||
private Integer gradeId;
|
private Integer gradeId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.couplet.trouble.domain.req;
|
||||||
|
|
||||||
|
import com.couplet.common.core.annotation.Excel;
|
||||||
|
import com.couplet.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DongXiaoDong
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/3/26 22:32
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TroubleAddReq {
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障码")
|
||||||
|
private String troubleCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障位
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障位")
|
||||||
|
private String troublePosition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障值
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障值")
|
||||||
|
private String troubleValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障标签
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障标签")
|
||||||
|
private String troubleTag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障类型Id
|
||||||
|
*/
|
||||||
|
private Integer troubleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障等级Id
|
||||||
|
*/
|
||||||
|
private Integer troubleGradeId;
|
||||||
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
package com.couplet.trouble.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.couplet.common.core.annotation.Excel;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DongXiaoDong
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/3/26 22:32
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TroubleUpdReq {
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障码主键", cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
@TableId(value = "trouble_id",type = IdType.AUTO)
|
||||||
|
private Integer troubleId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障码")
|
||||||
|
private String troubleCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障位
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障位")
|
||||||
|
private String troublePosition;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障值
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障值")
|
||||||
|
private String troubleValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障标签
|
||||||
|
*/
|
||||||
|
@Excel(name = "故障标签")
|
||||||
|
private String troubleTag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障类型Id
|
||||||
|
*/
|
||||||
|
private Integer troubleTypeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障等级Id
|
||||||
|
*/
|
||||||
|
private Integer troubleGradeId;
|
||||||
|
}
|
|
@ -19,6 +19,32 @@
|
||||||
LEFT JOIN couplet_trouble_grade g on t.grade_id = g.grade_id
|
LEFT JOIN couplet_trouble_grade g on t.grade_id = g.grade_id
|
||||||
LEFT JOIN couplet_trouble_type y on t.type_id= y.type_id
|
LEFT JOIN couplet_trouble_type y on t.type_id= y.type_id
|
||||||
</sql>
|
</sql>
|
||||||
|
<!-- <insert id="addTrouble">-->
|
||||||
|
<!-- insert into couplet_trouble_code (trouble_code,trouble_position,trouble_value,trouble_tag,trouble_type_id,trouble_grade_id)-->
|
||||||
|
<!-- values (#{troubleCode},#{troublePosition},#{troubleValue},#{troubleTag},#{troubleTypeId},#{troubleGradeId})-->
|
||||||
|
<!-- </insert>-->
|
||||||
|
<!-- <update id="updateTrouble">-->
|
||||||
|
<!-- update couplet_trouble_code set-->
|
||||||
|
<!-- trouble_code = #{troubleCode},-->
|
||||||
|
<!-- trouble_position = #{troublePosition},-->
|
||||||
|
<!-- trouble_value = #{troubleValue},-->
|
||||||
|
<!-- trouble_tag = #{troubleTag},-->
|
||||||
|
<!-- trouble_type_id = #{troubleTypeId},-->
|
||||||
|
<!-- trouble_grade_id = #{troubleGradeId}-->
|
||||||
|
<!-- where trouble_id = #{troubleId}-->
|
||||||
|
<!-- </update>-->
|
||||||
|
<!-- <update id="updateTrouble" parameterType="com.couplet.trouble.domain.req.TroubleUpdReq">-->
|
||||||
|
<!-- update dxd_trouble_code-->
|
||||||
|
<!-- <set>-->
|
||||||
|
<!-- <if test="troubleCode != null and troubleCode != ''">trouble_code = #{troubleCode},</if>-->
|
||||||
|
<!-- <if test="troublePosition != null and troublePosition != ''">trouble_position = #{troublePosition},</if>-->
|
||||||
|
<!-- <if test="troubleTag != null and troubleTag != ''">trouble_tag = #{troubleTag},</if>-->
|
||||||
|
<!-- <if test="troubleTypeId != null">trouble_typeId = #{troubleTypeId},</if>-->
|
||||||
|
<!-- <if test="troubleValue != null and troubleValue != ''">trouble_value = #{troubleValue},</if>-->
|
||||||
|
<!-- <if test="troubleGradeId != null">trouble_gradeId = #{troubleGradeId},</if>-->
|
||||||
|
<!-- </set>-->
|
||||||
|
<!-- where trouble_id = #{troubleId}-->
|
||||||
|
<!-- </update>-->
|
||||||
|
|
||||||
<select id="selectTroubleList" parameterType="com.couplet.trouble.mapper.SysTroubleMapper" resultMap="SysTroubleResult">
|
<select id="selectTroubleList" parameterType="com.couplet.trouble.mapper.SysTroubleMapper" resultMap="SysTroubleResult">
|
||||||
<include refid="selectTroubleVo"/>
|
<include refid="selectTroubleVo"/>
|
||||||
|
@ -38,4 +64,23 @@
|
||||||
select * from couplet_trouble_grade
|
select * from couplet_trouble_grade
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <insert id="addTrouble" parameterType="com.couplet.trouble.domain.req.TroubleAddReq">-->
|
||||||
|
<!-- insert into dxd_trouble_code(-->
|
||||||
|
<!-- <if test="troubleCode != null and troubleCode != ''">trouble_code,</if>-->
|
||||||
|
<!-- <if test="troublePosition != null and troublePosition != ''">trouble_position,</if>-->
|
||||||
|
<!-- <if test="troubleTag != null and troubleTag != ''">trouble_tag,</if>-->
|
||||||
|
<!-- <if test="troubleTypeId != null">trouble_typeId,</if>-->
|
||||||
|
<!-- <if test="troubleValue != null and troubleValue != ''">trouble_value,</if>-->
|
||||||
|
<!-- <if test="troubleGradeId != null">trouble_gradeId</if>-->
|
||||||
|
<!-- )values(-->
|
||||||
|
<!-- <if test="troubleCode != null and troubleCode != ''">#{troubleCode},</if>-->
|
||||||
|
<!-- <if test="troublePosition != null and troublePosition != ''">#{troublePosition},</if>-->
|
||||||
|
<!-- <if test="troubleTag != null and troubleTag != ''">#{troubleTag},</if>-->
|
||||||
|
<!-- <if test="troubleTypeId != null">#{troubleTypeId},</if>-->
|
||||||
|
<!-- <if test="troubleValue != null and troubleValue != ''">#{troubleValue},</if>-->
|
||||||
|
<!-- <if test="troubleGradeId != null">#{troubleGradeId},</if>-->
|
||||||
|
<!-- )-->
|
||||||
|
<!-- </insert>-->
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
<module>couplet-modules-vehicle</module>
|
<module>couplet-modules-vehicle</module>
|
||||||
<module>couplet-modules-mq</module>
|
<module>couplet-modules-mq</module>
|
||||||
<module>couplet-enterprisemanagement</module>
|
<module>couplet-enterprisemanagement</module>
|
||||||
<module>couplet-modules-onLine</module>
|
|
||||||
<module>couplet-analyze</module>
|
<module>couplet-analyze</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
19
pom.xml
19
pom.xml
|
@ -260,25 +260,6 @@
|
||||||
<version>${couplet.version}</version>
|
<version>${couplet.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 事件系统远程调用 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-incident-remote</artifactId>
|
|
||||||
<version>${couplet.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- 事件系统公共依赖 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-incident-common</artifactId>
|
|
||||||
<version>${couplet.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- 事件系统核心模块 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-incident-server</artifactId>
|
|
||||||
<version>${couplet.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue