Merge branch 'server_five' into server_five_dongxiaodong
# Conflicts: # couplet-modules/couplet-analyze/couplet-analyze-msg/src/main/java/com/couplet/analyze/msg/model/ModelMessage.javaserver_five_liuyunhu
commit
eac6f6076d
|
@ -5,30 +5,23 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.couplet</groupId>
|
<groupId>com.couplet</groupId>
|
||||||
<artifactId>couplet-electronic-fence</artifactId>
|
<artifactId>couplet-common</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
<artifactId>couplet-electronic-fence-common</artifactId>
|
<artifactId>couplet-common-business</artifactId>
|
||||||
|
|
||||||
<description>
|
|
||||||
couplet-electronic-fence-common
|
|
||||||
</description>
|
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.couplet</groupId>
|
<groupId>com.couplet</groupId>
|
||||||
<artifactId>couplet-common-core</artifactId>
|
<artifactId>couplet-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,9 +1,11 @@
|
||||||
package com.couplet.trouble.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.couplet.common.core.annotation.Excel;
|
import com.couplet.common.core.annotation.Excel;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.trouble.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.couplet.trouble.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.trouble.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
|
@ -1,25 +1,20 @@
|
||||||
package com.couplet.map.common.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.couplet.common.core.web.domain.BaseEntity;
|
import com.couplet.common.core.web.domain.BaseEntity;
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
import com.couplet.common.domain.request.FenceUpdateRequest;
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
import javax.validation.constraints.NotEmpty;
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: LiJiaYao
|
* @Author: LiJiaYao
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.map.common.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
@ -21,8 +21,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName("couplet_vehicle")
|
@TableName("couplet_vehicle")
|
||||||
public class Vehicle {
|
public class Vehicle{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*车辆id
|
*车辆id
|
||||||
* */
|
* */
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2024/4/2 11:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@ToString
|
||||||
|
public class VehicleMiddle{
|
||||||
|
|
||||||
|
private Long middleId;
|
||||||
|
private Long userId;
|
||||||
|
private Long vehicleId;
|
||||||
|
private Long delFlag;
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.domain;
|
package com.couplet.common.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ProjectName: five-groups-couplet
|
* @ProjectName: five-groups-couplet
|
||||||
|
@ -16,7 +15,6 @@ import lombok.experimental.SuperBuilder;
|
||||||
* @Description: 车辆类型
|
* @Description: 车辆类型
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName("couplet_vehicle_type")
|
@TableName("couplet_vehicle_type")
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.map.common.domain.request;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.map.common.domain.request;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -8,7 +8,6 @@ import lombok.NoArgsConstructor;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: LiJiaYao
|
* @Author: LiJiaYao
|
|
@ -1,6 +1,5 @@
|
||||||
package com.couplet.map.common.domain.request;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
|
@ -1,6 +1,6 @@
|
||||||
package com.couplet.trouble.domain.resp;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import com.couplet.trouble.domain.CoupletTroubleCode;
|
import com.couplet.common.domain.CoupletTroubleCode;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.domain.req;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.domain.req;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -7,7 +7,6 @@ import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.domain.req;
|
package com.couplet.common.domain.request;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.utils;
|
package com.couplet.common.utils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ProjectName: five-groups-couplet
|
* @ProjectName: five-groups-couplet
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.common.log.annotation;
|
package com.couplet.log.annotation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongXiaoDong
|
* @author DongXiaoDong
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.common.log.aop;
|
package com.couplet.log.aop;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongXiaoDong
|
* @author DongXiaoDong
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.couplet.remote;
|
||||||
|
|
||||||
|
import com.couplet.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
|
import com.couplet.remote.factory.RemoteVehicleFallbackFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(contextId = "remoteVehicleService" ,
|
||||||
|
value = ServiceNameConstants.VEHICLE_SERVICE,
|
||||||
|
fallbackFactory = RemoteVehicleFallbackFactory.class,
|
||||||
|
path = "/vehicle"
|
||||||
|
)
|
||||||
|
public interface RemoteVehicleService {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param null:
|
||||||
|
* @return null
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 根据员工id查询员工下有哪些车
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@PostMapping("UserUnderTheVehicle/{userId}")
|
||||||
|
public Result<List<Vehicle>> UserUnderTheVehicleList(@PathVariable(value = "userId") Long userId);
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param middleId:
|
||||||
|
* @return Result<Integer>
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 删除员工管理的车辆
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@DeleteMapping("/{middleId}")
|
||||||
|
public Result<Integer> deleteVehicle(@PathVariable(value = "middleId") Long middleId);
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
public Result<Integer> addVehicle(@RequestBody VehicleMiddle vehicleMiddle);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("vehicleAll")
|
||||||
|
public Result<List<Vehicle>> VehicleManageList();
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/findByVIN/{vin}")
|
||||||
|
public Result<List<Vehicle>> findByVIN(@PathVariable("vin") String vin);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
package com.couplet.remote.factory;
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
|
import com.couplet.remote.RemoteVehicleService;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: TODO
|
||||||
|
* @date 2024/4/2 14:46
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class RemoteVehicleFallbackFactory implements FallbackFactory<RemoteVehicleService> {
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RemoteVehicleFallbackFactory.class);
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RemoteVehicleService create(Throwable cause) {
|
||||||
|
return new RemoteVehicleService() {
|
||||||
|
@Override
|
||||||
|
public Result<List<Vehicle>> UserUnderTheVehicleList(Long userId) {
|
||||||
|
return Result.error("调用失败...."+cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<Integer> deleteVehicle(Long middleId) {
|
||||||
|
return Result.error("调用失败...."+cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<Integer> addVehicle(VehicleMiddle vehicleMiddle) {
|
||||||
|
return Result.error("调用失败....."+cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<Vehicle>> VehicleManageList() {
|
||||||
|
return Result.error("调用失败....."+cause.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<Vehicle>> findByVIN(String vin) {
|
||||||
|
return Result.error("车辆服务调用失败:" + cause.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,4 +20,14 @@ public class ServiceNameConstants {
|
||||||
* 文件服务的serviceid
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "couplet-file";
|
public static final String FILE_SERVICE = "couplet-file";
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param null:
|
||||||
|
* @return null
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 车辆管理模块
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
public static final String VEHICLE_SERVICE = "couplet-vehicle";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.vehicle.exception;
|
package com.couplet.common.core.exception.vehicle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ProjectName: five-groups-couplet
|
* @ProjectName: five-groups-couplet
|
|
@ -1,20 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-trouble-log</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -18,7 +18,8 @@
|
||||||
<module>couplet-common-datascope</module>
|
<module>couplet-common-datascope</module>
|
||||||
<module>couplet-common-datasource</module>
|
<module>couplet-common-datasource</module>
|
||||||
<module>couplet-common-system</module>
|
<module>couplet-common-system</module>
|
||||||
<module>couplet-trouble-log</module>
|
<module>couplet-common-business</module>
|
||||||
|
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>couplet-common</artifactId>
|
<artifactId>couplet-common</artifactId>
|
||||||
|
|
|
@ -86,12 +86,6 @@
|
||||||
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
<version>1.2.5</version>
|
<version>1.2.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- RabbitMQ依赖-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-amqp</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -1,49 +0,0 @@
|
||||||
package com.couplet.analyze.msg.config;
|
|
||||||
|
|
||||||
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
|
|
||||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
@Configuration
|
|
||||||
public class RabbitAdminConfig {
|
|
||||||
|
|
||||||
@Value("${spring.rabbitmq.host}")
|
|
||||||
private String host;
|
|
||||||
@Value("${spring.rabbitmq.username}")
|
|
||||||
private String username;
|
|
||||||
@Value("${spring.rabbitmq.password}")
|
|
||||||
private String password;
|
|
||||||
@Value("${spring.rabbitmq.virtualhost}")
|
|
||||||
private String virtualhost;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构建RabbitMQ的连接工厂
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public ConnectionFactory connectionFactory() {
|
|
||||||
CachingConnectionFactory connectionFactory = new CachingConnectionFactory();
|
|
||||||
connectionFactory.setAddresses(host);
|
|
||||||
connectionFactory.setUsername(username);
|
|
||||||
connectionFactory.setPassword(password);
|
|
||||||
connectionFactory.setVirtualHost(virtualhost);
|
|
||||||
return connectionFactory;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 初始化RabbitAdmin
|
|
||||||
* @param connectionFactory
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public RabbitAdmin rabbitAdmin(ConnectionFactory connectionFactory) {
|
|
||||||
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
|
|
||||||
rabbitAdmin.setAutoStartup(true);
|
|
||||||
return rabbitAdmin;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,96 +0,0 @@
|
||||||
package com.couplet.analyze.msg.consumer;
|
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
|
||||||
import com.couplet.analyze.msg.service.IncidentService;
|
|
||||||
import com.couplet.common.core.utils.SpringUtils;
|
|
||||||
import com.rabbitmq.client.Channel;
|
|
||||||
import lombok.extern.log4j.Log4j2;
|
|
||||||
import org.springframework.amqp.core.Message;
|
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* @Description: 消费传输过来的数据
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@Log4j2
|
|
||||||
@RabbitListener(queues = "couplet-msg-queue")
|
|
||||||
public class IncidentConsumer {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调用事件服务接口
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private IncidentService incidentService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate redis;
|
|
||||||
|
|
||||||
static ArrayList<String> strings = new ArrayList<>(){
|
|
||||||
{
|
|
||||||
add("breakdown");
|
|
||||||
add("electronic-fence");
|
|
||||||
add("real-time-data");
|
|
||||||
add("stored-event");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@RabbitHandler
|
|
||||||
public void incidentConsumer(List<CoupletMsgData> list, Channel channel, Message message) throws IOException {
|
|
||||||
|
|
||||||
log.info("消费者收到的消息是:【{}】",list);
|
|
||||||
|
|
||||||
long deliveryTag = message.getMessageProperties().getDeliveryTag();
|
|
||||||
String messageId = message.getMessageProperties().getMessageId();
|
|
||||||
|
|
||||||
if (redis.hasKey("解析系统value:"+messageId)){
|
|
||||||
redis.opsForValue().set("解析系统value:"+messageId,deliveryTag+"",5, TimeUnit.MINUTES);
|
|
||||||
}
|
|
||||||
Long add = redis.opsForSet().add("解析系统:set" + messageId,messageId);
|
|
||||||
redis.expire("解析系统:set"+messageId,5,TimeUnit.MINUTES);
|
|
||||||
|
|
||||||
try {
|
|
||||||
if (0 < add){
|
|
||||||
log.info("消费者开始消费,消费者收到消息是:【{ }】"+list);
|
|
||||||
for (CoupletMsgData coupletMsgData : list) {
|
|
||||||
for (String string : strings) {
|
|
||||||
CoupletMsgData bean = SpringUtils.getBean(string);
|
|
||||||
incidentService.incident(coupletMsgData);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
channel.basicAck(deliveryTag,false);
|
|
||||||
} else {
|
|
||||||
//重复消费
|
|
||||||
log.error("重复消费");
|
|
||||||
//拒绝消费
|
|
||||||
channel.basicReject(deliveryTag, false);
|
|
||||||
|
|
||||||
//删除缓存
|
|
||||||
redis.opsForSet().remove("解析系统:set"+messageId, messageId);
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("消息消费失败...消息信息为:【{ }】", list);
|
|
||||||
String s = redis.opsForValue().get("解析系统value:" + messageId);
|
|
||||||
Long o = Long.parseLong( s );
|
|
||||||
if (deliveryTag == o+2){
|
|
||||||
log.error("队列无法进入了,消息是:【{}】",list);
|
|
||||||
channel.basicNack(deliveryTag,false,false);
|
|
||||||
} else {
|
|
||||||
log.info("再一次进入队列,消息是:[{}]", list);
|
|
||||||
channel.basicNack(deliveryTag,false,true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
package com.couplet.analyze.msg.controller;
|
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
|
||||||
import com.couplet.analyze.msg.service.IncidentService;
|
|
||||||
import com.couplet.common.core.domain.Result;
|
|
||||||
import com.couplet.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.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/2
|
|
||||||
* 事件控制器
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/incident")
|
|
||||||
public class IncidentController extends BaseController {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 事件服务
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private IncidentService incidentService;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
package com.couplet.analyze.msg.mapper;
|
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 19:58
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface CoupletMapper {
|
|
||||||
void insertMsgData(CoupletMsgData msgData);
|
|
||||||
}
|
|
|
@ -1,11 +1,13 @@
|
||||||
package com.couplet.analyze.msg.model;
|
package com.couplet.analyze.msg.model;
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||||
import com.couplet.analyze.msg.service.CoupletMsgService;
|
import com.couplet.analyze.msg.service.IncidentService;
|
||||||
|
import com.couplet.common.core.utils.SpringUtils;
|
||||||
|
import com.couplet.common.core.utils.uuid.IdUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.eclipse.paho.client.mqttv3.*;
|
import org.eclipse.paho.client.mqttv3.*;
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@ -33,16 +35,32 @@ import static io.lettuce.core.pubsub.PubSubOutput.Type.message;
|
||||||
@Component
|
@Component
|
||||||
public class ModelMessage {
|
public class ModelMessage {
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private CoupletMsgService coupletMsgService;
|
// private CoupletMsgService coupletMsgService;
|
||||||
|
|
||||||
@Autowired
|
// @Autowired
|
||||||
private RabbitTemplate rabbitTemplate;
|
// public ModelMessage(CoupletMsgService coupletMsgService){
|
||||||
|
// this.coupletMsgService = coupletMsgService;
|
||||||
|
// }
|
||||||
|
static ArrayList<String> strings = new ArrayList<>() {
|
||||||
|
{
|
||||||
|
add("breakdown");
|
||||||
|
add("electronic-fence");
|
||||||
|
add("real-time-data");
|
||||||
|
add("stored-event");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@Autowired
|
@Value("${mq.queueName}")
|
||||||
public ModelMessage(CoupletMsgService coupletMsgService){
|
public String queueName;
|
||||||
this.coupletMsgService = coupletMsgService;
|
|
||||||
}
|
//交换机
|
||||||
|
@Value("${mq.exchangeName}")
|
||||||
|
public String exchangeName;
|
||||||
|
|
||||||
|
//路由键
|
||||||
|
@Value("${mq.routingKey}")
|
||||||
|
public String routingKey;
|
||||||
|
|
||||||
@Scheduled(cron = "0/5 * * * * ?")
|
@Scheduled(cron = "0/5 * * * * ?")
|
||||||
public void startMsg() {
|
public void startMsg() {
|
||||||
|
@ -70,10 +88,15 @@ public class ModelMessage {
|
||||||
for (CoupletMsgData msgData : coupletMsgDataList) {
|
for (CoupletMsgData msgData : coupletMsgDataList) {
|
||||||
log.info("解析到车辆数据:{}", msgData);
|
log.info("解析到车辆数据:{}", msgData);
|
||||||
//发送日志到MQ
|
//发送日志到MQ
|
||||||
rabbitTemplate.convertAndSend("couplet-msg-queue",msgData,message -> {
|
for (String string : strings) {
|
||||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString());
|
IncidentService incidentService = SpringUtils.getBean(string);
|
||||||
return message;
|
incidentService.incident(msgData);
|
||||||
});
|
}
|
||||||
|
try {
|
||||||
|
Thread.sleep(1000);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package com.couplet.analyze.msg.service;
|
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 16:44
|
|
||||||
* @description 存储报文数据信息
|
|
||||||
*/
|
|
||||||
public interface CoupletMsgService {
|
|
||||||
void saveDataToDatabase(CoupletMsgData msgData);
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.couplet.analyze.msg.service.impl;
|
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
|
||||||
import com.couplet.analyze.msg.mapper.CoupletMapper;
|
|
||||||
import com.couplet.analyze.msg.service.CoupletMsgService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author DongXiaoDong
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/4/2 19:57
|
|
||||||
* @description
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class CoupletMsgServiceImpl implements CoupletMsgService {
|
|
||||||
@Autowired
|
|
||||||
private CoupletMapper coupletMapper;
|
|
||||||
@Override
|
|
||||||
public void saveDataToDatabase(CoupletMsgData msgData) {
|
|
||||||
coupletMapper.insertMsgData(msgData);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,6 +2,7 @@ package com.couplet.analyze.msg.service.impl;
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||||
import com.couplet.analyze.msg.service.IncidentService;
|
import com.couplet.analyze.msg.service.IncidentService;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @Description: 电子围栏事件服务实现类
|
* @Description: 电子围栏事件服务实现类
|
||||||
*/
|
*/
|
||||||
@Service("electronic-fence")
|
@Service("electronic-fence")
|
||||||
|
@Log4j2
|
||||||
public class ElectronicFenceServiceImpl implements IncidentService {
|
public class ElectronicFenceServiceImpl implements IncidentService {
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,6 +23,11 @@ public class ElectronicFenceServiceImpl implements IncidentService {
|
||||||
@Override
|
@Override
|
||||||
public void incident(CoupletMsgData coupletMsgData) {
|
public void incident(CoupletMsgData coupletMsgData) {
|
||||||
|
|
||||||
|
log.info("电子围栏事件开始.......");
|
||||||
|
log.info("电子围栏事件结束.......");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.couplet.analyze.msg.service.impl;
|
||||||
|
|
||||||
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
import com.couplet.analyze.msg.domain.CoupletMsgData;
|
||||||
import com.couplet.analyze.msg.service.IncidentService;
|
import com.couplet.analyze.msg.service.IncidentService;
|
||||||
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,6 +11,7 @@ import org.springframework.stereotype.Service;
|
||||||
* @Description: 实时数据事件
|
* @Description: 实时数据事件
|
||||||
*/
|
*/
|
||||||
@Service("real-time-data")
|
@Service("real-time-data")
|
||||||
|
@Log4j2
|
||||||
public class RealTimeDataServiceImpl implements IncidentService {
|
public class RealTimeDataServiceImpl implements IncidentService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +22,9 @@ public class RealTimeDataServiceImpl implements IncidentService {
|
||||||
@Override
|
@Override
|
||||||
public void incident(CoupletMsgData coupletMsgData) {
|
public void incident(CoupletMsgData coupletMsgData) {
|
||||||
|
|
||||||
|
log.info("实时数据事件开始.....");
|
||||||
|
log.info("实时数据事件结束.....");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,74 +0,0 @@
|
||||||
package com.couplet.analyze.msg.utils;
|
|
||||||
|
|
||||||
import org.springframework.amqp.core.Binding;
|
|
||||||
import org.springframework.amqp.core.BindingBuilder;
|
|
||||||
import org.springframework.amqp.core.DirectExchange;
|
|
||||||
import org.springframework.amqp.core.Queue;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class DLXQueueUtil {
|
|
||||||
// routingKey
|
|
||||||
private static final String DEAD_ROUTING_KEY = "dead.routingkey";
|
|
||||||
private static final String ROUTING_KEY = "routingkey";
|
|
||||||
private static final String DEAD_EXCHANGE = "dead.exchange";
|
|
||||||
private static final String EXCHANGE = "common.exchange";
|
|
||||||
@Autowired
|
|
||||||
RabbitTemplate rabbitTemplate;
|
|
||||||
@Resource
|
|
||||||
RabbitAdmin rabbitAdmin;
|
|
||||||
/**
|
|
||||||
* 发送死信队列,过期后进入死信交换机,进入死信队列
|
|
||||||
* @param queueName 队列名称
|
|
||||||
* @param deadQueueName 死信队列名称
|
|
||||||
* @param params 消息内容
|
|
||||||
* @param expiration 过期时间 毫秒
|
|
||||||
*/
|
|
||||||
public void sendDLXQueue(String queueName, String deadQueueName, Object params, Integer expiration){
|
|
||||||
/**
|
|
||||||
* ----------------------------------先创建一个ttl队列和死信队列--------------------------------------------
|
|
||||||
*/
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
// 队列设置存活时间,单位ms, 必须是整形数据。
|
|
||||||
map.put("x-message-ttl",expiration);
|
|
||||||
// 设置死信交换机
|
|
||||||
map.put("x-dead-letter-exchange",DEAD_EXCHANGE);
|
|
||||||
// 设置死信交换器路由
|
|
||||||
map.put("x-dead-letter-routing-key", DEAD_ROUTING_KEY);
|
|
||||||
/*参数1:队列名称 参数2:持久化 参数3:是否排他 参数4:自动删除队列 参数5:队列参数*/
|
|
||||||
Queue queue = new Queue(queueName, true, false, false, map);
|
|
||||||
rabbitAdmin.declareQueue(queue);
|
|
||||||
/**
|
|
||||||
* ---------------------------------创建交换机---------------------------------------------
|
|
||||||
*/
|
|
||||||
DirectExchange directExchange = new DirectExchange(EXCHANGE, true, false);
|
|
||||||
rabbitAdmin.declareExchange(directExchange);
|
|
||||||
/**
|
|
||||||
* ---------------------------------队列绑定交换机---------------------------------------------
|
|
||||||
*/
|
|
||||||
Binding binding = BindingBuilder.bind(queue).to(directExchange).with(ROUTING_KEY);
|
|
||||||
rabbitAdmin.declareBinding(binding);
|
|
||||||
/**
|
|
||||||
* ---------------------------------在创建一个死信交换机和队列,接收死信队列---------------------------------------------
|
|
||||||
*/
|
|
||||||
DirectExchange deadExchange = new DirectExchange(DEAD_EXCHANGE, true, false);
|
|
||||||
rabbitAdmin.declareExchange(deadExchange);
|
|
||||||
|
|
||||||
Queue deadQueue = new Queue(deadQueueName,true,false,false);
|
|
||||||
rabbitAdmin.declareQueue(deadQueue);
|
|
||||||
/**
|
|
||||||
* ---------------------------------队列绑定死信交换机---------------------------------------------
|
|
||||||
*/
|
|
||||||
// 将队列和交换机绑定
|
|
||||||
Binding deadbinding = BindingBuilder.bind(deadQueue).to(deadExchange).with(DEAD_ROUTING_KEY);
|
|
||||||
rabbitAdmin.declareBinding(deadbinding);
|
|
||||||
// 发送消息
|
|
||||||
rabbitTemplate.convertAndSend(EXCHANGE,ROUTING_KEY,params);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
package com.couplet.analyze.msg.utils;
|
|
||||||
|
|
||||||
import org.springframework.amqp.AmqpException;
|
|
||||||
import org.springframework.amqp.core.*;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class DelayedQueueUtil {
|
|
||||||
// routingKey
|
|
||||||
private static final String DELAYED_ROUTING_KEY = "delayed.routingkey";
|
|
||||||
|
|
||||||
// 延迟队列交换机
|
|
||||||
private static final String DELAYED_EXCHANGE = "delayed.exchange";
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
RabbitTemplate rabbitTemplate;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
RabbitAdmin rabbitAdmin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送延迟队列
|
|
||||||
*
|
|
||||||
* @param queueName 队列名称
|
|
||||||
* @param params 消息内容
|
|
||||||
* @param expiration 延迟时间 毫秒
|
|
||||||
*/
|
|
||||||
public void sendDelayedQueue(String queueName, Object params, Integer expiration) {
|
|
||||||
// 先创建一个队列
|
|
||||||
Queue queue = new Queue(queueName);
|
|
||||||
rabbitAdmin.declareQueue(queue);
|
|
||||||
// 创建延迟队列交换机
|
|
||||||
CustomExchange customExchange = createCustomExchange();
|
|
||||||
rabbitAdmin.declareExchange(customExchange);
|
|
||||||
// 将队列和交换机绑定
|
|
||||||
Binding binding = BindingBuilder.bind(queue).to(customExchange).with(DELAYED_ROUTING_KEY).noargs();
|
|
||||||
rabbitAdmin.declareBinding(binding);
|
|
||||||
// 发送延迟消息
|
|
||||||
rabbitTemplate.convertAndSend(DELAYED_EXCHANGE, DELAYED_ROUTING_KEY, params, message -> {
|
|
||||||
message.getMessageProperties().setDelay(expiration);
|
|
||||||
return message;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomExchange createCustomExchange() {
|
|
||||||
Map<String, Object> arguments = new HashMap<>();
|
|
||||||
/**
|
|
||||||
* 参数说明:
|
|
||||||
* 1.交换机的名称
|
|
||||||
* 2.交换机的类型
|
|
||||||
* 3.是否需要持久化
|
|
||||||
* 4.是否自动删除
|
|
||||||
* 5.其它参数
|
|
||||||
*/
|
|
||||||
arguments.put("x-delayed-type", "direct");
|
|
||||||
return new CustomExchange(DELAYED_EXCHANGE, "x-delayed-message", true, false, arguments);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,118 +0,0 @@
|
||||||
package com.couplet.analyze.msg.utils;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.eclipse.paho.client.mqttv3.*;
|
|
||||||
import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ProjectName: five-groups-couplet
|
|
||||||
* @Author: LiuYunHu
|
|
||||||
* @CreateTime: 2024/4/1
|
|
||||||
* @Description: mqtt监听者
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public class MqttMonitor {
|
|
||||||
/*
|
|
||||||
* 路径
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.broker}")
|
|
||||||
private String broker;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 主题
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.topic}")
|
|
||||||
private String topic;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 客户端id
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.clientId}")
|
|
||||||
private String clientId;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 用户名
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.username}")
|
|
||||||
private String userName;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 密码
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.password}")
|
|
||||||
private String password;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 遗嘱消息qos
|
|
||||||
* */
|
|
||||||
@Value("${mqtt.server.qos}")
|
|
||||||
private Integer qos;
|
|
||||||
|
|
||||||
|
|
||||||
//随项目启动而执行这个方法
|
|
||||||
@PostConstruct
|
|
||||||
public void connect() {
|
|
||||||
log.info("mqtt监听者启动");
|
|
||||||
try {
|
|
||||||
MqttClient client = new MqttClient(broker, clientId, new MemoryPersistence());
|
|
||||||
|
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
|
||||||
options.setUserName(userName);
|
|
||||||
options.setPassword(password.toCharArray());
|
|
||||||
|
|
||||||
//连接超时
|
|
||||||
options.setConnectionTimeout(10);
|
|
||||||
|
|
||||||
//心跳时间
|
|
||||||
options.setKeepAliveInterval(60);
|
|
||||||
|
|
||||||
log.info("mqtt监听者启动成功,连接到:{}", broker);
|
|
||||||
|
|
||||||
client.connect(options);
|
|
||||||
log.info("连接成功!");
|
|
||||||
|
|
||||||
//设置回调
|
|
||||||
client.setCallback(new MqttCallback() {
|
|
||||||
@Override
|
|
||||||
public void connectionLost(Throwable throwable) {
|
|
||||||
log.error("连接丢失:{}", throwable.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void messageArrived(String topic, MqttMessage mqttMessage) {
|
|
||||||
// log.info("消息已送达");
|
|
||||||
// log.info("接收消息主题:{}",topic);
|
|
||||||
// log.info("接收消息qos:{}", mqttMessage.getQos());
|
|
||||||
|
|
||||||
//接收到的原始报文
|
|
||||||
String message = new String(mqttMessage.getPayload());
|
|
||||||
|
|
||||||
log.info("接收消息原始内容:{}", message);
|
|
||||||
|
|
||||||
//去除空格 得到16进制字符串
|
|
||||||
String replaced = message.replaceAll(" ", "");
|
|
||||||
log.info("接收消息剪切后内容:{}", replaced);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deliveryComplete(IMqttDeliveryToken iMqttDeliveryToken) {
|
|
||||||
log.info("消息发送成功!");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
client.subscribe(topic, qos);
|
|
||||||
|
|
||||||
|
|
||||||
} catch (MqttException e) {
|
|
||||||
log.error("mqtt监听者启动失败,{}", e.getMessage());
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,50 +0,0 @@
|
||||||
package com.couplet.analyze.msg.utils;
|
|
||||||
|
|
||||||
import org.springframework.amqp.core.*;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
@Component
|
|
||||||
public class TTLQueueUtil {
|
|
||||||
// routingKey
|
|
||||||
private static final String TTL_KEY = "ttl.routingkey";
|
|
||||||
private static final String TTL_EXCHANGE = "ttl.exchange";
|
|
||||||
@Autowired
|
|
||||||
RabbitTemplate rabbitTemplate;
|
|
||||||
@Resource
|
|
||||||
RabbitAdmin rabbitAdmin;
|
|
||||||
/**
|
|
||||||
* 发送TTL队列
|
|
||||||
* @param queueName 队列名称
|
|
||||||
* @param params 消息内容
|
|
||||||
* @param expiration 过期时间 毫秒
|
|
||||||
*/
|
|
||||||
public void sendTtlQueue(String queueName, Object params, Integer expiration) {
|
|
||||||
/**
|
|
||||||
* ----------------------------------先创建一个ttl队列--------------------------------------------
|
|
||||||
*/
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
// 队列设置存活时间,单位ms,必须是整形数据。
|
|
||||||
map.put("x-message-ttl",expiration);
|
|
||||||
/*参数1:队列名称 参数2:持久化 参数3:是否排他 参数4:自动删除队列 参数5:队列参数*/
|
|
||||||
Queue queue = new Queue(queueName,true,false,false,map);
|
|
||||||
rabbitAdmin.declareQueue(queue);
|
|
||||||
/**
|
|
||||||
* ---------------------------------创建交换机---------------------------------------------
|
|
||||||
*/
|
|
||||||
DirectExchange directExchange = new DirectExchange(TTL_EXCHANGE, true, false);
|
|
||||||
rabbitAdmin.declareExchange(directExchange);
|
|
||||||
/**
|
|
||||||
* ---------------------------------队列绑定交换机---------------------------------------------
|
|
||||||
*/
|
|
||||||
// 将队列和交换机绑定
|
|
||||||
Binding binding = BindingBuilder.bind(queue).to(directExchange).with(TTL_KEY);
|
|
||||||
rabbitAdmin.declareBinding(binding);
|
|
||||||
// 发送消息
|
|
||||||
rabbitTemplate.convertAndSend(TTL_EXCHANGE,TTL_KEY,params);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,11 +15,9 @@ spring:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 121.89.211.230:8848
|
server-addr: 121.89.211.230:8848
|
||||||
namespace: a439ce3f-2c42-4b4c-9c4d-c8db49933c15
|
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -27,14 +25,32 @@ spring:
|
||||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
main:
|
main:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
|
rabbitmq:
|
||||||
|
host: 39.103.133.57
|
||||||
|
port: 5672
|
||||||
|
username: guest
|
||||||
|
password: guest
|
||||||
|
virtual-host: /
|
||||||
|
publisher-confirm-type: correlated #确认消息已发送到交换机(Exchange)
|
||||||
|
publisher-returns: true #确认消息已发送到队列(Queue)
|
||||||
|
listener:
|
||||||
|
simple:
|
||||||
|
prefetch: 1 # 每次只能获取一条,处理完成才能获取下一条
|
||||||
|
#acknowledge-mode: manual # 设置消费端手动ack确认
|
||||||
|
retry:
|
||||||
|
enabled: true # 是否支持重试
|
||||||
|
template:
|
||||||
|
# 只要消息抵达Queue,就会异步发送优先回调return firm
|
||||||
|
mandatory: true
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
com.couplet.analyze.msg.mapper: DEBUG
|
com.couplet.analyze.msg.mapper: DEBUG
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
map-underscore-to-camel-case: true
|
map-underscore-to-camel-case: true
|
||||||
|
|
||||||
# RabbitMQ配置
|
# RabbitMQ配置
|
||||||
#mq:
|
mq:
|
||||||
# queueName: queue
|
queueName: queue
|
||||||
# exchangeName: exchange
|
exchangeName: exchange
|
||||||
# routingKey: routingKey
|
routingKey: routingKey
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
|
|
||||||
<insert id="reportMapper">
|
<insert id="reportMapper">
|
||||||
INSERT INTO `vehicle-resolver`.`resolver_report_data`
|
INSERT INTO `couplet-cloud`.`couplet_msg_data`
|
||||||
(`vin`, `create_time`, `longitude`, `latitude`,
|
(`vin`, `create_time`, `longitude`, `latitude`,
|
||||||
`speed`, `mileage`, `voltage`, `current`, `resistance`, `gear`,
|
`speed`, `mileage`, `voltage`, `current`, `resistance`, `gear`,
|
||||||
`acceleration_pedal`, `fuel_consumption_rate`,
|
`acceleration_pedal`, `fuel_consumption_rate`,
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.couplet.analyze.msg.mapper.CoupletMapper">
|
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertMsgData">
|
|
||||||
|
|
||||||
</insert>
|
|
||||||
</mapper>
|
|
|
@ -5,25 +5,22 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.couplet</groupId>
|
<groupId>com.couplet</groupId>
|
||||||
<artifactId>couplet-electronic-fence</artifactId>
|
<artifactId>couplet-modules</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>couplet-electronic-fence-server</artifactId>
|
<artifactId>couplet-business</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.couplet</groupId>
|
<groupId>com.couplet</groupId>
|
||||||
<artifactId>couplet-electronic-fence-common</artifactId>
|
<artifactId>couplet-common-business</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
@ -48,7 +45,6 @@
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<!-- Swagger UI -->
|
<!-- Swagger UI -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.springfox</groupId>
|
<groupId>io.springfox</groupId>
|
||||||
|
@ -85,14 +81,6 @@
|
||||||
<groupId>com.couplet</groupId>
|
<groupId>com.couplet</groupId>
|
||||||
<artifactId>couplet-common-swagger</artifactId>
|
<artifactId>couplet-common-swagger</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-system</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.kafka</groupId>
|
|
||||||
<artifactId>kafka-clients</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -121,5 +109,4 @@
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
</project>
|
</project>
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.map.server;
|
package com.couplet.business.server;
|
||||||
|
|
||||||
import com.couplet.common.security.annotation.EnableCustomConfig;
|
import com.couplet.common.security.annotation.EnableCustomConfig;
|
||||||
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
||||||
|
@ -7,16 +7,17 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统模块
|
* @Author: LiJiaYao
|
||||||
*
|
* @Date: 2024/4/3
|
||||||
* @author couplet
|
* @Description: 业务实现启动类
|
||||||
*/
|
*/
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients(basePackages = ("com.couplet"))
|
||||||
@SpringBootApplication
|
@SpringBootApplication(scanBasePackages = {"com.couplet"})
|
||||||
public class CoupletElectronicFenceApplication {
|
public class CoupletBusinessApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(CoupletElectronicFenceApplication.class, args);
|
SpringApplication.run(CoupletBusinessApplication.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
package com.couplet.server.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.EmployeeService;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
import com.couplet.common.core.web.page.TableDataInfo;
|
import com.couplet.common.core.web.page.TableDataInfo;
|
||||||
import com.couplet.common.security.annotation.RequiresPermissions;
|
import com.couplet.common.security.annotation.RequiresPermissions;
|
||||||
import com.couplet.common.system.domain.SysUser;
|
import com.couplet.common.system.domain.SysUser;
|
||||||
import com.couplet.server.service.EmployeeService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package com.couplet.map.server.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.FenceService;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.common.domain.Fence;
|
||||||
|
import com.couplet.common.domain.request.FenceConfig;
|
||||||
|
import com.couplet.common.domain.request.FenceRequest;
|
||||||
|
import com.couplet.common.domain.request.FenceUpdateRequest;
|
||||||
import com.couplet.common.log.annotation.Log;
|
import com.couplet.common.log.annotation.Log;
|
||||||
import com.couplet.common.log.enums.BusinessType;
|
import com.couplet.common.log.enums.BusinessType;
|
||||||
import com.couplet.common.security.annotation.RequiresPermissions;
|
import com.couplet.common.security.annotation.RequiresPermissions;
|
||||||
import com.couplet.map.common.domain.Fence;
|
|
||||||
import com.couplet.map.common.domain.request.FenceConfig;
|
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
|
||||||
import com.couplet.map.server.service.FenceService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
@ -83,7 +83,7 @@ public class FenceController extends BaseController {
|
||||||
@DeleteMapping("/{fenceId}")
|
@DeleteMapping("/{fenceId}")
|
||||||
@RequiresPermissions("couplet:fence:fenceDelete")
|
@RequiresPermissions("couplet:fence:fenceDelete")
|
||||||
@Log(title = "电子围栏删除",businessType = BusinessType.DELETE)
|
@Log(title = "电子围栏删除",businessType = BusinessType.DELETE)
|
||||||
public Result<?> fenceDelete(@PathVariable Long fenceId){
|
public Result<?> fenceDelete(@PathVariable Long fenceId){
|
||||||
fenceService.removeByFenceId(fenceId);
|
fenceService.removeByFenceId(fenceId);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
|
@ -1,19 +1,17 @@
|
||||||
package com.couplet.map.server.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.LogoService;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.common.domain.Logo;
|
||||||
import com.couplet.common.log.annotation.Log;
|
import com.couplet.common.log.annotation.Log;
|
||||||
import com.couplet.common.log.enums.BusinessType;
|
import com.couplet.common.log.enums.BusinessType;
|
||||||
import com.couplet.common.security.annotation.RequiresPermissions;
|
import com.couplet.common.security.annotation.RequiresPermissions;
|
||||||
import com.couplet.map.common.domain.Logo;
|
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
|
||||||
import com.couplet.map.server.service.LogoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,11 +1,11 @@
|
||||||
package com.couplet.server.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.ManageServer;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.log.annotation.Log;
|
import com.couplet.common.log.annotation.Log;
|
||||||
import com.couplet.common.log.enums.BusinessType;
|
import com.couplet.common.log.enums.BusinessType;
|
||||||
import com.couplet.common.security.annotation.RequiresPermissions;
|
import com.couplet.common.security.annotation.RequiresPermissions;
|
||||||
import com.couplet.common.system.domain.SysDept;
|
import com.couplet.common.system.domain.SysDept;
|
||||||
import com.couplet.server.service.ManageServer;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package com.couplet.trouble.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.SysTroubleService;
|
||||||
import com.couplet.common.core.domain.PageResult;
|
import com.couplet.common.core.domain.PageResult;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.common.domain.CoupletTroubleCode;
|
||||||
|
import com.couplet.common.domain.CoupletTroubleGrade;
|
||||||
|
import com.couplet.common.domain.CoupletTroubleType;
|
||||||
|
import com.couplet.common.domain.request.TroubleResp;
|
||||||
import com.couplet.common.log.annotation.Log;
|
import com.couplet.common.log.annotation.Log;
|
||||||
import com.couplet.common.log.enums.BusinessType;
|
import com.couplet.common.log.enums.BusinessType;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleCode;
|
|
||||||
import com.couplet.trouble.domain.CoupletTroubleGrade;
|
|
||||||
import com.couplet.trouble.domain.CoupletTroubleType;
|
|
||||||
import com.couplet.trouble.domain.resp.TroubleResp;
|
|
||||||
import com.couplet.trouble.service.SysTroubleService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
|
@ -1,15 +1,15 @@
|
||||||
package com.couplet.vehicle.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.VehicleService;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.request.VehicleEditParams;
|
||||||
|
import com.couplet.common.domain.request.VehicleInsertParams;
|
||||||
|
import com.couplet.common.domain.request.VehicleListParams;
|
||||||
import com.couplet.common.log.annotation.Log;
|
import com.couplet.common.log.annotation.Log;
|
||||||
import com.couplet.common.log.enums.BusinessType;
|
import com.couplet.common.log.enums.BusinessType;
|
||||||
import com.couplet.common.security.annotation.RequiresPermissions;
|
import com.couplet.common.security.annotation.RequiresPermissions;
|
||||||
import com.couplet.vehicle.domain.Vehicle;
|
|
||||||
import com.couplet.vehicle.domain.req.VehicleEditParams;
|
|
||||||
import com.couplet.vehicle.domain.req.VehicleInsertParams;
|
|
||||||
import com.couplet.vehicle.domain.req.VehicleListParams;
|
|
||||||
import com.couplet.vehicle.service.VehicleService;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -60,7 +60,7 @@ public class VehicleController extends BaseController {
|
||||||
@RequiresPermissions("couplet:vehicle:deleteById")
|
@RequiresPermissions("couplet:vehicle:deleteById")
|
||||||
@GetMapping("/deleteById/{vehicleId}")
|
@GetMapping("/deleteById/{vehicleId}")
|
||||||
@Log(title = "删除车辆", businessType = BusinessType.DELETE)
|
@Log(title = "删除车辆", businessType = BusinessType.DELETE)
|
||||||
public Result deleteById(@PathVariable Long vehicleId) {
|
public Result<String> deleteById(@PathVariable Long vehicleId) {
|
||||||
String result = vehicleService.deleteById(vehicleId);
|
String result = vehicleService.deleteById(vehicleId);
|
||||||
|
|
||||||
return Result.success(result);
|
return Result.success(result);
|
||||||
|
@ -77,7 +77,7 @@ public class VehicleController extends BaseController {
|
||||||
@RequiresPermissions("couplet:vehicle:editById")
|
@RequiresPermissions("couplet:vehicle:editById")
|
||||||
@PostMapping("/editById")
|
@PostMapping("/editById")
|
||||||
@Log(title = "编辑车辆", businessType = BusinessType.UPDATE)
|
@Log(title = "编辑车辆", businessType = BusinessType.UPDATE)
|
||||||
public Result editById(@RequestBody VehicleEditParams editParams) {
|
public Result<String> editById(@RequestBody VehicleEditParams editParams) {
|
||||||
|
|
||||||
String result = vehicleService.editById(editParams);
|
String result = vehicleService.editById(editParams);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public class VehicleController extends BaseController {
|
||||||
@RequiresPermissions("couplet:vehicle:insert")
|
@RequiresPermissions("couplet:vehicle:insert")
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
@Log(title = "新增车辆", businessType = BusinessType.INSERT)
|
@Log(title = "新增车辆", businessType = BusinessType.INSERT)
|
||||||
public Result insert(@RequestBody @Validated VehicleInsertParams insertParams) {
|
public Result<String> insert(@RequestBody @Validated VehicleInsertParams insertParams) {
|
||||||
System.out.println(insertParams);
|
System.out.println(insertParams);
|
||||||
String result = vehicleService.insert(insertParams);
|
String result = vehicleService.insert(insertParams);
|
||||||
|
|
||||||
|
@ -111,11 +111,26 @@ public class VehicleController extends BaseController {
|
||||||
**/
|
**/
|
||||||
@RequiresPermissions("couplet:vehicle:list")
|
@RequiresPermissions("couplet:vehicle:list")
|
||||||
@GetMapping("/getBindLogoById/{vehicleId}")
|
@GetMapping("/getBindLogoById/{vehicleId}")
|
||||||
public Result getBindLogoById(@PathVariable("vehicleId") Long vehicleId) {
|
public Result<List<Long>> getBindLogoById(@PathVariable("vehicleId") Long vehicleId) {
|
||||||
|
|
||||||
List<Long> bindLogoById = vehicleService.getBindLogoById(vehicleId);
|
List<Long> bindLogoById = vehicleService.getBindLogoById(vehicleId);
|
||||||
|
|
||||||
|
|
||||||
return Result.success(bindLogoById);
|
return Result.success(bindLogoById);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @Date: 2024/4/2 15:35
|
||||||
|
* @Description: 通过vin码查询车辆
|
||||||
|
* @Param: [vin]
|
||||||
|
* @Return: com.couplet.common.core.domain.Result<java.util.List<com.couplet.vehicle.domain.Vehicle>>
|
||||||
|
**/
|
||||||
|
@GetMapping("/findByVIN/{vin}")
|
||||||
|
public Result<List<Vehicle>> findByVIN(@PathVariable("vin") String vin) {
|
||||||
|
List<Vehicle> list = vehicleService.findByVIN(vin);
|
||||||
|
|
||||||
|
return Result.success(list);
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,73 @@
|
||||||
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.VehicleManageService;
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 车辆管理控制层
|
||||||
|
* @date 2024/4/2 9:05
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/VehicleManage")
|
||||||
|
public class VehicleManageController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private VehicleManageService vehicleManageService;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param :
|
||||||
|
* @return Result<List<Vehicle>>
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description Y管理车辆列表
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@PostMapping("/VehicleManageList")
|
||||||
|
public Result<List<Vehicle>> VehicleManageList(){
|
||||||
|
List<Vehicle> vehicles = vehicleManageService.VehicleManageList();
|
||||||
|
Result<List<Vehicle>> success = Result.success(vehicles);
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* @param middleId:
|
||||||
|
* @return Result<Integer>
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 删除员工管理的车辆
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
|
||||||
|
@DeleteMapping("/{middleId}")
|
||||||
|
public Result deleteVehicle(@PathVariable(value = "middleId") Long middleId){
|
||||||
|
return vehicleManageService.deleteVehicle(middleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param middle:
|
||||||
|
* @return Result
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 添加车辆
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public Result addVehicle(@RequestBody VehicleMiddle middle){
|
||||||
|
return vehicleManageService.addVehicle(middle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("vehicleAll")
|
||||||
|
public Result<List<Vehicle>> vehicleAll(){
|
||||||
|
List<Vehicle> vehicles = vehicleManageService.vehicleAll();
|
||||||
|
return Result.success(vehicles);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package com.couplet.vehicle.controller;
|
package com.couplet.business.server.controller;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.VehicleTypeService;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.controller.BaseController;
|
import com.couplet.common.core.web.controller.BaseController;
|
||||||
|
import com.couplet.common.domain.VehicleType;
|
||||||
import com.couplet.common.security.annotation.RequiresPermissions;
|
import com.couplet.common.security.annotation.RequiresPermissions;
|
||||||
import com.couplet.vehicle.domain.VehicleType;
|
|
||||||
import com.couplet.vehicle.service.VehicleTypeService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.couplet.map.server.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.common.domain.Fence;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
package com.couplet.map.server.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.map.common.domain.Fence;
|
|
||||||
import com.couplet.map.common.domain.request.FenceConfig;
|
import com.couplet.common.domain.Fence;
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
import com.couplet.common.domain.request.FenceConfig;
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
import com.couplet.common.domain.request.FenceRequest;
|
||||||
|
import com.couplet.common.domain.request.FenceUpdateRequest;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -19,7 +20,7 @@ public interface FenceMapper extends BaseMapper<Fence> {
|
||||||
* 改变围栏信息
|
* 改变围栏信息
|
||||||
* @param fenceUpdateRequest
|
* @param fenceUpdateRequest
|
||||||
*/
|
*/
|
||||||
void changeFence(FenceUpdateRequest fenceUpdateRequest);
|
void changeFence(FenceUpdateRequest fenceUpdateRequest);
|
||||||
|
|
||||||
int insertFence(FenceRequest fenceRequest);
|
int insertFence(FenceRequest fenceRequest);
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
package com.couplet.map.server.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.common.domain.Logo;
|
||||||
import com.couplet.map.common.domain.Logo;
|
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,10 +1,10 @@
|
||||||
package com.couplet.trouble.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleCode;
|
import com.couplet.common.domain.CoupletTroubleCode;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleGrade;
|
import com.couplet.common.domain.CoupletTroubleGrade;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleType;
|
import com.couplet.common.domain.CoupletTroubleType;
|
||||||
import com.couplet.trouble.domain.resp.TroubleResp;
|
import com.couplet.common.domain.request.TroubleResp;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
|
@ -1,7 +1,7 @@
|
||||||
package com.couplet.vehicle.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.vehicle.domain.VehicleAndLogo;
|
import com.couplet.common.domain.VehicleAndLogo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
|
@ -1,10 +1,13 @@
|
||||||
package com.couplet.vehicle.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.vehicle.domain.Vehicle;
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ProjectName: five-groups-couplet
|
* @ProjectName: five-groups-couplet
|
||||||
* @Author: LiuYunHu
|
* @Author: LiuYunHu
|
||||||
|
@ -14,4 +17,11 @@ import org.springframework.stereotype.Component;
|
||||||
@Mapper
|
@Mapper
|
||||||
@Component
|
@Component
|
||||||
public interface VehicleMapper extends BaseMapper<Vehicle> {
|
public interface VehicleMapper extends BaseMapper<Vehicle> {
|
||||||
|
List<Vehicle> UserUnderTheVehicleList(Long userId);
|
||||||
|
|
||||||
|
Integer deleteVehicle(Long middleId);
|
||||||
|
|
||||||
|
Integer addVehicle(VehicleMiddle vehicleMiddle);
|
||||||
|
|
||||||
|
List<Vehicle> vehicleAll();
|
||||||
}
|
}
|
|
@ -1,8 +1,7 @@
|
||||||
package com.couplet.vehicle.mapper;
|
package com.couplet.business.server.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.couplet.vehicle.domain.Vehicle;
|
import com.couplet.common.domain.VehicleType;
|
||||||
import com.couplet.vehicle.domain.VehicleType;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.couplet.server.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.page.TableDataInfo;
|
import com.couplet.common.core.web.page.TableDataInfo;
|
|
@ -1,7 +1,8 @@
|
||||||
package com.couplet.map.server.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.common.domain.Fence;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: LiJiaYao
|
* @Author: LiJiaYao
|
|
@ -1,10 +1,10 @@
|
||||||
package com.couplet.map.server.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.common.domain.Fence;
|
||||||
import com.couplet.map.common.domain.request.FenceConfig;
|
import com.couplet.common.domain.request.FenceConfig;
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
import com.couplet.common.domain.request.FenceRequest;
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
import com.couplet.common.domain.request.FenceUpdateRequest;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -27,7 +27,7 @@ public interface FenceService extends IService<Fence> {
|
||||||
*
|
*
|
||||||
* @param fenceRequest
|
* @param fenceRequest
|
||||||
*/
|
*/
|
||||||
void fenceInsert(HttpServletRequest request,FenceRequest fenceRequest);
|
void fenceInsert(HttpServletRequest request, FenceRequest fenceRequest);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除电子围栏
|
* 删除电子围栏
|
|
@ -1,7 +1,8 @@
|
||||||
package com.couplet.map.server.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.couplet.map.common.domain.Logo;
|
import com.couplet.common.domain.Logo;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package com.couplet.server.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.system.domain.SysDept;
|
import com.couplet.common.system.domain.SysDept;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package com.couplet.trouble.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.couplet.common.core.domain.PageResult;
|
import com.couplet.common.core.domain.PageResult;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleCode;
|
import com.couplet.common.domain.CoupletTroubleCode;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleGrade;
|
import com.couplet.common.domain.CoupletTroubleGrade;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleType;
|
import com.couplet.common.domain.CoupletTroubleType;
|
||||||
import com.couplet.trouble.domain.resp.TroubleResp;
|
import com.couplet.common.domain.request.TroubleResp;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.couplet.vehicle.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.couplet.vehicle.domain.VehicleAndLogo;
|
import com.couplet.common.domain.VehicleAndLogo;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface VehicleManageService {
|
||||||
|
List<Vehicle> VehicleManageList();
|
||||||
|
|
||||||
|
|
||||||
|
Result deleteVehicle(Long middleId);
|
||||||
|
|
||||||
|
Result addVehicle(VehicleMiddle middle);
|
||||||
|
|
||||||
|
List<Vehicle> vehicleAll();
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
|
import com.couplet.common.domain.request.VehicleEditParams;
|
||||||
|
import com.couplet.common.domain.request.VehicleInsertParams;
|
||||||
|
import com.couplet.common.domain.request.VehicleListParams;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ProjectName: five-groups-couplet
|
||||||
|
* @Author: LiuYunHu
|
||||||
|
* @CreateTime: 2024/3/26
|
||||||
|
* @Description: 车辆服务
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface VehicleService extends IService<Vehicle> {
|
||||||
|
List<Vehicle> list(VehicleListParams listParams);
|
||||||
|
|
||||||
|
String deleteById(Long vehicleId);
|
||||||
|
|
||||||
|
String editById(VehicleEditParams editParams);
|
||||||
|
|
||||||
|
String insert(VehicleInsertParams insertParams);
|
||||||
|
|
||||||
|
List<Long> getBindLogoById(Long vehicleId);
|
||||||
|
|
||||||
|
List<Vehicle> findByVIN(String vin);
|
||||||
|
|
||||||
|
List<Vehicle> UserUnderTheVehicleList(Long userId);
|
||||||
|
|
||||||
|
Integer deleteVehicle(Long middleId);
|
||||||
|
|
||||||
|
Integer addVehicle(VehicleMiddle vehicleMiddle);
|
||||||
|
|
||||||
|
List<Vehicle> vehicleAll();
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,8 @@
|
||||||
package com.couplet.vehicle.service;
|
package com.couplet.business.server.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.couplet.vehicle.domain.VehicleType;
|
import com.couplet.common.domain.VehicleType;
|
||||||
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.couplet.server.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.EmployeeService;
|
||||||
import com.couplet.common.core.constant.SecurityConstants;
|
import com.couplet.common.core.constant.SecurityConstants;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.web.page.TableDataInfo;
|
import com.couplet.common.core.web.page.TableDataInfo;
|
||||||
|
@ -8,7 +9,6 @@ import com.couplet.common.system.domain.LoginUser;
|
||||||
import com.couplet.common.system.domain.SysUser;
|
import com.couplet.common.system.domain.SysUser;
|
||||||
import com.couplet.common.system.remote.RemoteEmployeeService;
|
import com.couplet.common.system.remote.RemoteEmployeeService;
|
||||||
import com.couplet.common.system.remote.RemoteUserService;
|
import com.couplet.common.system.remote.RemoteUserService;
|
||||||
import com.couplet.server.service.EmployeeService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ import java.util.List;
|
||||||
* @date 2024/3/31 19:42
|
* @date 2024/3/31 19:42
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class EmployeeServiceImpl implements EmployeeService{
|
public class EmployeeServiceImpl implements EmployeeService {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -91,6 +91,14 @@ public class EmployeeServiceImpl implements EmployeeService{
|
||||||
return remoteEmployeeService.changeStatus(user);
|
return remoteEmployeeService.changeStatus(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param user:
|
||||||
|
* @return List<SysUser>
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 员工管理列表
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysUser> userList(SysUser user) {
|
public List<SysUser> userList(SysUser user) {
|
||||||
String username = SecurityUtils.getUsername();
|
String username = SecurityUtils.getUsername();
|
|
@ -1,9 +1,9 @@
|
||||||
package com.couplet.map.server.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.business.server.mapper.FenAndLogoMapper;
|
||||||
import com.couplet.map.server.mapper.FenAndLogoMapper;
|
import com.couplet.business.server.service.FenAndLogoService;
|
||||||
import com.couplet.map.server.service.FenAndLogoService;
|
import com.couplet.common.domain.Fence;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
|
@ -1,13 +1,13 @@
|
||||||
package com.couplet.map.server.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.business.server.mapper.FenceMapper;
|
||||||
import com.couplet.map.common.domain.request.FenceConfig;
|
import com.couplet.business.server.service.FenAndLogoService;
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
import com.couplet.business.server.service.FenceService;
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
import com.couplet.common.domain.Fence;
|
||||||
import com.couplet.map.server.mapper.FenceMapper;
|
import com.couplet.common.domain.request.FenceConfig;
|
||||||
import com.couplet.map.server.service.FenAndLogoService;
|
import com.couplet.common.domain.request.FenceRequest;
|
||||||
import com.couplet.map.server.service.FenceService;
|
import com.couplet.common.domain.request.FenceUpdateRequest;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -58,7 +58,7 @@ public class FenceServiceImpl extends ServiceImpl<FenceMapper, Fence> implements
|
||||||
* @param fenceRequest
|
* @param fenceRequest
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void fenceInsert(HttpServletRequest request,FenceRequest fenceRequest) {
|
public void fenceInsert(HttpServletRequest request, FenceRequest fenceRequest) {
|
||||||
|
|
||||||
//先添加围栏
|
//先添加围栏
|
||||||
int a= fenceMapper.insertFence(fenceRequest);
|
int a= fenceMapper.insertFence(fenceRequest);
|
|
@ -1,19 +1,14 @@
|
||||||
package com.couplet.map.server.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.couplet.map.common.domain.Fence;
|
import com.couplet.business.server.mapper.LogoMapper;
|
||||||
import com.couplet.map.common.domain.Logo;
|
import com.couplet.business.server.service.LogoService;
|
||||||
import com.couplet.map.common.domain.request.FenceRequest;
|
import com.couplet.common.domain.Logo;
|
||||||
import com.couplet.map.common.domain.request.FenceUpdateRequest;
|
|
||||||
import com.couplet.map.server.mapper.LogoMapper;
|
|
||||||
import com.couplet.map.server.service.LogoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -1,18 +1,16 @@
|
||||||
package com.couplet.server.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.couplet.common.core.constant.SecurityConstants;
|
import com.couplet.business.server.service.ManageServer;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.utils.StringUtils;
|
|
||||||
import com.couplet.common.security.utils.SecurityUtils;
|
import com.couplet.common.security.utils.SecurityUtils;
|
||||||
import com.couplet.common.system.domain.LoginUser;
|
import com.couplet.common.system.domain.LoginUser;
|
||||||
import com.couplet.common.system.domain.SysDept;
|
import com.couplet.common.system.domain.SysDept;
|
||||||
import com.couplet.common.system.remote.RemoteDeptService;
|
import com.couplet.common.system.remote.RemoteDeptService;
|
||||||
import com.couplet.common.system.remote.RemoteUserService;
|
import com.couplet.common.system.remote.RemoteUserService;
|
||||||
import com.couplet.server.service.ManageServer;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +20,7 @@ import java.util.List;
|
||||||
* @date 2024/3/27 15:34
|
* @date 2024/3/27 15:34
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class ManageServiceImpl implements ManageServer{
|
public class ManageServiceImpl implements ManageServer {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteDeptService remoteDeptService;
|
private RemoteDeptService remoteDeptService;
|
|
@ -1,13 +1,13 @@
|
||||||
package com.couplet.trouble.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.couplet.business.server.mapper.SysTroubleMapper;
|
||||||
|
import com.couplet.business.server.service.SysTroubleService;
|
||||||
import com.couplet.common.core.domain.PageResult;
|
import com.couplet.common.core.domain.PageResult;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleCode;
|
import com.couplet.common.domain.CoupletTroubleCode;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleGrade;
|
import com.couplet.common.domain.CoupletTroubleGrade;
|
||||||
import com.couplet.trouble.domain.CoupletTroubleType;
|
import com.couplet.common.domain.CoupletTroubleType;
|
||||||
import com.couplet.trouble.domain.resp.TroubleResp;
|
import com.couplet.common.domain.request.TroubleResp;
|
||||||
import com.couplet.trouble.mapper.SysTroubleMapper;
|
|
||||||
import com.couplet.trouble.service.SysTroubleService;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class SysTroubleServiceImpl extends ServiceImpl<SysTroubleMapper, CoupletTroubleCode> implements SysTroubleService{
|
public class SysTroubleServiceImpl extends ServiceImpl<SysTroubleMapper, CoupletTroubleCode> implements SysTroubleService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysTroubleMapper sysTroubleMapper;
|
private SysTroubleMapper sysTroubleMapper;
|
|
@ -1,14 +1,13 @@
|
||||||
package com.couplet.vehicle.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.couplet.vehicle.domain.VehicleAndLogo;
|
import com.couplet.business.server.mapper.VehicleAndLogoMapper;
|
||||||
import com.couplet.vehicle.mapper.VehicleAndLogoMapper;
|
import com.couplet.business.server.service.VehicleAndLogoService;
|
||||||
import com.couplet.vehicle.service.VehicleAndLogoService;
|
import com.couplet.common.domain.VehicleAndLogo;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -0,0 +1,78 @@
|
||||||
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
|
import com.couplet.business.server.service.VehicleManageService;
|
||||||
|
import com.couplet.common.core.domain.Result;
|
||||||
|
import com.couplet.common.domain.Vehicle;
|
||||||
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
|
import com.couplet.common.security.utils.SecurityUtils;
|
||||||
|
import com.couplet.remote.RemoteVehicleService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author fufanrui
|
||||||
|
* @version 1.0
|
||||||
|
* @description: 车辆管理服务实现类
|
||||||
|
* @date 2024/4/2 9:05
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class VehicleManageServiceImpl implements VehicleManageService {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RemoteVehicleService remoteVehicleService;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @description: 车辆管理列表
|
||||||
|
* @param: []
|
||||||
|
* @return: com.couplet.common.core.domain.Result<java.util.List<com.couplet.common.system.domain.Vehicle>>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> VehicleManageList() {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
Result<List<Vehicle>> listResult = remoteVehicleService.UserUnderTheVehicleList(userId);
|
||||||
|
List<Vehicle> list = listResult.getData();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param middleId:
|
||||||
|
* @return Result
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 删除员工管理车辆
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result deleteVehicle(Long middleId) {
|
||||||
|
Result<Integer> integerResult = remoteVehicleService.deleteVehicle(middleId);
|
||||||
|
Integer resultData = integerResult.getData();
|
||||||
|
|
||||||
|
return resultData==1?Result.success():Result.error("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param middle:
|
||||||
|
* @return Result
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 添加车辆
|
||||||
|
* @date
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Result addVehicle(VehicleMiddle middle) {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
middle.setUserId(userId);
|
||||||
|
Result<Integer> integerResult = remoteVehicleService.addVehicle(middle);
|
||||||
|
Integer resultData = integerResult.getData();
|
||||||
|
return resultData==1?Result.success():Result.error("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> vehicleAll() {
|
||||||
|
Result<List<Vehicle>> listResult = remoteVehicleService.VehicleManageList();
|
||||||
|
return listResult.getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,20 +1,21 @@
|
||||||
package com.couplet.vehicle.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.couplet.business.server.mapper.VehicleMapper;
|
||||||
|
import com.couplet.business.server.service.VehicleAndLogoService;
|
||||||
|
import com.couplet.business.server.service.VehicleService;
|
||||||
|
import com.couplet.business.server.service.VehicleTypeService;
|
||||||
import com.couplet.common.core.domain.Result;
|
import com.couplet.common.core.domain.Result;
|
||||||
import com.couplet.common.core.utils.StringUtils;
|
import com.couplet.common.core.utils.StringUtils;
|
||||||
import com.couplet.vehicle.domain.Vehicle;
|
import com.couplet.common.core.utils.uuid.UUID;
|
||||||
import com.couplet.vehicle.domain.VehicleType;
|
import com.couplet.common.domain.Vehicle;
|
||||||
import com.couplet.vehicle.domain.req.VehicleEditParams;
|
import com.couplet.common.domain.VehicleMiddle;
|
||||||
import com.couplet.vehicle.domain.req.VehicleInsertParams;
|
import com.couplet.common.domain.VehicleType;
|
||||||
import com.couplet.vehicle.domain.req.VehicleListParams;
|
import com.couplet.common.domain.request.VehicleEditParams;
|
||||||
import com.couplet.vehicle.mapper.VehicleMapper;
|
import com.couplet.common.domain.request.VehicleInsertParams;
|
||||||
import com.couplet.vehicle.service.VehicleAndLogoService;
|
import com.couplet.common.domain.request.VehicleListParams;
|
||||||
import com.couplet.vehicle.service.VehicleService;
|
|
||||||
import com.couplet.vehicle.service.VehicleTypeService;
|
|
||||||
import com.couplet.vehicle.utils.SnowflakeIdGenerator;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
@ -187,6 +188,14 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//UUID生成17位随机字符串
|
||||||
|
UUID uuid = UUID.randomUUID();
|
||||||
|
String string = uuid.toString();
|
||||||
|
String s = string.replaceAll("-", "");
|
||||||
|
String vin = s.substring(0, 17);
|
||||||
|
// System.out.println(vin+" "+vin.length());
|
||||||
|
|
||||||
|
/*
|
||||||
//雪花算法生成随机数
|
//雪花算法生成随机数
|
||||||
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
SnowflakeIdGenerator idGenerator = new SnowflakeIdGenerator(1, 1);
|
||||||
long randomId = idGenerator.nextId();
|
long randomId = idGenerator.nextId();
|
||||||
|
@ -196,6 +205,8 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
//切割,只留后17位
|
//切割,只留后17位
|
||||||
vin = vin.substring(vin.length() - 17);
|
vin = vin.substring(vin.length() - 17);
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//创建入参对象
|
//创建入参对象
|
||||||
Vehicle vehicle = new Vehicle();
|
Vehicle vehicle = new Vehicle();
|
||||||
|
@ -243,4 +254,46 @@ public class VehicleServiceImpl extends ServiceImpl<VehicleMapper, Vehicle> impl
|
||||||
return logoIds;
|
return logoIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @param userId:
|
||||||
|
* @return List<Vehicle>
|
||||||
|
* @author 付凡芮
|
||||||
|
* @description 根据登入人id查询管理车辆
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> UserUnderTheVehicleList(Long userId) {
|
||||||
|
return vehicleMapper.UserUnderTheVehicleList(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer deleteVehicle(Long middleId) {
|
||||||
|
return vehicleMapper.deleteVehicle(middleId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Integer addVehicle(VehicleMiddle vehicleMiddle) {
|
||||||
|
|
||||||
|
return vehicleMapper.addVehicle(vehicleMiddle);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> vehicleAll() {
|
||||||
|
return vehicleMapper.vehicleAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Vehicle> findByVIN(String vin) {
|
||||||
|
|
||||||
|
//创建查询条件包装器
|
||||||
|
LambdaQueryWrapper<Vehicle> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (!StringUtils.isEmpty(vin)) {
|
||||||
|
queryWrapper.eq(Vehicle::getVin, vin);
|
||||||
|
}
|
||||||
|
|
||||||
|
//执行查询
|
||||||
|
return this.list(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,10 +1,10 @@
|
||||||
package com.couplet.vehicle.service.impl;
|
package com.couplet.business.server.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.couplet.vehicle.domain.VehicleType;
|
import com.couplet.business.server.mapper.VehicleTypeMapper;
|
||||||
import com.couplet.vehicle.mapper.VehicleTypeMapper;
|
import com.couplet.business.server.service.VehicleTypeService;
|
||||||
import com.couplet.vehicle.service.VehicleTypeService;
|
import com.couplet.common.domain.VehicleType;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: couplet-electronic-fence
|
name: couplet-business
|
||||||
|
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.couplet.map.server.mapper.FenAndLogoMapper">
|
<mapper namespace="com.couplet.business.server.mapper.FenAndLogoMapper">
|
||||||
|
|
||||||
<resultMap id="map" type="com.couplet.map.common.domain.Fence">
|
<resultMap id="map" type="com.couplet.common.domain.Fence">
|
||||||
<id property="fenceId" column="fence_id"/>
|
<id property="fenceId" column="fence_id"/>
|
||||||
<result property="fenceName" column="fence_name"/>
|
<result property="fenceName" column="fence_name"/>
|
||||||
<result property="fenceDescription" column="fence_description"/>
|
<result property="fenceDescription" column="fence_description"/>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<result property="isDelete" column="is_delete" />
|
<result property="isDelete" column="is_delete" />
|
||||||
<result property="maintainerName" column="maintainer_name" />
|
<result property="maintainerName" column="maintainer_name" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap id="logoMap" type="com.couplet.map.common.domain.Logo">
|
<resultMap id="logoMap" type="com.couplet.common.domain.Logo">
|
||||||
<id property="logoId" column="logo_id"/>
|
<id property="logoId" column="logo_id"/>
|
||||||
<result property="logoName" column="logo_name" />
|
<result property="logoName" column="logo_name" />
|
||||||
</resultMap>
|
</resultMap>
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.couplet.map.server.mapper.FenceMapper">
|
<mapper namespace="com.couplet.business.server.mapper.FenceMapper">
|
||||||
|
|
||||||
<resultMap id="map" type="com.couplet.map.common.domain.Fence">
|
<resultMap id="map" type="com.couplet.common.domain.Fence">
|
||||||
<id property="fenceId" column="fence_id"/>
|
<id property="fenceId" column="fence_id"/>
|
||||||
<result property="fenceName" column="fence_name"/>
|
<result property="fenceName" column="fence_name"/>
|
||||||
<result property="fenceDescription" column="fence_description"/>
|
<result property="fenceDescription" column="fence_description"/>
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
<result property="isDelete" column="is_delete" />
|
<result property="isDelete" column="is_delete" />
|
||||||
<result property="maintainerName" column="maintainer_name" />
|
<result property="maintainerName" column="maintainer_name" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<resultMap id="logoMap" type="com.couplet.map.common.domain.Logo">
|
<resultMap id="logoMap" type="com.couplet.common.domain.Logo">
|
||||||
<id property="logoId" column="logo_id"/>
|
<id property="logoId" column="logo_id"/>
|
||||||
<result property="logoName" column="logo_name" />
|
<result property="logoName" column="logo_name" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
@ -52,7 +52,7 @@
|
||||||
alarm_status
|
alarm_status
|
||||||
FROM couplet_fence_info
|
FROM couplet_fence_info
|
||||||
</sql>
|
</sql>
|
||||||
<insert id="insertFence" parameterType="com.couplet.map.common.domain.request.FenceRequest" keyProperty="fenceId"
|
<insert id="insertFence" parameterType="com.couplet.common.domain.request.FenceRequest" keyProperty="fenceId"
|
||||||
useGeneratedKeys="true">
|
useGeneratedKeys="true">
|
||||||
INSERT INTO `couplet-cloud`.`couplet_fence_info`
|
INSERT INTO `couplet-cloud`.`couplet_fence_info`
|
||||||
(`fence_name`, `fence_longitude_latitude`, `fence_description`, `is_delete`, `fence_state`, `create_time`,
|
(`fence_name`, `fence_longitude_latitude`, `fence_description`, `is_delete`, `fence_state`, `create_time`,
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="changeFence" parameterType="com.couplet.map.common.domain.request.FenceUpdateRequest">
|
<update id="changeFence" parameterType="com.couplet.common.domain.request.FenceUpdateRequest">
|
||||||
|
|
||||||
UPDATE `couplet-cloud`.`couplet_fence_info`
|
UPDATE `couplet-cloud`.`couplet_fence_info`
|
||||||
SET `fence_name` = #{fenceName},
|
SET `fence_name` = #{fenceName},
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
delete from couplet_fence_info where fence_id = #{fenceId}
|
delete from couplet_fence_info where fence_id = #{fenceId}
|
||||||
</delete>
|
</delete>
|
||||||
<select id="pageQuery" resultMap="map"
|
<select id="pageQuery" resultMap="map"
|
||||||
parameterType="com.couplet.map.common.domain.request.FenceConfig">
|
parameterType="com.couplet.common.domain.request.FenceConfig">
|
||||||
<include refid="selectFence"></include>
|
<include refid="selectFence"></include>
|
||||||
<where>
|
<where>
|
||||||
<if test="fenceName!=null and fenceName!='' ">
|
<if test="fenceName!=null and fenceName!='' ">
|
|
@ -2,9 +2,9 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.couplet.trouble.mapper.SysTroubleMapper">
|
<mapper namespace="com.couplet.business.server.mapper.SysTroubleMapper">
|
||||||
|
|
||||||
<resultMap type="com.couplet.trouble.domain.CoupletTroubleCode" id="SysTroubleResult">
|
<resultMap type="com.couplet.common.domain.CoupletTroubleCode" id="SysTroubleResult">
|
||||||
<id property="troubleId" column="trouble_id"/>
|
<id property="troubleId" column="trouble_id"/>
|
||||||
<result property="troubleCode" column="trouble_code"/>
|
<result property="troubleCode" column="trouble_code"/>
|
||||||
<result property="troubleValue" column="trouble_value"/>
|
<result property="troubleValue" column="trouble_value"/>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
LEFT JOIN couplet_trouble_type y on t.type_id= y.type_id
|
LEFT JOIN couplet_trouble_type y on t.type_id= y.type_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectTroubleList" parameterType="com.couplet.trouble.mapper.SysTroubleMapper" resultMap="SysTroubleResult">
|
<select id="selectTroubleList" parameterType="com.couplet.business.server.mapper.SysTroubleMapper" resultMap="SysTroubleResult">
|
||||||
<include refid="selectTroubleVo"/>
|
<include refid="selectTroubleVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="troubleCode != null and troubleCode != ''">
|
<if test="troubleCode != null and troubleCode != ''">
|
||||||
|
@ -31,10 +31,10 @@
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTroubleListByType" resultType="com.couplet.trouble.domain.CoupletTroubleType">
|
<select id="selectTroubleListByType" resultType="com.couplet.common.domain.CoupletTroubleType">
|
||||||
select * from couplet_trouble_type
|
select * from couplet_trouble_type
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTroubleListByGrade" resultType="com.couplet.trouble.domain.CoupletTroubleGrade">
|
<select id="selectTroubleListByGrade" resultType="com.couplet.common.domain.CoupletTroubleGrade">
|
||||||
select * from couplet_trouble_grade
|
select * from couplet_trouble_grade
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.couplet.vehicle.mapper.VehicleAndLogoMapper">
|
<mapper namespace="com.couplet.business.server.mapper.VehicleAndLogoMapper">
|
||||||
|
|
||||||
|
|
||||||
<insert id="vehicleBindLogo">
|
<insert id="vehicleBindLogo">
|
|
@ -0,0 +1,63 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.couplet.business.server.mapper.VehicleMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<sql id="selectMiddleUserOrVehicle">
|
||||||
|
SELECT
|
||||||
|
m.middle_id,
|
||||||
|
m.user_id,
|
||||||
|
m.vehicle_id,
|
||||||
|
m.del_flag,
|
||||||
|
v.vehicle_type,
|
||||||
|
v.motor_manufacturer,
|
||||||
|
v.battery_manufacturer,
|
||||||
|
v.motor_number,
|
||||||
|
v.battery_number,
|
||||||
|
v.vin,
|
||||||
|
v.vehicle_state,
|
||||||
|
t.vehicle_type_name
|
||||||
|
FROM
|
||||||
|
`couplet_middle` m
|
||||||
|
LEFT JOIN couplet_vehicle v ON m.vehicle_id = v.vehicle_id
|
||||||
|
LEFT JOIN couplet_vehicle_type t ON v.vehicle_id = t.vehicle_type_id
|
||||||
|
WHERE m.del_flag = 0
|
||||||
|
</sql>
|
||||||
|
<sql id="selectVehicle">
|
||||||
|
select
|
||||||
|
v.vehicle_id,
|
||||||
|
v.motor_manufacturer,
|
||||||
|
v.battery_manufacturer,
|
||||||
|
v.motor_number,
|
||||||
|
v.battery_number,
|
||||||
|
v.vin,
|
||||||
|
v.vehicle_state,
|
||||||
|
t.vehicle_type_name
|
||||||
|
from couplet_vehicle v
|
||||||
|
left join couplet_vehicle_type t on v.vehicle_type = t.vehicle_type_id
|
||||||
|
where v.isdelete = 0
|
||||||
|
</sql>
|
||||||
|
<insert id="addVehicle">
|
||||||
|
INSERT INTO `couplet-cloud`.`couplet_middle` (`user_id`, `vehicle_id`, `del_flag`) VALUES
|
||||||
|
<foreach collection="vehicleId" item="vehicleId" separator=",">
|
||||||
|
(#{userId}, #{vehicleId}, 0)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
<delete id="deleteVehicle">
|
||||||
|
update couplet_middle
|
||||||
|
set del_flag = '2'
|
||||||
|
where middle_id = #{middleId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="UserUnderTheVehicleList" resultType="com.couplet.common.domain.Vehicle">
|
||||||
|
<include refid="selectMiddleUserOrVehicle"/>
|
||||||
|
<if test="userId!=null">
|
||||||
|
AND m.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
<select id="vehicleAll" resultType="com.couplet.common.domain.Vehicle">
|
||||||
|
<include refid="selectVehicle"/>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.couplet.vehicle.mapper.VehicleTypeMapper">
|
<mapper namespace="com.couplet.business.server.mapper.VehicleTypeMapper">
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -1,38 +0,0 @@
|
||||||
target/
|
|
||||||
!.mvn/wrapper/maven-wrapper.jar
|
|
||||||
!**/src/main/**/target/
|
|
||||||
!**/src/test/**/target/
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea/modules.xml
|
|
||||||
.idea/jarRepositories.xml
|
|
||||||
.idea/compiler.xml
|
|
||||||
.idea/libraries/
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
### Eclipse ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
build/
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
### Mac OS ###
|
|
||||||
.DS_Store
|
|
|
@ -1,38 +0,0 @@
|
||||||
target/
|
|
||||||
!.mvn/wrapper/maven-wrapper.jar
|
|
||||||
!**/src/main/**/target/
|
|
||||||
!**/src/test/**/target/
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea/modules.xml
|
|
||||||
.idea/jarRepositories.xml
|
|
||||||
.idea/compiler.xml
|
|
||||||
.idea/libraries/
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
### Eclipse ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
build/
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
### Mac OS ###
|
|
||||||
.DS_Store
|
|
|
@ -1,38 +0,0 @@
|
||||||
target/
|
|
||||||
!.mvn/wrapper/maven-wrapper.jar
|
|
||||||
!**/src/main/**/target/
|
|
||||||
!**/src/test/**/target/
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea/modules.xml
|
|
||||||
.idea/jarRepositories.xml
|
|
||||||
.idea/compiler.xml
|
|
||||||
.idea/libraries/
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
### Eclipse ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
build/
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
### Mac OS ###
|
|
||||||
.DS_Store
|
|
|
@ -1,29 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-electronic-fence</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-electronic-fence-remote</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
<dependencies>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-electronic-fence-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,38 +0,0 @@
|
||||||
target/
|
|
||||||
!.mvn/wrapper/maven-wrapper.jar
|
|
||||||
!**/src/main/**/target/
|
|
||||||
!**/src/test/**/target/
|
|
||||||
|
|
||||||
### IntelliJ IDEA ###
|
|
||||||
.idea/modules.xml
|
|
||||||
.idea/jarRepositories.xml
|
|
||||||
.idea/compiler.xml
|
|
||||||
.idea/libraries/
|
|
||||||
*.iws
|
|
||||||
*.iml
|
|
||||||
*.ipr
|
|
||||||
|
|
||||||
### Eclipse ###
|
|
||||||
.apt_generated
|
|
||||||
.classpath
|
|
||||||
.factorypath
|
|
||||||
.project
|
|
||||||
.settings
|
|
||||||
.springBeans
|
|
||||||
.sts4-cache
|
|
||||||
|
|
||||||
### NetBeans ###
|
|
||||||
/nbproject/private/
|
|
||||||
/nbbuild/
|
|
||||||
/dist/
|
|
||||||
/nbdist/
|
|
||||||
/.nb-gradle/
|
|
||||||
build/
|
|
||||||
!**/src/main/**/build/
|
|
||||||
!**/src/test/**/build/
|
|
||||||
|
|
||||||
### VS Code ###
|
|
||||||
.vscode/
|
|
||||||
|
|
||||||
### Mac OS ###
|
|
||||||
.DS_Store
|
|
|
@ -1,33 +0,0 @@
|
||||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
|
||||||
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/1
|
|
||||||
* 异步发送
|
|
||||||
*/
|
|
||||||
public class test {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
Properties props = new Properties();
|
|
||||||
props.put("bootstrap.servers","39.103.133.136:9092");
|
|
||||||
//使用默认的配置
|
|
||||||
// props.put("acks","all");
|
|
||||||
// props.put("retries",0);
|
|
||||||
// props.put("batch.size",16384);
|
|
||||||
// props.put("linger.ms",1);
|
|
||||||
// props.put("buffer.memory",33554432);
|
|
||||||
props.put("key.serializer","org.apache.kafka.common.serialization.StringSerializer");
|
|
||||||
props.put("value.serializer","org.apache.kafka.common.serialization.StringSerializer");
|
|
||||||
KafkaProducer<String, String> producer = new KafkaProducer<>(props);
|
|
||||||
for (int i = 0; i < 10; i++) {
|
|
||||||
producer.send(new ProducerRecord<String,String>("my-topic",Integer.toString(i),Integer.toString(i)));
|
|
||||||
}
|
|
||||||
producer.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
import org.apache.kafka.clients.producer.KafkaProducer;
|
|
||||||
import org.apache.kafka.clients.producer.Producer;
|
|
||||||
import org.apache.kafka.clients.producer.ProducerRecord;
|
|
||||||
import org.apache.kafka.clients.producer.RecordMetadata;
|
|
||||||
import org.yaml.snakeyaml.introspector.Property;
|
|
||||||
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.Future;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: LiJiaYao
|
|
||||||
* @Date: 2024/4/1
|
|
||||||
* 同步发送
|
|
||||||
*/
|
|
||||||
public class test2 {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
Properties properties = new Properties();
|
|
||||||
properties.put("bootstrap.servers", "39.103.133.136:9092");
|
|
||||||
properties.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer");
|
|
||||||
properties.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer");
|
|
||||||
KafkaProducer<String, String> producer = new KafkaProducer<String, String>(properties);
|
|
||||||
for (int i = 0; i < 10; i++) {
|
|
||||||
Future<RecordMetadata> result = producer.send(new ProducerRecord<>("test", Integer.toString(i), Integer.toString(i)));
|
|
||||||
try {
|
|
||||||
RecordMetadata recordMetadata =result.get();
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (ExecutionException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
producer.close();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-modules</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<packaging>pom</packaging>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<artifactId>couplet-electronic-fence</artifactId>
|
|
||||||
|
|
||||||
<modules>
|
|
||||||
<module>couplet-electronic-fence-server</module>
|
|
||||||
<module>couplet-electronic-fence-common</module>
|
|
||||||
<module>couplet-electronic-fence-remote</module>
|
|
||||||
</modules>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,30 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-enterprisemanagement</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-enterprisemanagement-common</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-system</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-enterprisemanagement</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-enterprisemanagement-remote</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-enterprisemanagement-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-security</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-security</artifactId>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,88 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
|
||||||
<parent>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-enterprisemanagement</artifactId>
|
|
||||||
<version>3.6.3</version>
|
|
||||||
</parent>
|
|
||||||
|
|
||||||
<artifactId>couplet-enterprisemanagement-server</artifactId>
|
|
||||||
|
|
||||||
<properties>
|
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-enterprisemanagement-common</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- SpringCloud Alibaba Nacos -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Nacos Config -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba Sentinel -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
|
||||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringBoot Actuator -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.boot</groupId>
|
|
||||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Swagger UI -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-swagger-ui</artifactId>
|
|
||||||
<version>${swagger.fox.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Mysql Connector -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mysql</groupId>
|
|
||||||
<artifactId>mysql-connector-j</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common DataSource -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-datasource</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common DataScope -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-datascope</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Log -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-log</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- MuYu Common Swagger -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.couplet</groupId>
|
|
||||||
<artifactId>couplet-common-swagger</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
|
||||||
|
|
||||||
</project>
|
|
|
@ -1,27 +0,0 @@
|
||||||
package com.couplet.server;
|
|
||||||
|
|
||||||
import com.couplet.common.security.annotation.EnableCustomConfig;
|
|
||||||
import com.couplet.common.security.annotation.EnableMyFeignClients;
|
|
||||||
import com.couplet.common.swagger.annotation.EnableCustomSwagger2;
|
|
||||||
import org.springframework.boot.SpringApplication;
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author fufanrui
|
|
||||||
* @version 1.0
|
|
||||||
* @description: 启动类
|
|
||||||
* @date 2024/3/27 14:04
|
|
||||||
*/
|
|
||||||
@EnableCustomConfig
|
|
||||||
@EnableCustomSwagger2
|
|
||||||
@EnableMyFeignClients
|
|
||||||
@SpringBootApplication
|
|
||||||
public class CoupleManagementApp {
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
|
|
||||||
SpringApplication.run(CoupleManagementApp.class, args);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue