Compare commits
No commits in common. "master" and "server_2024_3_26_jiangcan" have entirely different histories.
master
...
server_202
124
pom.xml
124
pom.xml
|
@ -36,9 +36,6 @@
|
||||||
<poi.version>4.1.2</poi.version>
|
<poi.version>4.1.2</poi.version>
|
||||||
<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>
|
|
||||||
<spring-kafka.version>2.8.0</spring-kafka.version>
|
|
||||||
<aliyun.ecs.version>3.1.12</aliyun.ecs.version>
|
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
|
@ -245,36 +242,7 @@
|
||||||
<version>${zhilian.version}</version>
|
<version>${zhilian.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--mqtt版本管理-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.eclipse.paho</groupId>
|
|
||||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
|
||||||
<version>${mqttv3.version}</version>
|
|
||||||
</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>
|
||||||
|
@ -328,57 +296,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,9 +15,11 @@ 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,8 +19,6 @@
|
||||||
<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>
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.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>
|
|
|
@ -1,43 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,113 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
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.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName Fence
|
|
||||||
* @Description 电子围栏实体类
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 15:28 2024/4/8
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@TableName("business_fence")
|
|
||||||
public class Fence extends BaseEntity {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
/**
|
|
||||||
* 电子围栏编号
|
|
||||||
*/
|
|
||||||
@Excel(name = "参数主键", cellType = Excel.ColumnType.NUMERIC)
|
|
||||||
@TableId(value = "fence_id", type = IdType.AUTO)
|
|
||||||
private Long fenceId;
|
|
||||||
/**
|
|
||||||
* 电子围栏名称
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏名称")
|
|
||||||
@TableField("fence_name")
|
|
||||||
private String fenceName;
|
|
||||||
/**
|
|
||||||
* 电子围栏类型编号
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏类型编号")
|
|
||||||
@TableField("fence_type_id")
|
|
||||||
private Long fenceTypeId;
|
|
||||||
/**
|
|
||||||
* 电子围栏状态
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏状态")
|
|
||||||
@TableField("fence_state")
|
|
||||||
private Long fenceState;
|
|
||||||
/**
|
|
||||||
* 电子围栏经纬度信息
|
|
||||||
*/
|
|
||||||
@Excel(name = "电子围栏经纬度信息")
|
|
||||||
@TableField("fence_message")
|
|
||||||
private String fenceMessage;
|
|
||||||
@TableField(exist = false)
|
|
||||||
List<Markers> markersList;
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,71 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package com.zhilian.business.domain.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class MarkersVo {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,37 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
package com.zhilian.business.remote;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public interface RemoteFenceService {
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,38 +0,0 @@
|
||||||
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("故障日志服务调用失败");
|
|
||||||
// }
|
|
||||||
// };
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
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 {
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
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());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
com.zhilian.business.remote.factory.RemoteBreakFallbackFactory
|
|
||||||
com.zhilian.business.remote.factory.RemoteFenceFallbackFactory
|
|
||||||
com.zhilian.business.remote.factory.RemoteVehicleFallbackFactory
|
|
|
@ -11,12 +11,6 @@ public class SecurityConstants {
|
||||||
*/
|
*/
|
||||||
public static final String DETAILS_USER_ID = "user_id";
|
public static final String DETAILS_USER_ID = "user_id";
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID字段
|
|
||||||
*/
|
|
||||||
public static final String COMPANY_SIGN = "company_sign";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名字段
|
* 用户名字段
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -20,13 +20,4 @@ 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";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,14 +61,6 @@ public class SecurityContextHolder {
|
||||||
set(SecurityConstants.DETAILS_USERNAME, username);
|
set(SecurityConstants.DETAILS_USERNAME, username);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCompanySign () {
|
|
||||||
return get(SecurityConstants.COMPANY_SIGN);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setCompanySign (String companySign) {
|
|
||||||
set(SecurityConstants.COMPANY_SIGN, companySign);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getUserKey () {
|
public static String getUserKey () {
|
||||||
return get(SecurityConstants.USER_KEY);
|
return get(SecurityConstants.USER_KEY);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应信息主体
|
* 响应信息主体
|
||||||
|
|
|
@ -109,25 +109,6 @@ public class JwtUtils {
|
||||||
return getValue(claims, SecurityConstants.DETAILS_USERNAME);
|
return getValue(claims, SecurityConstants.DETAILS_USERNAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据令牌获取公司标识
|
|
||||||
* @param token
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getCompanySign (String token) {
|
|
||||||
Claims claims = parseToken(token);
|
|
||||||
return getValue(claims, SecurityConstants.COMPANY_SIGN);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据身份信息获取公司标识
|
|
||||||
* @param claims
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getCompanySign (Claims claims) {
|
|
||||||
return getValue(claims, SecurityConstants.COMPANY_SIGN);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据身份信息获取键值
|
* 根据身份信息获取键值
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.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>
|
|
|
@ -1,18 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
package com.zhilian.common.event;
|
|
||||||
|
|
||||||
public interface VehicleEventConstants {
|
|
||||||
}
|
|
|
@ -1 +0,0 @@
|
||||||
com.zhilian.common.event.VehicleEventCache
|
|
|
@ -1,13 +1,14 @@
|
||||||
package com.zhilian.common.redis.service;
|
package com.zhilian.common.redis.service;
|
||||||
|
|
||||||
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.BoundSetOperations;
|
||||||
|
import org.springframework.data.redis.core.HashOperations;
|
||||||
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
|
import org.springframework.data.redis.core.ValueOperations;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spring redis 工具类
|
* spring redis 工具类
|
||||||
|
@ -26,7 +27,7 @@ public class RedisService {
|
||||||
* @param key 缓存的键值
|
* @param key 缓存的键值
|
||||||
* @param value 缓存的值
|
* @param value 缓存的值
|
||||||
*/
|
*/
|
||||||
public <T> void setCacheObject(final String key, final T value) {
|
public <T> void setCacheObject (final String key, final T value) {
|
||||||
redisTemplate.opsForValue().set(key, value);
|
redisTemplate.opsForValue().set(key, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +39,7 @@ public class RedisService {
|
||||||
* @param timeout 时间
|
* @param timeout 时间
|
||||||
* @param timeUnit 时间颗粒度
|
* @param timeUnit 时间颗粒度
|
||||||
*/
|
*/
|
||||||
public <T> void setCacheObject(final String key, final T value, final Long timeout, final TimeUnit timeUnit) {
|
public <T> void setCacheObject (final String key, final T value, final Long timeout, final TimeUnit timeUnit) {
|
||||||
redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
|
redisTemplate.opsForValue().set(key, value, timeout, timeUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,9 +48,10 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key Redis键
|
* @param key Redis键
|
||||||
* @param timeout 超时时间
|
* @param timeout 超时时间
|
||||||
|
*
|
||||||
* @return true=设置成功;false=设置失败
|
* @return true=设置成功;false=设置失败
|
||||||
*/
|
*/
|
||||||
public boolean expire(final String key, final long timeout) {
|
public boolean expire (final String key, final long timeout) {
|
||||||
return expire(key, timeout, TimeUnit.SECONDS);
|
return expire(key, timeout, TimeUnit.SECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +61,10 @@ public class RedisService {
|
||||||
* @param key Redis键
|
* @param key Redis键
|
||||||
* @param timeout 超时时间
|
* @param timeout 超时时间
|
||||||
* @param unit 时间单位
|
* @param unit 时间单位
|
||||||
|
*
|
||||||
* @return true=设置成功;false=设置失败
|
* @return true=设置成功;false=设置失败
|
||||||
*/
|
*/
|
||||||
public boolean expire(final String key, final long timeout, final TimeUnit unit) {
|
public boolean expire (final String key, final long timeout, final TimeUnit unit) {
|
||||||
return redisTemplate.expire(key, timeout, unit);
|
return redisTemplate.expire(key, timeout, unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,9 +72,10 @@ public class RedisService {
|
||||||
* 获取有效时间
|
* 获取有效时间
|
||||||
*
|
*
|
||||||
* @param key Redis键
|
* @param key Redis键
|
||||||
|
*
|
||||||
* @return 有效时间
|
* @return 有效时间
|
||||||
*/
|
*/
|
||||||
public long getExpire(final String key) {
|
public long getExpire (final String key) {
|
||||||
return redisTemplate.getExpire(key);
|
return redisTemplate.getExpire(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,9 +83,10 @@ public class RedisService {
|
||||||
* 判断 key是否存在
|
* 判断 key是否存在
|
||||||
*
|
*
|
||||||
* @param key 键
|
* @param key 键
|
||||||
|
*
|
||||||
* @return true 存在 false不存在
|
* @return true 存在 false不存在
|
||||||
*/
|
*/
|
||||||
public Boolean hasKey(String key) {
|
public Boolean hasKey (String key) {
|
||||||
return redisTemplate.hasKey(key);
|
return redisTemplate.hasKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,9 +94,10 @@ public class RedisService {
|
||||||
* 获得缓存的基本对象。
|
* 获得缓存的基本对象。
|
||||||
*
|
*
|
||||||
* @param key 缓存键值
|
* @param key 缓存键值
|
||||||
|
*
|
||||||
* @return 缓存键值对应的数据
|
* @return 缓存键值对应的数据
|
||||||
*/
|
*/
|
||||||
public <T> T getCacheObject(final String key) {
|
public <T> T getCacheObject (final String key) {
|
||||||
ValueOperations<String, T> operation = redisTemplate.opsForValue();
|
ValueOperations<String, T> operation = redisTemplate.opsForValue();
|
||||||
return operation.get(key);
|
return operation.get(key);
|
||||||
}
|
}
|
||||||
|
@ -101,7 +107,7 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
public boolean deleteObject(final String key) {
|
public boolean deleteObject (final String key) {
|
||||||
return redisTemplate.delete(key);
|
return redisTemplate.delete(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,9 +115,10 @@ public class RedisService {
|
||||||
* 删除集合对象
|
* 删除集合对象
|
||||||
*
|
*
|
||||||
* @param collection 多个对象
|
* @param collection 多个对象
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean deleteObject(final Collection collection) {
|
public boolean deleteObject (final Collection collection) {
|
||||||
return redisTemplate.delete(collection) > 0;
|
return redisTemplate.delete(collection) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,9 +127,10 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key 缓存的键值
|
* @param key 缓存的键值
|
||||||
* @param dataList 待缓存的List数据
|
* @param dataList 待缓存的List数据
|
||||||
|
*
|
||||||
* @return 缓存的对象
|
* @return 缓存的对象
|
||||||
*/
|
*/
|
||||||
public <T> long setCacheList(final String key, final List<T> dataList) {
|
public <T> long setCacheList (final String key, final List<T> dataList) {
|
||||||
Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
|
Long count = redisTemplate.opsForList().rightPushAll(key, dataList);
|
||||||
return count == null ? 0 : count;
|
return count == null ? 0 : count;
|
||||||
}
|
}
|
||||||
|
@ -131,9 +139,10 @@ public class RedisService {
|
||||||
* 获得缓存的list对象
|
* 获得缓存的list对象
|
||||||
*
|
*
|
||||||
* @param key 缓存的键值
|
* @param key 缓存的键值
|
||||||
|
*
|
||||||
* @return 缓存键值对应的数据
|
* @return 缓存键值对应的数据
|
||||||
*/
|
*/
|
||||||
public <T> List<T> getCacheList(final String key) {
|
public <T> List<T> getCacheList (final String key) {
|
||||||
return redisTemplate.opsForList().range(key, 0, -1);
|
return redisTemplate.opsForList().range(key, 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,9 +151,10 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key 缓存键值
|
* @param key 缓存键值
|
||||||
* @param dataSet 缓存的数据
|
* @param dataSet 缓存的数据
|
||||||
|
*
|
||||||
* @return 缓存数据的对象
|
* @return 缓存数据的对象
|
||||||
*/
|
*/
|
||||||
public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet) {
|
public <T> BoundSetOperations<String, T> setCacheSet (final String key, final Set<T> dataSet) {
|
||||||
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
|
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
|
||||||
Iterator<T> it = dataSet.iterator();
|
Iterator<T> it = dataSet.iterator();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
|
@ -153,26 +163,14 @@ 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
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public <T> Set<T> getCacheSet(final String key) {
|
public <T> Set<T> getCacheSet (final String key) {
|
||||||
return redisTemplate.opsForSet().members(key);
|
return redisTemplate.opsForSet().members(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,7 +180,7 @@ public class RedisService {
|
||||||
* @param key
|
* @param key
|
||||||
* @param dataMap
|
* @param dataMap
|
||||||
*/
|
*/
|
||||||
public <T> void setCacheMap(final String key, final Map<String, T> dataMap) {
|
public <T> void setCacheMap (final String key, final Map<String, T> dataMap) {
|
||||||
if (dataMap != null) {
|
if (dataMap != null) {
|
||||||
redisTemplate.opsForHash().putAll(key, dataMap);
|
redisTemplate.opsForHash().putAll(key, dataMap);
|
||||||
}
|
}
|
||||||
|
@ -192,9 +190,10 @@ public class RedisService {
|
||||||
* 获得缓存的Map
|
* 获得缓存的Map
|
||||||
*
|
*
|
||||||
* @param key
|
* @param key
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public <T> Map<String, T> getCacheMap(final String key) {
|
public <T> Map<String, T> getCacheMap (final String key) {
|
||||||
return redisTemplate.opsForHash().entries(key);
|
return redisTemplate.opsForHash().entries(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +204,7 @@ public class RedisService {
|
||||||
* @param hKey Hash键
|
* @param hKey Hash键
|
||||||
* @param value 值
|
* @param value 值
|
||||||
*/
|
*/
|
||||||
public <T> void setCacheMapValue(final String key, final String hKey, final T value) {
|
public <T> void setCacheMapValue (final String key, final String hKey, final T value) {
|
||||||
redisTemplate.opsForHash().put(key, hKey, value);
|
redisTemplate.opsForHash().put(key, hKey, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,9 +213,10 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key Redis键
|
* @param key Redis键
|
||||||
* @param hKey Hash键
|
* @param hKey Hash键
|
||||||
|
*
|
||||||
* @return Hash中的对象
|
* @return Hash中的对象
|
||||||
*/
|
*/
|
||||||
public <T> T getCacheMapValue(final String key, final String hKey) {
|
public <T> T getCacheMapValue (final String key, final String hKey) {
|
||||||
HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
|
HashOperations<String, String, T> opsForHash = redisTemplate.opsForHash();
|
||||||
return opsForHash.get(key, hKey);
|
return opsForHash.get(key, hKey);
|
||||||
}
|
}
|
||||||
|
@ -226,9 +226,10 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key Redis键
|
* @param key Redis键
|
||||||
* @param hKeys Hash键集合
|
* @param hKeys Hash键集合
|
||||||
|
*
|
||||||
* @return Hash对象集合
|
* @return Hash对象集合
|
||||||
*/
|
*/
|
||||||
public <T> List<T> getMultiCacheMapValue(final String key, final Collection<Object> hKeys) {
|
public <T> List<T> getMultiCacheMapValue (final String key, final Collection<Object> hKeys) {
|
||||||
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,202 +238,21 @@ public class RedisService {
|
||||||
*
|
*
|
||||||
* @param key Redis键
|
* @param key Redis键
|
||||||
* @param hKey Hash键
|
* @param hKey Hash键
|
||||||
|
*
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
public boolean deleteCacheMapValue(final String key, final String hKey) {
|
public boolean deleteCacheMapValue (final String key, final String hKey) {
|
||||||
return redisTemplate.opsForHash().delete(key, hKey) > 0;
|
return redisTemplate.opsForHash().delete(key, hKey) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 向Zset中存入单条数据
|
|
||||||
*
|
|
||||||
* @param zkey ZSet键
|
|
||||||
* @param value 值
|
|
||||||
* @param score 分数
|
|
||||||
*/
|
|
||||||
public <T> void setCacheZsetValue(final String zkey, final T value, final Double score) {
|
|
||||||
redisTemplate.opsForZSet().add(zkey, value, score);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 向Zset中存入多条数据
|
|
||||||
*
|
|
||||||
* @param zkey zSet键
|
|
||||||
* @param map => 键值对 键T 值Double分数
|
|
||||||
*/
|
|
||||||
public <T> void setCacheZsetBatchValue(final String zkey, final Map<T, Double> map) {
|
|
||||||
Set<DefaultTypedTuple> collect = map.entrySet().stream()
|
|
||||||
.map(item -> {
|
|
||||||
return new DefaultTypedTuple(item.getKey(), item.getValue());
|
|
||||||
})
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
|
|
||||||
redisTemplate.opsForZSet().add(zkey, collect);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取Zset集合大小
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @return size
|
|
||||||
*/
|
|
||||||
public Long getCacheZsetSize(String zkey) {
|
|
||||||
return redisTemplate.opsForZSet().size(zkey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询成员分数
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param value
|
|
||||||
* @param <T>
|
|
||||||
* @return score
|
|
||||||
*/
|
|
||||||
public <T> Double getCacheZsetScore(final String zkey, final T value) {
|
|
||||||
return redisTemplate.opsForZSet().score(zkey, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 范围查询分数
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public <T> Set<Double> getCacheZsetScoreBatch(final String zkey, final Long start, final Long end) {
|
|
||||||
return redisTemplate.opsForZSet().range(zkey, start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 范围查询集合携带分数
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public <T> Set<HashMap<Object, Double>> getCacheZsetScoreWithDataBatch(final String zkey, final Long start, final Long end) {
|
|
||||||
Set<ZSetOperations.TypedTuple<Object>> rangeSet = redisTemplate.opsForZSet().range(zkey, start, end);
|
|
||||||
Set<HashMap<Object, Double>> collect = rangeSet.stream().
|
|
||||||
map(item -> {
|
|
||||||
HashMap<Object, Double> objectDoubleHashMap = new HashMap<Object, Double>();
|
|
||||||
objectDoubleHashMap.put(item.getValue(), item.getScore());
|
|
||||||
return objectDoubleHashMap;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toSet());
|
|
||||||
return collect;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改对应键值分数,delta为正数则增加,为负数则减少
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param value
|
|
||||||
* @param delta
|
|
||||||
* @param <T>
|
|
||||||
*/
|
|
||||||
public <T> Double incrementScore(final String zkey, final T value, final Double delta) {
|
|
||||||
return redisTemplate.opsForZSet().incrementScore(zkey, value, delta);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除元素
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param values
|
|
||||||
* @param <T>
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public <T> Long removeCacheZsetBatch(final String zkey, final T... values) {
|
|
||||||
return redisTemplate.opsForZSet().remove(zkey, values);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序并限制结果集大小,按降序返回有序集合的部分元素,支持指定索引范围。
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param start
|
|
||||||
* @param end
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Set<Double> reverseRange(final String zkey, final Long start, final Long end) {
|
|
||||||
return redisTemplate.opsForZSet().reverseRange(zkey, start, end);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按分数范围查询
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @param min
|
|
||||||
* @param max
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public Set<Double> rangeByScore(final String zkey, final Double min, final Double max) {
|
|
||||||
return redisTemplate.opsForZSet().rangeByScore(zkey, min, max);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取最小值
|
|
||||||
*
|
|
||||||
* @param zkey
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public ZSetOperations.TypedTuple getCacheZsetMin(final String zkey) {
|
|
||||||
ZSetOperations.TypedTuple typedTuple = redisTemplate.opsForZSet().popMin(zkey);
|
|
||||||
return typedTuple;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得缓存的基本对象列表
|
* 获得缓存的基本对象列表
|
||||||
*
|
*
|
||||||
* @param pattern 字符串前缀
|
* @param pattern 字符串前缀
|
||||||
|
*
|
||||||
* @return 对象列表
|
* @return 对象列表
|
||||||
*/
|
*/
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
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";
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
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;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -29,7 +29,6 @@ public class HeaderInterceptor implements AsyncHandlerInterceptor {
|
||||||
SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID));
|
SecurityContextHolder.setUserId(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USER_ID));
|
||||||
SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
|
SecurityContextHolder.setUserName(ServletUtils.getHeader(request, SecurityConstants.DETAILS_USERNAME));
|
||||||
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
|
SecurityContextHolder.setUserKey(ServletUtils.getHeader(request, SecurityConstants.USER_KEY));
|
||||||
SecurityContextHolder.setCompanySign(ServletUtils.getHeader(request, SecurityConstants.COMPANY_SIGN));
|
|
||||||
|
|
||||||
String token = SecurityUtils.getToken();
|
String token = SecurityUtils.getToken();
|
||||||
if (StringUtils.isNotEmpty(token)) {
|
if (StringUtils.isNotEmpty(token)) {
|
||||||
|
|
|
@ -44,11 +44,9 @@ public class TokenService {
|
||||||
String token = IdUtils.fastUUID();
|
String token = IdUtils.fastUUID();
|
||||||
Long userId = loginUser.getSysUser().getUserId();
|
Long userId = loginUser.getSysUser().getUserId();
|
||||||
String userName = loginUser.getSysUser().getUserName();
|
String userName = loginUser.getSysUser().getUserName();
|
||||||
String companySign = loginUser.getSysUser().getDept().getCompanySign();
|
|
||||||
loginUser.setToken(token);
|
loginUser.setToken(token);
|
||||||
loginUser.setUserid(userId);
|
loginUser.setUserid(userId);
|
||||||
loginUser.setUsername(userName);
|
loginUser.setUsername(userName);
|
||||||
loginUser.setCompanySign(companySign);
|
|
||||||
loginUser.setIpaddr(IpUtils.getIpAddr());
|
loginUser.setIpaddr(IpUtils.getIpAddr());
|
||||||
refreshToken(loginUser);
|
refreshToken(loginUser);
|
||||||
|
|
||||||
|
@ -57,7 +55,6 @@ public class TokenService {
|
||||||
claimsMap.put(SecurityConstants.USER_KEY, token);
|
claimsMap.put(SecurityConstants.USER_KEY, token);
|
||||||
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
|
claimsMap.put(SecurityConstants.DETAILS_USER_ID, userId);
|
||||||
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
|
claimsMap.put(SecurityConstants.DETAILS_USERNAME, userName);
|
||||||
claimsMap.put(SecurityConstants.COMPANY_SIGN,companySign);
|
|
||||||
|
|
||||||
// 接口返回信息
|
// 接口返回信息
|
||||||
Map<String, Object> rspMap = new HashMap<String, Object>();
|
Map<String, Object> rspMap = new HashMap<String, Object>();
|
||||||
|
|
|
@ -3,12 +3,9 @@ package com.zhilian.common.security.utils;
|
||||||
import com.zhilian.common.core.constant.SecurityConstants;
|
import com.zhilian.common.core.constant.SecurityConstants;
|
||||||
import com.zhilian.common.core.constant.TokenConstants;
|
import com.zhilian.common.core.constant.TokenConstants;
|
||||||
import com.zhilian.common.core.context.SecurityContextHolder;
|
import com.zhilian.common.core.context.SecurityContextHolder;
|
||||||
import com.zhilian.common.core.utils.JwtUtils;
|
|
||||||
import com.zhilian.common.core.utils.ServletUtils;
|
import com.zhilian.common.core.utils.ServletUtils;
|
||||||
import com.zhilian.common.core.utils.StringUtils;
|
import com.zhilian.common.core.utils.StringUtils;
|
||||||
import com.zhilian.common.system.domain.LoginUser;
|
import com.zhilian.common.system.domain.LoginUser;
|
||||||
import io.jsonwebtoken.Claims;
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
@ -33,13 +30,6 @@ public class SecurityUtils {
|
||||||
return SecurityContextHolder.getUserName();
|
return SecurityContextHolder.getUserName();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取公司标识
|
|
||||||
*/
|
|
||||||
public static String getCompanySign () {
|
|
||||||
return SecurityContextHolder.getCompanySign();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户key
|
* 获取用户key
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -27,11 +27,6 @@ public class LoginUser implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String username;
|
private String username;
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业标识
|
|
||||||
*/
|
|
||||||
private String companySign;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录时间
|
* 登录时间
|
||||||
*/
|
*/
|
||||||
|
@ -133,12 +128,4 @@ public class LoginUser implements Serializable {
|
||||||
public void setSysUser (SysUser sysUser) {
|
public void setSysUser (SysUser sysUser) {
|
||||||
this.sysUser = sysUser;
|
this.sysUser = sysUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCompanySign() {
|
|
||||||
return companySign;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCompanySign(String companySign) {
|
|
||||||
this.companySign = companySign;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,12 +44,6 @@ public class SysDept extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String ancestors;
|
private String ancestors;
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业标识
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String companySign;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -45,11 +45,6 @@ public class SysUser extends BaseEntity {
|
||||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 企业标识
|
|
||||||
// */
|
|
||||||
// private String companySign;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户账号
|
* 用户账号
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,6 +12,7 @@ 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)
|
||||||
|
|
|
@ -66,13 +66,11 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
||||||
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) {
|
if (StringUtils.isEmpty(userid) || StringUtils.isEmpty(username)) {
|
||||||
return unauthorizedResponse(exchange, "令牌验证失败");
|
return unauthorizedResponse(exchange, "令牌验证失败");
|
||||||
}
|
}
|
||||||
String companySign = JwtUtils.getCompanySign(claims);
|
|
||||||
|
|
||||||
// 设置用户信息到请求
|
// 设置用户信息到请求
|
||||||
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
|
addHeader(mutate, SecurityConstants.USER_KEY, userkey);
|
||||||
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid);
|
||||||
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username);
|
||||||
addHeader(mutate, SecurityConstants.COMPANY_SIGN, companySign);
|
|
||||||
// 内部请求来源参数清除
|
// 内部请求来源参数清除
|
||||||
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
removeHeader(mutate, SecurityConstants.FROM_SOURCE);
|
||||||
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
return chain.filter(exchange.mutate().request(mutate.build()).build());
|
||||||
|
|
|
@ -15,9 +15,11 @@ 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
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -34,8 +36,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,7 +17,6 @@
|
||||||
<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,12 +73,6 @@
|
||||||
<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>
|
||||||
|
@ -112,4 +106,4 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,42 +0,0 @@
|
||||||
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,102 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,82 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
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,95 +0,0 @@
|
||||||
package com.zhilian.business.controller;
|
|
||||||
|
|
||||||
import com.zhilian.business.domain.Fence;
|
|
||||||
import com.zhilian.common.core.domain.Result;
|
|
||||||
import com.zhilian.common.core.web.controller.BaseController;
|
|
||||||
import com.zhilian.business.service.FenceService;
|
|
||||||
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 FenceController
|
|
||||||
* @Description 电子围栏控制层
|
|
||||||
* @Author ZeJinG.Su
|
|
||||||
* @Date 14:37 2024/3/29
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("fence")
|
|
||||||
public class FenceController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private FenceService fenceService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电子围栏列表
|
|
||||||
* @param fence
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/list")
|
|
||||||
public Result<TableDataInfo<Fence>> fenceList(@RequestBody Fence fence) {
|
|
||||||
startPage();
|
|
||||||
List<Fence> result = fenceService.fenceList(fence);
|
|
||||||
return getDataTable(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加所有围栏信息进入redis
|
|
||||||
*/
|
|
||||||
public void fenceRedisData() {
|
|
||||||
fenceService.fenceRedisData();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增围栏
|
|
||||||
* @param fence
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/fenceAdd")
|
|
||||||
public Result fenceAdd(@RequestBody Fence fence) {
|
|
||||||
fence.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
fence.setUpdateTime(new Date());
|
|
||||||
return toAjax(fenceService.saveFence(fence));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改围栏信息
|
|
||||||
* @param fence
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/fenceUpdate")
|
|
||||||
public Result fenceUpdate(@RequestBody Fence fence) {
|
|
||||||
fence.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除围栏
|
|
||||||
* @param
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@PostMapping("/fenceDelete/{fenceId}")
|
|
||||||
public Result fenceDelete(@PathVariable Long fenceId) {
|
|
||||||
return toAjax(fenceService.removeByFence(fenceId));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,119 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,148 +0,0 @@
|
||||||
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));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,44 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,112 +0,0 @@
|
||||||
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,22 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
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,32 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,69 +0,0 @@
|
||||||
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,12 +0,0 @@
|
||||||
package com.zhilian.business.mapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.zhilian.business.domain.Fence;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
@Component
|
|
||||||
public interface FenceMapper extends BaseMapper<Fence> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
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> {
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
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();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,29 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
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,18 +0,0 @@
|
||||||
package com.zhilian.business.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.zhilian.business.domain.Fence;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface FenceService extends IService<Fence> {
|
|
||||||
List<Fence> fenceList(Fence fence);
|
|
||||||
|
|
||||||
void fenceRedisData();
|
|
||||||
|
|
||||||
boolean saveFence(Fence fence);
|
|
||||||
|
|
||||||
boolean updateByMap(Fence fence);
|
|
||||||
|
|
||||||
boolean removeByFence(Long fenceId);
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
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();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
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();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
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();
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,96 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,101 +0,0 @@
|
||||||
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,114 +0,0 @@
|
||||||
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.zhilian.business.domain.Fence;
|
|
||||||
import com.zhilian.business.domain.middle.MarkersFence;
|
|
||||||
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.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.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements FenceService {
|
|
||||||
@Autowired
|
|
||||||
private RedisService redisService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MarkersFenceMapper markersFenceMapper;
|
|
||||||
|
|
||||||
private static final String FENCE_INFO_KEY = "fence_info:";
|
|
||||||
//电子围栏信息查询
|
|
||||||
@Override
|
|
||||||
public List<Fence> fenceList(Fence fence) {
|
|
||||||
if (fence.getFenceName() == null && fence.getFenceTypeId() == null && fence.getFenceState() == null) {
|
|
||||||
return this.list();
|
|
||||||
}
|
|
||||||
|
|
||||||
LambdaQueryWrapper<Fence> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
// 模糊条件 - 电子围栏名称
|
|
||||||
if (StringUtils.isNotEmpty(fence.getFenceName())) {
|
|
||||||
queryWrapper.like(Fence::getFenceName, fence.getFenceName());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 精确查询 - 查询类型
|
|
||||||
if (fence.getFenceTypeId() != null) {
|
|
||||||
queryWrapper.eq(Fence::getFenceTypeId, fence.getFenceTypeId());
|
|
||||||
}
|
|
||||||
|
|
||||||
// 模糊查询 - 状态
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,74 +0,0 @@
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,109 +0,0 @@
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.zhilian.business;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
public class zhilianOnLineApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(zhilianOnLineApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,2 @@
|
||||||
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,9 +15,11 @@ 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
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -1,47 +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.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>
|
|
|
@ -1,22 +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.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>
|
|
|
@ -1,81 +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.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,10 +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.MarkersFenceMapper">
|
|
||||||
|
|
||||||
<delete id="deleteBatchFenceIds">
|
|
||||||
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
|
@ -1,24 +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.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,9 +15,11 @@ 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,9 +15,11 @@ 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
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue