From e027acc275443833853d0d4087d3b4b20657aacd Mon Sep 17 00:00:00 2001 From: ffr <492210217@qq.com> Date: Wed, 3 Apr 2024 11:38:59 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- couplet-auth/src/main/resources/bootstrap.yml | 4 ++-- couplet-gateway/src/main/resources/bootstrap.yml | 4 ++-- .../couplet-file/src/main/resources/bootstrap.yml | 4 ++-- .../couplet-gen/src/main/resources/bootstrap.yml | 4 ++-- .../couplet-job/src/main/resources/bootstrap.yml | 4 ++-- .../couplet-system/src/main/resources/bootstrap.yml | 7 ++++--- .../couplet-monitor/src/main/resources/bootstrap.yml | 4 ++-- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/couplet-auth/src/main/resources/bootstrap.yml b/couplet-auth/src/main/resources/bootstrap.yml index 68c3c25..b89bb00 100644 --- a/couplet-auth/src/main/resources/bootstrap.yml +++ b/couplet-auth/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-gateway/src/main/resources/bootstrap.yml b/couplet-gateway/src/main/resources/bootstrap.yml index 6dc39fe..acd4642 100644 --- a/couplet-gateway/src/main/resources/bootstrap.yml +++ b/couplet-gateway/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-file/src/main/resources/bootstrap.yml b/couplet-modules/couplet-file/src/main/resources/bootstrap.yml index b0d1d24..8681657 100644 --- a/couplet-modules/couplet-file/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-file/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml b/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml index b024662..d2834c9 100644 --- a/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-gen/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-job/src/main/resources/bootstrap.yml b/couplet-modules/couplet-job/src/main/resources/bootstrap.yml index bb8e219..3b56a22 100644 --- a/couplet-modules/couplet-job/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-job/src/main/resources/bootstrap.yml @@ -17,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-modules/couplet-system/src/main/resources/bootstrap.yml b/couplet-modules/couplet-system/src/main/resources/bootstrap.yml index 62d5318..2d396df 100644 --- a/couplet-modules/couplet-system/src/main/resources/bootstrap.yml +++ b/couplet-modules/couplet-system/src/main/resources/bootstrap.yml @@ -4,7 +4,8 @@ server: # Spring spring: - + main: + allow-bean-definition-overriding: true application: # 应用名称 name: couplet-system @@ -16,11 +17,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 diff --git a/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml b/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml index d219500..94d42fc 100644 --- a/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml +++ b/couplet-visual/couplet-monitor/src/main/resources/bootstrap.yml @@ -15,11 +15,11 @@ spring: discovery: # 服务注册地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 config: # 配置中心地址 server-addr: 121.89.211.230:8848 - namespace: 172469 + namespace: 968741d4-299d-483c-8d30-ede2aff8cfd4 # 配置文件格式 file-extension: yml # 共享配置 From 0c71aec7486716bf9e2eab84a44c0b8f0d9a8484 Mon Sep 17 00:00:00 2001 From: ffr <492210217@qq.com> Date: Thu, 4 Apr 2024 14:37:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=BD=A6=E8=BE=86=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/request/RealTimeDataRequest.java | 27 ++++++++++ .../VehicleDetectionController.java | 53 +++++++++++++++++++ .../server/mapper/VehicleDetectionMapper.java | 13 +++++ .../service/VehicleDetectionService.java | 13 +++++ .../impl/VehicleDetectionServiceImpl.java | 34 ++++++++++++ .../business/VehicleDetectionMapper.xml | 36 +++++++++++++ 6 files changed, 176 insertions(+) create mode 100644 couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java create mode 100644 couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java create mode 100644 couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleDetectionMapper.java create mode 100644 couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java create mode 100644 couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java create mode 100644 couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleDetectionMapper.xml diff --git a/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java b/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java new file mode 100644 index 0000000..5135e00 --- /dev/null +++ b/couplet-common/couplet-common-business/src/main/java/com/couplet/common/domain/request/RealTimeDataRequest.java @@ -0,0 +1,27 @@ +package com.couplet.common.domain.request; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; + +/** + * @author fufanrui + * @version 1.0 + * @description: 车辆实时数据请求参数 + * @date 2024/4/4 14:35 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@ToString +public class RealTimeDataRequest { + + + private Integer userId; + + private String vin; + + + +} diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java new file mode 100644 index 0000000..8e7f851 --- /dev/null +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/controller/VehicleDetectionController.java @@ -0,0 +1,53 @@ +package com.couplet.business.server.controller; + +import com.couplet.business.server.service.VehicleDetectionService; +import com.couplet.common.core.domain.Result; +import com.couplet.common.domain.Vehicle; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author fufanrui + * @version 1.0 + * @description: 车辆检测控制器 + * @date 2024/4/4 10:11 + */ + +@RestController +@RequestMapping("detection") +public class VehicleDetectionController { + + + @Autowired + private VehicleDetectionService vehicleDetectionService; + + /* + * @param : + * @return Result> + * @author 付凡芮 + * @description 查询上线的车辆信息 + * @date + */ + @PostMapping("/detectionList") + public Result> detectionList() { + return Result.success(vehicleDetectionService.detectionList()); + } + + + /* + * @param vin: + * @return Result> + * @author 付凡芮 + * @description 根据vin查询车辆信息 + * @date + */ + @PostMapping("/findByVin/{vehicleId}") + public Result> findByVin(@PathVariable("vehicleId") Integer vehicleId) { + return Result.success(vehicleDetectionService.findByVin(vehicleId)); + } +} diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleDetectionMapper.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleDetectionMapper.java new file mode 100644 index 0000000..33ab95a --- /dev/null +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/mapper/VehicleDetectionMapper.java @@ -0,0 +1,13 @@ +package com.couplet.business.server.mapper; + +import com.couplet.common.domain.Vehicle; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface VehicleDetectionMapper { + List detectionList(); + + List findByVin(Integer vehicleId); +} diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java new file mode 100644 index 0000000..2da84f6 --- /dev/null +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/VehicleDetectionService.java @@ -0,0 +1,13 @@ +package com.couplet.business.server.service; + +import com.couplet.common.core.domain.Result; +import com.couplet.common.domain.Vehicle; + +import java.util.List; + +public interface VehicleDetectionService { + + List detectionList(); + + List findByVin(Integer vehicleId); +} diff --git a/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java new file mode 100644 index 0000000..d0d29ce --- /dev/null +++ b/couplet-modules/couplet-business/src/main/java/com/couplet/business/server/service/impl/VehicleDetectionServiceImpl.java @@ -0,0 +1,34 @@ +package com.couplet.business.server.service.impl; + +import com.couplet.business.server.mapper.VehicleDetectionMapper; +import com.couplet.business.server.service.VehicleDetectionService; +import com.couplet.business.server.service.VehicleManageService; +import com.couplet.common.core.domain.Result; +import com.couplet.common.domain.Vehicle; +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/4 10:23 + */ +@Service +public class VehicleDetectionServiceImpl implements VehicleDetectionService{ + + @Autowired + private VehicleDetectionMapper vehicleDetectionMapper; + + @Override + public List detectionList() { + return vehicleDetectionMapper.detectionList(); + } + + @Override + public List findByVin(Integer vehicleId) { + return vehicleDetectionMapper.findByVin(vehicleId); + } +} diff --git a/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleDetectionMapper.xml b/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleDetectionMapper.xml new file mode 100644 index 0000000..bf0db67 --- /dev/null +++ b/couplet-modules/couplet-business/src/main/resources/mapper/business/VehicleDetectionMapper.xml @@ -0,0 +1,36 @@ + + + + + + SELECT + v.vehicle_id, + v.vehicle_type, + v.motor_manufacturer, + v.battery_manufacturer, + v.motor_number, + v.battery_number, + v.vin, + v.vehicle_state, + v.isdelete, + t.vehicle_type_id, + 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 + + + +