Merge remote-tracking branch 'origin/dev.wei'
# Conflicts: # cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarInformationController.java # cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/controller/CarMessageController.java # cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/domain/CarMessage.java # cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/mapper/CarInformationMapper.java # cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/CarMessageService.java # cloud-modules/cloud-modules-car/src/main/java/com/muyu/car/service/Impl/CarInformationServiceImpl.java # cloud-modules/cloud-modules-car/src/main/resources/mapper/car/CarInformationMapper.xml # pom.xmlmaster
commit
c415b7676f
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>cloud-faultmanage</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-faultmanage-client</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,14 @@
|
||||||
|
package com.muyu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu
|
||||||
|
* @Project:Default (Template) Project
|
||||||
|
* @name:${NAME}
|
||||||
|
* @Date:2024/9/17 23:27
|
||||||
|
*/
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello world!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,32 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-faultmanage</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-faultmanage-common</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.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger.core.v3</groupId>
|
||||||
|
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||||
|
<version>2.2.8</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.cloud.annotate;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.annotate
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultField
|
||||||
|
* @Date:2024/9/24 9:16
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
public @interface FaultField {
|
||||||
|
String name(); //假设FaultCondition中有一个相同名字的字段或可以映射到它的字段
|
||||||
|
}
|
|
@ -0,0 +1,214 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.faultrule
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:PureElectricCar
|
||||||
|
* @Date:2024/9/20 20:22
|
||||||
|
*/
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class CarFaultRule {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* VIN码VIN码VIN码
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
/**
|
||||||
|
* 时间戳时间戳时间戳
|
||||||
|
*/
|
||||||
|
private long timestamp;
|
||||||
|
/**
|
||||||
|
* 经度经度经度
|
||||||
|
*/
|
||||||
|
private double longitude;
|
||||||
|
/**
|
||||||
|
* 纬度纬度纬度
|
||||||
|
*/
|
||||||
|
private double latitude;
|
||||||
|
/**
|
||||||
|
* 车速车速车速
|
||||||
|
*/
|
||||||
|
private double speed;
|
||||||
|
/**
|
||||||
|
* 总里程总里程总里程
|
||||||
|
*/
|
||||||
|
private Long tm;
|
||||||
|
/**
|
||||||
|
* 总电压总电压总电压
|
||||||
|
*/
|
||||||
|
private double tv;
|
||||||
|
/**
|
||||||
|
* 总电流总电流总电流
|
||||||
|
*/
|
||||||
|
private double cc;
|
||||||
|
/**
|
||||||
|
* 绝缘电阻绝缘电阻绝缘电阻
|
||||||
|
*/
|
||||||
|
private double ir;
|
||||||
|
/**
|
||||||
|
* 档位档位档位
|
||||||
|
*/
|
||||||
|
private String gp;
|
||||||
|
/**
|
||||||
|
* 加速踏板行程值加速踏板行程值加速踏板行程值
|
||||||
|
*/
|
||||||
|
private double aptv;
|
||||||
|
/**
|
||||||
|
* 制动踏板行程值制动踏板行程值制动踏板行程值
|
||||||
|
*/
|
||||||
|
private double bptv;
|
||||||
|
/**
|
||||||
|
* 燃料消耗率燃料消耗率燃料消耗率
|
||||||
|
*/
|
||||||
|
private double sfc;
|
||||||
|
/**
|
||||||
|
* 电机控制器温度电机控制器温度电机控制器温度
|
||||||
|
*/
|
||||||
|
private double mct;
|
||||||
|
/**
|
||||||
|
* 电机转速电机转速电机转速
|
||||||
|
*/
|
||||||
|
private int ms;
|
||||||
|
/**
|
||||||
|
* 电机转矩电机转矩电机转矩
|
||||||
|
*/
|
||||||
|
private double mto;
|
||||||
|
/**
|
||||||
|
* 电机温度电机温度电机温度
|
||||||
|
*/
|
||||||
|
private double mte;
|
||||||
|
/**
|
||||||
|
* 电机电压电机电压电机电压
|
||||||
|
*/
|
||||||
|
private double mv;
|
||||||
|
/**
|
||||||
|
* 电机电流电机电流电机电流
|
||||||
|
*/
|
||||||
|
private double mc;
|
||||||
|
/**
|
||||||
|
* 动力电池剩余电量SOC动力电池剩余电量SOC动力电池剩余电量SOC
|
||||||
|
*/
|
||||||
|
private double pbrsoc;
|
||||||
|
/**
|
||||||
|
* 当前状态允许的最大反馈功率当前状态允许的最大反馈功率当前状态允许的最大反馈功率
|
||||||
|
*/
|
||||||
|
private double macsfp;
|
||||||
|
/**
|
||||||
|
* 当前状态允许最大放电功率当前状态允许最大放电功率当前状态允许最大放电功率
|
||||||
|
*/
|
||||||
|
private double csatmdp;
|
||||||
|
/**
|
||||||
|
* BMS自检计数器BMS自检计数器BMS自检计数器
|
||||||
|
*/
|
||||||
|
private int bms;
|
||||||
|
/**
|
||||||
|
* 动力电池充放电电流动力电池充放电电流动力电池充放电电流
|
||||||
|
*/
|
||||||
|
private double cadc;
|
||||||
|
/**
|
||||||
|
* 动力电池负载端总电压V3动力电池负载端总电压V3动力电池负载端总电压V3
|
||||||
|
*/
|
||||||
|
private double pbletvv3;
|
||||||
|
/**
|
||||||
|
* 单次最大电压单次最大电压单次最大电压
|
||||||
|
*/
|
||||||
|
private double smv;
|
||||||
|
/**
|
||||||
|
* 单体电池最低电压单体电池最低电压单体电池最低电压
|
||||||
|
*/
|
||||||
|
private double mvoab;
|
||||||
|
/**
|
||||||
|
* 单体电池最高温度单体电池最高温度单体电池最高温度
|
||||||
|
*/
|
||||||
|
private double maxbt;
|
||||||
|
/**
|
||||||
|
* 单体电池最低温度单体电池最低温度单体电池最低温度
|
||||||
|
*/
|
||||||
|
private double minbt;
|
||||||
|
/**
|
||||||
|
* 动力电池可用容量动力电池可用容量动力电池可用容量
|
||||||
|
*/
|
||||||
|
private double pbac;
|
||||||
|
/**
|
||||||
|
* 车辆状态车辆状态车辆状态
|
||||||
|
*/
|
||||||
|
private String vs;
|
||||||
|
/**
|
||||||
|
* 充电状态充电状态充电状态
|
||||||
|
*/
|
||||||
|
private String cs;
|
||||||
|
/**
|
||||||
|
* 运行状态运行状态运行状态
|
||||||
|
*/
|
||||||
|
private String rs;
|
||||||
|
/**
|
||||||
|
* SOCSOCSOC
|
||||||
|
*/
|
||||||
|
private double soc;
|
||||||
|
/**
|
||||||
|
* 可充电储能装置工作状态可充电储能装置工作状态可充电储能装置工作状态
|
||||||
|
*/
|
||||||
|
private String resdwc;
|
||||||
|
/**
|
||||||
|
* EASEASEAS
|
||||||
|
*/
|
||||||
|
private String eas;
|
||||||
|
/**
|
||||||
|
* PTCPTCPTC
|
||||||
|
*/
|
||||||
|
private String ptc;
|
||||||
|
/**
|
||||||
|
* EPSEPSEPS
|
||||||
|
*/
|
||||||
|
private String eps;
|
||||||
|
/**
|
||||||
|
* ABSABSABS
|
||||||
|
*/
|
||||||
|
private String abs;
|
||||||
|
/**
|
||||||
|
* MCUMCUMCU
|
||||||
|
*/
|
||||||
|
private String mcu;
|
||||||
|
/**
|
||||||
|
* 动力电池加热状态动力电池加热状态动力电池加热状态
|
||||||
|
*/
|
||||||
|
private String pbhs;
|
||||||
|
/**
|
||||||
|
* 动力电池当前状态动力电池当前状态动力电池当前状态
|
||||||
|
*/
|
||||||
|
private String pbcs;
|
||||||
|
/**
|
||||||
|
* 动力电池保温状态动力电池保温状态动力电池保温状态
|
||||||
|
*/
|
||||||
|
private String pbis;
|
||||||
|
/**
|
||||||
|
* DCDCDCDCDCDC
|
||||||
|
*/
|
||||||
|
private String dcdc;
|
||||||
|
/**
|
||||||
|
* CHGCHGCHG
|
||||||
|
*/
|
||||||
|
private String chg;
|
||||||
|
/**
|
||||||
|
* 校验位校验位校验位
|
||||||
|
*/
|
||||||
|
private byte chb;
|
||||||
|
/**
|
||||||
|
* 截止位截止位截止位
|
||||||
|
*/
|
||||||
|
private byte cub;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,124 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarInformation
|
||||||
|
* @Date:2024/9/23 22:29
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "企业车辆管理实体类",autoResultMap = true)
|
||||||
|
public class CarInformation {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆Id
|
||||||
|
*/
|
||||||
|
private Long carInformationId;
|
||||||
|
/**
|
||||||
|
* 车辆唯一VIN固定(不可修改)
|
||||||
|
*/
|
||||||
|
private String carInformationVIN;
|
||||||
|
/**
|
||||||
|
* 车牌号
|
||||||
|
*/
|
||||||
|
private String carInformationLicensePlate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆品牌
|
||||||
|
*/
|
||||||
|
private String carInformationBrand;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆颜色
|
||||||
|
*/
|
||||||
|
private String carInformationColor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆驾驶员
|
||||||
|
*/
|
||||||
|
private String carInformationDriver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车检到期日期
|
||||||
|
* 固定(不可修改)
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
|
||||||
|
private Date carInformationExamineEnddata;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机厂商
|
||||||
|
*/
|
||||||
|
private String carInformationMotorManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电机型号
|
||||||
|
*/
|
||||||
|
private String carInformationMotorModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池厂商
|
||||||
|
*/
|
||||||
|
private String carInformationBatteryManufacturer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电池型号
|
||||||
|
*/
|
||||||
|
private String carInformationBatteryModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆电子围栏外键ID
|
||||||
|
*/
|
||||||
|
private Integer carInformationFence;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型外键ID
|
||||||
|
*/
|
||||||
|
private Integer carInformationType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否重点车辆 (0否默认 1是 )
|
||||||
|
*/
|
||||||
|
private Integer carInformationFocus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用状态(1.在线 2.离线 3.已断开 4.待连接 5.维修中)
|
||||||
|
*/
|
||||||
|
private Integer carInformationState;
|
||||||
|
|
||||||
|
|
||||||
|
//车辆类型表
|
||||||
|
/**
|
||||||
|
* 车辆类型ID
|
||||||
|
*/
|
||||||
|
private Integer carTypeId;
|
||||||
|
/**
|
||||||
|
* 车辆类型名
|
||||||
|
*/
|
||||||
|
private String carTypeName;
|
||||||
|
|
||||||
|
//电子围栏
|
||||||
|
/**
|
||||||
|
*电子围栏ID
|
||||||
|
*/
|
||||||
|
private Integer fenceid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电子围栏名
|
||||||
|
*/
|
||||||
|
private String fencename;
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarType
|
||||||
|
* @Date:2024/9/21 19:01
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_type",autoResultMap = true)
|
||||||
|
public class CarType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型ID
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
* 车辆类型名
|
||||||
|
*/
|
||||||
|
private String carTypeName;
|
||||||
|
/**
|
||||||
|
* 车辆规则外键ID
|
||||||
|
*/
|
||||||
|
private long carTypeRules;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCode
|
||||||
|
* @Date:2024/9/17 14:55
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_faultcode",autoResultMap = true)
|
||||||
|
public class FaultCode {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*故障码Id
|
||||||
|
*/
|
||||||
|
@TableId(value = "faultcode_id",type = IdType.AUTO)
|
||||||
|
private long faultcodeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
*故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
*故障组
|
||||||
|
*/
|
||||||
|
private String faultGroup;
|
||||||
|
/**
|
||||||
|
*故障位
|
||||||
|
*/
|
||||||
|
private String faultBit;
|
||||||
|
/**
|
||||||
|
*故障值
|
||||||
|
*/
|
||||||
|
private String faultValue;
|
||||||
|
/**
|
||||||
|
*是否警告
|
||||||
|
*/
|
||||||
|
private Integer isWarning;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static FaultCode addfaultcode(FaultCodeAddReq faultCodeAddReq){
|
||||||
|
return FaultCode.builder()
|
||||||
|
.faultcodeId(0)
|
||||||
|
.messageTypeId(faultCodeAddReq.getMessageTypeId())
|
||||||
|
.faultcodeNumber(faultCodeAddReq.getFaultcodeNumber())
|
||||||
|
.faultGroup(faultCodeAddReq.getFaultGroup())
|
||||||
|
.faultBit(faultCodeAddReq.getFaultBit())
|
||||||
|
.faultValue(faultCodeAddReq.getFaultValue())
|
||||||
|
.isWarning(faultCodeAddReq.getIsWarning())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionUpdReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultCondition
|
||||||
|
* @Date:2024/9/21 19:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_fault_condition",autoResultMap = true)
|
||||||
|
public class FaultCondition {
|
||||||
|
/**
|
||||||
|
* 故障规则表Id
|
||||||
|
*/
|
||||||
|
@TableId(value = "carcondition_id",type = IdType.AUTO)
|
||||||
|
private long carconditionId;
|
||||||
|
/**
|
||||||
|
* 车辆类型Id
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 故障条件
|
||||||
|
*/
|
||||||
|
private String faultconditionIdentification;
|
||||||
|
/**
|
||||||
|
* 故障规则参数
|
||||||
|
*/
|
||||||
|
private BigDecimal faultconditionParameter;
|
||||||
|
/**
|
||||||
|
* 车辆类型名称
|
||||||
|
*/
|
||||||
|
private String carTypeName;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
|
||||||
|
|
||||||
|
public static FaultCondition faultConditionadd(FaultConditionAddReq faultConditionAddReq){
|
||||||
|
return FaultCondition.builder()
|
||||||
|
.carTypeId(faultConditionAddReq.getCarTypeId())
|
||||||
|
.messageTypeId(faultConditionAddReq.getMessageTypeId())
|
||||||
|
.faultconditionIdentification(faultConditionAddReq.getFaultconditionIdentification())
|
||||||
|
.faultconditionParameter(faultConditionAddReq.getFaultconditionParameter())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static FaultCondition faultConditionupd(FaultConditionUpdReq faultConditionUpdReq, Supplier<Long> idSupplier){
|
||||||
|
return FaultCondition.builder()
|
||||||
|
.carconditionId(faultConditionUpdReq.getCarconditionId())
|
||||||
|
.carTypeId(faultConditionUpdReq.getCarTypeId())
|
||||||
|
.messageTypeId(faultConditionUpdReq.getMessageTypeId())
|
||||||
|
.faultconditionIdentification(faultConditionUpdReq.getFaultconditionIdentification())
|
||||||
|
.faultconditionParameter(faultConditionUpdReq.getFaultconditionParameter())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultLabel
|
||||||
|
* @Date:2024/9/17 15:06
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障标签
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_fault_label",autoResultMap = true)
|
||||||
|
public class FaultLabel {
|
||||||
|
/**
|
||||||
|
*自增主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "message_type_id",type = IdType.AUTO)
|
||||||
|
private String messageTypeId;
|
||||||
|
/**
|
||||||
|
*报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
/**
|
||||||
|
*报文名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
*报文所属类别
|
||||||
|
*/
|
||||||
|
private String messageTypeBelongs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLog
|
||||||
|
* @Date:2024/9/19 0:42
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_fault_log",autoResultMap = true)
|
||||||
|
public class FaultLog {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障日志Id
|
||||||
|
*/
|
||||||
|
@TableId(value = "log_id",type = IdType.AUTO)
|
||||||
|
private long logId;
|
||||||
|
/**
|
||||||
|
* 故障码Id
|
||||||
|
*/
|
||||||
|
private long faultcodeId;
|
||||||
|
/**
|
||||||
|
* 车辆Id
|
||||||
|
*/
|
||||||
|
private long carInformationId;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date startwarningTime;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date endwarningTime;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
* 车辆vin
|
||||||
|
*/
|
||||||
|
private String carInformationVIN;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultReport
|
||||||
|
* @Date:2024/9/20 20:36
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class FaultReport {
|
||||||
|
|
||||||
|
private String VehicleType;
|
||||||
|
private String FaultDescription;
|
||||||
|
}
|
|
@ -0,0 +1,66 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRule
|
||||||
|
* @Date:2024/9/19 22:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_fault_condition",autoResultMap = true)
|
||||||
|
public class FaultRule {
|
||||||
|
/**
|
||||||
|
* 触发条件Id
|
||||||
|
*/
|
||||||
|
private long conditionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码Id
|
||||||
|
*/
|
||||||
|
private long faultcodeId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 触发条件描述
|
||||||
|
*/
|
||||||
|
private String conditionContent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单个参数的阈值
|
||||||
|
*/
|
||||||
|
private BigDecimal singleThreshold;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区间参数的阈值的最小值
|
||||||
|
*/
|
||||||
|
private BigDecimal minThreshold;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区间参数的阈值的最大值
|
||||||
|
*/
|
||||||
|
private BigDecimal maxThreshold;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 触发条件是否激活
|
||||||
|
*/
|
||||||
|
private Integer isActive;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆数据值
|
||||||
|
*/
|
||||||
|
private BigDecimal Threshold;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultType
|
||||||
|
* @Date:2024/9/17 15:03
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* 故障类型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_fault_type",autoResultMap = true)
|
||||||
|
public class FaultType {
|
||||||
|
/**
|
||||||
|
*故障类型Id
|
||||||
|
*/
|
||||||
|
@TableId(value = "faulttype_id",type = IdType.AUTO)
|
||||||
|
private long faulttypeId;
|
||||||
|
/**
|
||||||
|
*故障类型名称
|
||||||
|
*/
|
||||||
|
private String faulttypeName;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:Vehicle
|
||||||
|
* @Date:2024/9/20 20:44
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class Vehicle {
|
||||||
|
/**
|
||||||
|
* 车辆VIN 唯一标识
|
||||||
|
*/
|
||||||
|
private String VIN;
|
||||||
|
/**
|
||||||
|
* g故障信息
|
||||||
|
*/
|
||||||
|
private String faultmessage;
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.message;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:Message
|
||||||
|
* @Date:2024/9/22 10:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@TableName(value = "car_fault_message",autoResultMap = true)
|
||||||
|
public class Message {
|
||||||
|
/**
|
||||||
|
* id
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送者
|
||||||
|
*/
|
||||||
|
private String sender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 接收者
|
||||||
|
*/
|
||||||
|
private String receiver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date createTime;
|
||||||
|
/**
|
||||||
|
* 登录人Id
|
||||||
|
*/
|
||||||
|
private long userId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.message;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageReq
|
||||||
|
* @Date:2024/9/22 11:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class MessageReq {
|
||||||
|
/**
|
||||||
|
* 消息状态
|
||||||
|
*/
|
||||||
|
private Integer status;
|
||||||
|
/**
|
||||||
|
* 登录人Id
|
||||||
|
*/
|
||||||
|
private long userId;
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.message;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageReq
|
||||||
|
* @Date:2024/9/22 11:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class MessageSendReq {
|
||||||
|
/**
|
||||||
|
* 发送者
|
||||||
|
*/
|
||||||
|
private String sender;
|
||||||
|
/**
|
||||||
|
* 接收者
|
||||||
|
*/
|
||||||
|
private String receiver;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 登录人Id
|
||||||
|
*/
|
||||||
|
private long userId;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "消息创建时间",defaultValue = "2024-8-9 10:47:57",type = "String")
|
||||||
|
private Date createTime;
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.message;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.message
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:User
|
||||||
|
* @Date:2024/9/23 9:34
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class User {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
private String username;
|
||||||
|
private String email;
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultCodeAddReq
|
||||||
|
* @Date:2024/9/18 10:12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultCodeAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
* 故障分类Id
|
||||||
|
*/
|
||||||
|
private long faulttypeId;
|
||||||
|
/**
|
||||||
|
* 是否产生报警
|
||||||
|
*/
|
||||||
|
private Integer isWarning;
|
||||||
|
/**
|
||||||
|
* 故障描述
|
||||||
|
*/
|
||||||
|
private String faultContent;
|
||||||
|
/**
|
||||||
|
*故障组
|
||||||
|
*/
|
||||||
|
private String faultGroup;
|
||||||
|
/**
|
||||||
|
*故障位
|
||||||
|
*/
|
||||||
|
private String faultBit;
|
||||||
|
/**
|
||||||
|
*故障值
|
||||||
|
*/
|
||||||
|
private String faultValue;
|
||||||
|
/**
|
||||||
|
*报文所属类别
|
||||||
|
*/
|
||||||
|
private String messageTypeBelongs;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeListReq
|
||||||
|
* @Date:2024/9/17 15:55
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Tag(name = "故障码列表请求对象")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultCodeListReq {
|
||||||
|
/**
|
||||||
|
*故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
*故障位
|
||||||
|
*/
|
||||||
|
private String faultBit;
|
||||||
|
/**
|
||||||
|
* 页码,从1开始
|
||||||
|
*/
|
||||||
|
private Integer pageNum=1;
|
||||||
|
/**
|
||||||
|
* 每页大小
|
||||||
|
*/
|
||||||
|
private Integer pageSize=10;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,79 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultCodeAddReq
|
||||||
|
* @Date:2024/9/18 10:12
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultCodeUpdReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*故障码Id
|
||||||
|
*/
|
||||||
|
private long faultcodeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
* 故障分类Id
|
||||||
|
*/
|
||||||
|
private long faulttypeId;
|
||||||
|
/**
|
||||||
|
* 是否产生报警
|
||||||
|
*/
|
||||||
|
private Integer isWarning;
|
||||||
|
/**
|
||||||
|
* 故障描述
|
||||||
|
*/
|
||||||
|
private String faultContent;
|
||||||
|
/**
|
||||||
|
*故障状态
|
||||||
|
*/
|
||||||
|
private Integer faultStatus;
|
||||||
|
/**
|
||||||
|
*故障组
|
||||||
|
*/
|
||||||
|
private String faultGroup;
|
||||||
|
/**
|
||||||
|
*故障位
|
||||||
|
*/
|
||||||
|
private String faultBit;
|
||||||
|
/**
|
||||||
|
*故障值
|
||||||
|
*/
|
||||||
|
private String faultValue;
|
||||||
|
/**
|
||||||
|
*报文所属类别
|
||||||
|
*/
|
||||||
|
private String messageTypeBelongs;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultConditionAddReq
|
||||||
|
* @Date:2024/9/21 21:02
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultConditionAddReq {
|
||||||
|
/**
|
||||||
|
* 故障规则表Id
|
||||||
|
*/
|
||||||
|
private long carconditionId;
|
||||||
|
/**
|
||||||
|
* 车辆类型Id
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 故障条件
|
||||||
|
*/
|
||||||
|
private String faultconditionIdentification;
|
||||||
|
/**
|
||||||
|
* 故障规则参数
|
||||||
|
*/
|
||||||
|
private BigDecimal faultconditionParameter;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultCondition
|
||||||
|
* @Date:2024/9/21 20:02
|
||||||
|
*/
|
||||||
|
@Tag(name = "故障规则列表请求对象")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultConditionListReq {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型Id
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 页码,从1开始
|
||||||
|
*/
|
||||||
|
private Integer pageNum=1;
|
||||||
|
/**
|
||||||
|
* 每页大小
|
||||||
|
*/
|
||||||
|
private Integer pageSize=10;
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultConditionUpdReq
|
||||||
|
* @Date:2024/9/22 9:38
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultConditionUpdReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则表Id
|
||||||
|
*/
|
||||||
|
private long carconditionId;
|
||||||
|
/**
|
||||||
|
* 车辆类型Id
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 故障条件
|
||||||
|
*/
|
||||||
|
private String faultconditionIdentification;
|
||||||
|
/**
|
||||||
|
* 故障规则参数
|
||||||
|
*/
|
||||||
|
private BigDecimal faultconditionParameter;
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.req
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogReq
|
||||||
|
* @Date:2024/9/20 9:38
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Tag(name = "故障日志列表请求对象")
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class FaultLogListReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码Id
|
||||||
|
*/
|
||||||
|
private long faultcodeId;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date startwarningTime;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date endwarningTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页码,从1开始
|
||||||
|
*/
|
||||||
|
private Integer pageNum=1;
|
||||||
|
/**
|
||||||
|
* 每页大小
|
||||||
|
*/
|
||||||
|
private Integer pageSize=10;
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.resp;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.vo.FaultCodeVO;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.resp
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeListResp
|
||||||
|
* @Date:2024/9/17 15:41
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name="故障码信息响应对象",description = "故障码查询的响应结果")
|
||||||
|
public class FaultCodeListResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*故障码Id
|
||||||
|
*/
|
||||||
|
private long faultcodeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
*故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
*故障组
|
||||||
|
*/
|
||||||
|
private String faultGroup;
|
||||||
|
/**
|
||||||
|
*故障位
|
||||||
|
*/
|
||||||
|
private String faultBit;
|
||||||
|
/**
|
||||||
|
*故障值
|
||||||
|
*/
|
||||||
|
private String faultValue;
|
||||||
|
/**
|
||||||
|
*是否警告
|
||||||
|
*/
|
||||||
|
private Integer isWarning;
|
||||||
|
/**
|
||||||
|
*故障类型名称
|
||||||
|
*/
|
||||||
|
private String faulttypeName;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
/**
|
||||||
|
*报文所属类别
|
||||||
|
*/
|
||||||
|
private String messageTypeBelongs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库对象构建为返回结果对象
|
||||||
|
* @param faultCodeVO
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static FaultCodeListResp faultCodeListResp(FaultCodeVO faultCodeVO){
|
||||||
|
return FaultCodeListResp.builder()
|
||||||
|
.faultcodeId(faultCodeVO.getFaultcodeId())
|
||||||
|
.messageTypeId(faultCodeVO.getMessageTypeId())
|
||||||
|
.faultcodeNumber(faultCodeVO.getFaultcodeNumber())
|
||||||
|
.faultGroup(faultCodeVO.getFaultGroup())
|
||||||
|
.faultBit(faultCodeVO.getFaultBit())
|
||||||
|
.faultValue(faultCodeVO.getFaultValue())
|
||||||
|
.isWarning(faultCodeVO.getIsWarning())
|
||||||
|
.faulttypeName(faultCodeVO.getFaulttypeName())
|
||||||
|
.messageTypeName(faultCodeVO.getMessageTypeName())
|
||||||
|
.messageTypeCode(faultCodeVO.getMessageTypeCode())
|
||||||
|
.messageTypeBelongs(faultCodeVO.getMessageTypeBelongs())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.resp;
|
||||||
|
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.resp
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeTotalListResp
|
||||||
|
* @Date:2024/9/17 15:44
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name="数据总数列表",description = "数据和总数的响应")
|
||||||
|
public class FaultCodeTotalListResp {
|
||||||
|
|
||||||
|
|
||||||
|
private List<FaultCodeListResp> faultCodeListRespList;
|
||||||
|
|
||||||
|
private long total;
|
||||||
|
|
||||||
|
public static FaultCodeTotalListResp faultCodeTotalListResp(List<FaultCodeListResp> faultCodeListRespList,long total){
|
||||||
|
FaultCodeTotalListResp faultCodeTotalListResp = new FaultCodeTotalListResp();
|
||||||
|
faultCodeTotalListResp.setFaultCodeListRespList(faultCodeListRespList);
|
||||||
|
faultCodeTotalListResp.setTotal(total);
|
||||||
|
return faultCodeTotalListResp;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,75 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.resp
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultConditionResp
|
||||||
|
* @Date:2024/9/21 19:59
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name="故障规则信息响应对象",description = "故障规则查询的响应结果")
|
||||||
|
public class FaultConditionListResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则表Id
|
||||||
|
*/
|
||||||
|
private long carconditionId;
|
||||||
|
/**
|
||||||
|
* 车辆类型Id
|
||||||
|
*/
|
||||||
|
private long carTypeId;
|
||||||
|
/**
|
||||||
|
*故障名称Id
|
||||||
|
*/
|
||||||
|
private long messageTypeId;
|
||||||
|
/**
|
||||||
|
* 故障条件
|
||||||
|
*/
|
||||||
|
private String faultconditionIdentification;
|
||||||
|
/**
|
||||||
|
* 故障规则参数
|
||||||
|
*/
|
||||||
|
private BigDecimal faultconditionParameter;
|
||||||
|
/**
|
||||||
|
* 车辆类型名称
|
||||||
|
*/
|
||||||
|
private String carTypeName;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库对象构建为返回结果对象
|
||||||
|
* @param faultCondition
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static FaultConditionListResp faultConditionListResp(FaultCondition faultCondition){
|
||||||
|
return FaultConditionListResp.builder()
|
||||||
|
.carconditionId(faultCondition.getCarconditionId())
|
||||||
|
.carTypeId(faultCondition.getCarTypeId())
|
||||||
|
.messageTypeId(faultCondition.getMessageTypeId())
|
||||||
|
.faultconditionParameter(faultCondition.getFaultconditionParameter())
|
||||||
|
.faultconditionIdentification(faultCondition.getFaultconditionIdentification())
|
||||||
|
.carTypeName(faultCondition.getCarTypeName())
|
||||||
|
.messageTypeName(faultCondition.getMessageTypeName())
|
||||||
|
.messageTypeCode(faultCondition.getMessageTypeCode())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.resp
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultConditionTotalListResp
|
||||||
|
* @Date:2024/9/21 20:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name="故障规则数据总数列表",description = "数据和总数的响应")
|
||||||
|
public class FaultConditionTotalListResp {
|
||||||
|
|
||||||
|
private List<FaultConditionListResp> faultConditionListRespList;
|
||||||
|
|
||||||
|
private long total;
|
||||||
|
|
||||||
|
public static FaultConditionTotalListResp faultConditionTotalListResp(List<FaultConditionListResp> faultConditionListRespList,long total){
|
||||||
|
FaultConditionTotalListResp faultConditionTotalListResp = new FaultConditionTotalListResp();
|
||||||
|
faultConditionTotalListResp.setFaultConditionListRespList(faultConditionListRespList);
|
||||||
|
faultConditionTotalListResp.setTotal(total);
|
||||||
|
return faultConditionTotalListResp;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLog;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.resp
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogResp
|
||||||
|
* @Date:2024/9/20 9:43
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Tag(name="故障日志信息响应对象",description = "故障日志的响应结果")
|
||||||
|
public class FaultLogListResp {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障日志Id
|
||||||
|
*/
|
||||||
|
private long logId;
|
||||||
|
/**
|
||||||
|
* 故障码Id
|
||||||
|
*/
|
||||||
|
private long faultcodeId;
|
||||||
|
/**
|
||||||
|
* 车辆Id
|
||||||
|
*/
|
||||||
|
private long carInformationId;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
private String carVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "开始报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date startwarningTime;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "结束报警时间",defaultValue = "2024-8-9 10:47:57",type = "Date")
|
||||||
|
private Date endwarningTime;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
*/
|
||||||
|
private String faultcodeNumber;
|
||||||
|
/**
|
||||||
|
* 车辆vin
|
||||||
|
*/
|
||||||
|
private String carInformationVIN;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据库对象构建为返回结果对象
|
||||||
|
* @param faultLog
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static FaultLogListResp faultLogListResp(FaultLog faultLog){
|
||||||
|
return FaultLogListResp.builder()
|
||||||
|
.logId(faultLog.getLogId())
|
||||||
|
.faultcodeId(faultLog.getFaultcodeId())
|
||||||
|
.carInformationId(faultLog.getCarInformationId())
|
||||||
|
.carVin(faultLog.getCarVin())
|
||||||
|
.startwarningTime(faultLog.getStartwarningTime())
|
||||||
|
.endwarningTime(faultLog.getEndwarningTime())
|
||||||
|
.faultcodeNumber(faultLog.getFaultcodeNumber())
|
||||||
|
.carInformationVIN(faultLog.getCarInformationVIN())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.resp;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.resp
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogTotalListResp
|
||||||
|
* @Date:2024/9/20 11:18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Tag(name="故障日志数据总数列表",description = "数据和总数的响应")
|
||||||
|
public class FaultLogTotalListResp {
|
||||||
|
|
||||||
|
private List<FaultLogListResp> faultLogListRespList;
|
||||||
|
|
||||||
|
private long total;
|
||||||
|
|
||||||
|
public static FaultLogTotalListResp faultLogTotalListResp(List<FaultLogListResp> faultLogListRespList,long total){
|
||||||
|
FaultLogTotalListResp faultLogTotalListResp = new FaultLogTotalListResp();
|
||||||
|
faultLogTotalListResp.setFaultLogListRespList(faultLogListRespList);
|
||||||
|
faultLogTotalListResp.setTotal(total);
|
||||||
|
return faultLogTotalListResp;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.cloud.faultmanage.domain.vo;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCode;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.domain.vo
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeVO
|
||||||
|
* @Date:2024/9/17 15:14
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class FaultCodeVO extends FaultCode {
|
||||||
|
/**
|
||||||
|
*故障类型名称
|
||||||
|
*/
|
||||||
|
private String faulttypeName;
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
*/
|
||||||
|
private String messageTypeName;
|
||||||
|
/**
|
||||||
|
* 报文编码
|
||||||
|
*/
|
||||||
|
private String messageTypeCode;
|
||||||
|
/**
|
||||||
|
*报文所属类别
|
||||||
|
*/
|
||||||
|
private String messageTypeBelongs;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -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.muyu</groupId>
|
||||||
|
<artifactId>cloud-faultmanage</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-faultmanage-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>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.muyu;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu
|
||||||
|
* @Project:Default (Template) Project
|
||||||
|
* @name:${NAME}
|
||||||
|
* @Date:2024/9/17 23:28
|
||||||
|
*/
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello world!");
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**/target/
|
||||||
|
!**/src/test/**/target/
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/jarRepositories.xml
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/libraries/
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
!**/src/main/**/build/
|
||||||
|
!**/src/test/**/build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
|
||||||
|
### Mac OS ###
|
||||||
|
.DS_Store
|
|
@ -0,0 +1,159 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-faultmanage</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-faultmanage-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>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-faultmanage-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 图片上传 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.16.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 邮箱依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 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>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 接口模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-api-doc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- XllJob定时任务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-xxl</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--rqbbit公共依赖-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-common-rabbit</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 文件上传 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpmime</artifactId>
|
||||||
|
<version>4.5.14</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JSON -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>1.2.41</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>cloud-faultmanage</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>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version> <!-- 使用适合你的项目的版本 -->
|
||||||
|
<configuration>
|
||||||
|
<compilerArgs>
|
||||||
|
<arg>-parameters</arg>
|
||||||
|
</compilerArgs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.cloud.faultmanage;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:MuYuFaultManageApplication
|
||||||
|
* @Date:2024/9/16 21:16
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MuYuFaultManageApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(MuYuFaultManageApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.service.CarTypeService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarTypeController
|
||||||
|
* @Date:2024/9/21 19:01
|
||||||
|
*/
|
||||||
|
@RequestMapping("/cartype")
|
||||||
|
@RestController
|
||||||
|
public class CarTypeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CarTypeService carTypeService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Operation(summary = "车辆类型",description = "车辆类型信息")
|
||||||
|
public Result carTypeList(){
|
||||||
|
return Result.success(carTypeService.selectcarType());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeUpdReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultCodeTotalListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultCodeService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeController
|
||||||
|
* @Date:2024/9/17 14:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆故障码
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faultcode")
|
||||||
|
public class FaultCodeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultCodeService faultCodeService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码展示(仅故障码单表)
|
||||||
|
* @param faultCodeListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/list")
|
||||||
|
@Operation(summary = "故障码列表(单)",description = "展示故障码信息")
|
||||||
|
public Result<FaultCodeTotalListResp> selectlist(@Validated @RequestBody FaultCodeListReq faultCodeListReq){
|
||||||
|
return Result.success(faultCodeService.selectlist(faultCodeListReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码展示(故障码联查)
|
||||||
|
* @param faultCodeListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultcodelist")
|
||||||
|
@Operation(summary = "故障码列表(多)",description = "展示故障码信息")
|
||||||
|
public Result<FaultCodeTotalListResp> selectfaultcodelist(@Validated @RequestBody FaultCodeListReq faultCodeListReq){
|
||||||
|
return Result.success(faultCodeService.selectfaultcodelist(faultCodeListReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障码
|
||||||
|
* @param faultCodeAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultcodeadd")
|
||||||
|
@Operation(summary = "新增故障码",description = "新增故障码信息")
|
||||||
|
public Result insertfaultcode(@Validated @RequestBody FaultCodeAddReq faultCodeAddReq){
|
||||||
|
faultCodeService.insert(faultCodeAddReq);
|
||||||
|
return Result.success(null,"新增成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障码
|
||||||
|
* @param faultCodeUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultcodeupd")
|
||||||
|
@Operation(summary = "修改故障码",description = "修改故障码信息")
|
||||||
|
public Result updfaultcode(@Validated @RequestBody FaultCodeUpdReq faultCodeUpdReq){
|
||||||
|
faultCodeService.upd(faultCodeUpdReq);
|
||||||
|
return Result.success(null,"修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障码
|
||||||
|
* @param messageTypeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultcodedel/{messageTypeId}")
|
||||||
|
@Operation(summary = "删除故障码",description = "删除故障码信息")
|
||||||
|
public Result delfaultcode(@PathVariable("messageTypeId") Integer messageTypeId){
|
||||||
|
faultCodeService.del(messageTypeId);
|
||||||
|
return Result.success(null,"删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionUpdReq;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultConditionService;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultRuleService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleController
|
||||||
|
* @Date:2024/9/19 22:10
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障检测
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faultcondition")
|
||||||
|
public class FaultConditionController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultConditionService faultConditionService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则
|
||||||
|
* @param faultConditionListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Operation(summary = "故障规则列表展示",description = "故障规则列表展示")
|
||||||
|
public Result getfaultrulelist(@RequestBody @Validated FaultConditionListReq faultConditionListReq){
|
||||||
|
return Result.success(faultConditionService.getfaultrulelist(faultConditionListReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则添加
|
||||||
|
* @param faultConditionAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultconditionadd")
|
||||||
|
@Operation(summary = "添加规则",description = "添加故障规则")
|
||||||
|
public Result faultconditionadd(@RequestBody FaultConditionAddReq faultConditionAddReq){
|
||||||
|
//判断车辆类型是否已存在所对应的故障规则
|
||||||
|
List<FaultCondition> faultConditionList = faultConditionService.selectBytypeAndlabel(faultConditionAddReq);
|
||||||
|
if (faultConditionList.size()>0){
|
||||||
|
return Result.error("此车辆类型已存在所对应的故障规则,无需重新制定,可在原规则上进行修改");
|
||||||
|
}
|
||||||
|
faultConditionService.save(FaultCondition.faultConditionadd(faultConditionAddReq));
|
||||||
|
return Result.success(null,"规则制定成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则修改
|
||||||
|
* @param
|
||||||
|
* @param faultConditionUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultconditionupd")
|
||||||
|
@Operation(summary = "修改规则",description = "修改故障规则")
|
||||||
|
public Result faultconditionupd(
|
||||||
|
@RequestBody @Validated FaultConditionUpdReq faultConditionUpdReq){
|
||||||
|
faultConditionService.updateById(FaultCondition.faultConditionupd(faultConditionUpdReq,()->faultConditionUpdReq.getCarconditionId()));
|
||||||
|
return Result.success(null,"规则修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则删除
|
||||||
|
* @param carconditionId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/faultconditiondel/{carconditionId}")
|
||||||
|
@Operation(summary = "删除规则",description = "删除故障规则")
|
||||||
|
public Result faultconditiondel(@PathVariable("carconditionId") long carconditionId){
|
||||||
|
faultConditionService.removeById(carconditionId);
|
||||||
|
return Result.success(null,"规则删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultDetectionStrategyController
|
||||||
|
* @Date:2024/9/21 14:18
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faultdetectionstrategy")
|
||||||
|
public class FaultDetectionStrategyController {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeController
|
||||||
|
* @Date:2024/9/18 20:58
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultLabelService;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultTypeService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码分类
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faultlabel")
|
||||||
|
public class FaultLabelController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultLabelService faultLabelService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Operation(summary = "故障名称查询",description = "故障名称信息")
|
||||||
|
public Result findfaulttype(){
|
||||||
|
return Result.success(faultLabelService.select());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLog;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultLogListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultLogService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogController
|
||||||
|
* @Date:2024/9/20 9:30
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faultlog")
|
||||||
|
public class FaultLogController {
|
||||||
|
@Autowired
|
||||||
|
private FaultLogService faultLogService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障日志列表
|
||||||
|
* @param faultLogListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Operation(summary = "故障日志列表",description = "故障日志列表展示")
|
||||||
|
public Result selectfaultlog(@Validated @RequestBody FaultLogListReq faultLogListReq){
|
||||||
|
return Result.success(faultLogService.selectfaultlog(faultLogListReq));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarFaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.Vehicle;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultRuleService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleController
|
||||||
|
* @Date:2024/9/19 22:10
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障检测
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faultrule")
|
||||||
|
public class FaultRuleController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultRuleService faultRuleService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障参数匹配检查
|
||||||
|
* @param carFaultRule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/cheakfaults")
|
||||||
|
@Operation(summary = "故障参数匹配检查",description = "获取报文数据与故障参数进行比较")
|
||||||
|
public Result cheakfaults(@Validated @RequestBody CarFaultRule carFaultRule){
|
||||||
|
List<Vehicle> checkfault = faultRuleService.checkfault(carFaultRule);
|
||||||
|
return Result.success(checkfault);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeController
|
||||||
|
* @Date:2024/9/18 20:58
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultTypeService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码分类
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/faulttype")
|
||||||
|
public class FaultTypeController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultTypeService faultTypeService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码分类查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
@Operation(summary = "故障码分类查询",description = "故障码分类信息")
|
||||||
|
public Result findfaulttype(){
|
||||||
|
return Result.success(faultTypeService.select());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package com.muyu.cloud.faultmanage.controller;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.Message;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.MessageReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.MessageSendReq;
|
||||||
|
import com.muyu.cloud.faultmanage.service.MessageService;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.controller
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageController
|
||||||
|
* @Date:2024/9/22 10:56
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/message")
|
||||||
|
public class MessageController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MessageService messageService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息发送
|
||||||
|
* @param messageSendReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/sendmessage")
|
||||||
|
@Operation(summary = "发送消息",description = "站内信消息发送")
|
||||||
|
public Result sendmessage(@Validated MessageSendReq messageSendReq){
|
||||||
|
messageService.sendmessage(messageSendReq);
|
||||||
|
return Result.success(null,"发送成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息查看
|
||||||
|
* @param messageReq
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/messagelist")
|
||||||
|
@Operation(summary = "消息查看(能根据登录人新的信息查看当前登录人的消息栏)",description = "消息查看")
|
||||||
|
public Result selectmessage(@Validated @RequestBody MessageReq messageReq){
|
||||||
|
return Result.success(messageService.selectmessage(messageReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看消息改变状态
|
||||||
|
* @param message
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/changestatus")
|
||||||
|
@Operation(summary = "状态改变",description = "状态改变")
|
||||||
|
public Result changestatus(@RequestBody Message message){
|
||||||
|
messageService.changestatus(message);
|
||||||
|
return Result.success(null,"成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看未读的消息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/unread")
|
||||||
|
@Operation(summary = "查看未读的消息",description = "查看未读的消息")
|
||||||
|
public Result unread(){
|
||||||
|
return Result.success(messageService.unread());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarType;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarTypeMapper
|
||||||
|
* @Date:2024/9/21 19:06
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface CarTypeMapper extends BaseMapper<CarType> {
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCode;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLabel;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeUpdReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.vo.FaultCodeVO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeMapper
|
||||||
|
* @Date:2024/9/17 14:52
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FaultCodeMapper extends BaseMapper<FaultCodeVO> {
|
||||||
|
|
||||||
|
List<FaultCodeVO> selectfaultcodelist(FaultCodeListReq faultCodeListReq);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//新增故障码
|
||||||
|
FaultLabel selectfaultName(@Param("messageTypeName") String messageTypeName);
|
||||||
|
FaultCode selectfaultCode(@Param("faultcodeNumber") String faultcodeNumber);
|
||||||
|
Integer insertfaultlabel(FaultCodeAddReq faultCodeAddReq);
|
||||||
|
Integer insertfaultcode(FaultCodeAddReq faultCodeAddReq);
|
||||||
|
|
||||||
|
//修改故障码
|
||||||
|
Integer updfaultlabel(FaultCodeUpdReq faultCodeUpdReq);
|
||||||
|
Integer updfaultcode(FaultCodeUpdReq faultCodeUpdReq);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Integer delfaultcode(@Param("messageTypeId") long messageTypeId);
|
||||||
|
Integer delfaultlabel(@Param("messageTypeId") long messageTypeId);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionListReq;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleMapper
|
||||||
|
* @Date:2024/9/19 22:11
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FaultConditionMapper extends BaseMapper<FaultCondition> {
|
||||||
|
|
||||||
|
List<FaultCondition> selectfaultconditionlist(FaultConditionListReq faultConditionListReq);
|
||||||
|
|
||||||
|
|
||||||
|
List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq);
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLabel;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultType;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeMapper
|
||||||
|
* @Date:2024/9/18 20:59
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FaultLabelMapper extends BaseMapper<FaultLabel> {
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLog;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultLogListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultLogListResp;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogMapper
|
||||||
|
* @Date:2024/9/20 9:33
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FaultLogMapper extends BaseMapper<FaultLog> {
|
||||||
|
|
||||||
|
|
||||||
|
List<FaultLog> selectfaultLogMapper(FaultLogListReq faultLogListReq);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarFaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarInformation;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleMapper
|
||||||
|
* @Date:2024/9/19 22:11
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FaultRuleMapper extends BaseMapper<CarFaultRule> {
|
||||||
|
|
||||||
|
CarInformation selectTypeByVIN(@Param("vin") String vin);
|
||||||
|
|
||||||
|
List<FaultCondition> selectruleByType(@Param("carInformationType") Integer carInformationType);
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultType;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeMapper
|
||||||
|
* @Date:2024/9/18 20:59
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface FaultTypeMapper extends BaseMapper<FaultType> {
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.cloud.faultmanage.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.Message;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.mapper
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageMapper
|
||||||
|
* @Date:2024/9/22 11:54
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MessageMapper extends BaseMapper<Message> {
|
||||||
|
void changestatus(Message message);
|
||||||
|
|
||||||
|
List<Message> unread();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarTypeService
|
||||||
|
* @Date:2024/9/21 19:08
|
||||||
|
*/
|
||||||
|
public interface CarTypeService extends IService<CarType> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<CarType> selectcarType();
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeUpdReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultCodeTotalListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.vo.FaultCodeVO;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeService
|
||||||
|
* @Date:2024/9/17 14:53
|
||||||
|
*/
|
||||||
|
public interface FaultCodeService extends IService<FaultCodeVO> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码展示
|
||||||
|
* @param faultCodeListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FaultCodeTotalListResp selectlist(FaultCodeListReq faultCodeListReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码展示(故障码联查)
|
||||||
|
* @param faultCodeListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FaultCodeTotalListResp selectfaultcodelist(FaultCodeListReq faultCodeListReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障码
|
||||||
|
* @param faultCodeAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void insert(FaultCodeAddReq faultCodeAddReq);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障码
|
||||||
|
* @param faultCodeUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void upd(FaultCodeUpdReq faultCodeUpdReq);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障码
|
||||||
|
* @param messageTypeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void del(Integer messageTypeId);
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultConditionTotalListResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleService
|
||||||
|
* @Date:2024/9/19 22:10
|
||||||
|
*/
|
||||||
|
public interface FaultConditionService extends IService<FaultCondition> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则
|
||||||
|
* @param faultConditionListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FaultConditionTotalListResp getfaultrulelist(FaultConditionListReq faultConditionListReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则添加
|
||||||
|
* @param faultConditionAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq);
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultDetectionStrategy
|
||||||
|
* @Date:2024/9/20 19:40
|
||||||
|
*/
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarFaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultReport;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.Vehicle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障检测策略的接口
|
||||||
|
*/
|
||||||
|
public interface FaultDetectionStrategy {
|
||||||
|
|
||||||
|
FaultReport detectFaults(CarFaultRule carFaultRule);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLabel;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeService
|
||||||
|
* @Date:2024/9/18 20:59
|
||||||
|
*/
|
||||||
|
public interface FaultLabelService extends IService<FaultLabel> {
|
||||||
|
/**
|
||||||
|
* 故障名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FaultLabel> select();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLog;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultLogListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultLogListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultLogTotalListResp;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogService
|
||||||
|
* @Date:2024/9/20 9:34
|
||||||
|
*/
|
||||||
|
public interface FaultLogService extends IService<FaultLog> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障日志列表
|
||||||
|
* @param faultLogListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
FaultLogTotalListResp selectfaultlog(FaultLogListReq faultLogListReq);
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarFaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.Vehicle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleService
|
||||||
|
* @Date:2024/9/19 22:10
|
||||||
|
*/
|
||||||
|
public interface FaultRuleService extends IService<CarFaultRule> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障参数匹配检查
|
||||||
|
* @param carFaultRule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Vehicle> checkfault(CarFaultRule carFaultRule);
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeService
|
||||||
|
* @Date:2024/9/18 20:59
|
||||||
|
*/
|
||||||
|
public interface FaultTypeService extends IService<FaultType> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码分类查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<FaultType> select();
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.Message;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.MessageReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.MessageSendReq;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageService
|
||||||
|
* @Date:2024/9/22 10:57
|
||||||
|
*/
|
||||||
|
public interface MessageService extends IService<Message> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息发送
|
||||||
|
* @param messageSendReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void sendmessage(MessageSendReq messageSendReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息查看
|
||||||
|
* @param messageReq
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Message> selectmessage(MessageReq messageReq);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看消息改变状态
|
||||||
|
* @param message
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void changestatus(Message message);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看未读的消息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Message> unread();
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarType;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.CarTypeMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.CarTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarTypeServiceImpl
|
||||||
|
* @Date:2024/9/21 19:08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CarTypeServiceImpl extends ServiceImpl<CarTypeMapper, CarType> implements CarTypeService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CarTypeMapper carTypeMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<CarType> selectcarType() {
|
||||||
|
LambdaQueryWrapper<CarType> carTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
List<CarType> list = this.list(carTypeLambdaQueryWrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,124 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCode;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLabel;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultCodeUpdReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultCodeListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultCodeTotalListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.vo.FaultCodeVO;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultCodeMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultCodeService;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-faultmanage
|
||||||
|
* @name:FaultCodeServiceImpl
|
||||||
|
* @Date:2024/9/17 14:53
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FaultCodeServiceImpl extends ServiceImpl<FaultCodeMapper, FaultCodeVO> implements FaultCodeService {
|
||||||
|
@Autowired
|
||||||
|
private FaultCodeMapper faultCodeMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码展示
|
||||||
|
* @param faultCodeListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public FaultCodeTotalListResp selectlist(FaultCodeListReq faultCodeListReq) {
|
||||||
|
Integer pageNum = faultCodeListReq.getPageNum();
|
||||||
|
Integer pageSize = faultCodeListReq.getPageSize();
|
||||||
|
LambdaQueryWrapper<FaultCodeVO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(StringUtils.isNotEmpty(faultCodeListReq.getFaultcodeNumber()),
|
||||||
|
FaultCodeVO::getFaultcodeNumber,faultCodeListReq.getFaultcodeNumber());
|
||||||
|
queryWrapper.eq(StringUtils.isNotEmpty(faultCodeListReq.getFaultBit()),
|
||||||
|
FaultCodeVO::getFaultBit,faultCodeListReq.getFaultBit());
|
||||||
|
long count = this.count(queryWrapper);
|
||||||
|
queryWrapper.last("LIMIT "+ ((pageNum-1)*pageSize)+", "+pageSize);
|
||||||
|
List<FaultCodeVO> faultCodeVOList = this.list(queryWrapper);
|
||||||
|
List<FaultCodeListResp> faultCodeListRespList = faultCodeVOList.stream()
|
||||||
|
.map(FaultCodeListResp::faultCodeListResp)
|
||||||
|
.toList();
|
||||||
|
return FaultCodeTotalListResp.faultCodeTotalListResp(faultCodeListRespList,count);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码展示(故障码联查)
|
||||||
|
* @param faultCodeListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public FaultCodeTotalListResp selectfaultcodelist(FaultCodeListReq faultCodeListReq) {
|
||||||
|
LambdaQueryWrapper<FaultCodeVO> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
long count = this.count(queryWrapper);
|
||||||
|
int offset = (faultCodeListReq.getPageNum() - 1) * faultCodeListReq.getPageSize();
|
||||||
|
faultCodeListReq.setPageNum(offset);
|
||||||
|
List<FaultCodeVO> selectfaultcodelist = faultCodeMapper.selectfaultcodelist(faultCodeListReq);
|
||||||
|
List<FaultCodeListResp> faultCodeListRespList = selectfaultcodelist.stream()
|
||||||
|
.map(FaultCodeListResp::faultCodeListResp)
|
||||||
|
.toList();
|
||||||
|
return FaultCodeTotalListResp.faultCodeTotalListResp(faultCodeListRespList,count);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障码
|
||||||
|
* @param faultCodeAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void insert(FaultCodeAddReq faultCodeAddReq) {
|
||||||
|
//判断故障名称或故障码是否存在,若都不存在先添加故障名称表,在添加故障码表
|
||||||
|
//1.判断故障名称是否存在
|
||||||
|
String messageTypeName = faultCodeAddReq.getMessageTypeName();
|
||||||
|
FaultLabel faultLabel = faultCodeMapper.selectfaultName(messageTypeName);
|
||||||
|
//2.判断故障码是否存在
|
||||||
|
String faultcodeNumber = faultCodeAddReq.getFaultcodeNumber();
|
||||||
|
FaultCode faultCode = faultCodeMapper.selectfaultCode(faultcodeNumber);
|
||||||
|
if (faultLabel==null && faultCode==null){
|
||||||
|
faultCodeMapper.insertfaultlabel(faultCodeAddReq);
|
||||||
|
faultCodeMapper.insertfaultcode(faultCodeAddReq);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障码
|
||||||
|
* @param faultCodeUpdReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void upd(FaultCodeUpdReq faultCodeUpdReq) {
|
||||||
|
//修改故障名称表信息和故障码表信息
|
||||||
|
// faultCodeMapper.updfaultlabel(faultCodeUpdReq);
|
||||||
|
faultCodeMapper.updfaultcode(faultCodeUpdReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障码
|
||||||
|
* @param messageTypeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void del(Integer messageTypeId) {
|
||||||
|
|
||||||
|
//删除故障码表信息
|
||||||
|
faultCodeMapper.delfaultcode(messageTypeId);
|
||||||
|
//删除对应的故障名称表信息
|
||||||
|
faultCodeMapper.delfaultlabel(messageTypeId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultCondition;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionAddReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultConditionListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultCodeListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultCodeTotalListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultConditionListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultConditionTotalListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.vo.FaultCodeVO;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultConditionMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultRuleMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultConditionService;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultRuleService;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleServiceImpl
|
||||||
|
* @Date:2024/9/19 22:10
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FaultConditionServiceImpl extends ServiceImpl<FaultConditionMapper, FaultCondition> implements FaultConditionService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultConditionMapper faultConditionMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则
|
||||||
|
* @param faultConditionListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public FaultConditionTotalListResp getfaultrulelist(FaultConditionListReq faultConditionListReq) {
|
||||||
|
LambdaQueryWrapper<FaultCondition> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
long count = this.count(queryWrapper);
|
||||||
|
int offset = (faultConditionListReq.getPageNum() - 1) * faultConditionListReq.getPageSize();
|
||||||
|
faultConditionListReq.setPageNum(offset);
|
||||||
|
|
||||||
|
List<FaultCondition> selectfaultconditionlist = faultConditionMapper.selectfaultconditionlist(faultConditionListReq);
|
||||||
|
List<FaultConditionListResp> faultConditionListRespList = selectfaultconditionlist.stream()
|
||||||
|
.map(FaultConditionListResp::faultConditionListResp)
|
||||||
|
.toList();
|
||||||
|
return FaultConditionTotalListResp.faultConditionTotalListResp(faultConditionListRespList,count);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障规则添加 判断故障规则是否存在
|
||||||
|
* @param faultConditionAddReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<FaultCondition> selectBytypeAndlabel(FaultConditionAddReq faultConditionAddReq) {
|
||||||
|
List<FaultCondition> faultConditionList = faultConditionMapper.selectBytypeAndlabel(faultConditionAddReq);
|
||||||
|
return faultConditionList;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLabel;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultType;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultLabelMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultTypeMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultLabelService;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeServiceImpl
|
||||||
|
* @Date:2024/9/18 21:00
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FaultLabelServiceImpl extends ServiceImpl<FaultLabelMapper, FaultLabel> implements FaultLabelService {
|
||||||
|
@Autowired
|
||||||
|
private FaultLabelMapper faultLabelMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障信息查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<FaultLabel> select() {
|
||||||
|
LambdaQueryWrapper<FaultLabel> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
List<FaultLabel> list = this.list(queryWrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultLog;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.req.FaultLogListReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultLogListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.resp.FaultLogTotalListResp;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultLogMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultLogService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultLogServiceImpl
|
||||||
|
* @Date:2024/9/20 9:34
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FaultLogServiceImpl extends ServiceImpl<FaultLogMapper, FaultLog> implements FaultLogService {
|
||||||
|
@Autowired
|
||||||
|
private FaultLogMapper faultLogMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障日志列表
|
||||||
|
* @param faultLogListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public FaultLogTotalListResp selectfaultlog(FaultLogListReq faultLogListReq) {
|
||||||
|
LambdaQueryWrapper<FaultLog> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
long count = this.count(queryWrapper);
|
||||||
|
int offset = (faultLogListReq.getPageNum() - 1) * faultLogListReq.getPageSize();
|
||||||
|
faultLogListReq.setPageNum(offset);
|
||||||
|
List<FaultLog> faultLogListResps = faultLogMapper.selectfaultLogMapper(faultLogListReq);
|
||||||
|
List<FaultLogListResp> faultLogListRespList = faultLogListResps.stream()
|
||||||
|
.map(FaultLogListResp::faultLogListResp)
|
||||||
|
.toList();
|
||||||
|
return FaultLogTotalListResp.faultLogTotalListResp(faultLogListRespList,count);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,103 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.*;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultRuleMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultRuleService;
|
||||||
|
import org.apache.poi.ss.formula.functions.Intercept;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultRuleServiceImpl
|
||||||
|
* @Date:2024/9/19 22:10
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class FaultRuleServiceImpl extends ServiceImpl<FaultRuleMapper, CarFaultRule> implements FaultRuleService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FaultRuleMapper faultRuleMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障参数匹配检查
|
||||||
|
* @param carFaultRule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> checkfault(CarFaultRule carFaultRule) {
|
||||||
|
List<Vehicle> vehicles = new ArrayList<>();
|
||||||
|
//根据车辆VIN判断它属于什么类型的车辆
|
||||||
|
CarInformation carInformation = faultRuleMapper.selectTypeByVIN(carFaultRule.getVin());
|
||||||
|
Integer carInformationType = carInformation.getCarInformationType();
|
||||||
|
//根据车辆类型,查询表获取对应的类型的故障规则
|
||||||
|
List<FaultCondition> faultConditionList = faultRuleMapper.selectruleByType(carInformationType);
|
||||||
|
//获取当前类的所有字段,不包括继承的
|
||||||
|
Class<? extends CarFaultRule> carFaultRuleClass = carFaultRule.getClass();
|
||||||
|
Field[] declaredFields = carFaultRuleClass.getDeclaredFields();
|
||||||
|
for (Field declaredField : declaredFields) {
|
||||||
|
//确保可以访问私有字段
|
||||||
|
declaredField.setAccessible(true);
|
||||||
|
try {
|
||||||
|
//获取字段的值
|
||||||
|
Object value = declaredField.get(carFaultRule);
|
||||||
|
if (value != null && declaredField.get(carFaultRule)!=null) {
|
||||||
|
// 遍历faultConditionList,查找匹配的FaultCondition
|
||||||
|
for (FaultCondition faultCondition : faultConditionList) {
|
||||||
|
if (faultCondition.getMessageTypeCode().equals(declaredField.getName())){
|
||||||
|
String faultconditionIdentification = faultCondition.getFaultconditionIdentification();
|
||||||
|
BigDecimal faultconditionParameter = faultCondition.getFaultconditionParameter();
|
||||||
|
// 尝试将值转换为BigDecimal
|
||||||
|
BigDecimal bigDecimalValue = null;
|
||||||
|
if (value instanceof Number) {
|
||||||
|
Number numberValue = (Number) value;
|
||||||
|
if (numberValue instanceof Long || numberValue instanceof Integer) {
|
||||||
|
bigDecimalValue = BigDecimal.valueOf(numberValue.longValue());
|
||||||
|
} else if (numberValue instanceof Double || numberValue instanceof Float) {
|
||||||
|
// 注意:Double转BigDecimal可能会引入精度问题,因为Double本身可能不精确
|
||||||
|
// 如果需要精确控制,可以考虑从源头使用BigDecimal
|
||||||
|
bigDecimalValue = BigDecimal.valueOf(numberValue.doubleValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断条件选择
|
||||||
|
if (faultconditionIdentification.equals(">") || faultconditionIdentification.equals(">") ){
|
||||||
|
if (bigDecimalValue.compareTo(faultconditionParameter)>0){
|
||||||
|
vehicles.add(new Vehicle(carFaultRule.getVin(),declaredField.getName()+"超出规定范围"));
|
||||||
|
}
|
||||||
|
}else if(faultconditionIdentification.equals("<") || faultconditionIdentification.equals("<")){
|
||||||
|
if (bigDecimalValue.compareTo(faultconditionParameter)<0){
|
||||||
|
vehicles.add(new Vehicle(carFaultRule.getVin(),declaredField.getName()+"过低"));
|
||||||
|
}
|
||||||
|
}else if(faultconditionIdentification.equals(">=") || faultconditionIdentification.equals(">=")){
|
||||||
|
if (bigDecimalValue.compareTo(faultconditionParameter)>=0){
|
||||||
|
vehicles.add(new Vehicle(carFaultRule.getVin(),declaredField.getName()+"超出规定范围")) ;
|
||||||
|
}
|
||||||
|
}else if(faultconditionIdentification.equals("<=") || faultconditionIdentification.equals("<=")){
|
||||||
|
if (bigDecimalValue.compareTo(faultconditionParameter)<=0){
|
||||||
|
vehicles.add(new Vehicle(carFaultRule.getVin(),declaredField.getName()+"过低"));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
if (bigDecimalValue.compareTo(faultconditionParameter)==0){
|
||||||
|
vehicles.add(new Vehicle(carFaultRule.getVin(),declaredField.getName()+"已达到故障点"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return vehicles;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultType;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.FaultTypeMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultTypeService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FaultTypeServiceImpl
|
||||||
|
* @Date:2024/9/18 21:00
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class FaultTypeServiceImpl extends ServiceImpl<FaultTypeMapper, FaultType> implements FaultTypeService {
|
||||||
|
@Autowired
|
||||||
|
private FaultTypeMapper faultTypeMapper;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障码分类查询
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<FaultType> select() {
|
||||||
|
LambdaQueryWrapper<FaultType> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
List<FaultType> list = this.list(queryWrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,126 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.Message;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.MessageReq;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.MessageSendReq;
|
||||||
|
import com.muyu.cloud.faultmanage.mapper.MessageMapper;
|
||||||
|
import com.muyu.cloud.faultmanage.service.MessageService;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.common.security.service.TokenService;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageServiceImpl
|
||||||
|
* @Date:2024/9/22 10:57
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MessageServiceImpl extends ServiceImpl<MessageMapper,Message> implements MessageService {
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
@Autowired
|
||||||
|
private HttpServletRequest request;
|
||||||
|
@Autowired
|
||||||
|
private MessageMapper messageMapper;
|
||||||
|
/**
|
||||||
|
* 消息发送
|
||||||
|
* @param messageSendReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void sendmessage(MessageSendReq messageSendReq) {
|
||||||
|
String token = SecurityUtils.getToken();// 获取当前Token
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
|
||||||
|
if (loginUser == null) {
|
||||||
|
throw new RuntimeException("用户未登录或Token无效");
|
||||||
|
}
|
||||||
|
Long userid = loginUser.getUserid();
|
||||||
|
messageSendReq.setUserId(userid);
|
||||||
|
|
||||||
|
// 定义一个DateTimeFormatter对象,用于格式化日期时间为yyyy-MM-dd HH:mm:ss
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// 获取当前日期和时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 使用formatter格式化当前日期和时间
|
||||||
|
String formattedDateTime = now.format(formatter);
|
||||||
|
// 使用formatter将字符串解析回LocalDateTime
|
||||||
|
LocalDateTime parsedDateTime = LocalDateTime.parse(formattedDateTime, formatter);
|
||||||
|
// 然后按照上面的步骤将LocalDateTime转换为Date
|
||||||
|
ZonedDateTime zdt = parsedDateTime.atZone(ZoneId.systemDefault());
|
||||||
|
Date date = Date.from(zdt.toInstant());
|
||||||
|
// 现在date是一个包含了字符串中日期和时间的Date对象
|
||||||
|
messageSendReq.setCreateTime(date);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息查看
|
||||||
|
* @param messageReq
|
||||||
|
* @param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Message> selectmessage(MessageReq messageReq) {
|
||||||
|
String token = SecurityUtils.getToken();// 获取当前Token
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
|
||||||
|
if (loginUser == null) {
|
||||||
|
throw new RuntimeException("用户未登录或Token无效");
|
||||||
|
}
|
||||||
|
Long userid = loginUser.getUserid();
|
||||||
|
messageReq.setUserId(userid);
|
||||||
|
LambdaQueryWrapper<Message> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
// queryWrapper.eq(StringUtils.isNotEmpty(String.valueOf(messageReq.getStatus())),
|
||||||
|
// Message::getStatus,messageReq.getStatus());
|
||||||
|
// queryWrapper.eq(StringUtils.isNotEmpty(String.valueOf(messageReq.getUserId())),
|
||||||
|
// Message::getUserId,messageReq.getUserId());
|
||||||
|
if (messageReq.getStatus() != null) {
|
||||||
|
queryWrapper.eq(Message::getStatus, messageReq.getStatus());
|
||||||
|
}
|
||||||
|
queryWrapper.eq(Message::getUserId, messageReq.getUserId());
|
||||||
|
List<Message> list = this.list(queryWrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看消息改变状态
|
||||||
|
* @param message
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void changestatus(Message message) {
|
||||||
|
messageMapper.changestatus(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看未读的消息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Message> unread() {
|
||||||
|
return messageMapper.unread();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl.faultDetectionStrategy;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl.faultDetectionStrategy
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:FuelVehicleCarFaultDetectionStrategy
|
||||||
|
* @Date:2024/9/20 20:00
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对燃油车的故障检测逻辑
|
||||||
|
*/
|
||||||
|
@Service(value = "FuelVehicleCar")
|
||||||
|
public class FuelVehicleCarFaultDetectionStrategy {
|
||||||
|
}
|
|
@ -0,0 +1,198 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.impl.faultDetectionStrategy;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.CarFaultRule;
|
||||||
|
import com.muyu.cloud.faultmanage.domain.FaultReport;
|
||||||
|
import com.muyu.cloud.faultmanage.service.FaultDetectionStrategy;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.impl.faultDetectionStrategy
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:CarFaultDetectionStrategy
|
||||||
|
* @Date:2024/9/20 19:44
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 针对纯电车的故障检测逻辑
|
||||||
|
*/
|
||||||
|
@Service(value = "PureElectricCar")
|
||||||
|
public class PureElectricCarFaultDetectionStrategy implements FaultDetectionStrategy {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FaultReport detectFaults(CarFaultRule carFaultRule) {
|
||||||
|
|
||||||
|
|
||||||
|
//检测车速是否处于正常范围
|
||||||
|
if (carFaultRule.getSpeed()>200 || carFaultRule.getSpeed()<0){
|
||||||
|
return new FaultReport("纯电车","车速不在正常范围内,请注意");
|
||||||
|
}
|
||||||
|
//检测总里程数是否超过正常数
|
||||||
|
if (carFaultRule.getTm()>5000000){
|
||||||
|
return new FaultReport("纯电车","总里程数已超标,请注意");
|
||||||
|
}
|
||||||
|
//检测总电压是否正常
|
||||||
|
if (carFaultRule.getTv()>650){
|
||||||
|
return new FaultReport("纯电车","总电压过高,请注意");
|
||||||
|
}
|
||||||
|
//检测电流是否超标
|
||||||
|
if (carFaultRule.getCc()>50){
|
||||||
|
return new FaultReport("纯电车","电流过高,请注意");
|
||||||
|
}
|
||||||
|
//检测绝缘电阻
|
||||||
|
if (carFaultRule.getIr()>100000){
|
||||||
|
return new FaultReport("纯电车","绝缘电阻过高,请注意");
|
||||||
|
}
|
||||||
|
// //检测加速踏板行程值
|
||||||
|
// if (carFaultRule.getAPTV()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测制动踏板行程值
|
||||||
|
// if (carFaultRule.getBPTV()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测燃料消耗率
|
||||||
|
// if (carFaultRule.getSFC()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测电机控制器温度
|
||||||
|
// if (carFaultRule.getMCT()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测电机转速
|
||||||
|
// if (carFaultRule.getMS()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测电机转矩
|
||||||
|
// if (carFaultRule.getMTO()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测电机温度
|
||||||
|
// if (carFaultRule.getMTE()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测电机电压
|
||||||
|
// if (carFaultRule.getMV()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测电机电流
|
||||||
|
// if (carFaultRule.getMC()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池剩余电量SOC
|
||||||
|
// if (carFaultRule.getPBRSOC()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测当前状态允许的最大反馈功率
|
||||||
|
// if (carFaultRule.getMACSFP()){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测当前状态允许最大放电功率
|
||||||
|
// if (carFaultRule.getCSATMDP()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测BMS自检计数器
|
||||||
|
// if (carFaultRule.getBMS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池充放电电流
|
||||||
|
// if (carFaultRule.getCADC()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池负载端总电压V3
|
||||||
|
// if (carFaultRule.getPBLETVV3()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测单次最大电压
|
||||||
|
// if (carFaultRule.getSMV()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测单体电池最低电压
|
||||||
|
// if (carFaultRule.getMVOAB()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测单体电池最高温度
|
||||||
|
// if (carFaultRule.getMAXBT()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测单体电池最低温度
|
||||||
|
// if (carFaultRule.getMINBT()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池可用容量
|
||||||
|
// if (carFaultRule.getPBAC()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测车辆状态
|
||||||
|
// if (carFaultRule.getVS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测充电状态
|
||||||
|
// if (carFaultRule.getCS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测运行状态
|
||||||
|
// if (carFaultRule.getRS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测SOC
|
||||||
|
// if (carFaultRule.getSOC()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测可充电储能装置工作状态
|
||||||
|
// if (carFaultRule.getRESDWC()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测驱动电机状态
|
||||||
|
// if (carFaultRule.getEAS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测定位是否有效
|
||||||
|
// if (carFaultRule.getPTC()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测EAS
|
||||||
|
// if (carFaultRule.getEPS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测PTC
|
||||||
|
// if (carFaultRule.getABS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测EPS
|
||||||
|
// if (carFaultRule.getMCU()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测ABS
|
||||||
|
// if (carFaultRule.getPBHS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测MCU
|
||||||
|
// if (carFaultRule.getPBCS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池加热状态
|
||||||
|
// if (carFaultRule.getPBIS()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池当前状态
|
||||||
|
// if (carFaultRule.getDCDC()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测动力电池保温状态
|
||||||
|
// if (carFaultRule.getCHG()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测DCDC
|
||||||
|
// if (carFaultRule.getCHB()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// //检测CHG
|
||||||
|
// if (carFaultRule.getCUB()) {
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.message;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.Message;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.messageDao
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageDao
|
||||||
|
* @Date:2024/9/23 9:42
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据访问层,使用JDBC进行基本的数据库操作
|
||||||
|
*/
|
||||||
|
public class MessageDao {
|
||||||
|
|
||||||
|
|
||||||
|
private Connection connection;
|
||||||
|
|
||||||
|
|
||||||
|
public MessageDao(Connection connection){
|
||||||
|
this.connection=connection;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendMessage(Message message) throws Exception{
|
||||||
|
String sql="INSERT INTO `eight`.`car_fault_message` (`id`, `sender`, `receiver`, `content`, `status`, `create_time`, `user_id`) " +
|
||||||
|
"VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL)";
|
||||||
|
try(PreparedStatement pstmt=connection.prepareStatement(sql)){
|
||||||
|
pstmt.setString(1, message.getContent());
|
||||||
|
pstmt.setString(2, message.getSender());
|
||||||
|
pstmt.setString(3, message.getReceiver());
|
||||||
|
pstmt.setObject(4, message.getCreateTime());
|
||||||
|
pstmt.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.muyu.cloud.faultmanage.service.message;
|
||||||
|
|
||||||
|
import com.muyu.cloud.faultmanage.domain.message.Message;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneId;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:weiran
|
||||||
|
* @Package:com.muyu.cloud.faultmanage.service.message
|
||||||
|
* @Project:cloud-server-8
|
||||||
|
* @name:MessageService
|
||||||
|
* @Date:2024/9/23 9:48
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务逻辑层将负责实现消息的发送逻辑
|
||||||
|
*/
|
||||||
|
public class MessageService {
|
||||||
|
|
||||||
|
private MessageDao messageDao;
|
||||||
|
|
||||||
|
public MessageService(MessageDao messageDao){
|
||||||
|
this.messageDao=messageDao;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendMessage(String content,String sender,String receiver){
|
||||||
|
|
||||||
|
// 定义一个DateTimeFormatter对象,用于格式化日期时间为yyyy-MM-dd HH:mm:ss
|
||||||
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||||
|
// 获取当前日期和时间
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
// 使用formatter格式化当前日期和时间
|
||||||
|
String formattedDateTime = now.format(formatter);
|
||||||
|
// 使用formatter将字符串解析回LocalDateTime
|
||||||
|
LocalDateTime parsedDateTime = LocalDateTime.parse(formattedDateTime, formatter);
|
||||||
|
// 然后按照上面的步骤将LocalDateTime转换为Date
|
||||||
|
ZonedDateTime zdt = parsedDateTime.atZone(ZoneId.systemDefault());
|
||||||
|
Date date = Date.from(zdt.toInstant());
|
||||||
|
|
||||||
|
|
||||||
|
Message message = new Message();
|
||||||
|
message.setContent(content);
|
||||||
|
message.setSender(sender);
|
||||||
|
message.setReceiver(receiver);
|
||||||
|
message.setCreateTime(date);
|
||||||
|
|
||||||
|
try {
|
||||||
|
messageDao.sendMessage(message);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-faultmanage"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<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.muyu" 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>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-faultmanage"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.sky.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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/cloud-faultmanage"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
<property name="log.sky.pattern" value="%d{HH:mm:ss.SSS} %yellow([%tid]) [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.sky.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>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 使用gRpc将日志发送到skywalking服务端 -->
|
||||||
|
<appender name="GRPC_LOG" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
|
||||||
|
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
|
||||||
|
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
|
||||||
|
<Pattern>${log.sky.pattern}</Pattern>
|
||||||
|
</layout>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="GRPC_LOG"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?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.muyu.cloud.faultmanage.mapper.FaultCodeMapper">
|
||||||
|
<resultMap id="FaultCodeVoResult" type="com.muyu.cloud.faultmanage.domain.vo.FaultCodeVO">
|
||||||
|
<id property="faultcodeId" column="faultcode_id"></id>
|
||||||
|
<result property="messageTypeId" column="message_type_id"></result>
|
||||||
|
<result property="faultcodeNumber" column="faultcode_number"></result>
|
||||||
|
<result property="faultGroup" column="fault_group"></result>
|
||||||
|
<result property="faultBit" column="fault_bit"></result>
|
||||||
|
<result property="faultValue" column="fault_value"></result>
|
||||||
|
<result property="isWarning" column="is_warning"></result>
|
||||||
|
<result property="faulttypeName" column="faulttype_name"></result>
|
||||||
|
<result property="messageTypeName" column="message_type_name"></result>
|
||||||
|
<result property="messageTypeCode" column="message_type_code"></result>
|
||||||
|
<result property="messageTypeBelongs" column="message_type_belongs"></result>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectfaultcodelist" >
|
||||||
|
SELECT
|
||||||
|
car_faultcode.faultcode_id,
|
||||||
|
car_faultcode.message_type_id,
|
||||||
|
car_fault_label.message_type_code,
|
||||||
|
car_faultcode.faultcode_number,
|
||||||
|
car_faultcode.fault_group,
|
||||||
|
car_faultcode.fault_bit,
|
||||||
|
car_faultcode.fault_value,
|
||||||
|
car_fault_label.message_type_name,
|
||||||
|
car_faultcode.is_warning
|
||||||
|
FROM
|
||||||
|
car_faultcode
|
||||||
|
LEFT JOIN car_fault_label ON car_faultcode.message_type_id = car_fault_label.message_type_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!--故障码列表展示-->
|
||||||
|
<select id="selectfaultcodelist" resultMap="FaultCodeVoResult">
|
||||||
|
<include refid="selectfaultcodelist"></include>
|
||||||
|
<where>
|
||||||
|
<if test="faultcodeNumber!=null and faultcodeNumber!=''">
|
||||||
|
and car_faultcode.faultcode_number=#{faultcodeNumber}
|
||||||
|
</if>
|
||||||
|
<if test="faultBit!=null and faultBit!=''">
|
||||||
|
and car_faultcode.fault_bit=#{faultBit}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
limit #{pageNum},#{pageSize}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!--新增故障码-->
|
||||||
|
<select id="selectfaultName" resultType="com.muyu.cloud.faultmanage.domain.FaultLabel">
|
||||||
|
select * from car_fault_label where message_type_name=#{messageTypeName}
|
||||||
|
</select>
|
||||||
|
<select id="selectfaultCode" resultType="com.muyu.cloud.faultmanage.domain.FaultCode">
|
||||||
|
select * from car_faultcode where faultcode_number=#{faultcodeNumber}
|
||||||
|
</select>
|
||||||
|
<insert id="insertfaultlabel" keyProperty="messageTypeId" useGeneratedKeys="true">
|
||||||
|
INSERT INTO `eight`.`car_fault_label`
|
||||||
|
(`message_type_id`, `message_type_code`, `message_type_name`, `message_type_belongs`) VALUES
|
||||||
|
(0, #{messageTypeCode}, #{messageTypeName}, '车辆基础');
|
||||||
|
</insert>
|
||||||
|
<insert id="insertfaultcode">
|
||||||
|
INSERT INTO `eight`.`car_faultcode`
|
||||||
|
(`faultcode_id`, `message_type_id`, `faultcode_number`, `fault_group`, `fault_bit`, `fault_value`, `is_warning`) VALUES
|
||||||
|
(0, #{messageTypeId}, #{faultcodeNumber}, #{faultGroup}, #{faultBit}, #{faultValue}, #{isWarning});
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
<!--修改故障码-->
|
||||||
|
<update id="updfaultlabel">
|
||||||
|
UPDATE `eight`.`car_fault_label`
|
||||||
|
SET `message_type_code` = #{messageTypeCode},
|
||||||
|
`message_type_name` = #{messageTypeName},
|
||||||
|
`message_type_belongs` =#{messageTypeBelongs}
|
||||||
|
WHERE `message_type_id` = #{messageTypeId};
|
||||||
|
</update>
|
||||||
|
<update id="updfaultcode">
|
||||||
|
UPDATE `eight`.`car_faultcode`
|
||||||
|
SET `message_type_id` = #{messageTypeId},
|
||||||
|
`faultcode_number` = #{faultcodeNumber},
|
||||||
|
`fault_group` = #{faultGroup},
|
||||||
|
`fault_bit` = #{faultBit},
|
||||||
|
`fault_value` = #{faultValue},
|
||||||
|
`is_warning` = #{isWarning}
|
||||||
|
WHERE `faultcode_id` = #{faultcodeId};
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!--删除故障码-->
|
||||||
|
<select id="findByfaultcodeId" resultType="com.muyu.cloud.faultmanage.domain.FaultCode">
|
||||||
|
select * from car_faultcode where faultcode_id=#{faultcodeId}
|
||||||
|
</select>
|
||||||
|
<delete id="delfaultcode">
|
||||||
|
delete from car_faultcode where message_type_id=#{messageTypeId}
|
||||||
|
</delete>
|
||||||
|
<delete id="delfaultlabel">
|
||||||
|
delete from car_fault_label where message_type_id=#{messageTypeId}
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?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.muyu.cloud.faultmanage.mapper.FaultConditionMapper">
|
||||||
|
<resultMap id="FaultConditionResult" type="com.muyu.cloud.faultmanage.domain.FaultCondition">
|
||||||
|
<id property="carconditionId" column="carcondition_id"></id>
|
||||||
|
<result property="carTypeId" column="car_type_id"></result>
|
||||||
|
<result property="messageTypeId" column="message_type_id"></result>
|
||||||
|
<result property="faultconditionIdentification" column="faultcondition_identification"></result>
|
||||||
|
<result property="faultconditionParameter" column="faultcondition_parameter"></result>
|
||||||
|
<result property="carTypeName" column="car_type_name"></result>
|
||||||
|
<result property="messageTypeName" column="message_type_name"></result>
|
||||||
|
<result property="messageTypeCode" column="message_type_code"></result>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectfaultconditionlist" >
|
||||||
|
SELECT
|
||||||
|
car_fault_condition.*,
|
||||||
|
car_type.car_type_name,
|
||||||
|
car_fault_label.message_type_name,
|
||||||
|
car_fault_label.message_type_code
|
||||||
|
FROM
|
||||||
|
car_fault_condition
|
||||||
|
LEFT JOIN car_type ON car_fault_condition.car_type_id = car_type.car_type_id
|
||||||
|
LEFT JOIN car_fault_label ON car_fault_condition.message_type_id = car_fault_label.message_type_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectfaultconditionlist" resultType="com.muyu.cloud.faultmanage.domain.FaultCondition">
|
||||||
|
<include refid="selectfaultconditionlist"></include>
|
||||||
|
<where>
|
||||||
|
<if test="carTypeId!=null and carTypeId!=''">
|
||||||
|
and car_type.car_type_id=#{carTypeId}
|
||||||
|
</if>
|
||||||
|
<if test="messageTypeId!=null and messageTypeId!=''">
|
||||||
|
and car_fault_label.message_type_id=#{messageTypeId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
limit #{pageNum},#{pageSize}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBytypeAndlabel" resultType="com.muyu.cloud.faultmanage.domain.FaultCondition">
|
||||||
|
SELECT
|
||||||
|
car_fault_condition.*
|
||||||
|
FROM
|
||||||
|
car_fault_condition
|
||||||
|
where
|
||||||
|
car_fault_condition.car_type_id=#{carTypeId}
|
||||||
|
and car_fault_condition.message_type_id=#{messageTypeId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,45 @@
|
||||||
|
<?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.muyu.cloud.faultmanage.mapper.FaultLogMapper">
|
||||||
|
<resultMap id="FaultCodeLogResult" type="com.muyu.cloud.faultmanage.domain.FaultLog">
|
||||||
|
<id property="logId" column="log_id"></id>
|
||||||
|
<result property="faultcodeId" column="faultcode_id"></result>
|
||||||
|
<result property="carInformationId" column="car_information_id"></result>
|
||||||
|
<result property="carVin" column="car_vin"></result>
|
||||||
|
<result property="startwarningTime" column="startwarning_time"></result>
|
||||||
|
<result property="endwarningTime" column="endwarning_time"></result>
|
||||||
|
<result property="carInformationVIN" column="car_information_VIN"></result>
|
||||||
|
<result property="faultcodeNumber" column="faultcode_number"></result>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectfaultloglist">
|
||||||
|
SELECT
|
||||||
|
car_fault_log.*,
|
||||||
|
car_faultcode.faultcode_number,
|
||||||
|
car_information.car_information_VIN
|
||||||
|
FROM
|
||||||
|
car_fault_log
|
||||||
|
LEFT JOIN car_faultcode ON car_fault_log.faultcode_id = car_faultcode.faultcode_id
|
||||||
|
LEFT JOIN car_information ON car_fault_log.car_information_id = car_information.car_information_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!--日志列表-->
|
||||||
|
<select id="selectfaultLogMapper" resultType="com.muyu.cloud.faultmanage.domain.FaultLog">
|
||||||
|
<include refid="selectfaultloglist"></include>
|
||||||
|
<where>
|
||||||
|
<if test="carVin!=null and carVin!=''">
|
||||||
|
and car_fault_log.car_vin=#{carVin}
|
||||||
|
</if>
|
||||||
|
<if test="startwarningTime!=null and startwarningTime!=''">
|
||||||
|
and car_fault_log.startwarning_time=#{startwarningTime}
|
||||||
|
</if>
|
||||||
|
<if test="endwarningTime!=null and endwarningTime!=''">
|
||||||
|
and car_fault_log.endwarning_time=#{endwarningTime}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
limit #{pageNum},#{pageSize}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,71 @@
|
||||||
|
<?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.muyu.cloud.faultmanage.mapper.FaultRuleMapper">
|
||||||
|
<resultMap id="CarInformationResult" type="com.muyu.cloud.faultmanage.domain.CarInformation">
|
||||||
|
<id property="carInformationId" column="car_information_id"></id>
|
||||||
|
<result property="carInformationVIN" column="car_information_VIN"></result>
|
||||||
|
<result property="carInformationLicensePlate" column="car_information_license_plate"></result>
|
||||||
|
<result property="carInformationBrand" column="car_information_brand"></result>
|
||||||
|
<result property="carInformationDriver" column="car_information_driver"></result>
|
||||||
|
<result property="carInformationMotorManufacturer" column="car_information_motor_manufacturer"></result>
|
||||||
|
<result property="carInformationMotorModel" column="car_information_motorModel"></result>
|
||||||
|
<result property="carInformationBatteryManufacturer" column="car_information_battery_manufacturer"></result>
|
||||||
|
<result property="carInformationBatteryModel" column="car_information_battery_model"></result>
|
||||||
|
<result property="carInformationFence" column="car_information_fence"></result>
|
||||||
|
<result property="carInformationType" column="car_information_type"></result>
|
||||||
|
<result property="carInformationFocus" column="car_informationfocus"></result>
|
||||||
|
<result property="carInformationState" column="car_information_state"></result>
|
||||||
|
<result property="carTypeName" column="car_type_name"></result>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<resultMap id="FaultCoditionResult" type="com.muyu.cloud.faultmanage.domain.FaultCondition">
|
||||||
|
<id property="carconditionId" column="carcondition_id"></id>
|
||||||
|
<result property="carTypeId" column="car_type_id"></result>
|
||||||
|
<result property="messageTypeId" column="message_type_id"></result>
|
||||||
|
<result property="faultconditionIdentification" column="faultcondition_identification"></result>
|
||||||
|
<result property="carTypeName" column="car_type_name"></result>
|
||||||
|
<result property="messageTypeName" column="message_type_name"></result>
|
||||||
|
<result property="messageTypeCode" column="message_type_code"></result>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<sql id="selectTypeByVIN">
|
||||||
|
select
|
||||||
|
car_information.*,
|
||||||
|
car_type.car_type_name
|
||||||
|
from
|
||||||
|
car_information
|
||||||
|
left join car_type on car_information.car_information_type=car_type.car_type_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="selectfaultconditionlist">
|
||||||
|
SELECT
|
||||||
|
car_fault_condition.*,
|
||||||
|
car_type.car_type_name,
|
||||||
|
car_fault_label.message_type_name,
|
||||||
|
car_fault_label.message_type_code
|
||||||
|
FROM
|
||||||
|
car_fault_condition
|
||||||
|
LEFT JOIN car_type ON car_fault_condition.car_type_id = car_type.car_type_id
|
||||||
|
LEFT JOIN car_fault_label ON car_fault_condition.message_type_id = car_fault_label.message_type_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectTypeByVIN" resultType="com.muyu.cloud.faultmanage.domain.CarInformation">
|
||||||
|
<include refid="selectTypeByVIN"></include>
|
||||||
|
<where>
|
||||||
|
and car_information.car_information_VIN=#{vin}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectruleByType" resultType="com.muyu.cloud.faultmanage.domain.FaultCondition">
|
||||||
|
<include refid="selectfaultconditionlist"></include>
|
||||||
|
<where>
|
||||||
|
and car_fault_condition.car_type_id=#{carInformationType}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?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.muyu.cloud.faultmanage.mapper.MessageMapper">
|
||||||
|
|
||||||
|
<select id="unread" resultType="com.muyu.cloud.faultmanage.domain.message.Message">
|
||||||
|
select * from car_fault_message where status=0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="changestatus">
|
||||||
|
update car_fault_message set status=1 where id=#{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>cloud-server</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>cloud-faultmanage</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>cloud-faultmanage-server</module>
|
||||||
|
<module>cloud-faultmanage-client</module>
|
||||||
|
<module>cloud-faultmanage-remote</module>
|
||||||
|
<module>cloud-faultmanage-common</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<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>
|
|
@ -2,7 +2,6 @@ package com.muyu.car.controller;
|
||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.car.domain.CarInformation;
|
import com.muyu.car.domain.CarInformation;
|
||||||
import com.muyu.car.domain.CarMessage;
|
|
||||||
import com.muyu.car.domain.req.CarInformationAddReq;
|
import com.muyu.car.domain.req.CarInformationAddReq;
|
||||||
import com.muyu.car.domain.req.CarInformationListReq;
|
import com.muyu.car.domain.req.CarInformationListReq;
|
||||||
import com.muyu.car.domain.req.CarInformationUpdReq;
|
import com.muyu.car.domain.req.CarInformationUpdReq;
|
||||||
|
@ -112,5 +111,4 @@ public class CarInformationController {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,4 +110,6 @@ public class SysDeptController extends BaseController {
|
||||||
deptService.checkDeptDataScope(deptId);
|
deptService.checkDeptDataScope(deptId);
|
||||||
return toAjax(deptService.deleteDeptById(deptId));
|
return toAjax(deptService.deleteDeptById(deptId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,4 +35,6 @@ public class DataSourceInterceptor implements HandlerInterceptor {
|
||||||
//请求完成之后进行清理操作
|
//请求完成之后进行清理操作
|
||||||
DataSourceContextHolder.clearDataSourceKey();
|
DataSourceContextHolder.clearDataSourceKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import com.muyu.system.domain.SysConfig;
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.amqp.core.Queue;
|
import org.springframework.amqp.core.Queue;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
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;
|
||||||
|
|
|
@ -70,6 +70,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||||
return buildDeptTreeSelect(depts);
|
return buildDeptTreeSelect(depts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 构建前端所需要树结构
|
* 构建前端所需要树结构
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue