Compare commits
50 Commits
server_202
...
master
Author | SHA1 | Date |
---|---|---|
|
682dd2f6e0 | |
|
a3059cbbf7 | |
|
3857e3a875 | |
|
4d1cb943ac | |
|
e6100a1318 | |
|
9c8131232b | |
|
ac3aa82ef4 | |
|
e5be107d55 | |
|
6454d72b8d | |
|
0463fde303 | |
|
b8de8285b7 | |
|
08acad4531 | |
|
a144a4d96a | |
|
a796863e54 | |
|
13960a292f | |
|
6fab49598e | |
|
46639b77a0 | |
|
00b4350289 | |
|
66ca1afa4a | |
|
4e4e80f64d | |
|
3c1b9cef33 | |
|
02f71d7baf | |
|
2c2854506e | |
|
5505c3c45f | |
|
9433dcb66d | |
|
55d398940f | |
|
d45da7b47f | |
|
672a340cdf | |
|
9478ae16c5 | |
|
7abd6f6523 | |
|
50767b8b9a | |
|
7ca3d4dede | |
|
31155a12a6 | |
|
4ccc21132c | |
|
75c0653091 | |
|
4664426562 | |
|
59b796f962 | |
|
82cad8d974 | |
|
e4bfdc56c8 | |
|
08a8480ab5 | |
|
c99d1e0e89 | |
|
dc3bf42273 | |
|
5dea92f527 | |
|
053d348800 | |
|
ae34564232 | |
|
447986b5ac | |
|
6a9e8c3097 | |
|
5a964fa9f5 | |
|
86d2643da9 | |
|
987f20b27c |
116
pom.xml
116
pom.xml
|
@ -37,6 +37,8 @@
|
||||||
<transmittable-thread-local.version>2.14.3</transmittable-thread-local.version>
|
<transmittable-thread-local.version>2.14.3</transmittable-thread-local.version>
|
||||||
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
|
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
|
||||||
<mqttv3.version>1.2.5</mqttv3.version>
|
<mqttv3.version>1.2.5</mqttv3.version>
|
||||||
|
<spring-kafka.version>2.8.0</spring-kafka.version>
|
||||||
|
<aliyun.ecs.version>3.1.12</aliyun.ecs.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
|
@ -250,7 +252,29 @@
|
||||||
<version>${mqttv3.version}</version>
|
<version>${mqttv3.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- kafka-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.kafka</groupId>
|
||||||
|
<artifactId>spring-kafka</artifactId>
|
||||||
|
<version>${spring-kafka.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common-business</artifactId>
|
||||||
|
<version>${zhilian.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里云ESC服务版本控制-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>ecs20140526</artifactId>
|
||||||
|
<version>${aliyun.ecs.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
@ -304,57 +328,57 @@
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<!-- 要将源码放上去,需要加入这个插件 -->
|
<!-- 要将源码放上去,需要加入这个插件 -->
|
||||||
<plugin>
|
<!-- <plugin>-->
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<!-- <groupId>org.apache.maven.plugins</groupId>-->
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<!-- <artifactId>maven-source-plugin</artifactId>-->
|
||||||
<version>3.0.1</version>
|
<!-- <version>3.0.1</version>-->
|
||||||
<configuration>
|
<!-- <configuration>-->
|
||||||
<attach>true</attach>
|
<!-- <attach>true</attach>-->
|
||||||
</configuration>
|
<!-- </configuration>-->
|
||||||
<executions>
|
<!-- <executions>-->
|
||||||
<execution>
|
<!-- <execution>-->
|
||||||
<phase>compile</phase>
|
<!-- <phase>compile</phase>-->
|
||||||
<goals>
|
<!-- <goals>-->
|
||||||
<goal>jar</goal>
|
<!-- <goal>jar</goal>-->
|
||||||
</goals>
|
<!-- </goals>-->
|
||||||
</execution>
|
<!-- </execution>-->
|
||||||
</executions>
|
<!-- </executions>-->
|
||||||
</plugin>
|
<!-- </plugin>-->
|
||||||
</plugins>
|
</plugins>
|
||||||
</pluginManagement>
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
<distributionManagement>
|
<!-- <distributionManagement>-->
|
||||||
<repository>
|
<!-- <repository>-->
|
||||||
<id>releases</id>
|
<!-- <id>releases</id>-->
|
||||||
<name>releases</name>
|
<!-- <name>releases</name>-->
|
||||||
<url>http://nexus.zhilian.com:8081/repository/maven-releases/</url>
|
<!-- <url>http://nexus.zhilian.com:8081/repository/maven-releases/</url>-->
|
||||||
</repository>
|
<!-- </repository>-->
|
||||||
</distributionManagement>
|
<!-- </distributionManagement>-->
|
||||||
|
|
||||||
<repositories>
|
<!-- <repositories>-->
|
||||||
<repository>
|
<!-- <repository>-->
|
||||||
<id>public</id>
|
<!-- <id>public</id>-->
|
||||||
<name>aliyun nexus</name>
|
<!-- <name>aliyun nexus</name>-->
|
||||||
<url>http://nexus.zhilian.com:8081/repository/maven-public/</url>
|
<!-- <url>http://nexus.zhilian.com:8081/repository/maven-public/</url>-->
|
||||||
<releases>
|
<!-- <releases>-->
|
||||||
<enabled>true</enabled>
|
<!-- <enabled>true</enabled>-->
|
||||||
</releases>
|
<!-- </releases>-->
|
||||||
</repository>
|
<!-- </repository>-->
|
||||||
</repositories>
|
<!-- </repositories>-->
|
||||||
|
|
||||||
<pluginRepositories>
|
<!-- <pluginRepositories>-->
|
||||||
<pluginRepository>
|
<!-- <pluginRepository>-->
|
||||||
<id>public</id>
|
<!-- <id>public</id>-->
|
||||||
<name>aliyun nexus</name>
|
<!-- <name>aliyun nexus</name>-->
|
||||||
<url>http://nexus.zhilian.com:8081/repository/maven-public/</url>
|
<!-- <url>http://nexus.zhilian.com:8081/repository/maven-public/</url>-->
|
||||||
<releases>
|
<!-- <releases>-->
|
||||||
<enabled>true</enabled>
|
<!-- <enabled>true</enabled>-->
|
||||||
</releases>
|
<!-- </releases>-->
|
||||||
<snapshots>
|
<!-- <snapshots>-->
|
||||||
<enabled>false</enabled>
|
<!-- <enabled>false</enabled>-->
|
||||||
</snapshots>
|
<!-- </snapshots>-->
|
||||||
</pluginRepository>
|
<!-- </pluginRepository>-->
|
||||||
</pluginRepositories>
|
<!-- </pluginRepositories>-->
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
<module>zhilian-common-datasource</module>
|
<module>zhilian-common-datasource</module>
|
||||||
<module>zhilian-common-system</module>
|
<module>zhilian-common-system</module>
|
||||||
<module>zhilian-common-resolver</module>
|
<module>zhilian-common-resolver</module>
|
||||||
|
<module>zhilian-common-business</module>
|
||||||
|
<module>zhilian-common-event</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>zhilian-common</artifactId>
|
<artifactId>zhilian-common</artifactId>
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?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.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>zhilian-common-business</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>
|
||||||
|
<!-- zhilian Common Core-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName Break
|
||||||
|
* @Description 故障实体类
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Break {
|
||||||
|
/**
|
||||||
|
* 故障id
|
||||||
|
**/
|
||||||
|
private Integer breakId;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
**/
|
||||||
|
private String breakCode;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
**/
|
||||||
|
private String breakVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
**/
|
||||||
|
private Date breakDate;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
**/
|
||||||
|
private Date breakTime;
|
||||||
|
/**
|
||||||
|
* 故障类型
|
||||||
|
**/
|
||||||
|
private String breakType;
|
||||||
|
/**
|
||||||
|
* 故障状态 是否警告
|
||||||
|
**/
|
||||||
|
private Integer breakState;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLog
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 15:07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BreakLog {
|
||||||
|
|
||||||
|
/** 故障日志id */
|
||||||
|
private Integer breakLogId;
|
||||||
|
/** 故障码 */
|
||||||
|
private String breakCode;
|
||||||
|
/** 车辆VIN */
|
||||||
|
private String breakVin;
|
||||||
|
/** 故障类型 */
|
||||||
|
private String breakType;
|
||||||
|
/** 结束报警时间 */
|
||||||
|
private Date breakTime;
|
||||||
|
/** 开始报警时间 */
|
||||||
|
private Date breakDate;
|
||||||
|
/** 是否报警 */
|
||||||
|
private String breakState;
|
||||||
|
/** 逻辑删除 */
|
||||||
|
private Integer breakDel;
|
||||||
|
}
|
|
@ -0,0 +1,113 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障对象 business_break
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BusinessBreak extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private Long breakId;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@Excel(name = "故障码")
|
||||||
|
private String breakCode;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
private String breakVin;
|
||||||
|
|
||||||
|
/** 结束报警时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "结束报警时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date breakTime;
|
||||||
|
|
||||||
|
/** 故障类型 */
|
||||||
|
@Excel(name = "故障类型")
|
||||||
|
private String breakType;
|
||||||
|
|
||||||
|
/** 开始报警时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "开始报警时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date breakDate;
|
||||||
|
|
||||||
|
/** 是否警告 */
|
||||||
|
@Excel(name = "是否警告")
|
||||||
|
private String breakState;
|
||||||
|
|
||||||
|
public void setBreakId(Long breakId)
|
||||||
|
{
|
||||||
|
this.breakId = breakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBreakId()
|
||||||
|
{
|
||||||
|
return breakId;
|
||||||
|
}
|
||||||
|
public void setBreakCode(String breakCode)
|
||||||
|
{
|
||||||
|
this.breakCode = breakCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakCode()
|
||||||
|
{
|
||||||
|
return breakCode;
|
||||||
|
}
|
||||||
|
public void setBreakVin(String breakVin)
|
||||||
|
{
|
||||||
|
this.breakVin = breakVin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakVin()
|
||||||
|
{
|
||||||
|
return breakVin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setBreakType(String breakType)
|
||||||
|
{
|
||||||
|
this.breakType = breakType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakType()
|
||||||
|
{
|
||||||
|
return breakType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBreakState(String breakState)
|
||||||
|
{
|
||||||
|
this.breakState = breakState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakState()
|
||||||
|
{
|
||||||
|
return breakState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("breakId", getBreakId())
|
||||||
|
.append("breakCode", getBreakCode())
|
||||||
|
.append("breakVin", getBreakVin())
|
||||||
|
.append("breakTime", getBreakTime())
|
||||||
|
.append("breakType", getBreakType())
|
||||||
|
.append("breakDate", getBreakDate())
|
||||||
|
.append("breakState", getBreakState())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,6 +12,15 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName Fence
|
||||||
|
* @Description 电子围栏实体类
|
||||||
|
* @Author ZeJinG.Su
|
||||||
|
* @Date 15:28 2024/4/8
|
||||||
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -50,6 +59,6 @@ public class Fence extends BaseEntity {
|
||||||
@Excel(name = "电子围栏经纬度信息")
|
@Excel(name = "电子围栏经纬度信息")
|
||||||
@TableField("fence_message")
|
@TableField("fence_message")
|
||||||
private String fenceMessage;
|
private String fenceMessage;
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<Markers> markersList;
|
||||||
}
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("business_markers")
|
||||||
|
public class Markers extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId(value = "markers_id", type = IdType.AUTO)
|
||||||
|
@Excel(name = "标识编号")
|
||||||
|
private Long markersId;
|
||||||
|
|
||||||
|
@TableField("markers_name")
|
||||||
|
@Excel(name = "标识名称")
|
||||||
|
private String markersName;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<Long> fenceIds;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,71 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.*;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆信息对象 business_vehicle
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("business_vehicle")
|
||||||
|
public class Vehicle extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "车辆ID",cellType = Excel.ColumnType.NUMERIC)
|
||||||
|
@TableId(value = "vehicle_id",type = IdType.AUTO)
|
||||||
|
private Long vehicleId;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
@TableField("vehicle_vin")
|
||||||
|
private String vehicleVIN;
|
||||||
|
/**
|
||||||
|
* 车辆类型编号
|
||||||
|
*/
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long vehicleTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电机厂商
|
||||||
|
*/
|
||||||
|
private String vehicleMotor;
|
||||||
|
/**
|
||||||
|
* 电池厂商
|
||||||
|
*/
|
||||||
|
private String vehicleBattery;
|
||||||
|
/**
|
||||||
|
* 电机ID
|
||||||
|
*/
|
||||||
|
private String motorId;
|
||||||
|
/**
|
||||||
|
* 电池ID
|
||||||
|
*/
|
||||||
|
private String batteryId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆状态
|
||||||
|
*/
|
||||||
|
private Long vehicleState;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<Long> markersIds;
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ToString
|
||||||
|
@TableName(value = "business_vehicle_type")
|
||||||
|
public class VehicleType {
|
||||||
|
|
||||||
|
@TableId(value = "vehicle_type_id", type = IdType.AUTO)
|
||||||
|
@Excel(name = "车型ID")
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
|
||||||
|
@Excel(name = "车型名称")
|
||||||
|
@TableField(value = "vehicle_type_name")
|
||||||
|
private String vehicleTypeName;
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.zhilian.business.domain.middle;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@TableName("business_markers_fence")
|
||||||
|
public class MarkersFence {
|
||||||
|
/**
|
||||||
|
* 车辆标识编号
|
||||||
|
*/
|
||||||
|
@TableId(value = "markers_id",type = IdType.INPUT)
|
||||||
|
private Long markerId;
|
||||||
|
@TableField(value = "fence_id",insertStrategy = FieldStrategy.IGNORED)
|
||||||
|
private Long fenceId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public Long getMarkerId() {
|
||||||
|
return markerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMarkerId(Long markerId) {
|
||||||
|
this.markerId = markerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getFenceId() {
|
||||||
|
return fenceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFenceId(Long fenceId) {
|
||||||
|
this.fenceId = fenceId;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.zhilian.business.domain.middle;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
@TableName("business_vehicle_markers")
|
||||||
|
public class VehicleMarkers {
|
||||||
|
/**
|
||||||
|
* 车辆编号
|
||||||
|
*/
|
||||||
|
@TableId(value = "vehicle_id",type = IdType.INPUT)
|
||||||
|
private Long vehicleId;
|
||||||
|
/**
|
||||||
|
* 车辆标识编号
|
||||||
|
*/
|
||||||
|
@TableField(value = "markers_id",insertStrategy = FieldStrategy.IGNORED)
|
||||||
|
private Long markersId;
|
||||||
|
|
||||||
|
public Long getVehicleId() {
|
||||||
|
return vehicleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVehicleId(Long vehicleId) {
|
||||||
|
this.vehicleId = vehicleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getMarkersId() {
|
||||||
|
return markersId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMarkersId(Long markersId) {
|
||||||
|
this.markersId = markersId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.zhilian.business.domain.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MarkersVo {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.zhilian.business.domain.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class VehicleVo {
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
*/
|
||||||
|
private String vehicleVIN;
|
||||||
|
/**
|
||||||
|
* 车辆类型编号
|
||||||
|
*/
|
||||||
|
private Long vehicleTypeId;
|
||||||
|
/**
|
||||||
|
* 电子围栏编号
|
||||||
|
*/
|
||||||
|
private Long fenceId;
|
||||||
|
/**
|
||||||
|
* 电机厂商
|
||||||
|
*/
|
||||||
|
private String motorBusiness;
|
||||||
|
/**
|
||||||
|
* 电池厂商
|
||||||
|
*/
|
||||||
|
private String batteryBusiness;
|
||||||
|
/**
|
||||||
|
* 电机ID
|
||||||
|
*/
|
||||||
|
private String motorID;
|
||||||
|
/**
|
||||||
|
* 电池ID
|
||||||
|
*/
|
||||||
|
private String batteryID;
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.zhilian.business.remote;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Break;
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.remote.factory.RemoteBreakFallbackFactory;
|
||||||
|
import com.zhilian.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import lombok.extern.java.Log;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteBreakService", value = ServiceNameConstants.BUSINESS_SERVICE, fallbackFactory = RemoteBreakFallbackFactory.class)
|
||||||
|
public interface RemoteBreakService {
|
||||||
|
/**
|
||||||
|
* 新增故障
|
||||||
|
*/
|
||||||
|
@PostMapping("logAdd")
|
||||||
|
public Result logAdd(@RequestBody BreakLog breakLog);
|
||||||
|
|
||||||
|
@GetMapping("/checkIfBreakLogExists/{breakCode}/{breakVin}")
|
||||||
|
public ResponseEntity<Boolean> checkIfBreakLogExists(@PathVariable("breakCode") String breakCode, @PathVariable("breakVin") String breakVin);
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.zhilian.business.remote;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public interface RemoteFenceService {
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.zhilian.business.remote;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory;
|
||||||
|
import com.zhilian.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteVehicleService", value = ServiceNameConstants.VIEHICLE_SERVICE, fallbackFactory = RemoteVehicleFallbackFactory.class)
|
||||||
|
public interface RemoteVehicleService {
|
||||||
|
// @PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
|
// public Result<SysFile> upload (@RequestPart(value = "file") MultipartFile file);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据VIN获取车辆信息
|
||||||
|
* @param vehicleVIN
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/vehicle/getMarkersByVIN/{vehicleVIN}")
|
||||||
|
public Result<Vehicle> getVehicleByVIN(@PathVariable("vehicleVIN") String vehicleVIN);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新车辆状态
|
||||||
|
* @param vehicle
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/vehicle/updateState")
|
||||||
|
public Result updateState(@RequestBody Vehicle vehicle);
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.zhilian.business.remote.factory;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.remote.RemoteBreakService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class RemoteBreakFallbackFactory implements FallbackFactory<RemoteBreakService> {
|
||||||
|
@Override
|
||||||
|
public RemoteBreakService create(Throwable cause) {
|
||||||
|
return new RemoteBreakService() {
|
||||||
|
@Override
|
||||||
|
public Result logAdd(BreakLog breakLog) {
|
||||||
|
log.error("故障日志服务调用失败");
|
||||||
|
return Result.error(HttpStatus.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseEntity<Boolean> checkIfBreakLogExists(String breakCode, String breakVin) {
|
||||||
|
log.error("根据VIN和故障码查询服务调用失败");
|
||||||
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// return new RemoteBreakService() {
|
||||||
|
// @Override
|
||||||
|
// public Result add(BusinessBreak businessBreak) {
|
||||||
|
// log.error("故障日志服务调用失败");
|
||||||
|
// return Result.error("故障日志服务调用失败");
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.zhilian.business.remote.factory;
|
||||||
|
|
||||||
|
import com.zhilian.common.core.constant.ServiceNameConstants;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
|
||||||
|
//@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
||||||
|
public class RemoteFenceFallbackFactory {
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.zhilian.business.remote.factory;
|
||||||
|
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.remote.RemoteVehicleService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class RemoteVehicleFallbackFactory implements FallbackFactory<RemoteVehicleService> {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RemoteVehicleFallbackFactory.class);
|
||||||
|
@Override
|
||||||
|
public RemoteVehicleService create(Throwable throwable) {
|
||||||
|
log.error("用户服务调用失败:{}", throwable.getMessage());
|
||||||
|
return new RemoteVehicleService() {
|
||||||
|
@Override
|
||||||
|
public Result<Vehicle> getVehicleByVIN(String vehicleVIN) {
|
||||||
|
return Result.error("获取车辆信息失败:" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result updateState(Vehicle vehicle) {
|
||||||
|
return Result.error("更新车辆状态失败:" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
com.zhilian.business.remote.factory.RemoteBreakFallbackFactory
|
||||||
|
com.zhilian.business.remote.factory.RemoteFenceFallbackFactory
|
||||||
|
com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory
|
|
@ -20,4 +20,13 @@ public class ServiceNameConstants {
|
||||||
* 文件服务的serviceid
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "zhilian-file";
|
public static final String FILE_SERVICE = "zhilian-file";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务服务的serviceid
|
||||||
|
*/
|
||||||
|
public static final String BUSINESS_SERVICE = "zhilian-business";
|
||||||
|
/**
|
||||||
|
* 车辆服务的serviceid
|
||||||
|
*/
|
||||||
|
public static final String VIEHICLE_SERVICE = "zhilian-vehicle";
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应信息主体
|
* 响应信息主体
|
||||||
|
|
|
@ -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.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>zhilian-common-event</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.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.zhilian.common.event;
|
||||||
|
|
||||||
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
public class VehicleEventCache {
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
|
public String encode(String vin){
|
||||||
|
return "event:arr"+vin;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addEvent(String vin ,String eventName){
|
||||||
|
redisService.setCacheSet(encode(vin),eventName);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.zhilian.common.event;
|
||||||
|
|
||||||
|
public interface VehicleEventConstants {
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
com.zhilian.common.event.VehicleEventCache
|
|
@ -1,6 +1,5 @@
|
||||||
package com.zhilian.common.redis.service;
|
package com.zhilian.common.redis.service;
|
||||||
|
|
||||||
import io.lettuce.core.output.DoubleListOutput;
|
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
import org.apache.poi.ss.formula.functions.T;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.*;
|
import org.springframework.data.redis.core.*;
|
||||||
|
@ -154,6 +153,19 @@ public class RedisService {
|
||||||
return setOperation;
|
return setOperation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 缓存Set
|
||||||
|
*
|
||||||
|
* @param key 缓存键值
|
||||||
|
* @param setValue 缓存的数据
|
||||||
|
* @return 缓存数据的对象
|
||||||
|
*/
|
||||||
|
public <T> BoundSetOperations<String, T> setCacheSet(final String key, final T setValue) {
|
||||||
|
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
|
||||||
|
setOperation.add(setValue);
|
||||||
|
return setOperation;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得缓存的set
|
* 获得缓存的set
|
||||||
*
|
*
|
||||||
|
@ -259,6 +271,7 @@ public class RedisService {
|
||||||
redisTemplate.opsForZSet().add(zkey, collect);
|
redisTemplate.opsForZSet().add(zkey, collect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取Zset集合大小
|
* 获取Zset集合大小
|
||||||
*
|
*
|
||||||
|
@ -295,6 +308,7 @@ public class RedisService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 范围查询集合携带分数
|
* 范围查询集合携带分数
|
||||||
|
*
|
||||||
* @param zkey
|
* @param zkey
|
||||||
* @param start
|
* @param start
|
||||||
* @param end
|
* @param end
|
||||||
|
@ -313,57 +327,62 @@ public class RedisService {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加分数
|
* 修改对应键值分数,delta为正数则增加,为负数则减少
|
||||||
|
*
|
||||||
* @param zkey
|
* @param zkey
|
||||||
* @param value
|
* @param value
|
||||||
* @param delta
|
* @param delta
|
||||||
* @param <T>
|
* @param <T>
|
||||||
*/
|
*/
|
||||||
public <T> Double incrementScore(final String zkey, final T value, final Double delta){
|
public <T> Double incrementScore(final String zkey, final T value, final Double delta) {
|
||||||
return redisTemplate.opsForZSet().incrementScore(zkey,value,delta);
|
return redisTemplate.opsForZSet().incrementScore(zkey, value, delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除元素
|
* 删除元素
|
||||||
|
*
|
||||||
* @param zkey
|
* @param zkey
|
||||||
* @param values
|
* @param values
|
||||||
* @return
|
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
public <T> Long removeCacheZsetBatch(final String zkey,final T... values){
|
public <T> Long removeCacheZsetBatch(final String zkey, final T... values) {
|
||||||
return redisTemplate.opsForZSet().remove(zkey,values);
|
return redisTemplate.opsForZSet().remove(zkey, values);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 排序并限制结果集大小,按降序返回有序集合的部分元素,支持指定索引范围。
|
* 排序并限制结果集大小,按降序返回有序集合的部分元素,支持指定索引范围。
|
||||||
|
*
|
||||||
* @param zkey
|
* @param zkey
|
||||||
* @param start
|
* @param start
|
||||||
* @param end
|
* @param end
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Set<Double> reverseRange(final String zkey,final Long start,final Long end){
|
public Set<Double> reverseRange(final String zkey, final Long start, final Long end) {
|
||||||
return redisTemplate.opsForZSet().reverseRange(zkey,start,end);
|
return redisTemplate.opsForZSet().reverseRange(zkey, start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按分数范围查询
|
* 按分数范围查询
|
||||||
|
*
|
||||||
* @param zkey
|
* @param zkey
|
||||||
* @param min
|
* @param min
|
||||||
* @param max
|
* @param max
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Set<Double> rangeByScore(final String zkey,final Double min,final Double max){
|
public Set<Double> rangeByScore(final String zkey, final Double min, final Double max) {
|
||||||
return redisTemplate.opsForZSet().rangeByScore(zkey,min,max);
|
return redisTemplate.opsForZSet().rangeByScore(zkey, min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取最小值
|
* 获取最小值
|
||||||
|
*
|
||||||
* @param zkey
|
* @param zkey
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Map<Object, Double> getCacheZsetMin(final String zkey){
|
public ZSetOperations.TypedTuple getCacheZsetMin(final String zkey) {
|
||||||
ZSetOperations.TypedTuple typedTuple = redisTemplate.opsForZSet().popMin(zkey);
|
ZSetOperations.TypedTuple typedTuple = redisTemplate.opsForZSet().popMin(zkey);
|
||||||
return new HashMap<Object,Double>(){{put(typedTuple.getValue(),typedTuple.getScore());}};
|
return typedTuple;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -376,4 +395,44 @@ public class RedisService {
|
||||||
public Collection<String> keys(final String pattern) {
|
public Collection<String> keys(final String pattern) {
|
||||||
return redisTemplate.keys(pattern);
|
return redisTemplate.keys(pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteCacheSet(final String key) {
|
||||||
|
SetOperations setOperations = redisTemplate.opsForSet();
|
||||||
|
setOperations.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public <T> void deleteCacheSetValue(final String key, final T value) {
|
||||||
|
SetOperations setOperations = redisTemplate.opsForSet();
|
||||||
|
setOperations.remove(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public <T> void deleteCacheZsetValue(final String key, final T value) {
|
||||||
|
ZSetOperations zSetOperations = redisTemplate.opsForZSet();
|
||||||
|
zSetOperations.remove(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 根据下标获取List中value
|
||||||
|
* @author: LiYuan
|
||||||
|
* @param: key ,index 下标
|
||||||
|
* @return: value
|
||||||
|
**/
|
||||||
|
public <T> T getcacheListValue(final String key, final Long index) {
|
||||||
|
ListOperations listOperations = redisTemplate.opsForList();
|
||||||
|
|
||||||
|
return (T) listOperations.index(key, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description: 增加String类型中缓存值
|
||||||
|
* @author: LiYuan
|
||||||
|
* @param: key,number
|
||||||
|
* @return: Long 增加后的值
|
||||||
|
**/
|
||||||
|
public Long increment(final String key,final Long number) {
|
||||||
|
ValueOperations valueOperations = redisTemplate.opsForValue();
|
||||||
|
return valueOperations.increment(key,number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.zhilian.common.resolver.constants;
|
||||||
|
/**
|
||||||
|
* @ClassName MqttConnectConstants
|
||||||
|
* @Description Mqtt 连接常量
|
||||||
|
* @Author Can.J
|
||||||
|
* @Date 2024/4/4 10:13
|
||||||
|
*/
|
||||||
|
public class MqttConnectConstants {
|
||||||
|
public static final String BROKER_URL = "tcp://111.229.33.194:1883";
|
||||||
|
|
||||||
|
public static final String CLIENT_ID = "mqttx_53f082e9";
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.zhilian.common.resolver.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
/**
|
||||||
|
* @ClassName EnhancedServicesType
|
||||||
|
* @Description 增值服务表 测试用
|
||||||
|
* @Author Can.J
|
||||||
|
* @Date 2024/4/4 11:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class EnhancedServicesType {
|
||||||
|
/**
|
||||||
|
* 增值服务id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 增值服务名称
|
||||||
|
*/
|
||||||
|
private String enhancedServicesName;
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.zhilian.common.resolver.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName SysUserEnhancedServices
|
||||||
|
* @Description 客户增值服务中间表(客户-增值服务)
|
||||||
|
* @Author Can.J
|
||||||
|
* @Date 2024/4/4 11:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class SysUserEnhancedServices {
|
||||||
|
private Long useId;
|
||||||
|
private Long enhancedServicesId;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private String updateTime;
|
||||||
|
private String createBy;
|
||||||
|
private String updateBy;
|
||||||
|
private int isDelete;
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.zhilian.common.resolver.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
/**
|
||||||
|
* @ClassName RealTimeTrajectoryRequest
|
||||||
|
* @Description 实时轨迹请求参数
|
||||||
|
* @Author Can.J
|
||||||
|
* @Date 2024/4/6 16:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RealTimeTrajectoryRequest {
|
||||||
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* vin
|
||||||
|
*/
|
||||||
|
private String vin;
|
||||||
|
}
|
|
@ -12,7 +12,6 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件服务
|
* 文件服务
|
||||||
*
|
|
||||||
* @author zhilian
|
* @author zhilian
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
||||||
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -36,8 +34,8 @@ spring:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
dataId: sentinel-zhilian-gateway
|
dataId: sentinel-zhilian-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
rule-type: gw-flow
|
rule-type: gw-flow
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
<module>zhilian-resolver</module>
|
<module>zhilian-resolver</module>
|
||||||
<module>zhilian-business</module>
|
<module>zhilian-business</module>
|
||||||
<module>zhilian-manager</module>
|
<module>zhilian-manager</module>
|
||||||
|
<module>zhilian-message</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>zhilian-modules</artifactId>
|
<artifactId>zhilian-modules</artifactId>
|
||||||
|
|
|
@ -73,6 +73,12 @@
|
||||||
<artifactId>zhilian-common-log</artifactId>
|
<artifactId>zhilian-common-log</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common-business</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- zhilian Common Swagger -->
|
<!-- zhilian Common Swagger -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zhilian</groupId>
|
<groupId>com.zhilian</groupId>
|
||||||
|
@ -106,4 +112,4 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.zhilian.business;
|
||||||
|
|
||||||
|
import com.zhilian.business.controller.FenceController;
|
||||||
|
import com.zhilian.business.controller.VehicleController;
|
||||||
|
import com.zhilian.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.zhilian.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.zhilian.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.ApplicationArguments;
|
||||||
|
import org.springframework.boot.ApplicationRunner;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @BelongsProject: smart-cloud-server
|
||||||
|
* @BelongsPackage: com.zhilian.business
|
||||||
|
* @Description 启动类
|
||||||
|
* @Author: LiYuan
|
||||||
|
* @CreateTime: 2024-03-31 10:13
|
||||||
|
* @Description: 业务模块启动类
|
||||||
|
* @Version: 1.0
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class ZhiLianBusinessApplication implements ApplicationRunner {
|
||||||
|
@Autowired
|
||||||
|
private VehicleController vehicleController;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FenceController fenceController;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(ZhiLianBusinessApplication.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run(ApplicationArguments args) throws Exception {
|
||||||
|
fenceController.fenceRedisData();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,25 +0,0 @@
|
||||||
package com.zhilian.business;
|
|
||||||
|
|
||||||
import com.zhilian.common.security.annotation.EnableCustomConfig;
|
|
||||||
import com.zhilian.common.security.annotation.EnableMyFeignClients;
|
|
||||||
import com.zhilian.common.swagger.annotation.EnableCustomSwagger2;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @BelongsProject: smart-cloud-server
|
|
||||||
* @BelongsPackage: com.zhilian.business
|
|
||||||
* @Author: LiYuan
|
|
||||||
* @CreateTime: 2024-03-31 10:13
|
|
||||||
* @Description: TODO
|
|
||||||
* @Version: 1.0
|
|
||||||
*/
|
|
||||||
@EnableCustomConfig
|
|
||||||
@EnableCustomSwagger2
|
|
||||||
@EnableMyFeignClients
|
|
||||||
@SpringBootApplication
|
|
||||||
public class ZhilianBusinessApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(ZhilianBusinessApplication.class);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Break;
|
||||||
|
import com.zhilian.business.domain.BreakVo;
|
||||||
|
import com.zhilian.business.service.BreakService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.web.page.PageResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakController
|
||||||
|
* @Description 故障业务实现
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:40
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class BreakController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BreakService breakService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 故障列表
|
||||||
|
* @Date 2024/4/4
|
||||||
|
* @param breakVo
|
||||||
|
* @return com.zhilian.common.core.domain.Result<com.zhilian.common.core.web.page.PageResult<com.zhilian.business.domain.Break>>
|
||||||
|
**/
|
||||||
|
@PostMapping("breakList")
|
||||||
|
public Result<PageResult<Break>> breakList(@RequestBody BreakVo breakVo) {
|
||||||
|
PageResult<Break> pageResult = breakService.breakList(breakVo);
|
||||||
|
return Result.success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 故障添加
|
||||||
|
* @Date 2024/4/4
|
||||||
|
* @param break1
|
||||||
|
* @return com.zhilian.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("breakAdd")
|
||||||
|
public Result breakAdd(@RequestBody Break break1) {
|
||||||
|
int i = breakService.breakAdd(break1);
|
||||||
|
Result<Integer> success = Result.success(i);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 故障修改
|
||||||
|
* @Date 2024/4/4
|
||||||
|
* @param break1
|
||||||
|
* @return com.zhilian.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("breakUpd")
|
||||||
|
public Result breadUpd(@RequestBody Break break1) {
|
||||||
|
int i = breakService.breakUpd(break1);
|
||||||
|
Result<Integer> success = Result.success(i);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 故障删除
|
||||||
|
* @Date 2024/4/4
|
||||||
|
* @param breakId
|
||||||
|
* @return com.zhilian.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("breakDel/{breakId}")
|
||||||
|
public Result delFirm(@PathVariable Integer breakId){
|
||||||
|
int i = breakService.breakDel(breakId);
|
||||||
|
Result<Integer> success = Result.success(i);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.service.BreakLogService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLogController
|
||||||
|
* @Description 故障日志业务实现
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 20:48
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
public class BreakLogController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BreakLogService breakLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description //故障日志列表
|
||||||
|
* @Date 2024/4/10
|
||||||
|
* @return com.zhilian.common.core.domain.Result<java.util.List<com.zhilian.business.domain.BreakLog>>
|
||||||
|
**/
|
||||||
|
@PostMapping("log")
|
||||||
|
public Result<List<BreakLog>> breakLog() {
|
||||||
|
List<BreakLog> list = breakLogService.breakLog();
|
||||||
|
Result<List<BreakLog>> success = Result.success(list);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description //故障日志添加
|
||||||
|
* @Date 2024/4/10
|
||||||
|
* @param breakLog
|
||||||
|
* @return com.zhilian.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("logAdd")
|
||||||
|
public Result logAdd(@RequestBody BreakLog breakLog){
|
||||||
|
int i = breakLogService.logAdd(breakLog);
|
||||||
|
Result<Integer> success = Result.success(i);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description // 故障日志修改
|
||||||
|
* @Date 2024/4/10
|
||||||
|
* @param breakLog
|
||||||
|
* @return com.zhilian.common.core.domain.Result
|
||||||
|
**/
|
||||||
|
@PostMapping("updLog")
|
||||||
|
public Result updLog(@RequestBody BreakLog breakLog){
|
||||||
|
int i = breakLogService.updLog(breakLog);
|
||||||
|
Result<Integer> success = Result.success(i);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("logDel/{breakLogId}")
|
||||||
|
public Result logDel(@PathVariable Integer breakLogId){
|
||||||
|
int del = breakLogService.logDel(breakLogId);
|
||||||
|
Result<Integer> success = Result.success(del);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/checkIfBreakLogExists/{breakCode}/{breakVin}")
|
||||||
|
public ResponseEntity <Boolean> checkIfBreakLogExists(@PathVariable("breakCode") String breakCode,@PathVariable("breakVin") String breakVin){
|
||||||
|
boolean exists =breakLogService.checkIfBreakLogExists(breakCode,breakVin);
|
||||||
|
return ResponseEntity.ok(exists);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,116 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.domain.request.BreakReq;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.zhilian.common.log.annotation.Log;
|
||||||
|
import com.zhilian.common.log.enums.BusinessType;
|
||||||
|
import com.zhilian.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.service.IBusinessBreakService;
|
||||||
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.utils.poi.ExcelUtil;
|
||||||
|
import com.zhilian.common.core.web.page.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障Controller
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/break")
|
||||||
|
public class BusinessBreakController extends BaseController{
|
||||||
|
@Autowired
|
||||||
|
private IBusinessBreakService businessBreakService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障列表
|
||||||
|
*/
|
||||||
|
// @RequiresPermissions("business:break:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<BusinessBreak>> list(BreakReq breakReq)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(breakReq);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出故障列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:break:export")
|
||||||
|
@Log(title = "故障", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, BreakReq breakReq)
|
||||||
|
{
|
||||||
|
List<BusinessBreak> list = businessBreakService.selectBusinessBreakList(breakReq);
|
||||||
|
ExcelUtil<BusinessBreak> util = new ExcelUtil<BusinessBreak>(BusinessBreak.class);
|
||||||
|
util.exportExcel(response, list, "故障数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取故障详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:break:query")
|
||||||
|
@GetMapping(value = "/{breakId}")
|
||||||
|
public Result getInfo(@PathVariable("breakId") Long breakId)
|
||||||
|
{
|
||||||
|
return success(businessBreakService.selectBusinessBreakByBreakId(breakId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:break:add")
|
||||||
|
@Log(title = "故障", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public Result add(@RequestBody BusinessBreak businessBreak)
|
||||||
|
{
|
||||||
|
return toAjax(businessBreakService.insertBusinessBreak(businessBreak));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:break:edit")
|
||||||
|
@Log(title = "故障", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public Result edit(@RequestBody BusinessBreak businessBreak)
|
||||||
|
{
|
||||||
|
return toAjax(businessBreakService.updateBusinessBreak(businessBreak));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("business:break:remove")
|
||||||
|
@Log(title = "故障", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{breakIds}")
|
||||||
|
public Result remove(@PathVariable Long[] breakIds)
|
||||||
|
{
|
||||||
|
return toAjax(businessBreakService.deleteBusinessBreakByBreakIds(breakIds));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障日志
|
||||||
|
*/
|
||||||
|
@PostMapping("breakLog")
|
||||||
|
public Result<List<BreakLog>> breakLog(){
|
||||||
|
List<BreakLog> list = businessBreakService.breakLog();
|
||||||
|
Result<List<BreakLog>> success = Result.success(list);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +1,17 @@
|
||||||
package com.zhilian.business.controller;
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.zhilian.business.domain.Fence;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.domain.Result;
|
||||||
import com.zhilian.common.core.web.controller.BaseController;
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
import com.zhilian.business.domain.Fence;
|
|
||||||
import com.zhilian.business.domain.FenceVo;
|
|
||||||
import com.zhilian.business.service.FenceService;
|
import com.zhilian.business.service.FenceService;
|
||||||
|
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||||
import com.zhilian.common.security.utils.SecurityUtils;
|
import com.zhilian.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName FenceController
|
* @ClassName FenceController
|
||||||
* @Description 电子围栏控制层
|
* @Description 电子围栏控制层
|
||||||
|
@ -24,11 +25,23 @@ public class FenceController extends BaseController {
|
||||||
private FenceService fenceService;
|
private FenceService fenceService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: 围栏管理
|
* 电子围栏列表
|
||||||
|
* @param fence
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public Result<PageInfo<Fence>> fenceList(@RequestBody FenceVo fenceVo) {
|
public Result<TableDataInfo<Fence>> fenceList(@RequestBody Fence fence) {
|
||||||
return success(fenceService.fenceList(fenceVo));
|
startPage();
|
||||||
|
List<Fence> result = fenceService.fenceList(fence);
|
||||||
|
return getDataTable(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加所有围栏信息进入redis
|
||||||
|
*/
|
||||||
|
public void fenceRedisData() {
|
||||||
|
fenceService.fenceRedisData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,24 +51,34 @@ public class FenceController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/fenceAdd")
|
@PostMapping("/fenceAdd")
|
||||||
public Result fenceAdd(@RequestBody Fence fence) {
|
public Result fenceAdd(@RequestBody Fence fence) {
|
||||||
boolean i = fenceService.save(fence);
|
fence.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(i);
|
fence.setUpdateTime(new Date());
|
||||||
|
return toAjax(fenceService.saveFence(fence));
|
||||||
}
|
}
|
||||||
|
|
||||||
// @PostMapping("insertFence")
|
|
||||||
// public Result insertFence(@RequestBody Fence fence) {
|
|
||||||
// Result result = fenceService.insertFence(fence);
|
|
||||||
// return Result.success();
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改电子围栏
|
* 修改围栏信息
|
||||||
|
* @param fence
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("system:config:fenceAdd")
|
|
||||||
@PostMapping("/fenceUpdate")
|
@PostMapping("/fenceUpdate")
|
||||||
public Result fenceUpdate(@RequestBody Fence fence) {
|
public Result fenceUpdate(@RequestBody Fence fence) {
|
||||||
boolean i = fenceService.updateById(fence);
|
fence.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(i);
|
fence.setUpdateTime(new Date());
|
||||||
|
return toAjax(fenceService.updateById(fence));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改电子围栏地图
|
||||||
|
* @param fence
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/fenceUpdateMap")
|
||||||
|
public Result fenceUpdateMap(@RequestBody Fence fence) {
|
||||||
|
fence.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
fence.setUpdateTime(new Date());
|
||||||
|
return toAjax(fenceService.updateByMap(fence));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,9 +87,9 @@ public class FenceController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/fenceDelete/{fenceId}")
|
@PostMapping("/fenceDelete/{fenceId}")
|
||||||
public Result fenceDelete(@PathVariable String fenceId) {
|
public Result fenceDelete(@PathVariable Long fenceId) {
|
||||||
boolean i = fenceService.removeById(fenceId);
|
return toAjax(fenceService.removeByFence(fenceId));
|
||||||
return toAjax(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,119 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zhilian.business.domain.Markers;
|
||||||
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
|
import com.zhilian.business.service.MarkersFenceService;
|
||||||
|
import com.zhilian.business.service.MarkersService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||||
|
import com.zhilian.common.security.utils.SecurityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* @ClassName MarkersController
|
||||||
|
* @Description 车辆标识控制层
|
||||||
|
* @Author ZeJinG.Su
|
||||||
|
* @Date 15:31 2024/4/8
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/markers")
|
||||||
|
public class MarkersController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private MarkersService markersService;
|
||||||
|
@Autowired
|
||||||
|
private MarkersFenceService markersFenceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆标识列表
|
||||||
|
* @param markers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("list")
|
||||||
|
public Result<TableDataInfo<Markers>> list(@RequestBody Markers markers) {
|
||||||
|
startPage();
|
||||||
|
List<Markers> result = markersService.selectMarkersList(markers);
|
||||||
|
return getDataTable(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆标识全部数据
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("markersVehicle")
|
||||||
|
public Result<List<Markers>> markersVehicle() {
|
||||||
|
List<Markers> listMarkers = markersService.listMarkers();
|
||||||
|
return Result.success(listMarkers);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增车辆标识
|
||||||
|
* @param markers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("insert")
|
||||||
|
public Result insert(@RequestBody Markers markers){
|
||||||
|
return toAjax(markersService.save(markers));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆标识
|
||||||
|
* @param markers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("update")
|
||||||
|
public Result update(@RequestBody Markers markers) {
|
||||||
|
markers.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
markers.setUpdateTime(new Date());
|
||||||
|
markersFenceService.removeAllFence(markers);
|
||||||
|
|
||||||
|
//修改原表数据
|
||||||
|
boolean update =markersService.updateById(markers);
|
||||||
|
|
||||||
|
//重新添加中间表数据
|
||||||
|
markersFenceService.insert(markers);
|
||||||
|
|
||||||
|
return toAjax(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除车辆标识
|
||||||
|
* @param markersId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("delete/{markersId}")
|
||||||
|
public Result delete(@PathVariable Long markersId) {
|
||||||
|
markersFenceList(markersId).forEach(markersFence -> {
|
||||||
|
markersFenceService.removeById(markersId);
|
||||||
|
});
|
||||||
|
return toAjax(markersService.removeById(markersId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 绑定电子围栏
|
||||||
|
* @param markers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("insertMarkersFence")
|
||||||
|
public Result insertMarkersFenceMarkers(@RequestBody Markers markers){
|
||||||
|
boolean insert = markersFenceService.insert(markers);
|
||||||
|
return toAjax(insert);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标识与电子围栏中间表信息
|
||||||
|
* @param markersId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("markersFenceList/{markersId}")
|
||||||
|
public List<MarkersFence> markersFenceList(@PathVariable Long markersId){
|
||||||
|
LambdaQueryWrapper<MarkersFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(MarkersFence::getMarkerId, markersId);
|
||||||
|
return markersFenceService.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
|
import com.zhilian.business.service.MarkersFenceService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* @ClassName MarkersFenceController
|
||||||
|
* @Description 标识与围栏中间表控制层
|
||||||
|
* @Author ZeJinG.Su
|
||||||
|
* @Date 15:31 2024/4/8
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/markersFence")
|
||||||
|
public class MarkersFenceController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private MarkersFenceService markersFenceService;
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<List<MarkersFence>> markersFenceList() {
|
||||||
|
return Result.success(markersFenceService.list());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,148 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.domain.VehicleFence;
|
||||||
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
|
import com.zhilian.business.service.MarkersService;
|
||||||
|
import com.zhilian.business.service.VehicleMarkersService;
|
||||||
|
import com.zhilian.business.service.VehicleService;
|
||||||
|
import com.zhilian.business.service.VehicleTypeService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
import com.zhilian.common.core.web.page.TableDataInfo;
|
||||||
|
import com.zhilian.common.security.utils.SecurityUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicle")
|
||||||
|
public class VehicleController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private VehicleService vehicleService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VehicleMarkersService vehicleMarkersService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VehicleTypeService vehicleTypeService;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MarkersService markersService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询车辆列表
|
||||||
|
* @param vehicle
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<TableDataInfo<Vehicle>> list(@RequestBody Vehicle vehicle) {
|
||||||
|
startPage();
|
||||||
|
List<Vehicle> list = vehicleService.selectVehicleList(vehicle);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/vehicleSelectAllData")
|
||||||
|
public List<VehicleFence> vehicleSelectAllData(){
|
||||||
|
List<VehicleFence> selectSelectAllData = vehicleService.selectSelectAllData();
|
||||||
|
return selectSelectAllData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增车辆
|
||||||
|
* @param vehicle
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/vehicleInsert")
|
||||||
|
public Result vehicleInsert(@RequestBody Vehicle vehicle){
|
||||||
|
vehicle.setCreateBy(SecurityUtils.getUsername());
|
||||||
|
vehicle.setCreateTime(new Date());
|
||||||
|
return toAjax(vehicleService.save(vehicle));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改车辆
|
||||||
|
* @param vehicle
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/vehicleUpdate")
|
||||||
|
public Result vehicleUpdate(@RequestBody Vehicle vehicle){
|
||||||
|
vehicle.setUpdateBy(SecurityUtils.getUsername());
|
||||||
|
vehicle.setUpdateTime(new Date());
|
||||||
|
|
||||||
|
//删除中间表全部关联数据
|
||||||
|
vehicleMarkersService.removeAllVehicle(vehicle);
|
||||||
|
|
||||||
|
//修改原表数据
|
||||||
|
boolean update =vehicleService.updateById(vehicle);
|
||||||
|
|
||||||
|
//重新添加中间表数据
|
||||||
|
vehicleMarkersService.insert(vehicle);
|
||||||
|
|
||||||
|
//判断添加完成后的标识与围栏是否绑定事件 如果没有绑定全部删除围栏事件 然后进行给予绑定
|
||||||
|
vehicleService.selectRedisData(vehicle);
|
||||||
|
return toAjax(update);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据车辆ID查询车辆与围栏中间表
|
||||||
|
* @param vehicleId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/getVehicleMarkers/{vehicleId}")
|
||||||
|
public List<VehicleMarkers> getVehicleMarkers(@PathVariable Long vehicleId){
|
||||||
|
LambdaQueryWrapper<VehicleMarkers> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(VehicleMarkers::getVehicleId, vehicleId);
|
||||||
|
return vehicleMarkersService.list(queryWrapper);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除车辆
|
||||||
|
* @param vehicleId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/vehicleDelete/{vehicleId}")
|
||||||
|
public Result vehicleDelete(@PathVariable Long vehicleId){
|
||||||
|
getVehicleMarkers(vehicleId).forEach(vehicleMarkers -> {
|
||||||
|
vehicleMarkersService.removeById(vehicleId);
|
||||||
|
});
|
||||||
|
return toAjax(vehicleService.removeById(vehicleId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆绑定围栏
|
||||||
|
* @param vehicle
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/vehicleInsertMarkers")
|
||||||
|
public Result vehicleInsertMarkers(@RequestBody Vehicle vehicle){
|
||||||
|
boolean insert = vehicleMarkersService.insert(vehicle);
|
||||||
|
return toAjax(insert);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据VIN查询车辆信息
|
||||||
|
* @param vehicleVIN
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/getMarkersByVIN/{vehicleVIN}")
|
||||||
|
public Result<Vehicle> getVehicleByVIN(@PathVariable("vehicleVIN") String vehicleVIN) {
|
||||||
|
Vehicle vehicle = vehicleService.getVehicleByVIN(vehicleVIN);
|
||||||
|
// vehicleMarkersService.getById(vehicle.getVehicleId());
|
||||||
|
return Result.success(vehicle);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据车辆VIN修改车辆状态
|
||||||
|
* @param vehicle
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/updateState")
|
||||||
|
public Result updateState(@RequestBody Vehicle vehicle) {
|
||||||
|
return toAjax(vehicleService.updateState(vehicle));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
|
import com.zhilian.business.service.VehicleMarkersService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/vehicleMarkers")
|
||||||
|
public class VehicleMarkersController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private VehicleMarkersService vehicleMarkersService;
|
||||||
|
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<List<VehicleMarkers>> vehicleMarkersList() {
|
||||||
|
return Result.success(vehicleMarkersService.list());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.zhilian.business.controller;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.VehicleType;
|
||||||
|
import com.zhilian.business.service.VehicleTypeService;
|
||||||
|
import com.zhilian.common.core.domain.Result;
|
||||||
|
import com.zhilian.common.core.web.controller.BaseController;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("vehicleType")
|
||||||
|
public class VehicleTypeController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private VehicleTypeService vehicleTypeService;
|
||||||
|
|
||||||
|
@GetMapping("list")
|
||||||
|
public Result<List<VehicleType>> list(){
|
||||||
|
List<VehicleType> list = vehicleTypeService.listVehicleType();
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName Break
|
||||||
|
* @Description 故障实体类
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:40
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class Break {
|
||||||
|
/**
|
||||||
|
* 故障id
|
||||||
|
**/
|
||||||
|
private Integer breakId;
|
||||||
|
/**
|
||||||
|
* 故障码
|
||||||
|
**/
|
||||||
|
private String breakCode;
|
||||||
|
/**
|
||||||
|
* 车辆VIN
|
||||||
|
**/
|
||||||
|
private String breakVin;
|
||||||
|
/**
|
||||||
|
* 开始报警时间
|
||||||
|
**/
|
||||||
|
private Date breakDate;
|
||||||
|
/**
|
||||||
|
* 结束报警时间
|
||||||
|
**/
|
||||||
|
private Date breakTime;
|
||||||
|
/**
|
||||||
|
* 故障类型
|
||||||
|
**/
|
||||||
|
private String breakType;
|
||||||
|
/**
|
||||||
|
* 故障状态 是否警告
|
||||||
|
**/
|
||||||
|
private Integer breakState;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import com.zhilian.common.core.web.page.PageResult;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLog
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 15:07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BreakLog {
|
||||||
|
|
||||||
|
/** 故障日志id */
|
||||||
|
private Integer breakLogId;
|
||||||
|
/** 故障码 */
|
||||||
|
private String breakCode;
|
||||||
|
/** 车辆VIN */
|
||||||
|
private String breakVin;
|
||||||
|
/** 故障类型 */
|
||||||
|
private String breakType;
|
||||||
|
/** 结束报警时间 */
|
||||||
|
private String breakTime;
|
||||||
|
/** 开始报警时间 */
|
||||||
|
private String breakDate;
|
||||||
|
/** 故障状态 */
|
||||||
|
private String breakState;
|
||||||
|
/** 逻辑删除 */
|
||||||
|
private Integer breakDel;
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakVo
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:51
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BreakVo {
|
||||||
|
/**
|
||||||
|
* 故障id
|
||||||
|
**/
|
||||||
|
private Integer breakId;
|
||||||
|
/**
|
||||||
|
* 车辆VIN码
|
||||||
|
**/
|
||||||
|
private String breakVin;
|
||||||
|
/**
|
||||||
|
* 故障状态
|
||||||
|
**/
|
||||||
|
private Integer breakState;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
**/
|
||||||
|
private Integer pageNum = 1;
|
||||||
|
private Integer pageSize = 3;
|
||||||
|
}
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.zhilian.common.core.annotation.Excel;
|
||||||
|
import com.zhilian.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障对象 business_break
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class BusinessBreak extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private Long breakId;
|
||||||
|
|
||||||
|
/** 故障码 */
|
||||||
|
@Excel(name = "故障码")
|
||||||
|
private String breakCode;
|
||||||
|
|
||||||
|
/** 车辆VIN */
|
||||||
|
@Excel(name = "车辆VIN")
|
||||||
|
private String breakVin;
|
||||||
|
|
||||||
|
/** 结束报警时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "结束报警时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private String breakTime;
|
||||||
|
|
||||||
|
/** 故障类型 */
|
||||||
|
@Excel(name = "故障类型")
|
||||||
|
private String breakType;
|
||||||
|
|
||||||
|
/** 开始报警时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "开始报警时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private String breakDate;
|
||||||
|
|
||||||
|
/** 是否警告 */
|
||||||
|
@Excel(name = "是否警告")
|
||||||
|
private String breakState;
|
||||||
|
|
||||||
|
public void setBreakId(Long breakId)
|
||||||
|
{
|
||||||
|
this.breakId = breakId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getBreakId()
|
||||||
|
{
|
||||||
|
return breakId;
|
||||||
|
}
|
||||||
|
public void setBreakCode(String breakCode)
|
||||||
|
{
|
||||||
|
this.breakCode = breakCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakCode()
|
||||||
|
{
|
||||||
|
return breakCode;
|
||||||
|
}
|
||||||
|
public void setBreakVin(String breakVin)
|
||||||
|
{
|
||||||
|
this.breakVin = breakVin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakVin()
|
||||||
|
{
|
||||||
|
return breakVin;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setBreakType(String breakType)
|
||||||
|
{
|
||||||
|
this.breakType = breakType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakType()
|
||||||
|
{
|
||||||
|
return breakType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBreakState(String breakState)
|
||||||
|
{
|
||||||
|
this.breakState = breakState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBreakState()
|
||||||
|
{
|
||||||
|
return breakState;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("breakId", getBreakId())
|
||||||
|
.append("breakCode", getBreakCode())
|
||||||
|
.append("breakVin", getBreakVin())
|
||||||
|
.append("breakTime", getBreakTime())
|
||||||
|
.append("breakType", getBreakType())
|
||||||
|
.append("breakDate", getBreakDate())
|
||||||
|
.append("breakState", getBreakState())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,43 +0,0 @@
|
||||||
package com.zhilian.business.domain;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName FenceResp //类名称
|
|
||||||
* @Author: yannan //作者
|
|
||||||
* @CreateDate: 2024/3/26 20:03 //创建时间
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@ToString
|
|
||||||
public class FenceVo {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏名称
|
|
||||||
*/
|
|
||||||
private String fenceName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏类型
|
|
||||||
*/
|
|
||||||
private Long fenceTypeId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏状态
|
|
||||||
*/
|
|
||||||
private Long fenceState;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
private Integer pageNum=1;
|
|
||||||
private Integer pageSize=5;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.zhilian.business.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@ToString
|
||||||
|
@SuperBuilder
|
||||||
|
public class VehicleFence {
|
||||||
|
private Long vehicleId;
|
||||||
|
private String vehicleVIN;
|
||||||
|
private String fences;
|
||||||
|
|
||||||
|
private List<String> fenceIds;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.zhilian.business.domain.request;
|
||||||
|
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakReq
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 15:28
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BreakReq {
|
||||||
|
/** 故障id */
|
||||||
|
private Integer breakId;
|
||||||
|
/** 故障码 */
|
||||||
|
private String breakCode;
|
||||||
|
/** 车辆VIN */
|
||||||
|
private String breakVin;
|
||||||
|
/** 故障类型 */
|
||||||
|
private String breakType;
|
||||||
|
}
|
|
@ -1,31 +0,0 @@
|
||||||
package com.zhilian.business.domain.request;
|
|
||||||
|
|
||||||
import com.zhilian.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class FenceRequest extends BaseEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
/**
|
|
||||||
* 电子围栏名称
|
|
||||||
*/
|
|
||||||
private String fenceName;
|
|
||||||
/**
|
|
||||||
* 电子围栏类型编号
|
|
||||||
*/
|
|
||||||
private Long fenceTypeId;
|
|
||||||
/**
|
|
||||||
* 电子围栏状态
|
|
||||||
*/
|
|
||||||
private Long fenceState;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLogMapper
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 20:49
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BreakLogMapper {
|
||||||
|
List<BreakLog> breakLog();
|
||||||
|
|
||||||
|
int logAdd(BreakLog breakLog);
|
||||||
|
|
||||||
|
int updLog(BreakLog breakLog);
|
||||||
|
|
||||||
|
int logDel(Integer breakLogId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
BreakLog findByBreakCodeAndBreakVin(@Param("breakCode") String breakCode, @Param("breakVin") String breakVin);
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Break;
|
||||||
|
import com.zhilian.business.domain.BreakVo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakMapper
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:59
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BreakMapper {
|
||||||
|
List<Break> breakList(BreakVo breakVo);
|
||||||
|
|
||||||
|
int breakAdd(Break break1);
|
||||||
|
|
||||||
|
int breakUpd(Break break1);
|
||||||
|
|
||||||
|
int breakDel(Integer breakId);
|
||||||
|
|
||||||
|
Integer addBreak(String breakCode, String breakVin, Date breakTime, Date breakDate, String breakType, Integer breakState);
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.domain.request.BreakReq;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BusinessBreakMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询故障
|
||||||
|
*
|
||||||
|
* @param breakId 故障主键
|
||||||
|
* @return 故障
|
||||||
|
*/
|
||||||
|
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障列表
|
||||||
|
*
|
||||||
|
* @param breakReq 故障
|
||||||
|
* @return 故障集合
|
||||||
|
*/
|
||||||
|
public List<BusinessBreak> selectBusinessBreakList(BreakReq breakReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障
|
||||||
|
*
|
||||||
|
* @param businessBreak 故障
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBusinessBreak(BusinessBreak businessBreak);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障
|
||||||
|
*
|
||||||
|
* @param businessBreak 故障
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBusinessBreak(BusinessBreak businessBreak);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障
|
||||||
|
*
|
||||||
|
* @param breakId 故障主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBusinessBreakByBreakId(Long breakId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除故障
|
||||||
|
*
|
||||||
|
* @param breakIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
|
||||||
|
|
||||||
|
List<BreakLog> breakLog();
|
||||||
|
|
||||||
|
}
|
|
@ -1,15 +1,12 @@
|
||||||
package com.zhilian.business.mapper;
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.zhilian.business.domain.Fence;
|
import com.zhilian.business.domain.Fence;
|
||||||
import com.zhilian.business.domain.FenceVo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
@Component
|
@Component
|
||||||
public interface FenceMapper extends BaseMapper<Fence> {
|
public interface FenceMapper extends BaseMapper<Fence> {
|
||||||
List<Fence> fenceList(FenceVo fenceVo);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface MarkersFenceMapper extends BaseMapper<MarkersFence> {
|
||||||
|
boolean deleteBatchFenceIds(List<Long> longs);
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.zhilian.business.domain.Markers;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface MarkersMapper extends BaseMapper<Markers> {
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.domain.VehicleFence;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface VehicleMapper extends BaseMapper<Vehicle> {
|
||||||
|
|
||||||
|
List<VehicleFence> selectListAll();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface VehicleMarkersMapper extends BaseMapper<VehicleMarkers> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.zhilian.business.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.VehicleType;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
@Component
|
||||||
|
public interface VehicleTypeMapper extends BaseMapper<VehicleType> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLogService
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 20:49
|
||||||
|
*/
|
||||||
|
public interface BreakLogService {
|
||||||
|
List<BreakLog> breakLog();
|
||||||
|
|
||||||
|
int logAdd(BreakLog breakLog);
|
||||||
|
|
||||||
|
int updLog(BreakLog breakLog);
|
||||||
|
|
||||||
|
int logDel(Integer breakLogId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean checkIfBreakLogExists(String breakCode, String breakVin);
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Break;
|
||||||
|
import com.zhilian.business.domain.BreakVo;
|
||||||
|
import com.zhilian.common.core.web.page.PageResult;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakService
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:54
|
||||||
|
*/
|
||||||
|
public interface BreakService {
|
||||||
|
PageResult<Break> breakList(BreakVo breakVo);
|
||||||
|
|
||||||
|
int breakAdd(Break break1);
|
||||||
|
|
||||||
|
int breakUpd(Break break1);
|
||||||
|
|
||||||
|
int breakDel(Integer breakId);
|
||||||
|
}
|
|
@ -1,14 +1,18 @@
|
||||||
package com.zhilian.business.service;
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
import com.zhilian.business.domain.Fence;
|
import com.zhilian.business.domain.Fence;
|
||||||
import com.zhilian.business.domain.FenceVo;
|
|
||||||
import com.zhilian.common.core.domain.Result;
|
import java.util.List;
|
||||||
|
|
||||||
public interface FenceService extends IService<Fence> {
|
public interface FenceService extends IService<Fence> {
|
||||||
PageInfo<Fence> fenceList(FenceVo fenceVo);
|
List<Fence> fenceList(Fence fence);
|
||||||
|
|
||||||
|
void fenceRedisData();
|
||||||
|
|
||||||
// Result insertFence(Fence fence);
|
boolean saveFence(Fence fence);
|
||||||
|
|
||||||
|
boolean updateByMap(Fence fence);
|
||||||
|
|
||||||
|
boolean removeByFence(Long fenceId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.domain.request.BreakReq;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障Service接口
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
public interface IBusinessBreakService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询故障
|
||||||
|
*
|
||||||
|
* @param breakId 故障主键
|
||||||
|
* @return 故障
|
||||||
|
*/
|
||||||
|
public BusinessBreak selectBusinessBreakByBreakId(Long breakId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障列表
|
||||||
|
*
|
||||||
|
* @param breakReq 故障
|
||||||
|
* @return 故障集合
|
||||||
|
*/
|
||||||
|
public List<BusinessBreak> selectBusinessBreakList(BreakReq breakReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障
|
||||||
|
*
|
||||||
|
* @param businessBreak 故障
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBusinessBreak(BusinessBreak businessBreak);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障
|
||||||
|
*
|
||||||
|
* @param businessBreak 故障
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBusinessBreak(BusinessBreak businessBreak);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除故障
|
||||||
|
*
|
||||||
|
* @param breakIds 需要删除的故障主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBusinessBreakByBreakIds(Long[] breakIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障信息
|
||||||
|
*
|
||||||
|
* @param breakId 故障主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBusinessBreakByBreakId(Long breakId);
|
||||||
|
|
||||||
|
List<BreakLog> breakLog();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zhilian.business.domain.Markers;
|
||||||
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
|
|
||||||
|
public interface MarkersFenceService extends IService<MarkersFence> {
|
||||||
|
boolean insert(Markers markers);
|
||||||
|
|
||||||
|
void removeAllFence(Markers markers);
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zhilian.business.domain.Markers;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface MarkersService extends IService<Markers> {
|
||||||
|
List<Markers> selectMarkersList(Markers markers);
|
||||||
|
|
||||||
|
List<Markers> listMarkers();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public interface VehicleMarkersService extends IService<VehicleMarkers> {
|
||||||
|
|
||||||
|
boolean insert(Vehicle vehicle);
|
||||||
|
|
||||||
|
void removeAllVehicle(Vehicle vehicle);
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.domain.VehicleFence;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VehicleService extends IService<Vehicle> {
|
||||||
|
|
||||||
|
List<Vehicle> selectVehicleList(Vehicle vehicle);
|
||||||
|
|
||||||
|
Vehicle getVehicleByVIN(String vehicleVIN);
|
||||||
|
|
||||||
|
boolean updateState(Vehicle vehicle);
|
||||||
|
|
||||||
|
void selectRedisData(Vehicle vehicle);
|
||||||
|
|
||||||
|
List<VehicleFence> selectSelectAllData();
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.zhilian.business.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.zhilian.business.domain.VehicleType;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VehicleTypeService extends IService<VehicleType> {
|
||||||
|
|
||||||
|
List<VehicleType> listVehicleType();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.mapper.BreakLogMapper;
|
||||||
|
import com.zhilian.business.service.BreakLogService;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakLogServiceImpl
|
||||||
|
* @Description 定时扫描故障状态
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/8 20:49
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Log4j2
|
||||||
|
public class BreakLogServiceImpl implements BreakLogService {
|
||||||
|
@Autowired
|
||||||
|
private BreakLogMapper breakLogMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisTemplate<String ,String> redisTemplate;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BreakLog> breakLog() {
|
||||||
|
BreakLog breakLog = new BreakLog();
|
||||||
|
// 10秒
|
||||||
|
final long timeInterval = 10000;
|
||||||
|
Runnable runnable = new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
while (true){
|
||||||
|
breakLogMapper.breakLog();
|
||||||
|
log.info("扫描故障状态");
|
||||||
|
String breakState = breakLog.getBreakState();
|
||||||
|
if (breakState != null){
|
||||||
|
// 判断故障状态
|
||||||
|
if (breakLog.getBreakState().equals("0")){
|
||||||
|
log.info("正常");
|
||||||
|
}else if (breakLog.getBreakState().equals("1")){
|
||||||
|
log.info("故障");
|
||||||
|
}else {
|
||||||
|
log.info("未知");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Thread.sleep(timeInterval);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
// 开启线程
|
||||||
|
Thread thread = new Thread(runnable);
|
||||||
|
thread.start();
|
||||||
|
// 返回故障日志
|
||||||
|
return breakLogMapper.breakLog();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int logAdd(BreakLog breakLog) {
|
||||||
|
return breakLogMapper.logAdd(breakLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int updLog(BreakLog breakLog) {
|
||||||
|
return breakLogMapper.updLog(breakLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int logDel(Integer breakLogId) {
|
||||||
|
return breakLogMapper.logDel(breakLogId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据故障码和vin判断数据库中是否有数据
|
||||||
|
* @param breakCode
|
||||||
|
* @param breakVin
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkIfBreakLogExists(String breakCode, String breakVin) {
|
||||||
|
BreakLog breakLog =breakLogMapper.findByBreakCodeAndBreakVin(breakCode,breakVin);
|
||||||
|
return breakLog!=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
|
import com.zhilian.business.domain.Break;
|
||||||
|
import com.zhilian.business.domain.BreakVo;
|
||||||
|
import com.zhilian.business.mapper.BreakMapper;
|
||||||
|
import com.zhilian.business.service.BreakService;
|
||||||
|
import com.zhilian.common.core.web.page.PageResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName BreakServiceImpl
|
||||||
|
* @Description TODO
|
||||||
|
* @Author YuanYongH
|
||||||
|
* @Date 2024/4/4 9:54
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BreakServiceImpl implements BreakService {
|
||||||
|
@Autowired
|
||||||
|
private BreakMapper breakMapper;
|
||||||
|
@Override
|
||||||
|
public PageResult<Break> breakList(BreakVo breakVo) {
|
||||||
|
PageHelper.startPage(breakVo.getPageNum(),breakVo.getPageSize());
|
||||||
|
List<Break> list = breakMapper.breakList(breakVo);
|
||||||
|
PageInfo<Break> info = new PageInfo<>(list);
|
||||||
|
return PageResult.toResult(info.getTotal(),list).getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int breakAdd(Break break1) {
|
||||||
|
int i = breakMapper.breakAdd(break1);
|
||||||
|
if (i>0){
|
||||||
|
breakMapper.addBreak(break1.getBreakCode(),break1.getBreakVin(),break1.getBreakTime(),break1.getBreakDate(),break1.getBreakType(),break1.getBreakState());
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int breakUpd(Break break1) {
|
||||||
|
return breakMapper.breakUpd(break1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int breakDel(Integer breakId) {
|
||||||
|
return breakMapper.breakDel(breakId);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,101 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhilian.business.domain.BreakLog;
|
||||||
|
import com.zhilian.business.domain.request.BreakReq;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.zhilian.business.mapper.BusinessBreakMapper;
|
||||||
|
import com.zhilian.business.domain.BusinessBreak;
|
||||||
|
import com.zhilian.business.service.IBusinessBreakService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yy
|
||||||
|
* @date 2024-04-07
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BusinessBreakServiceImpl implements IBusinessBreakService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private BusinessBreakMapper businessBreakMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障
|
||||||
|
*
|
||||||
|
* @param breakId 故障主键
|
||||||
|
* @return 故障
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BusinessBreak selectBusinessBreakByBreakId(Long breakId)
|
||||||
|
{
|
||||||
|
return businessBreakMapper.selectBusinessBreakByBreakId(breakId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障列表
|
||||||
|
*
|
||||||
|
* @param breakReq 故障
|
||||||
|
* @return 故障
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BusinessBreak> selectBusinessBreakList(BreakReq breakReq)
|
||||||
|
{
|
||||||
|
return businessBreakMapper.selectBusinessBreakList(breakReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障
|
||||||
|
*
|
||||||
|
* @param businessBreak 故障
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBusinessBreak(BusinessBreak businessBreak)
|
||||||
|
{
|
||||||
|
return businessBreakMapper.insertBusinessBreak(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障
|
||||||
|
*
|
||||||
|
* @param businessBreak 故障
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBusinessBreak(BusinessBreak businessBreak)
|
||||||
|
{
|
||||||
|
return businessBreakMapper.updateBusinessBreak(businessBreak);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除故障
|
||||||
|
*
|
||||||
|
* @param breakIds 需要删除的故障主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBusinessBreakByBreakIds(Long[] breakIds)
|
||||||
|
{
|
||||||
|
return businessBreakMapper.deleteBusinessBreakByBreakIds(breakIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障信息
|
||||||
|
*
|
||||||
|
* @param breakId 故障主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBusinessBreakByBreakId(Long breakId)
|
||||||
|
{
|
||||||
|
return businessBreakMapper.deleteBusinessBreakByBreakId(breakId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BreakLog> breakLog() {
|
||||||
|
return businessBreakMapper.breakLog();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,38 +1,114 @@
|
||||||
package com.zhilian.business.service.impl;
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.segments.MergeSegments;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.github.pagehelper.PageInfo;
|
|
||||||
import com.zhilian.business.domain.Fence;
|
import com.zhilian.business.domain.Fence;
|
||||||
import com.zhilian.business.domain.FenceVo;
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
import com.zhilian.business.mapper.FenceMapper;
|
import com.zhilian.business.mapper.FenceMapper;
|
||||||
|
import com.zhilian.business.mapper.MarkersFenceMapper;
|
||||||
|
import com.zhilian.business.mapper.MarkersMapper;
|
||||||
import com.zhilian.business.service.FenceService;
|
import com.zhilian.business.service.FenceService;
|
||||||
import com.zhilian.common.core.domain.Result;
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements FenceService {
|
public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements FenceService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private FenceMapper fenceMapper;
|
private RedisService redisService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MarkersFenceMapper markersFenceMapper;
|
||||||
|
|
||||||
|
private static final String FENCE_INFO_KEY = "fence_info:";
|
||||||
|
//电子围栏信息查询
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<Fence> fenceList(FenceVo fenceVo) {
|
public List<Fence> fenceList(Fence fence) {
|
||||||
|
if (fence.getFenceName() == null && fence.getFenceTypeId() == null && fence.getFenceState() == null) {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
PageHelper.startPage(fenceVo.getPageNum(),fenceVo.getPageSize());
|
LambdaQueryWrapper<Fence> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
List<Fence> list=fenceMapper.fenceList(fenceVo);
|
// 模糊条件 - 电子围栏名称
|
||||||
|
if (StringUtils.isNotEmpty(fence.getFenceName())) {
|
||||||
|
queryWrapper.like(Fence::getFenceName, fence.getFenceName());
|
||||||
|
}
|
||||||
|
|
||||||
PageInfo info = new PageInfo(list);
|
// 精确查询 - 查询类型
|
||||||
|
if (fence.getFenceTypeId() != null) {
|
||||||
|
queryWrapper.eq(Fence::getFenceTypeId, fence.getFenceTypeId());
|
||||||
|
}
|
||||||
|
|
||||||
return info;
|
// 模糊查询 - 状态
|
||||||
|
if (fence.getFenceState() != null) {
|
||||||
|
queryWrapper.eq(Fence::getFenceState, fence.getFenceState());
|
||||||
|
}
|
||||||
|
if(!redisService.hasKey(FENCE_INFO_KEY)){
|
||||||
|
fenceRedisData();
|
||||||
|
}
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
//缓存电子围栏信息
|
||||||
|
@Override
|
||||||
|
public void fenceRedisData() {
|
||||||
|
List<Fence> list = this.list();
|
||||||
|
for (Fence fence : list) {
|
||||||
|
if(!redisService.hasKey(FENCE_INFO_KEY+fence.getFenceId())){
|
||||||
|
redisService.setCacheSet(FENCE_INFO_KEY+fence.getFenceId(),fence.getFenceMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//删除电子围栏全部数据
|
||||||
|
private void fenceRedisDelete(){
|
||||||
|
List<Fence> list = this.list();
|
||||||
|
for (Fence fence : list) {
|
||||||
|
redisService.deleteObject(FENCE_INFO_KEY+fence.getFenceId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//添加电子围栏信息
|
||||||
|
@Override
|
||||||
|
public boolean saveFence(Fence fence) {
|
||||||
|
boolean save = this.save(fence);
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
//绑定经纬度地图
|
||||||
|
@Override
|
||||||
|
public boolean updateByMap(Fence fence) {
|
||||||
|
boolean updateByMap = this.updateById(fence);
|
||||||
|
if(redisService.hasKey(FENCE_INFO_KEY+fence.getFenceId())){
|
||||||
|
redisService.deleteObject(FENCE_INFO_KEY+fence.getFenceId());
|
||||||
|
}
|
||||||
|
redisService.setCacheSet(FENCE_INFO_KEY+fence.getFenceId(),fence.getFenceMessage());
|
||||||
|
return updateByMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//删除电子围栏
|
||||||
|
@Override
|
||||||
|
public boolean removeByFence(Long fenceId) {
|
||||||
|
boolean remove = this.removeById(fenceId);
|
||||||
|
if(redisService.hasKey(FENCE_INFO_KEY+fenceId)){
|
||||||
|
redisService.deleteObject(FENCE_INFO_KEY+fenceId);
|
||||||
|
}
|
||||||
|
QueryWrapper<MarkersFence> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("fence_id", fenceId);
|
||||||
|
List<MarkersFence> markersFences = markersFenceMapper.selectList(queryWrapper);
|
||||||
|
List<Long> longs = new ArrayList<>();
|
||||||
|
markersFences.stream().forEach(markersFence -> {
|
||||||
|
longs.add(markersFence.getMarkerId());
|
||||||
|
});
|
||||||
|
markersFenceMapper.deleteBatchFenceIds(longs);
|
||||||
|
return remove;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
|
||||||
// public Result insertFence(Fence fence) {
|
|
||||||
// boolean save = this.save(fence);
|
|
||||||
// return Result.success(save);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhilian.business.domain.Markers;
|
||||||
|
import com.zhilian.business.domain.middle.MarkersFence;
|
||||||
|
import com.zhilian.business.service.FenceService;
|
||||||
|
import com.zhilian.business.mapper.MarkersFenceMapper;
|
||||||
|
import com.zhilian.business.service.MarkersFenceService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MarkersFenceServiceImpl extends ServiceImpl<MarkersFenceMapper, MarkersFence> implements MarkersFenceService {
|
||||||
|
@Autowired
|
||||||
|
private MarkersFenceMapper markersFenceMapper;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean insert(Markers markers) {
|
||||||
|
ArrayList<MarkersFence> markersFences = new ArrayList<>();
|
||||||
|
markers.getFenceIds().forEach(fenceId -> {
|
||||||
|
MarkersFence markersFence = new MarkersFence();
|
||||||
|
markersFence.setMarkerId(markers.getMarkersId());
|
||||||
|
markersFence.setFenceId(fenceId);
|
||||||
|
markersFences.add(markersFence);
|
||||||
|
});
|
||||||
|
return this.saveBatch(markersFences);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAllFence(Markers markers) {
|
||||||
|
List<MarkersFence> list = this.list(new LambdaQueryWrapper<MarkersFence>().eq(MarkersFence::getMarkerId, markers.getMarkersId()));
|
||||||
|
this.removeBatchByIds(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhilian.business.domain.Markers;
|
||||||
|
import com.zhilian.business.mapper.MarkersMapper;
|
||||||
|
import com.zhilian.business.service.MarkersService;
|
||||||
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MarkersServiceImpl extends ServiceImpl<MarkersMapper, Markers> implements MarkersService {
|
||||||
|
@Autowired
|
||||||
|
RedisService service;
|
||||||
|
@Override
|
||||||
|
public List<Markers> selectMarkersList(Markers markers) {
|
||||||
|
LambdaQueryWrapper<Markers> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//模糊查询 查询标识名称
|
||||||
|
queryWrapper.like(StringUtils.isNotEmpty(markers.getMarkersName()), Markers::getMarkersName, markers.getMarkersName());
|
||||||
|
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部标识信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Markers> listMarkers() {
|
||||||
|
if(service.hasKey("markers")){
|
||||||
|
List<Markers> markers = service.getCacheList("markers");
|
||||||
|
return markers;
|
||||||
|
}
|
||||||
|
List<Markers> list = this.list();
|
||||||
|
service.setCacheList("markers",list);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.domain.middle.VehicleMarkers;
|
||||||
|
import com.zhilian.business.mapper.*;
|
||||||
|
import com.zhilian.business.service.VehicleMarkersService;
|
||||||
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class VehicleMarkersServiceImpl extends ServiceImpl<VehicleMarkersMapper, VehicleMarkers> implements VehicleMarkersService {
|
||||||
|
// @Autowired
|
||||||
|
// private VehicleMapper vehicleMapper;
|
||||||
|
//
|
||||||
|
// @Autowired
|
||||||
|
// private VehicleMarkersMapper vehicleMarkersMapper;
|
||||||
|
//
|
||||||
|
// @Autowired
|
||||||
|
// private RedisService redisService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MarkersMapper markersMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MarkersFenceMapper markersFenceMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FenceMapper fenceMapper;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor=Exception.class)
|
||||||
|
@Override
|
||||||
|
public boolean insert(Vehicle vehicle) {
|
||||||
|
ArrayList<VehicleMarkers> list = new ArrayList<>();
|
||||||
|
vehicle.getMarkersIds().forEach(markerId -> {
|
||||||
|
VehicleMarkers vehicleMarkers = new VehicleMarkers();
|
||||||
|
vehicleMarkers.setVehicleId(vehicle.getVehicleId());
|
||||||
|
vehicleMarkers.setMarkersId(markerId);
|
||||||
|
list.add(vehicleMarkers);
|
||||||
|
});
|
||||||
|
return this.saveBatch(list);
|
||||||
|
|
||||||
|
// String vehicleVIN = vehicle.getVehicleVIN();
|
||||||
|
// //标识
|
||||||
|
// List<Markers> markers = markersMapper.selectBatchIds(vehicle.getMarkersIds());
|
||||||
|
// //中间表
|
||||||
|
// List<MarkersFence> markersFences = markersFenceMapper.selectBatchIds(markers);
|
||||||
|
// //围栏
|
||||||
|
// List<Long> fenceIds = markersFences.stream().map(MarkersFence::getFenceId).collect(Collectors.toList());
|
||||||
|
// List<Fence> fences = fenceMapper.selectBatchIds(fenceIds);
|
||||||
|
//
|
||||||
|
// System.out.println("**********************"+fences);
|
||||||
|
// List<MarkersFence> markersFences = markersFenceMapper.selectList(new LambdaQueryWrapper<MarkersFence>().in(MarkersFence::getMarkersId, vehicle.getMarkersIds()));
|
||||||
|
// List<Fence> fences = fenceMapper.selectBatchIds(markersFences.stream().map(MarkersFence::getFenceId).distinct().toArray(Long[]::new));
|
||||||
|
// markersFences.forEach(markersFence -> {
|
||||||
|
// markersFence.setFence(fences.stream().filter(fence -> fence.getFenceId().equals(markersFence.getFenceId())).findFirst().get());
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// redisService.set(vehicle.getVehicleId(), markersFences);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeAllVehicle(Vehicle vehicle) {
|
||||||
|
List<VehicleMarkers> list = this.list(new LambdaQueryWrapper<VehicleMarkers>().eq(VehicleMarkers::getVehicleId, vehicle.getVehicleId()));
|
||||||
|
this.removeByIds(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,109 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhilian.business.domain.Vehicle;
|
||||||
|
import com.zhilian.business.domain.VehicleFence;
|
||||||
|
import com.zhilian.business.mapper.*;
|
||||||
|
import com.zhilian.business.service.VehicleService;
|
||||||
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@Log4j2
|
||||||
|
public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> implements VehicleService {
|
||||||
|
@Autowired
|
||||||
|
private VehicleMapper vehicleMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
|
private final String VEHICLE_PEOPLE_KEY = "vehicle_fence:";
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> selectVehicleList(Vehicle vehicle) {
|
||||||
|
LambdaQueryWrapper<Vehicle> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//模糊条件 查询VIN
|
||||||
|
if (StringUtils.isNotEmpty(vehicle.getVehicleVIN())) {
|
||||||
|
queryWrapper.like(Vehicle::getVehicleVIN, vehicle.getVehicleVIN());
|
||||||
|
}
|
||||||
|
// 精确查询 - 查询类型
|
||||||
|
if (vehicle.getVehicleTypeId() != null) {
|
||||||
|
queryWrapper.eq(Vehicle::getVehicleTypeId, vehicle.getVehicleTypeId());
|
||||||
|
}
|
||||||
|
//模糊查询 车辆电机厂商
|
||||||
|
if (StringUtils.isNotEmpty(vehicle.getMotorId())) {
|
||||||
|
queryWrapper.like(Vehicle::getMotorId, vehicle.getMotorId());
|
||||||
|
}
|
||||||
|
//模糊查询 车辆电池厂商
|
||||||
|
if (StringUtils.isNotEmpty(vehicle.getBatteryId())) {
|
||||||
|
queryWrapper.like(Vehicle::getBatteryId, vehicle.getBatteryId());
|
||||||
|
}
|
||||||
|
//模糊查询 车辆电机ID
|
||||||
|
if (StringUtils.isNotEmpty(vehicle.getVehicleMotor())) {
|
||||||
|
queryWrapper.like(Vehicle::getVehicleMotor, vehicle.getVehicleMotor());
|
||||||
|
}
|
||||||
|
//模糊查询 车辆电池ID
|
||||||
|
if (StringUtils.isNotEmpty(vehicle.getVehicleBattery())) {
|
||||||
|
queryWrapper.like(Vehicle::getVehicleBattery, vehicle.getVehicleBattery());
|
||||||
|
}
|
||||||
|
//精确查询 车辆状态
|
||||||
|
if (vehicle.getVehicleState() != null) {
|
||||||
|
queryWrapper.eq(Vehicle::getVehicleState, vehicle.getVehicleState());
|
||||||
|
}
|
||||||
|
|
||||||
|
// queryWrapper.like(StringUtils.isNotEmpty(vehicle.getVehicleVIN()), Vehicle::getVehicleVIN, vehicle.getVehicleVIN())
|
||||||
|
// .eq(vehicle.getVehicleTypeId() != null, Vehicle::getVehicleTypeId, vehicle.getVehicleTypeId())
|
||||||
|
// .like(StringUtils.isNotEmpty(vehicle.getMotorID()), Vehicle::getMotorID, vehicle.getMotorID())
|
||||||
|
// .like(StringUtils.isNotEmpty(vehicle.getBatteryID()), Vehicle::getBatteryID, vehicle.getBatteryID())
|
||||||
|
// .like(StringUtils.isNotEmpty(vehicle.getMotorBusiness()), Vehicle::getMotorBusiness, vehicle.getMotorBusiness())
|
||||||
|
// .like(StringUtils.isNotEmpty(vehicle.getBatteryBusiness()), Vehicle::getBatteryBusiness, vehicle.getBatteryBusiness())
|
||||||
|
// .eq(vehicle.getVehicleState() != null, Vehicle::getVehicleState, vehicle.getVehicleState());
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Vehicle getVehicleByVIN(String vehicleVIN) {
|
||||||
|
LambdaQueryWrapper<Vehicle> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(Vehicle::getVehicleVIN, vehicleVIN);
|
||||||
|
return vehicleMapper.selectOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updateState(Vehicle vehicle) {
|
||||||
|
int update = vehicleMapper.update(vehicle, new LambdaQueryWrapper<Vehicle>().eq(Vehicle::getVehicleVIN, vehicle.getVehicleVIN()));
|
||||||
|
if(update==0){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void selectRedisData(Vehicle vehicle) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<VehicleFence> selectSelectAllData() {
|
||||||
|
List<VehicleFence> vehicleMarkersFence = vehicleMapper.selectListAll();
|
||||||
|
for (VehicleFence vehicleFence : vehicleMarkersFence) {
|
||||||
|
String[] fenceIdsArray = vehicleFence.getFences().split(",");
|
||||||
|
ArrayList<String> fenceIdsArrayList = new ArrayList<>(Arrays.asList( fenceIdsArray));
|
||||||
|
vehicleFence.setFenceIds(fenceIdsArrayList);
|
||||||
|
}
|
||||||
|
for (VehicleFence vehicleFence : vehicleMarkersFence) {
|
||||||
|
redisService.setCacheList(VEHICLE_PEOPLE_KEY + vehicleFence.getVehicleVIN(), vehicleFence.getFenceIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info(vehicleMarkersFence);
|
||||||
|
return vehicleMarkersFence;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.zhilian.business.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.zhilian.business.domain.VehicleType;
|
||||||
|
import com.zhilian.business.mapper.VehicleTypeMapper;
|
||||||
|
import com.zhilian.business.service.VehicleTypeService;
|
||||||
|
import com.zhilian.common.redis.service.RedisService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Service
|
||||||
|
public class VehicleTypeServiceImpl extends ServiceImpl<VehicleTypeMapper, VehicleType> implements VehicleTypeService {
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
@Override
|
||||||
|
public List<VehicleType> listVehicleType() {
|
||||||
|
if(redisService.hasKey("vehicleType")){
|
||||||
|
List<VehicleType> vehicleType = redisService.getCacheList("vehicleType");
|
||||||
|
return vehicleType;
|
||||||
|
}
|
||||||
|
List<VehicleType> list = this.list();
|
||||||
|
redisService.setCacheList("vehicleType",list);
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,2 +1,3 @@
|
||||||
Spring Boot Version: ${spring-boot.version}
|
Spring Boot Version: ${spring-boot.version}
|
||||||
Spring Application Name: ${spring.application.name}
|
Spring Application Name: ${spring.application.name}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
<?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.zhilian.business.mapper.BreakLogMapper">
|
||||||
|
|
||||||
|
<!-- 查询-->
|
||||||
|
<resultMap type="com.zhilian.business.domain.BreakLog" id="BaseResultMap">
|
||||||
|
<result property="breakLogId" column="break_log_id"/>
|
||||||
|
<result property="breakCode" column="break_code"/>
|
||||||
|
<result property="breakVin" column="break_vin"/>
|
||||||
|
<result property="breakType" column="break_time"/>
|
||||||
|
<result property="breakTime" column="break_type"/>
|
||||||
|
<result property="breakDate" column="break_date"/>
|
||||||
|
<result property="breakState" column="break_state"/>
|
||||||
|
<result property="breakDel" column="break_del"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<insert id="logAdd">
|
||||||
|
|
||||||
|
INSERT INTO `zhilian-business`.`business_break_log`
|
||||||
|
( `break_code`, `break_vin`, `break_time`, `break_type`, `break_date`, `break_state`,`break_del`)
|
||||||
|
VALUES
|
||||||
|
(#{breakCode}, #{breakVin},#{breakTime}, #{breakType},DATE_ADD(NOW(),INTERVAL 8 HOUR), #{breakState},0);
|
||||||
|
</insert>
|
||||||
|
<update id="updLog">
|
||||||
|
UPDATE `zhilian-business`.`business_break_log`
|
||||||
|
SET `break_code` = #{breakCode}, `break_vin` = #{breakVin}, `break_time` = NOW(), `break_type` = #{breakType}, `break_date` = NOW(), `break_state` = #{breakState}, `break_del` = #{breakDel}
|
||||||
|
WHERE `break_log_id` = #{breakLogId};
|
||||||
|
|
||||||
|
</update>
|
||||||
|
<update id="logDel">
|
||||||
|
UPDATE `zhilian-business`.`business_break_log`
|
||||||
|
SET break_del = 1
|
||||||
|
WHERE break_log_id = #{breakLogId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
||||||
|
select * from business_break_log where break_del = 0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据故障码和vin判断数据库中是否有数据-->
|
||||||
|
<select id="findByBreakCodeAndBreakVin" resultMap="BaseResultMap">
|
||||||
|
select * from business_break_log where break_code =#{breakCode} and break_vin =#{breakVin} and break_del =0
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?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.zhilian.business.mapper.BreakMapper">
|
||||||
|
<insert id="breakAdd">
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
<insert id="addBreak">
|
||||||
|
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="breakUpd">
|
||||||
|
|
||||||
|
</update>
|
||||||
|
<update id="breakDel">
|
||||||
|
delete from business_breakdown where break_id = #{breakId}
|
||||||
|
</update>
|
||||||
|
<select id="breakList" resultType="com.zhilian.business.domain.Break">
|
||||||
|
select * from business_break
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,81 @@
|
||||||
|
<?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.zhilian.business.mapper.BusinessBreakMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.zhilian.business.domain.BusinessBreak" id="BusinessBreakResult">
|
||||||
|
<result property="breakId" column="break_id" />
|
||||||
|
<result property="breakCode" column="break_code" />
|
||||||
|
<result property="breakVin" column="break_vin" />
|
||||||
|
<result property="breakTime" column="break_time" />
|
||||||
|
<result property="breakType" column="break_type" />
|
||||||
|
<result property="breakDate" column="break_date" />
|
||||||
|
<result property="breakState" column="break_state" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectBusinessBreakVo">
|
||||||
|
select break_id, break_code, break_vin, break_time, break_type, break_date, break_state from business_break
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBusinessBreakList" parameterType="com.zhilian.business.domain.BusinessBreak" resultMap="BusinessBreakResult">
|
||||||
|
<include refid="selectBusinessBreakVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="breakCode != null and breakCode != ''"> and break_code = #{breakCode}</if>
|
||||||
|
<if test="breakVin != null and breakVin != ''"> and break_vin = #{breakVin}</if>
|
||||||
|
<if test="breakType != null and breakType != ''"> and break_type = #{breakType}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBusinessBreakByBreakId" parameterType="Long" resultMap="BusinessBreakResult">
|
||||||
|
<include refid="selectBusinessBreakVo"/>
|
||||||
|
where break_id = #{breakId}
|
||||||
|
</select>
|
||||||
|
<select id="breakLog" resultType="com.zhilian.business.domain.BreakLog">
|
||||||
|
select * from business_break_log
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBusinessBreak" parameterType="com.zhilian.business.domain.BusinessBreak" useGeneratedKeys="true" keyProperty="breakId">
|
||||||
|
insert into business_break
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="breakCode != null">break_code,</if>
|
||||||
|
<if test="breakVin != null">break_vin,</if>
|
||||||
|
<if test="breakTime != null">break_time,</if>
|
||||||
|
<if test="breakType != null">break_type,</if>
|
||||||
|
<if test="breakDate != null">break_date,</if>
|
||||||
|
<if test="breakState != null">break_state,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="breakCode != null">#{breakCode},</if>
|
||||||
|
<if test="breakVin != null">#{breakVin},</if>
|
||||||
|
<if test="breakTime != null">#{breakTime},</if>
|
||||||
|
<if test="breakType != null">#{breakType},</if>
|
||||||
|
<if test="breakDate != null">#{breakDate},</if>
|
||||||
|
<if test="breakState != null">#{breakState},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateBusinessBreak" parameterType="com.zhilian.business.domain.BusinessBreak">
|
||||||
|
update business_break
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="breakCode != null">break_code = #{breakCode},</if>
|
||||||
|
<if test="breakVin != null">break_vin = #{breakVin},</if>
|
||||||
|
<if test="breakTime != null">break_time = #{breakTime},</if>
|
||||||
|
<if test="breakType != null">break_type = #{breakType},</if>
|
||||||
|
<if test="breakDate != null">break_date = #{breakDate},</if>
|
||||||
|
<if test="breakState != null">break_state = #{breakState},</if>
|
||||||
|
</trim>
|
||||||
|
where break_id = #{breakId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBusinessBreakByBreakId" parameterType="Long">
|
||||||
|
delete from business_break where break_id = #{breakId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBusinessBreakByBreakIds" parameterType="String">
|
||||||
|
delete from business_break where break_id in
|
||||||
|
<foreach item="breakId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{breakId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -1,59 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.zhilian.business.mapper.FenceMapper">
|
|
||||||
<!-- <resultMap type="com.zhilian.business.domain.Fence" id="FenceResult">-->
|
|
||||||
<!-- <id property="fenceId" column="fence_id"/>-->
|
|
||||||
<!-- <result property="fenceName" column="fence_name"/>-->
|
|
||||||
<!-- <result property="fenceTypeId" column="fence_type_id"/>-->
|
|
||||||
<!-- <result property="fenceState" column="fence_state"/>-->
|
|
||||||
<!-- <result property="fenceMessage" column="fence_message"/>-->
|
|
||||||
<!-- <result property="createBy" column="create_by"/>-->
|
|
||||||
<!-- <result property="createTime" column="create_time"/>-->
|
|
||||||
<!-- <result property="updateBy" column="update_by"/>-->
|
|
||||||
<!-- <result property="updateTime" column="update_time"/>-->
|
|
||||||
<!-- <result property="remark" column="remark"/>-->
|
|
||||||
<!-- </resultMap>-->
|
|
||||||
<select id="fenceList" resultType="com.zhilian.business.domain.Fence">
|
|
||||||
select * from business_fence
|
|
||||||
<where>
|
|
||||||
<if test="fenceName!=null and fenceName!=''">
|
|
||||||
and fence_name like concat('%',#{fenceName},'%')
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="fenceTypeId!=null">
|
|
||||||
and fence_type_id=#{fenceTypeId}
|
|
||||||
</if>
|
|
||||||
|
|
||||||
<if test="fenceState!=null">
|
|
||||||
and fence_state=#{fenceState}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
<!-- <sql id="selectFenceVo">-->
|
|
||||||
<!-- select fence_id,-->
|
|
||||||
<!-- fence_name,-->
|
|
||||||
<!-- fence_type_id,-->
|
|
||||||
<!-- fence_state,-->
|
|
||||||
<!-- fence_message,-->
|
|
||||||
<!-- create_by,-->
|
|
||||||
<!-- create_time,-->
|
|
||||||
<!-- update_by,-->
|
|
||||||
<!-- update_time,-->
|
|
||||||
<!-- remark-->
|
|
||||||
<!-- from business_fence-->
|
|
||||||
<!-- </sql>-->
|
|
||||||
|
|
||||||
<!-- <select id="fenceList" parameterType="com.zhilian.business.domain.Fence">-->
|
|
||||||
<!-- <include refid="selectFenceVo"/>-->
|
|
||||||
<!-- <where>-->
|
|
||||||
<!-- <if test="fenceName != null and fenceName != ''">-->
|
|
||||||
<!-- AND fence_name like concat('%', #{fenceName}, '%')-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- <if test="fenceTypeId != null">-->
|
|
||||||
<!-- AND fenceTypeId = #{fenceTypeId}-->
|
|
||||||
<!-- </if>-->
|
|
||||||
<!-- </where>-->
|
|
||||||
<!-- </select>-->
|
|
||||||
</mapper>
|
|
|
@ -2,6 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.zhilian.online.mapper.OnlineGatherMapper">
|
<mapper namespace="com.zhilian.business.mapper.MarkersFenceMapper">
|
||||||
|
|
||||||
</mapper>
|
<delete id="deleteBatchFenceIds">
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,24 @@
|
||||||
|
<?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.zhilian.business.mapper.VehicleMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectListAll" resultType="com.zhilian.business.domain.VehicleFence">
|
||||||
|
SELECT
|
||||||
|
BV.vehicle_id,
|
||||||
|
BV.vehicle_vin,
|
||||||
|
GROUP_CONCAT(BF.fence_id) AS fenceIds
|
||||||
|
FROM
|
||||||
|
business_vehicle AS BV
|
||||||
|
JOIN
|
||||||
|
business_vehicle_markers AS BVM ON BV.vehicle_id = BVM.vehicle_id
|
||||||
|
JOIN
|
||||||
|
business_markers_fence AS BMF ON BVM.markers_id = BMF.markers_id
|
||||||
|
JOIN
|
||||||
|
business_fence AS BF ON BMF.fence_id = BF.fence_id
|
||||||
|
GROUP BY
|
||||||
|
BV.vehicle_id, BV.vehicle_vin
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
* @BelongsPackage: com.zhilian.manager
|
* @BelongsPackage: com.zhilian.manager
|
||||||
* @Author: LiYuan
|
* @Author: LiYuan
|
||||||
* @CreateTime: 2024-03-31 10:17
|
* @CreateTime: 2024-03-31 10:17
|
||||||
* @Description: TODO
|
* @Description: 管理模块启动类
|
||||||
* @Version: 1.0
|
* @Version: 1.0
|
||||||
*/
|
*/
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.zhilian.manager;
|
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
@SpringBootApplication
|
|
||||||
public class zhilianMangerApplication {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
SpringApplication.run(zhilianMangerApplication.class, args);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 10.10.25.2:8848
|
server-addr: 10.10.25.2:8848
|
||||||
namespace: 9d9e22dc-ff70-42c5-adac-fa69e6d62dbe
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -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.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>zhilian-message</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.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -92,6 +92,24 @@
|
||||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- kafka配置-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.kafka</groupId>
|
||||||
|
<artifactId>spring-kafka</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 业务系统远程调用-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zhilian</groupId>
|
||||||
|
<artifactId>zhilian-common-business</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里云Ecs服务依赖(openAPI)-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>ecs20140526</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue