From 9ba5f8e14a607a2cd97577060e1dc995d96b75f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E9=91=AB?= <1173628408@qq.com>
Date: Tue, 8 Oct 2024 15:54:50 +0800
Subject: [PATCH] =?UTF-8?q?fix():=E9=87=8D=E6=96=B0=E6=9E=84=E5=BB=BA?=
=?UTF-8?q?=E7=BB=93=E6=9E=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/muyu/auth/form/LoginBody.java | 4 +
.../rabbit/constants/RabbitConstants.java | 18 +-
cloud-common/cloud-common-saas/pom.xml | 4 +
.../many/datasource/ManyDataSource.java | 37 +-
.../constents/DatasourceContent.java | 7 -
.../domain/model/DataSourceInfo.java | 6 +-
.../factory/DruidDataSourceFactory.java | 3 +-
.../common/saas/domain/model/EntInfo.java | 4 +
.../muyu/common/system/domain/SysDept.java | 5 +
.../common/system/domain/SysFirmResp.java | 25 +
.../system/remote/RemoteUserService.java | 10 +-
.../factory/RemoteUserFallbackFactory.java | 3 +-
.../muyu/data/controller/TestController.java | 2 +-
.../data/rabbit/DownlineRabbitConsumer.java | 4 +-
.../com/muyu/CloudEnterpiseApplication.java | 10 +-
.../src/main/resources/bootstrap.yml | 6 +-
.../com/muyu/parse/process/ProcessData.java | 3 -
.../src/main/resources/bootstrap.yml | 4 +-
.../SysFirmDatasourceController.java | 26 +-
.../com/muyu/system/mapper/SysDeptMapper.java | 8 +
.../muyu/system/service/SysDeptService.java | 9 +
.../service/SysFirmDatasourceService.java | 16 +
.../service/impl/SysDeptServiceImpl.java | 10 +
.../impl/SysFirmDatasourceServiceImpl.java | 27 +
.../resources/mapper/system/SysDeptMapper.xml | 23 +-
.../cloud-modules-vehicle-gateway/pom.xml | 56 +-
.../muyu/vehicleGateway/ClearInstance.java | 108 ----
.../muyu/vehicleGateway/CreateInstance.java | 101 ----
.../vehicleGateway/MqttPublishSample.java | 56 --
.../vehicle/VehicleInstance.java | 68 ---
.../vehicle/model/VehicleData.java | 539 ------------------
.../vehicle/thread/VehicleThread.java | 45 --
.../web/domain/VehicleInfo.java | 126 ----
.../web/domain/model/PositionModel.java | 37 --
.../web/mapper/VehicleInfoMapper.java | 15 -
.../service/impl/VechileInfoServiceImpl.java | 24 -
.../vehicleGateway/web/util/VehicleUtils.java | 99 ----
.../VehicleGatewayApplication.java} | 17 +-
.../controller/AuthCarController.java | 14 +
.../controller/VehicleGatewayController.java | 55 ++
.../muyu/vehiclegateway/domain/AuthCar.java | 26 +
.../muyu/vehiclegateway/domain/Instance.java | 39 ++
.../domain/MqttServerModel.java | 30 +
.../domain/req/VehicleConnectionReq.java | 44 ++
.../vehiclegateway/instance/DelInstance.java | 90 +++
.../instance/GenerateInstance.java | 171 ++++++
.../vehiclegateway/mapper/AuthCarMapper.java | 14 +
.../VehicleGatewayControllerMapper.java | 12 +
.../vehiclegateway/mq/CreateExchange.java | 47 ++
.../service/AuthCarService.java | 12 +
.../service/Impl/AuthCarServiceImpl.java | 17 +
.../Impl/VehicleGatewayServiceImpl.java | 85 +++
.../service/VehicleGatewayService.java | 17 +
.../vehiclegateway/utils/InstanceUtil.java | 77 +++
.../muyu/vehiclegateway/utils/MD5Util.java | 71 +++
.../src/main/resources/bootstrap.yml | 12 +-
.../src/main/resources/logback/dev.xml | 2 +-
.../src/main/resources/logback/prod.xml | 2 +-
.../src/main/resources/logback/test.xml | 4 +-
cloud-modules/pom.xml | 2 +-
60 files changed, 1114 insertions(+), 1294 deletions(-)
create mode 100644 cloud-common/cloud-common-system/src/main/java/com/muyu/common/system/domain/SysFirmResp.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/ClearInstance.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/CreateInstance.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/MqttPublishSample.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/vehicle/VehicleInstance.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/vehicle/model/VehicleData.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/vehicle/thread/VehicleThread.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/web/domain/VehicleInfo.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/web/domain/model/PositionModel.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/web/mapper/VehicleInfoMapper.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/web/service/impl/VechileInfoServiceImpl.java
delete mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehicleGateway/web/util/VehicleUtils.java
rename cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/{CloudVehicleGatewayApplication.java => vehiclegateway/VehicleGatewayApplication.java} (62%)
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/controller/AuthCarController.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/controller/VehicleGatewayController.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/domain/AuthCar.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/domain/Instance.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/domain/MqttServerModel.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/domain/req/VehicleConnectionReq.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/instance/DelInstance.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/instance/GenerateInstance.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/mapper/AuthCarMapper.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/mapper/VehicleGatewayControllerMapper.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/mq/CreateExchange.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/service/AuthCarService.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/service/Impl/AuthCarServiceImpl.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/service/Impl/VehicleGatewayServiceImpl.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/service/VehicleGatewayService.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/utils/InstanceUtil.java
create mode 100644 cloud-modules/cloud-modules-vehicle-gateway/src/main/java/com/muyu/vehiclegateway/utils/MD5Util.java
diff --git a/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java b/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java
index 999ad44..add72cd 100644
--- a/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java
+++ b/cloud-auth/src/main/java/com/muyu/auth/form/LoginBody.java
@@ -15,6 +15,10 @@ public class LoginBody {
* 用户密码
*/
private String password;
+ /**
+ * 公司数据信息id
+ */
+ private Long firmId;
public String getUsername () {
return username;
diff --git a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/constants/RabbitConstants.java b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/constants/RabbitConstants.java
index c279371..55c6ace 100644
--- a/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/constants/RabbitConstants.java
+++ b/cloud-common/cloud-common-rabbit/src/main/java/com/muyu/common/rabbit/constants/RabbitConstants.java
@@ -7,9 +7,17 @@ package com.muyu.common.rabbit.constants;
* @Description: rabbit常量
* @Version 1.0.0
*/
-public class RabbitConstants {
-
- public final static String GO_ONLINE_QUEUE= "GoOnline";
-
- public final static String DOWNLINE_QUEUE= "Downline";
+public interface RabbitConstants {
+ /**
+ * 上线队列
+ */
+ String GO_ONLINE_QUEUE= "GoOnline";
+ /**
+ * 下线队列
+ */
+ String DOWN_LINE_QUEUE= "DownLine";
+ /**
+ * 交换机
+ */
+ String ONLINE_EXCHANGE = "online_exchange";
}
diff --git a/cloud-common/cloud-common-saas/pom.xml b/cloud-common/cloud-common-saas/pom.xml
index 60b4041..a0b5379 100644
--- a/cloud-common/cloud-common-saas/pom.xml
+++ b/cloud-common/cloud-common-saas/pom.xml
@@ -17,6 +17,10 @@
UTF-8
+
+ cloud-common-saas saas公共模块
+
+
diff --git a/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/ManyDataSource.java b/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/ManyDataSource.java
index cea0f49..21ced55 100644
--- a/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/ManyDataSource.java
+++ b/cloud-common/cloud-common-saas/src/main/java/com/muyu/cloud/common/many/datasource/ManyDataSource.java
@@ -14,6 +14,7 @@ import com.muyu.common.core.constant.UserConstants;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.SpringUtils;
import com.muyu.common.system.domain.SysDept;
+import com.muyu.common.system.domain.SysFirmDatasource;
import com.muyu.common.system.domain.SysUser;
import com.muyu.common.system.remote.RemoteUserService;
import lombok.extern.log4j.Log4j2;
@@ -23,10 +24,7 @@ import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
/**
* @Author: DongZeLiang
@@ -42,26 +40,28 @@ public class ManyDataSource implements ApplicationRunner {
private List dataSourceInfoList(){
RemoteUserService RemoteUserService = SpringUtils.getBean(RemoteUserService.class);
- Result> listResult = RemoteUserService.selectFirmDatabaseList(SecurityConstants.INNER);
+ Result> listResult = RemoteUserService.selectFirmDatabaseList(SecurityConstants.INNER);
if (listResult==null){
throw new SaaSException("saas远调数据源错误");
}
- List data = listResult.getData();
+ List data = listResult.getData();
if (listResult.getCode() ==Result.SUCCESS && data !=null){
List list = new ArrayList<>();
- for (String row : data) {
+ for (SysFirmDatasource row : data) {
list.add(
EntInfo.builder()
- .entCode(row)
- .ip(DatasourceContent.IP)
- .port(DatasourceContent.PORT)
+ .entCode(row.getDatabaseName())
+ .ip(row.getIp())
+ .port(row.getPort())
+ .userName(row.getUsername())
+ .password(row.getPassword())
.build()
);
}
return list;
}else {
log.error("远调数据源错误,远调数据为:{}", JSON.toJSONString(data));
- throw new RuntimeException("远调数据源错误,远调--》 companyList ");
+ throw new RuntimeException("远调数据源错误,远调--》 firmList ");
}
}
// private List dataPrimarySourceInfoList(){
@@ -82,9 +82,16 @@ public class ManyDataSource implements ApplicationRunner {
Map