Merge branch 'server_five' of https://gitea.qinmian.online/five-groups/five-groups-couplet into server_five_liuyunhu
commit
4b80034baf
|
@ -0,0 +1,26 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?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>
|
|
@ -0,0 +1,19 @@
|
||||||
|
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 {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.couplet.analyze.incident.server.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: LiJiaYao
|
||||||
|
* @Date: 2024/4/2
|
||||||
|
* @Description: 事件系统接口
|
||||||
|
*/
|
||||||
|
public interface IncidentService {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
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 {
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
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 {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
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 {
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
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 {
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
# 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,6 +10,11 @@
|
||||||
</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,4 +17,87 @@
|
||||||
<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>
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
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";
|
||||||
|
}
|
|
@ -0,0 +1,263 @@
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
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()
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.couplet.analyze.msg.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DongXiaoDong
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/4/2 16:44
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
public interface CoupletMsgService {
|
||||||
|
}
|
|
@ -1,382 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -14,6 +14,7 @@
|
||||||
<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>
|
||||||
|
@ -85,5 +86,10 @@
|
||||||
<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,11 +16,9 @@ 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,6 +96,12 @@
|
||||||
<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>
|
||||||
|
|
|
@ -31,6 +31,17 @@ logging:
|
||||||
level:
|
level:
|
||||||
com.couplet.system.mapper: DEBUG
|
com.couplet.system.mapper: DEBUG
|
||||||
|
|
||||||
|
# 订阅端配置
|
||||||
|
mqtt:
|
||||||
|
server:
|
||||||
|
broker: tcp://8.130.181.16:1883
|
||||||
|
# broker: tcp://115.159.47.13:1883
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
clientid: mqttx
|
||||||
|
qos: 0
|
||||||
|
topic: test
|
||||||
|
|
||||||
# RabbitMQ配置
|
# RabbitMQ配置
|
||||||
mq:
|
mq:
|
||||||
queueName: queue
|
queueName: queue
|
||||||
|
|
|
@ -4,8 +4,7 @@ server:
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
main:
|
|
||||||
allow-bean-definition-overriding: true
|
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: couplet-system
|
name: couplet-system
|
||||||
|
|
|
@ -6,6 +6,8 @@ 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
|
||||||
|
@ -23,12 +25,14 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,11 +57,13 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.couplet.msg.domain;
|
package com.couplet.trouble.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;
|
||||||
|
@ -12,14 +13,14 @@ import java.util.Date;
|
||||||
/**
|
/**
|
||||||
* @author DongXiaoDong
|
* @author DongXiaoDong
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @date 2024/3/31 21:18
|
* @date 2024/4/2 15:14
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TroubleLog {
|
public class CoupletTroubleLog {
|
||||||
/**
|
/**
|
||||||
* 故障记录Id
|
* 故障记录Id
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +32,7 @@ public class TroubleLog {
|
||||||
private String troubleLogCode;
|
private String troubleLogCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 故障记录车辆VIN
|
* 故障码VIN
|
||||||
*/
|
*/
|
||||||
private String troubleLogVin;
|
private String troubleLogVin;
|
||||||
|
|
||||||
|
@ -48,4 +49,5 @@ public class TroubleLog {
|
||||||
@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;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,52 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,60 +0,0 @@
|
||||||
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,32 +19,6 @@
|
||||||
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"/>
|
||||||
|
@ -64,23 +38,4 @@
|
||||||
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>
|
||||||
|
|
19
pom.xml
19
pom.xml
|
@ -260,6 +260,25 @@
|
||||||
<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