Compare commits
10 Commits
master
...
0a94f51e0d
| Author | SHA1 | Date | |
|---|---|---|---|
| 0a94f51e0d | |||
| 16aa6099ea | |||
| af8f225384 | |||
| 237f79a56f | |||
| e1cfe7f911 | |||
| 2b70f531b4 | |||
| a853dafca3 | |||
| 2164e77b5a | |||
| 3286204dc0 | |||
| af7cc98d77 |
58
api-gateway/src/main/resources/application-prod.yml
Normal file
58
api-gateway/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#网关
|
||||||
|
server:
|
||||||
|
port: 8001
|
||||||
|
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: api-gateway
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
#路由配置
|
||||||
|
gateway:
|
||||||
|
routes:
|
||||||
|
#用户中心
|
||||||
|
- id: user_center_route
|
||||||
|
uri: lb://user-center
|
||||||
|
predicates:
|
||||||
|
- Path=/api/sys/**
|
||||||
|
#业务中心
|
||||||
|
- id: business_route
|
||||||
|
uri: lb://business-service
|
||||||
|
predicates:
|
||||||
|
- Path=/api/business/**
|
||||||
|
#数据采集
|
||||||
|
- id: datacollect_route
|
||||||
|
uri: lb://datacollect-service
|
||||||
|
predicates:
|
||||||
|
- Path=/api/datacollect/**
|
||||||
|
#定时任务中心
|
||||||
|
- id: xxl_job_admin_route
|
||||||
|
uri: lb://xxl-job-admin
|
||||||
|
predicates:
|
||||||
|
- Path=/job-admin/**
|
||||||
|
#多媒体文件
|
||||||
|
- id: file_center_route
|
||||||
|
uri: lb://file-center
|
||||||
|
predicates:
|
||||||
|
- Path=/api/media/**
|
||||||
|
|
||||||
|
#告警和流程中心
|
||||||
|
- id: flow_center_route
|
||||||
|
uri: lb://flowable-center
|
||||||
|
predicates:
|
||||||
|
- Path=/api/flow/**
|
||||||
|
|
||||||
|
#actuator监控检查配置
|
||||||
|
management:
|
||||||
|
endpoint:
|
||||||
|
health:
|
||||||
|
show-details: always
|
||||||
|
health:
|
||||||
|
redis:
|
||||||
|
enabled: false
|
||||||
|
#需要校验:true ,不需要校验:false
|
||||||
|
isCheckLicence: false
|
||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/api-gateway/api-gateway.log</file>
|
<file>/www/zzkjcloud/logs/api-gateway/api-gateway.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/api-gateway/api-gateway.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/api-gateway/api-gateway.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
|
|||||||
@ -82,6 +82,7 @@ public class IargeScreenShowServiceImpl implements IargeScreenShowService {
|
|||||||
private final static BigDecimal parameter = new BigDecimal("18.3");
|
private final static BigDecimal parameter = new BigDecimal("18.3");
|
||||||
private final static BigDecimal four = new BigDecimal("0.4");
|
private final static BigDecimal four = new BigDecimal("0.4");
|
||||||
private final static BigDecimal fours = new BigDecimal("40");
|
private final static BigDecimal fours = new BigDecimal("40");
|
||||||
|
private final static BigDecimal coalPrice = new BigDecimal("0.6");//煤炭价格
|
||||||
private final static Integer maxSize = 30;
|
private final static Integer maxSize = 30;
|
||||||
private final static BigDecimal hundred = new BigDecimal(100);
|
private final static BigDecimal hundred = new BigDecimal(100);
|
||||||
private final static int FENGStationId = 418;
|
private final static int FENGStationId = 418;
|
||||||
@ -503,8 +504,8 @@ public class IargeScreenShowServiceImpl implements IargeScreenShowService {
|
|||||||
//等效节约煤 等效节约煤=所有电站总充*节约标准煤转换系数(04)
|
//等效节约煤 等效节约煤=所有电站总充*节约标准煤转换系数(04)
|
||||||
BigDecimal equivalentCoal = totalCharge.multiply(four);
|
BigDecimal equivalentCoal = totalCharge.multiply(four);
|
||||||
energySavingRespVo.setEquivalentCoal(equivalentCoal);
|
energySavingRespVo.setEquivalentCoal(equivalentCoal);
|
||||||
//等效经济收入 等效经济收入=所有电站总充*对应谷时电价
|
//等效经济收入 等效经济收入=等效节约煤*煤价 (600元/吨) 等效节约煤此处单位为kg,故而单价调整为0.6元/kg
|
||||||
energySavingRespVo.setIncome(income);
|
energySavingRespVo.setIncome(equivalentCoal.multiply(coalPrice));
|
||||||
return energySavingRespVo;
|
return energySavingRespVo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -126,6 +126,9 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>2.2.12.RELEASE</version>
|
<version>2.2.12.RELEASE</version>
|
||||||
|
<configuration>
|
||||||
|
<includeSystemScope>true</includeSystemScope>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|||||||
@ -20,9 +20,9 @@ spring:
|
|||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.100.244:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
url: jdbc:mysql://1.95.170.86:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
username: root
|
username: business_db
|
||||||
password: 123456
|
password: zzkj@688737
|
||||||
druid:
|
druid:
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
minIdle: 5
|
minIdle: 5
|
||||||
@ -33,40 +33,25 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 50000ms #连接超时
|
timeout: 50000ms #连接超时
|
||||||
host: 192.168.100.242 #单机
|
host: 1.95.170.86 #单机
|
||||||
password: 123456
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
#port: 6379 #端口
|
|
||||||
#timeout: 5000ms #连接超时
|
|
||||||
#host: 127.0.0.1 #单机
|
|
||||||
#password:
|
|
||||||
#database: 0
|
|
||||||
#集群 真实环境开启
|
|
||||||
# record:
|
|
||||||
# nodes:
|
|
||||||
# - 127.0.0.1:6379
|
|
||||||
# - 127.0.0.1:6380
|
|
||||||
# - 127.0.0.1:6381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8 #连接池最大连接 默认8
|
max-active: 8 #连接池最大连接 默认8
|
||||||
max-idle: 8 #连接池中最大空闲连接 默认8
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
min-idle: 1 #连接池中最小空闲连接 默认0
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
boot:
|
boot:
|
||||||
admin:
|
admin:
|
||||||
client:
|
client:
|
||||||
url: http://localhost:8019/boot
|
url: http://localhost:8019/boot
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
accessKey: admin
|
accessKey: minioadmin
|
||||||
secretKey: zzkj@688737
|
secretKey: minioadmin
|
||||||
endpoint: http://192.168.0.236:9000
|
endpoint: http://1.95.170.86:9000
|
||||||
prefixUrl: http://192.168.0.236:9000
|
prefixUrl: http://1.95.170.86:9000
|
||||||
|
|
||||||
formula:
|
formula:
|
||||||
fieldmap:
|
fieldmap:
|
||||||
|
|||||||
58
business-service/src/main/resources/application-prod.yml
Normal file
58
business-service/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
server:
|
||||||
|
port: 8011
|
||||||
|
servlet:
|
||||||
|
context-path: /api
|
||||||
|
|
||||||
|
#swagger2配置
|
||||||
|
swagger2:
|
||||||
|
enable: true #开启swagger
|
||||||
|
projectName: 云平台--business-前端接口
|
||||||
|
controllerPath: com.ho.business.controller
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: business-service
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://172.31.35.125:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
|
username: business_db
|
||||||
|
password: zzkj@688737
|
||||||
|
druid:
|
||||||
|
initialSize: 5
|
||||||
|
minIdle: 5
|
||||||
|
maxActive: 5
|
||||||
|
keepAlive: true #保持长连接
|
||||||
|
connection-error-retry-attempts: 3
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 50000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
url: http://localhost:8019/boot
|
||||||
|
|
||||||
|
minio:
|
||||||
|
accessKey: admin
|
||||||
|
secretKey: zzkj@688737
|
||||||
|
endpoint: http://172.31.35.125:9000
|
||||||
|
prefixUrl: http://172.31.35.125:9000
|
||||||
|
|
||||||
|
formula:
|
||||||
|
fieldmap:
|
||||||
|
RT_FIELD_BEAN: RT_FIELD_BEAN
|
||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/business-service/business-service.log</file>
|
<file>/www/zzkjcloud/logs/business-service/business-service.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/business-service/business-service.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/business-service/business-service.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
<!--Error级别-->
|
<!--Error级别-->
|
||||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/business-service/business-service-error.log</file>
|
<file>/www/zzkjcloud/logs/business-service/business-service-error.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/business-service/business-service-error.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/business-service/business-service-error.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
|
|||||||
@ -221,6 +221,8 @@ public interface RedisKeyConstant {
|
|||||||
String LOGIN_TYPE_ACCOUNT = "account";
|
String LOGIN_TYPE_ACCOUNT = "account";
|
||||||
//登陆方式 phone 手机号
|
//登陆方式 phone 手机号
|
||||||
String LOGIN_TYPE_PHONE = "phone";
|
String LOGIN_TYPE_PHONE = "phone";
|
||||||
|
// 语言切换
|
||||||
|
String LANG="lang";
|
||||||
}
|
}
|
||||||
|
|
||||||
//设备相关
|
//设备相关
|
||||||
|
|||||||
@ -140,6 +140,9 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>2.2.12.RELEASE</version>
|
<version>2.2.12.RELEASE</version>
|
||||||
|
<configuration>
|
||||||
|
<includeSystemScope>true</includeSystemScope>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@ -151,5 +154,4 @@
|
|||||||
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@ -1,233 +1,233 @@
|
|||||||
package com.ho.datacollect.config;
|
//package com.ho.datacollect.config;
|
||||||
|
//
|
||||||
import cn.hutool.core.util.IdUtil;
|
//import cn.hutool.core.util.IdUtil;
|
||||||
import com.ho.datacollect.util.AnotherMqttConfigUtil;
|
//import com.ho.datacollect.util.AnotherMqttConfigUtil;
|
||||||
import lombok.Data;
|
//import lombok.Data;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
import org.eclipse.paho.client.mqttv3.IMqttToken;
|
//import org.eclipse.paho.client.mqttv3.IMqttToken;
|
||||||
import org.eclipse.paho.client.mqttv3.MqttClient;
|
//import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||||
import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
|
//import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
//import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
//import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
//import org.springframework.context.annotation.Configuration;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* @author wp
|
// * @author wp
|
||||||
* @desc: Mqtt配置类
|
// * @desc: Mqtt配置类
|
||||||
* @date 2025/06/11
|
// * @date 2025/06/11
|
||||||
*/
|
// */
|
||||||
@Configuration
|
//@Configuration
|
||||||
@Data
|
//@Data
|
||||||
@ConfigurationProperties("mqtt1")
|
//@ConfigurationProperties("mqtt1")
|
||||||
@Slf4j
|
//@Slf4j
|
||||||
public class AnotherMqttConfig {
|
//public class AnotherMqttConfig {
|
||||||
|
//
|
||||||
//服务器url
|
// //服务器url
|
||||||
@Value("${mqtt1.url}")
|
// @Value("${mqtt1.url}")
|
||||||
String url;
|
// String url;
|
||||||
//超时时间
|
// //超时时间
|
||||||
@Value("${mqtt1.timeout}")
|
// @Value("${mqtt1.timeout}")
|
||||||
Integer timeout;
|
// Integer timeout;
|
||||||
//会话保持时间
|
// //会话保持时间
|
||||||
@Value("${mqtt1.keepAlive}")
|
// @Value("${mqtt1.keepAlive}")
|
||||||
Integer keepAlive;
|
// Integer keepAlive;
|
||||||
|
//
|
||||||
@Value("${mqtt1.userName}")
|
// @Value("${mqtt1.userName}")
|
||||||
String userName;
|
// String userName;
|
||||||
|
//
|
||||||
@Value("${mqtt1.passWord}")
|
// @Value("${mqtt1.passWord}")
|
||||||
String passWord;
|
// String passWord;
|
||||||
|
//
|
||||||
@Value("${topic.edgeLoginRequest}")
|
// @Value("${topic.edgeLoginRequest}")
|
||||||
String edgeLoginRequest;
|
// String edgeLoginRequest;
|
||||||
|
//
|
||||||
@Value("${topic.edgeReadResponse}")
|
// @Value("${topic.edgeReadResponse}")
|
||||||
String edgeReadResponse;
|
// String edgeReadResponse;
|
||||||
|
//
|
||||||
@Value("${topic.edgeWriteResponse}")
|
// @Value("${topic.edgeWriteResponse}")
|
||||||
String edgeWriteResponse;
|
// String edgeWriteResponse;
|
||||||
|
//
|
||||||
@Value("${topic.edgeReportPush}")
|
// @Value("${topic.edgeReportPush}")
|
||||||
String edgeReportPush;
|
// String edgeReportPush;
|
||||||
|
//
|
||||||
@Value("${topic.edgeControlResponse}")
|
// @Value("${topic.edgeControlResponse}")
|
||||||
String edgeControlResponse;
|
// String edgeControlResponse;
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
AnotherLoginRequestConsumer loginRequestConsumer;
|
// AnotherLoginRequestConsumer loginRequestConsumer;
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
AnotherReadResponseConsumer readResponseConsumer;
|
// AnotherReadResponseConsumer readResponseConsumer;
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
AnotherWriteResponseConsumer writeResponseConsumer;
|
// AnotherWriteResponseConsumer writeResponseConsumer;
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
AnotherReportPushConsumer reportPushConsumer;
|
// AnotherReportPushConsumer reportPushConsumer;
|
||||||
|
//
|
||||||
@Autowired
|
// @Autowired
|
||||||
AnotherControlResponseConsumer controlResponseConsumer;
|
// AnotherControlResponseConsumer controlResponseConsumer;
|
||||||
|
//
|
||||||
//是否自动重连 实际环境要改为true
|
// //是否自动重连 实际环境要改为true
|
||||||
private boolean autoReConnect = true;
|
// private boolean autoReConnect = true;
|
||||||
|
//
|
||||||
|
//
|
||||||
//登录验证的监听
|
// //登录验证的监听
|
||||||
@Bean(name = "AnotherLoginRequest")
|
// @Bean(name = "AnotherLoginRequest")
|
||||||
public MqttClient initLoginRequest() {
|
// public MqttClient initLoginRequest() {
|
||||||
String clientId = IdUtil.simpleUUID();
|
// String clientId = IdUtil.simpleUUID();
|
||||||
log.info("clientId:" +clientId);
|
// log.info("clientId:" +clientId);
|
||||||
MqttClient client =null;
|
// MqttClient client =null;
|
||||||
try {
|
// try {
|
||||||
client = new MqttClient(url, clientId,null);
|
// client = new MqttClient(url, clientId,null);
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
// MqttConnectOptions options = new MqttConnectOptions();
|
||||||
options.setUserName(userName);
|
// options.setUserName(userName);
|
||||||
options.setPassword(passWord.toCharArray());
|
// options.setPassword(passWord.toCharArray());
|
||||||
options.setCleanSession(true);
|
// options.setCleanSession(true);
|
||||||
options.setConnectionTimeout(timeout);
|
// options.setConnectionTimeout(timeout);
|
||||||
options.setKeepAliveInterval(keepAlive);
|
// options.setKeepAliveInterval(keepAlive);
|
||||||
options.setExecutorServiceTimeout(0);
|
// options.setExecutorServiceTimeout(0);
|
||||||
//options.setAutomaticReconnect(autoReConnect);
|
// //options.setAutomaticReconnect(autoReConnect);
|
||||||
client.setCallback(loginRequestConsumer);
|
// client.setCallback(loginRequestConsumer);
|
||||||
IMqttToken iMqttToken = client.connectWithResult(options);
|
// IMqttToken iMqttToken = client.connectWithResult(options);
|
||||||
boolean complete = iMqttToken.isComplete();
|
// boolean complete = iMqttToken.isComplete();
|
||||||
log.info("LoginRequestMqttClient建立连接:{}", complete);
|
// log.info("LoginRequestMqttClient建立连接:{}", complete);
|
||||||
//这里监听的是
|
// //这里监听的是
|
||||||
String[] topic = AnotherMqttConfigUtil.getLoginRequestTopic();
|
// String[] topic = AnotherMqttConfigUtil.getLoginRequestTopic();
|
||||||
int[] qos = new int[topic.length];
|
// int[] qos = new int[topic.length];
|
||||||
client.subscribe(topic,qos);
|
// client.subscribe(topic,qos);
|
||||||
log.info("已订阅topic:{}", topic);
|
// log.info("已订阅topic:{}", topic);
|
||||||
return client;
|
// return client;
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
return client;
|
// return client;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//读取文件请求的监听
|
// //读取文件请求的监听
|
||||||
@Bean(name = "AnotherReadResponse")
|
// @Bean(name = "AnotherReadResponse")
|
||||||
public MqttClient initReadRequest() {
|
// public MqttClient initReadRequest() {
|
||||||
String clientId = IdUtil.simpleUUID();
|
// String clientId = IdUtil.simpleUUID();
|
||||||
log.info("clientId:" +clientId);
|
// log.info("clientId:" +clientId);
|
||||||
MqttClient client =null;
|
// MqttClient client =null;
|
||||||
try {
|
// try {
|
||||||
client = new MqttClient(url, clientId,null);
|
// client = new MqttClient(url, clientId,null);
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
// MqttConnectOptions options = new MqttConnectOptions();
|
||||||
options.setUserName(userName);
|
// options.setUserName(userName);
|
||||||
options.setPassword(passWord.toCharArray());
|
// options.setPassword(passWord.toCharArray());
|
||||||
options.setCleanSession(true);
|
// options.setCleanSession(true);
|
||||||
options.setConnectionTimeout(timeout);
|
// options.setConnectionTimeout(timeout);
|
||||||
options.setKeepAliveInterval(keepAlive);
|
// options.setKeepAliveInterval(keepAlive);
|
||||||
options.setExecutorServiceTimeout(0);
|
// options.setExecutorServiceTimeout(0);
|
||||||
//options.setAutomaticReconnect(autoReConnect);
|
// //options.setAutomaticReconnect(autoReConnect);
|
||||||
client.setCallback(readResponseConsumer);
|
// client.setCallback(readResponseConsumer);
|
||||||
IMqttToken iMqttToken = client.connectWithResult(options);
|
// IMqttToken iMqttToken = client.connectWithResult(options);
|
||||||
boolean complete = iMqttToken.isComplete();
|
// boolean complete = iMqttToken.isComplete();
|
||||||
log.info("ReadRequestMqttClient建立连接:{}", complete);
|
// log.info("ReadRequestMqttClient建立连接:{}", complete);
|
||||||
//这里监听的是
|
// //这里监听的是
|
||||||
String[] topic = AnotherMqttConfigUtil.getReadRequestTopic();
|
// String[] topic = AnotherMqttConfigUtil.getReadRequestTopic();
|
||||||
int[] qos = new int[topic.length];
|
// int[] qos = new int[topic.length];
|
||||||
client.subscribe(topic,qos);
|
// client.subscribe(topic,qos);
|
||||||
log.info("已订阅topic:{}", topic);
|
// log.info("已订阅topic:{}", topic);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
return client;
|
// return client;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//写文件响应的监听
|
// //写文件响应的监听
|
||||||
@Bean(name = "AnotherWriteResponse")
|
// @Bean(name = "AnotherWriteResponse")
|
||||||
public MqttClient initWriteRequest() {
|
// public MqttClient initWriteRequest() {
|
||||||
String clientId = IdUtil.simpleUUID();
|
// String clientId = IdUtil.simpleUUID();
|
||||||
log.info("clientId:" +clientId);
|
// log.info("clientId:" +clientId);
|
||||||
MqttClient client =null;
|
// MqttClient client =null;
|
||||||
try {
|
// try {
|
||||||
client = new MqttClient(url, clientId,null);
|
// client = new MqttClient(url, clientId,null);
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
// MqttConnectOptions options = new MqttConnectOptions();
|
||||||
options.setUserName(userName);
|
// options.setUserName(userName);
|
||||||
options.setPassword(passWord.toCharArray());
|
// options.setPassword(passWord.toCharArray());
|
||||||
options.setCleanSession(true);
|
// options.setCleanSession(true);
|
||||||
options.setConnectionTimeout(timeout);
|
// options.setConnectionTimeout(timeout);
|
||||||
options.setKeepAliveInterval(keepAlive);
|
// options.setKeepAliveInterval(keepAlive);
|
||||||
options.setExecutorServiceTimeout(0);
|
// options.setExecutorServiceTimeout(0);
|
||||||
//options.setAutomaticReconnect(autoReConnect);
|
// //options.setAutomaticReconnect(autoReConnect);
|
||||||
client.setCallback(writeResponseConsumer);
|
// client.setCallback(writeResponseConsumer);
|
||||||
IMqttToken iMqttToken = client.connectWithResult(options);
|
// IMqttToken iMqttToken = client.connectWithResult(options);
|
||||||
boolean complete = iMqttToken.isComplete();
|
// boolean complete = iMqttToken.isComplete();
|
||||||
log.info("WriteRequestMqttClient建立连接:{}", complete);
|
// log.info("WriteRequestMqttClient建立连接:{}", complete);
|
||||||
//这里监听的是
|
// //这里监听的是
|
||||||
String[] topic = AnotherMqttConfigUtil.getWriteRequestTopic();
|
// String[] topic = AnotherMqttConfigUtil.getWriteRequestTopic();
|
||||||
int[] qos = new int[topic.length];
|
// int[] qos = new int[topic.length];
|
||||||
client.subscribe(topic,qos);
|
// client.subscribe(topic,qos);
|
||||||
log.info("已订阅topic:{}", topic);
|
// log.info("已订阅topic:{}", topic);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
return client;
|
// return client;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//报告上传
|
// //报告上传
|
||||||
@Bean(name = "AnotherReportPush")
|
// @Bean(name = "AnotherReportPush")
|
||||||
public MqttClient initReportPush() {
|
// public MqttClient initReportPush() {
|
||||||
String clientId = IdUtil.simpleUUID();
|
// String clientId = IdUtil.simpleUUID();
|
||||||
log.info("clientId:" +clientId);
|
// log.info("clientId:" +clientId);
|
||||||
MqttClient client =null;
|
// MqttClient client =null;
|
||||||
try {
|
// try {
|
||||||
client = new MqttClient(url, clientId,null);
|
// client = new MqttClient(url, clientId,null);
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
// MqttConnectOptions options = new MqttConnectOptions();
|
||||||
options.setUserName(userName);
|
// options.setUserName(userName);
|
||||||
options.setPassword(passWord.toCharArray());
|
// options.setPassword(passWord.toCharArray());
|
||||||
options.setCleanSession(true);
|
// options.setCleanSession(true);
|
||||||
options.setConnectionTimeout(timeout);
|
// options.setConnectionTimeout(timeout);
|
||||||
options.setKeepAliveInterval(keepAlive);
|
// options.setKeepAliveInterval(keepAlive);
|
||||||
options.setExecutorServiceTimeout(0);
|
// options.setExecutorServiceTimeout(0);
|
||||||
//options.setAutomaticReconnect(autoReConnect);
|
// //options.setAutomaticReconnect(autoReConnect);
|
||||||
client.setCallback(reportPushConsumer);
|
// client.setCallback(reportPushConsumer);
|
||||||
IMqttToken iMqttToken = client.connectWithResult(options);
|
// IMqttToken iMqttToken = client.connectWithResult(options);
|
||||||
boolean complete = iMqttToken.isComplete();
|
// boolean complete = iMqttToken.isComplete();
|
||||||
log.info("ReportPushMqttClient建立连接:{}", complete);
|
// log.info("ReportPushMqttClient建立连接:{}", complete);
|
||||||
//这里监听的是
|
// //这里监听的是
|
||||||
String[] topic = AnotherMqttConfigUtil.getReportPushTopic();
|
// String[] topic = AnotherMqttConfigUtil.getReportPushTopic();
|
||||||
int[] qos = new int[topic.length];
|
// int[] qos = new int[topic.length];
|
||||||
client.subscribe(topic,qos);
|
// client.subscribe(topic,qos);
|
||||||
log.info("已订阅topic:{}", topic);
|
// log.info("已订阅topic:{}", topic);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
return client;
|
// return client;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
//远程控制
|
// //远程控制
|
||||||
@Bean(name = "AnotherControlResponse")
|
// @Bean(name = "AnotherControlResponse")
|
||||||
public MqttClient initControlResponse() {
|
// public MqttClient initControlResponse() {
|
||||||
String clientId = IdUtil.simpleUUID();
|
// String clientId = IdUtil.simpleUUID();
|
||||||
log.info("clientId:" +clientId);
|
// log.info("clientId:" +clientId);
|
||||||
MqttClient client =null;
|
// MqttClient client =null;
|
||||||
try {
|
// try {
|
||||||
client = new MqttClient(url, clientId,null);
|
// client = new MqttClient(url, clientId,null);
|
||||||
MqttConnectOptions options = new MqttConnectOptions();
|
// MqttConnectOptions options = new MqttConnectOptions();
|
||||||
options.setUserName(userName);
|
// options.setUserName(userName);
|
||||||
options.setPassword(passWord.toCharArray());
|
// options.setPassword(passWord.toCharArray());
|
||||||
options.setCleanSession(true);
|
// options.setCleanSession(true);
|
||||||
options.setConnectionTimeout(timeout);
|
// options.setConnectionTimeout(timeout);
|
||||||
options.setKeepAliveInterval(keepAlive);
|
// options.setKeepAliveInterval(keepAlive);
|
||||||
options.setExecutorServiceTimeout(0);
|
// options.setExecutorServiceTimeout(0);
|
||||||
//options.setAutomaticReconnect(autoReConnect);
|
// //options.setAutomaticReconnect(autoReConnect);
|
||||||
client.setCallback(controlResponseConsumer);
|
// client.setCallback(controlResponseConsumer);
|
||||||
IMqttToken iMqttToken = client.connectWithResult(options);
|
// IMqttToken iMqttToken = client.connectWithResult(options);
|
||||||
boolean complete = iMqttToken.isComplete();
|
// boolean complete = iMqttToken.isComplete();
|
||||||
log.info("ControlResponseMqttClient建立连接:{}", complete);
|
// log.info("ControlResponseMqttClient建立连接:{}", complete);
|
||||||
//这里监听的是
|
// //这里监听的是
|
||||||
String[] topic = AnotherMqttConfigUtil.getControlResponseTopic();
|
// String[] topic = AnotherMqttConfigUtil.getControlResponseTopic();
|
||||||
int[] qos = new int[topic.length];
|
// int[] qos = new int[topic.length];
|
||||||
client.subscribe(topic,qos);
|
// client.subscribe(topic,qos);
|
||||||
log.info("已订阅topic:{}", topic);
|
// log.info("已订阅topic:{}", topic);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
}
|
// }
|
||||||
return client;
|
// return client;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|||||||
@ -1,75 +1,75 @@
|
|||||||
package com.ho.datacollect.util;
|
//package com.ho.datacollect.util;
|
||||||
|
//
|
||||||
public class AnotherMqttConfigUtil {
|
//public class AnotherMqttConfigUtil {
|
||||||
|
//
|
||||||
public static String[] commonTopic = new String[]{
|
// public static String[] commonTopic = new String[]{
|
||||||
"+/device/27d83a2844ff5866",
|
// "+/device/27d83a2844ff5866",
|
||||||
"+/device/77ba753718908d1a",
|
// "+/device/77ba753718908d1a",
|
||||||
"1/device/+"
|
// "1/device/+"
|
||||||
};
|
// };
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取登录验证的监听主题
|
// * 获取登录验证的监听主题
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public static String[] getLoginRequestTopic(){
|
// public static String[] getLoginRequestTopic(){
|
||||||
String log = "/login/request";
|
// String log = "/login/request";
|
||||||
String[] str = new String[commonTopic.length];
|
// String[] str = new String[commonTopic.length];
|
||||||
for (int i = 0; i < commonTopic.length; i++) {
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
str[i] = commonTopic[i]+log;
|
// str[i] = commonTopic[i]+log;
|
||||||
}
|
// }
|
||||||
return str;
|
// return str;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 读取文件请求的监听主题
|
// * 读取文件请求的监听主题
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public static String[] getReadRequestTopic(){
|
// public static String[] getReadRequestTopic(){
|
||||||
String log = "/read/response";
|
// String log = "/read/response";
|
||||||
String[] str = new String[commonTopic.length];
|
// String[] str = new String[commonTopic.length];
|
||||||
for (int i = 0; i < commonTopic.length; i++) {
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
str[i] = commonTopic[i]+log;
|
// str[i] = commonTopic[i]+log;
|
||||||
}
|
// }
|
||||||
return str;
|
// return str;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 写文件响应的监听主题
|
// * 写文件响应的监听主题
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public static String[] getWriteRequestTopic(){
|
// public static String[] getWriteRequestTopic(){
|
||||||
String log = "/write/response";
|
// String log = "/write/response";
|
||||||
String[] str = new String[commonTopic.length];
|
// String[] str = new String[commonTopic.length];
|
||||||
for (int i = 0; i < commonTopic.length; i++) {
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
str[i] = commonTopic[i]+log;
|
// str[i] = commonTopic[i]+log;
|
||||||
}
|
// }
|
||||||
return str;
|
// return str;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取数据上送监听主题
|
// * 获取数据上送监听主题
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public static String[] getReportPushTopic(){
|
// public static String[] getReportPushTopic(){
|
||||||
String log = "/report/push";
|
// String log = "/report/push";
|
||||||
String[] str = new String[commonTopic.length];
|
// String[] str = new String[commonTopic.length];
|
||||||
for (int i = 0; i < commonTopic.length; i++) {
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
str[i] = commonTopic[i]+log;
|
// str[i] = commonTopic[i]+log;
|
||||||
}
|
// }
|
||||||
return str;
|
// return str;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* 获取远程控制主题
|
// * 获取远程控制主题
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
public static String[] getControlResponseTopic(){
|
// public static String[] getControlResponseTopic(){
|
||||||
String log = "/control/response";
|
// String log = "/control/response";
|
||||||
String[] str = new String[commonTopic.length];
|
// String[] str = new String[commonTopic.length];
|
||||||
for (int i = 0; i < commonTopic.length; i++) {
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
str[i] = commonTopic[i]+log;
|
// str[i] = commonTopic[i]+log;
|
||||||
}
|
// }
|
||||||
return str;
|
// return str;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|||||||
@ -3,118 +3,7 @@ package com.ho.datacollect.util;
|
|||||||
public class MqttConfigUtil {
|
public class MqttConfigUtil {
|
||||||
|
|
||||||
public static String[] commonTopic = new String[]{
|
public static String[] commonTopic = new String[]{
|
||||||
"+/device/fa22fd97b39c04c8",
|
"1/device/+"
|
||||||
"+/device/803274d9432df350",
|
|
||||||
"+/device/e4067161c4ab1929",
|
|
||||||
"+/device/f0e9a01d8b98e820",
|
|
||||||
"+/device/f6c6c5b5dfcc73bb",
|
|
||||||
"+/device/9038222e7fb8789d",
|
|
||||||
"+/device/a707000000000000",
|
|
||||||
"+/device/811b4eb0f8e99c12",
|
|
||||||
"+/device/c2c574a5c691bf69",
|
|
||||||
"+/device/5265899ad223c157",
|
|
||||||
"+/device/517664ba87ac49ec",
|
|
||||||
"+/device/b602b10956119d39",
|
|
||||||
"+/device/4c7dd125b6da91fd",
|
|
||||||
"+/device/581bf6724737da0c",
|
|
||||||
"+/device/8a2396ad453891b1",
|
|
||||||
"+/device/917ca24a9ccdf809",
|
|
||||||
"+/device/a8402702a1d41d88",
|
|
||||||
"+/device/7a5202c7dc74afd6",
|
|
||||||
"+/device/bfe7a19ced50c54d",
|
|
||||||
"+/device/21f835330b485415",
|
|
||||||
"+/device/a978d559eeb0a32e",
|
|
||||||
"+/device/4dddf8b0caae7d8b",
|
|
||||||
"+/device/beff9c2ea2d210c4",
|
|
||||||
"+/device/a5af67550fd4dc50",
|
|
||||||
"+/device/0c3e8eadd58f8a51",
|
|
||||||
"+/device/14ed724c77b73494",
|
|
||||||
"+/device/d12d361c6bfef025",
|
|
||||||
"+/device/781c2bf41a6ffa5a",
|
|
||||||
"+/device/ac10829b20169da0",
|
|
||||||
"+/device/ec939740502f3a66",
|
|
||||||
"+/device/e0c812e00ac4e006",
|
|
||||||
"+/device/0000000000000000",
|
|
||||||
"+/device/5e9b285116453b1a",
|
|
||||||
"+/device/eeb34d0de2b6a953",
|
|
||||||
"+/device/56501a13712f9a6e",
|
|
||||||
"+/device/e8d98e91aaa7b04f",
|
|
||||||
"+/device/6c6978a7fb9a8f6d",
|
|
||||||
"+/device/6803ef0410fb7c02",
|
|
||||||
"+/device/fe828101e353b919",
|
|
||||||
"+/device/42ff4118453e41ca",
|
|
||||||
"+/device/d9f866f14483c92d",
|
|
||||||
"+/device/1deae4a5f1400666",
|
|
||||||
"+/device/a608ea4ffb5221d7",
|
|
||||||
"+/device/bd0ccfe06c1d3596",
|
|
||||||
"+/device/262cdfc279065aa0",
|
|
||||||
"+/device/3df87897c35ae0c5",
|
|
||||||
"+/device/8ca0297304c266b6",
|
|
||||||
"+/device/1200000000000000",
|
|
||||||
"+/device/333470f1dccfb19b",
|
|
||||||
"+/device/02bd28350b1c2619",
|
|
||||||
"+/device/9688431d4f01806e",
|
|
||||||
"+/device/a2f3973e0c3b4835",
|
|
||||||
"+/device/f91779c511763a5b",
|
|
||||||
"+/device/2b8924e509ee8559",
|
|
||||||
"+/device/9e4ee680a26303f7",
|
|
||||||
"+/device/56d9bb7131c724b5",
|
|
||||||
"+/device/9511bebccc477456",
|
|
||||||
"+/device/0a3146610bcc5440",
|
|
||||||
"+/device/e817466c6127ab44",
|
|
||||||
"+/device/99efbb96bc40fd15",
|
|
||||||
"+/device/43687f5b1ebecb64",
|
|
||||||
"+/device/b9e0cdfdd4df7736",
|
|
||||||
"+/device/ed76d5ab39f6c42d",
|
|
||||||
"+/device/63f8d5df0c9d647c",
|
|
||||||
"+/device/98b61a1f166b8419",
|
|
||||||
"+/device/201913c33e0318ee",
|
|
||||||
"+/device/9c74bebb12d05635",
|
|
||||||
"+/device/1f237999be964f42",
|
|
||||||
"+/device/104cebca14ffa98c",
|
|
||||||
"+/device/2d1cab6edbfaeb94",
|
|
||||||
"+/device/c8c30d1decff167d",
|
|
||||||
"+/device/984423fdfda19376",
|
|
||||||
"+/device/18db1248acf66a3e",
|
|
||||||
"+/device/e18710921a53bfff",
|
|
||||||
"+/device/04878a29f87e237d",
|
|
||||||
"+/device/c336512bd77d6cbc",
|
|
||||||
"+/device/01ac2a161029e555",
|
|
||||||
"+/device/4eeccb413407a4e4",
|
|
||||||
"+/device/14e7f5c9b123360d",
|
|
||||||
"+/device/daf25437cbc31a00",
|
|
||||||
"+/device/44dfc09110e1f994",
|
|
||||||
"+/device/2dd522056c132349",
|
|
||||||
"+/device/bd7f78f9d070abe6",
|
|
||||||
"+/device/e932c594ce083810",
|
|
||||||
"+/device/b80c3b7513773c7f",
|
|
||||||
"+/device/7f0d37c30d28ed0f",
|
|
||||||
"+/device/53be81deba3b9c74",
|
|
||||||
"+/device/fe5f56cc9029bf20",
|
|
||||||
"+/device/60723affac3821a5",
|
|
||||||
"+/device/d3e22616db04dc52",
|
|
||||||
"+/device/36c12afabd8fa201",
|
|
||||||
"+/device/71db70b8ce2eb0d1",
|
|
||||||
"+/device/69f319418cfe13a2",
|
|
||||||
"+/device/f043173d1fd8cb0d",
|
|
||||||
"+/device/9b5084678310c4da",
|
|
||||||
"+/device/fa3936fdeb8f8cd1",
|
|
||||||
"+/device/0819c35644808b72",
|
|
||||||
"+/device/40442c5a0a29de37",
|
|
||||||
"+/device/75fa0ee5048bd500",
|
|
||||||
"+/device/39674be356de68ad",
|
|
||||||
"+/device/b490b672a5f76716",
|
|
||||||
"+/device/6a3ba96ed146872b",
|
|
||||||
"+/device/3a785a63862c213d",
|
|
||||||
"+/device/2d29a0fbac938329",
|
|
||||||
"+/device/7d97391a68f8d6af",
|
|
||||||
"+/device/b50a1edd44549876",
|
|
||||||
"+/device/7c31d3c5c077228f",
|
|
||||||
"+/device/99e513be6075f8c6",
|
|
||||||
"+/device/5d4297256f02ebc2",
|
|
||||||
"+/device/67aa37e699e1e08f",
|
|
||||||
"+/device/ea0ebfbfa1487bd2",
|
|
||||||
"+/device/aa8a43d326dddb3f"
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -11,9 +11,9 @@ swagger2:
|
|||||||
|
|
||||||
#mqtt
|
#mqtt
|
||||||
mqtt:
|
mqtt:
|
||||||
url: tcp://123.60.190.77:1883 # 线上环境MQTT
|
url: tcp://1.95.170.86:1883
|
||||||
userName: admin
|
userName: admin
|
||||||
passWord: public
|
passWord: zzkj688737
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
keepAlive: 60
|
keepAlive: 60
|
||||||
|
|
||||||
@ -37,8 +37,6 @@ topic:
|
|||||||
cloudControlRequest: +/cloud/+/control/request
|
cloudControlRequest: +/cloud/+/control/request
|
||||||
edgeControlResponse: +/device/+/control/response
|
edgeControlResponse: +/device/+/control/response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
spring:
|
spring:
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
@ -50,12 +48,9 @@ spring:
|
|||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
#url: jdbc:mysql://1.95.153.121:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://1.95.170.86:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
url: jdbc:mysql://192.168.100.244:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
username: business_db
|
||||||
#username: zzkj
|
password: zzkj@688737
|
||||||
username: root
|
|
||||||
#password: zzkj@688737
|
|
||||||
password: 123456
|
|
||||||
druid:
|
druid:
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
minIdle: 5
|
minIdle: 5
|
||||||
@ -66,23 +61,9 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 3000ms #连接超时
|
timeout: 3000ms #连接超时
|
||||||
#host: 1.95.153.121 #单机
|
host: 1.95.170.86 #单机
|
||||||
host: 192.168.100.242 #单机
|
|
||||||
#password: zzkj@688737
|
|
||||||
password: 123456
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
#port: 6379 #端口
|
|
||||||
#timeout: 5000ms #连接超时
|
|
||||||
#host: 127.0.0.1 #单机
|
|
||||||
#password:
|
|
||||||
#database: 0
|
|
||||||
#集群 真实环境开启
|
|
||||||
# cluster:
|
|
||||||
# nodes:
|
|
||||||
# - 127.0.0.1:6379
|
|
||||||
# - 127.0.0.1:6380
|
|
||||||
# - 127.0.0.1:6381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8 #连接池最大连接 默认8
|
max-active: 8 #连接池最大连接 默认8
|
||||||
@ -91,10 +72,10 @@ spring:
|
|||||||
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
accessKey: admin
|
accessKey: minioadmin
|
||||||
secretKey: zzkj@688737
|
secretKey: minioadmin
|
||||||
endpoint: http://192.168.0.236:9000
|
endpoint: http://1.95.170.86:9000
|
||||||
prefixUrl: http://192.168.0.236:9000
|
prefixUrl: http://1.95.170.86:9000
|
||||||
|
|
||||||
#跳过登录:true ,不跳过:false
|
#跳过登录:true ,不跳过:false
|
||||||
skipLogin: false
|
skipLogin: false
|
||||||
83
data-collect-service/src/main/resources/application-prod.yml
Normal file
83
data-collect-service/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
server:
|
||||||
|
port: 8010
|
||||||
|
servlet:
|
||||||
|
context-path: /api
|
||||||
|
|
||||||
|
#swagger2配置
|
||||||
|
swagger2:
|
||||||
|
enable: true #开启swagger
|
||||||
|
projectName: 云平台--business-前端接口
|
||||||
|
controllerPath: com.ho.datacollect.controller
|
||||||
|
|
||||||
|
#mqtt
|
||||||
|
mqtt:
|
||||||
|
url: tcp://172.31.9.103:1883
|
||||||
|
userName: admin
|
||||||
|
passWord: zzkj@688737
|
||||||
|
timeout: 5000
|
||||||
|
keepAlive: 60
|
||||||
|
|
||||||
|
#密钥
|
||||||
|
secret:
|
||||||
|
loginSecret: 6131231@#42a765#
|
||||||
|
|
||||||
|
#topic
|
||||||
|
topic:
|
||||||
|
edgeLoginRequest: +/device/+/login/request
|
||||||
|
cloudLoginResponse: +/cloud/+/login/response
|
||||||
|
|
||||||
|
cloudReadRequest: +/cloud/+/read/request
|
||||||
|
edgeReadResponse: +/device/+/read/response
|
||||||
|
cloudWriteRequest: +/cloud/+/write/request
|
||||||
|
edgeWriteResponse: +/device/+/write/response
|
||||||
|
|
||||||
|
cloudReportPush: +/cloud/+/report/push
|
||||||
|
edgeReportPush: +/device/+/report/push
|
||||||
|
|
||||||
|
cloudControlRequest: +/cloud/+/control/request
|
||||||
|
edgeControlResponse: +/device/+/control/response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: datacollect-service
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://172.31.35.125:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
|
username: business_db
|
||||||
|
password: zzkj@688737
|
||||||
|
druid:
|
||||||
|
initialSize: 5
|
||||||
|
minIdle: 5
|
||||||
|
maxActive: 5
|
||||||
|
keepAlive: true #保持长连接
|
||||||
|
connection-error-retry-attempts: 3
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 3000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
|
||||||
|
minio:
|
||||||
|
accessKey: admin
|
||||||
|
secretKey: zzkj@688737
|
||||||
|
endpoint: http://172.31.35.125:9000
|
||||||
|
prefixUrl: http://172.31.35.125:9000
|
||||||
|
|
||||||
|
#跳过登录:true ,不跳过:false
|
||||||
|
skipLogin: false
|
||||||
@ -53,7 +53,7 @@ largeScreen:
|
|||||||
#mqtt接外部数据使用
|
#mqtt接外部数据使用
|
||||||
mqtt1:
|
mqtt1:
|
||||||
url: tcp://1.95.131.171:1883
|
url: tcp://1.95.131.171:1883
|
||||||
userName: root
|
userName: admin
|
||||||
passWord: zzkj@688737
|
passWord: zzkj@688737
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
keepAlive: 60
|
keepAlive: 60
|
||||||
|
|||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/datacollect-service/datacollect-service.log</file>
|
<file>/www/zzkjcloud/logs/datacollect-service/datacollect-service.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/datacollect-service/datacollect-service.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/datacollect-service/datacollect-service.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
@ -28,9 +28,9 @@
|
|||||||
|
|
||||||
<!--Error级别-->
|
<!--Error级别-->
|
||||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/datacollect-service/datacollect-service-error.log</file>
|
<file>/www/zzkjcloud/logs/datacollect-service/datacollect-service-error.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/datacollect-service/datacollect-service-error.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/datacollect-service/datacollect-service-error.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
|
|||||||
@ -205,6 +205,9 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>2.2.12.RELEASE</version>
|
<version>2.2.12.RELEASE</version>
|
||||||
|
<configuration>
|
||||||
|
<includeSystemScope>true</includeSystemScope>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|||||||
@ -0,0 +1,75 @@
|
|||||||
|
//package com.ho.filecenter.config;
|
||||||
|
//
|
||||||
|
//import cn.hutool.core.util.IdUtil;
|
||||||
|
//import com.ho.filecenter.util.AnotherMqttConfigUtil;
|
||||||
|
//import lombok.Data;
|
||||||
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
|
//import org.eclipse.paho.client.mqttv3.IMqttToken;
|
||||||
|
//import org.eclipse.paho.client.mqttv3.MqttClient;
|
||||||
|
//import org.eclipse.paho.client.mqttv3.MqttConnectOptions;
|
||||||
|
//import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
//import org.springframework.beans.factory.annotation.Value;
|
||||||
|
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
//import org.springframework.context.annotation.Bean;
|
||||||
|
//import org.springframework.context.annotation.Configuration;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * @author wp
|
||||||
|
// * @desc: Mqtt配置类
|
||||||
|
// * @date 2025/06/11
|
||||||
|
// */
|
||||||
|
//@Configuration
|
||||||
|
//@Data
|
||||||
|
//@ConfigurationProperties("mqtt1")
|
||||||
|
//@Slf4j
|
||||||
|
//public class AnotherMqttConfig {
|
||||||
|
//
|
||||||
|
// //服务器url
|
||||||
|
// @Value("${mqtt1.url}")
|
||||||
|
// String url;
|
||||||
|
// //超时时间
|
||||||
|
// @Value("${mqtt1.timeout}")
|
||||||
|
// Integer timeout;
|
||||||
|
// //会话保持时间
|
||||||
|
// @Value("${mqtt1.keepAlive}")
|
||||||
|
// Integer keepAlive;
|
||||||
|
//
|
||||||
|
// @Value("${mqtt1.userName}")
|
||||||
|
// String userName;
|
||||||
|
//
|
||||||
|
// @Value("${mqtt1.passWord}")
|
||||||
|
// String passWord;
|
||||||
|
//
|
||||||
|
// @Autowired
|
||||||
|
// AnotherFileEdgeResponseConsumer fileEdgeResponseConsumer;
|
||||||
|
//
|
||||||
|
// //文件响应
|
||||||
|
// @Bean(name = "AnotherFileEdgeResponse")
|
||||||
|
// public MqttClient initFileResponseClient() {
|
||||||
|
// String clientId = IdUtil.simpleUUID();
|
||||||
|
// log.info("clientId:" + clientId);
|
||||||
|
// MqttClient client =null;
|
||||||
|
// try {
|
||||||
|
// client = new MqttClient(url, clientId,null);
|
||||||
|
// MqttConnectOptions options = new MqttConnectOptions();
|
||||||
|
// options.setUserName(userName);
|
||||||
|
// options.setPassword(passWord.toCharArray());
|
||||||
|
// options.setCleanSession(true);
|
||||||
|
// options.setConnectionTimeout(timeout);
|
||||||
|
// options.setKeepAliveInterval(keepAlive);
|
||||||
|
// client.setCallback(fileEdgeResponseConsumer);
|
||||||
|
// IMqttToken iMqttToken = client.connectWithResult(options);
|
||||||
|
// boolean complete = iMqttToken.isComplete();
|
||||||
|
// log.info("FileResponseClient建立连接:{}", complete);
|
||||||
|
//
|
||||||
|
// //这里监听的是
|
||||||
|
// String[] topic = AnotherMqttConfigUtil.getFileResponseTopic();
|
||||||
|
// int[] qos = new int[topic.length];
|
||||||
|
// client.subscribe(topic,qos);
|
||||||
|
// log.info("已订阅topic:{}", topic);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// }
|
||||||
|
// return client;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@ -13,9 +13,12 @@ import com.ho.common.tools.exception.BusinessException;
|
|||||||
import com.ho.common.tools.exception.DataResult;
|
import com.ho.common.tools.exception.DataResult;
|
||||||
import com.ho.common.tools.service.RedisService;
|
import com.ho.common.tools.service.RedisService;
|
||||||
import com.ho.common.tools.util.CommonBytesUtil;
|
import com.ho.common.tools.util.CommonBytesUtil;
|
||||||
|
import com.ho.common.tools.util.MqttUtil;
|
||||||
import com.ho.common.tools.util.PageResult;
|
import com.ho.common.tools.util.PageResult;
|
||||||
import com.ho.filecenter.entity.MediaFile;
|
import com.ho.filecenter.entity.MediaFile;
|
||||||
|
import com.ho.filecenter.service.AnotherFileService;
|
||||||
import com.ho.filecenter.service.FileService;
|
import com.ho.filecenter.service.FileService;
|
||||||
|
import com.ho.filecenter.util.MqttConfigUtil;
|
||||||
import com.ho.filecenter.vo.mqtt.*;
|
import com.ho.filecenter.vo.mqtt.*;
|
||||||
import com.ho.filecenter.vo.resp.*;
|
import com.ho.filecenter.vo.resp.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@ -53,6 +56,8 @@ public class FileController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
CommonBytesUtil bytesUtil;
|
CommonBytesUtil bytesUtil;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AnotherFileService anotherFileService;
|
||||||
@PostMapping("filePage")
|
@PostMapping("filePage")
|
||||||
@ApiOperation(value = "分页查询文件")
|
@ApiOperation(value = "分页查询文件")
|
||||||
public DataResult<PageResult<MediaFile>> filePage(@RequestBody FilePageVO vo, HttpServletRequest request) {
|
public DataResult<PageResult<MediaFile>> filePage(@RequestBody FilePageVO vo, HttpServletRequest request) {
|
||||||
@ -152,7 +157,13 @@ public class FileController {
|
|||||||
fileAttributeResp.setList(new ArrayList<>());
|
fileAttributeResp.setList(new ArrayList<>());
|
||||||
return DataResult.success(fileAttributeResp);
|
return DataResult.success(fileAttributeResp);
|
||||||
}
|
}
|
||||||
|
// String serialNo = vo.getSerialNo();
|
||||||
|
// List<String> snList = MqttConfigUtil.getSnList();
|
||||||
|
// if(snList.stream().anyMatch(s -> s.contains(serialNo))){
|
||||||
fileAttributeResp = fileService.getFileAttribute(vo);
|
fileAttributeResp = fileService.getFileAttribute(vo);
|
||||||
|
// }else{
|
||||||
|
// fileAttributeResp = anotherFileService.getFileAttribute(vo);
|
||||||
|
// }
|
||||||
return DataResult.success(fileAttributeResp);
|
return DataResult.success(fileAttributeResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +179,13 @@ public class FileController {
|
|||||||
fileDeleteResp.setMsg(msg + CommonConstant.Heartbeat.FAIL);
|
fileDeleteResp.setMsg(msg + CommonConstant.Heartbeat.FAIL);
|
||||||
return DataResult.success(fileDeleteResp);
|
return DataResult.success(fileDeleteResp);
|
||||||
}
|
}
|
||||||
|
// String serialNo = fileDeleteReqVO.getSerialNo();
|
||||||
|
// List<String> snList = MqttConfigUtil.getSnList();
|
||||||
|
// if(snList.stream().anyMatch(s -> s.contains(serialNo))){
|
||||||
fileDeleteResp = fileService.deleteDeviceFiles(fileDeleteReqVO);
|
fileDeleteResp = fileService.deleteDeviceFiles(fileDeleteReqVO);
|
||||||
|
// }else{
|
||||||
|
// fileDeleteResp = anotherFileService.deleteDeviceFiles(fileDeleteReqVO);
|
||||||
|
// }
|
||||||
return DataResult.success(fileDeleteResp);
|
return DataResult.success(fileDeleteResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -193,7 +210,12 @@ public class FileController {
|
|||||||
resp.setMsg(CommonConstant.Heartbeat.MSG + serialNo + CommonConstant.Heartbeat.SUCCESS);
|
resp.setMsg(CommonConstant.Heartbeat.MSG + serialNo + CommonConstant.Heartbeat.SUCCESS);
|
||||||
resp.setHeartbeatStatus(CommonConstant.ONE);
|
resp.setHeartbeatStatus(CommonConstant.ONE);
|
||||||
log.info("文件上传(向边端上传)开始上传");
|
log.info("文件上传(向边端上传)开始上传");
|
||||||
|
// List<String> snList = MqttConfigUtil.getSnList();
|
||||||
|
// if(snList.stream().anyMatch(s -> s.contains(serialNo))){
|
||||||
fileService.fileUploadForDevice(file, stationId, serialNo, filePath);
|
fileService.fileUploadForDevice(file, stationId, serialNo, filePath);
|
||||||
|
// }else{
|
||||||
|
// anotherFileService.fileUploadForDevice(file, stationId, serialNo, filePath);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return DataResult.success(resp);
|
return DataResult.success(resp);
|
||||||
}
|
}
|
||||||
@ -217,6 +239,13 @@ public class FileController {
|
|||||||
resp.setHeartbeatStatus(CommonConstant.ONE);
|
resp.setHeartbeatStatus(CommonConstant.ONE);
|
||||||
log.info("文件下载(从边端下载到云端)开始下载");
|
log.info("文件下载(从边端下载到云端)开始下载");
|
||||||
fileService.downloadFromDevice(fileForDeviceReqVO);
|
fileService.downloadFromDevice(fileForDeviceReqVO);
|
||||||
|
// String serialNo = fileForDeviceReqVO.getSerialNo();
|
||||||
|
// List<String> snList = MqttConfigUtil.getSnList();
|
||||||
|
// if(snList.stream().anyMatch(s -> s.contains(serialNo))){
|
||||||
|
fileService.downloadFromDevice(fileForDeviceReqVO);
|
||||||
|
// }else{
|
||||||
|
// anotherFileService.downloadFromDevice(fileForDeviceReqVO);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
return DataResult.success(resp);
|
return DataResult.success(resp);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,9 @@ import com.ho.common.tools.service.RedisService;
|
|||||||
import com.ho.common.tools.util.PageResult;
|
import com.ho.common.tools.util.PageResult;
|
||||||
import com.ho.filecenter.feignclient.BusinessFeignClient;
|
import com.ho.filecenter.feignclient.BusinessFeignClient;
|
||||||
import com.ho.filecenter.feignclient.UserFeignClient;
|
import com.ho.filecenter.feignclient.UserFeignClient;
|
||||||
|
import com.ho.filecenter.service.AnotherOrderSendService;
|
||||||
import com.ho.filecenter.service.OrderSendService;
|
import com.ho.filecenter.service.OrderSendService;
|
||||||
|
import com.ho.filecenter.util.MqttConfigUtil;
|
||||||
import com.ho.filecenter.vo.mqtt.*;
|
import com.ho.filecenter.vo.mqtt.*;
|
||||||
import com.ho.filecenter.vo.resp.HeartbeatResp;
|
import com.ho.filecenter.vo.resp.HeartbeatResp;
|
||||||
import com.ho.filecenter.vo.resp.OrderProcessDetailResp;
|
import com.ho.filecenter.vo.resp.OrderProcessDetailResp;
|
||||||
@ -60,6 +62,9 @@ public class OrderSendController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
UserFeignClient userFeignClient;
|
UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
AnotherOrderSendService anotherOrderSendService;
|
||||||
|
|
||||||
public static final Long TIME_LIMIT = 90L;
|
public static final Long TIME_LIMIT = 90L;
|
||||||
|
|
||||||
@PostMapping("orderIssued")
|
@PostMapping("orderIssued")
|
||||||
@ -158,7 +163,12 @@ public class OrderSendController {
|
|||||||
return DataResult.success(heartbeatResp);
|
return DataResult.success(heartbeatResp);
|
||||||
}
|
}
|
||||||
log.info("指令下发正常开始下发");
|
log.info("指令下发正常开始下发");
|
||||||
|
List<String> snList = MqttConfigUtil.getSnList();
|
||||||
|
if(snList.contains(sn)){
|
||||||
orderSendService.orderIssued(vo);
|
orderSendService.orderIssued(vo);
|
||||||
|
}else{
|
||||||
|
anotherOrderSendService.orderIssued(vo);
|
||||||
|
}
|
||||||
if(vo.getPlanTemId() != null){
|
if(vo.getPlanTemId() != null){
|
||||||
String hourValue ="";
|
String hourValue ="";
|
||||||
String minuteValue ="";
|
String minuteValue ="";
|
||||||
@ -322,7 +332,14 @@ public class OrderSendController {
|
|||||||
// @LogAnnotation(title = "命令下发曲线", action = "命令下发曲线")
|
// @LogAnnotation(title = "命令下发曲线", action = "命令下发曲线")
|
||||||
@TokenIgnore
|
@TokenIgnore
|
||||||
public DataResult<HeartbeatResp> sendPlanPowerOrder(@RequestBody OrderPlanPowerReq vo) {
|
public DataResult<HeartbeatResp> sendPlanPowerOrder(@RequestBody OrderPlanPowerReq vo) {
|
||||||
HeartbeatResp heartbeatResp = orderSendService.sendPlanPowerOrder(vo);
|
String sn = vo.getSn();
|
||||||
|
List<String> snList = MqttConfigUtil.getSnList();
|
||||||
|
HeartbeatResp heartbeatResp = null;
|
||||||
|
if(snList.contains(sn)){
|
||||||
|
heartbeatResp = orderSendService.sendPlanPowerOrder(vo);
|
||||||
|
}else{
|
||||||
|
heartbeatResp = anotherOrderSendService.sendPlanPowerOrder(vo);
|
||||||
|
}
|
||||||
return DataResult.success(heartbeatResp);
|
return DataResult.success(heartbeatResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,66 @@
|
|||||||
|
//package com.ho.filecenter.util;
|
||||||
|
//
|
||||||
|
//import java.util.Arrays;
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
//public class AnotherMqttConfigUtil {
|
||||||
|
//
|
||||||
|
// public static String[] commonTopic = new String[]{
|
||||||
|
// "+/device/27d83a2844ff5866",
|
||||||
|
// "+/device/77ba753718908d1a",
|
||||||
|
// "1/device/+"
|
||||||
|
// };
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取文件请求监听主题
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public static String[] getFileRequestTopic(){
|
||||||
|
// String log = "/file/request";
|
||||||
|
// String[] str = new String[commonTopic.length];
|
||||||
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
|
// str[i] = commonTopic[i]+log;
|
||||||
|
// }
|
||||||
|
// return str;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 读取文件响应监听主题
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public static String[] getFileResponseTopic(){
|
||||||
|
// String log = "/file/response";
|
||||||
|
// String[] str = new String[commonTopic.length];
|
||||||
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
|
// str[i] = commonTopic[i]+log;
|
||||||
|
// }
|
||||||
|
// return str;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static String[] getCurveResponseTopic(){
|
||||||
|
// String log = "/curve/response";
|
||||||
|
// String[] str = new String[commonTopic.length];
|
||||||
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
|
// str[i] = commonTopic[i]+log;
|
||||||
|
// }
|
||||||
|
// return str;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public static String[] getDispatchResponseTopic(){
|
||||||
|
// String log = "/dispatch/response";
|
||||||
|
// String[] str = new String[commonTopic.length];
|
||||||
|
// for (int i = 0; i < commonTopic.length; i++) {
|
||||||
|
// str[i] = commonTopic[i]+log;
|
||||||
|
// }
|
||||||
|
// return str;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取SN配置合集
|
||||||
|
// * @return
|
||||||
|
// */
|
||||||
|
// public static List<String> getSnList(){
|
||||||
|
// List<String> strings = Arrays.asList(commonTopic);
|
||||||
|
// return strings;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
@ -1,122 +1,11 @@
|
|||||||
package com.ho.filecenter.util;
|
package com.ho.filecenter.util;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class MqttConfigUtil {
|
public class MqttConfigUtil {
|
||||||
|
|
||||||
public static String[] commonTopic = new String[]{
|
public static String[] commonTopic = new String[]{
|
||||||
"+/device/fa22fd97b39c04c8",
|
|
||||||
"+/device/803274d9432df350",
|
|
||||||
"+/device/e4067161c4ab1929",
|
|
||||||
"+/device/f0e9a01d8b98e820",
|
|
||||||
"+/device/f6c6c5b5dfcc73bb",
|
|
||||||
"+/device/9038222e7fb8789d",
|
|
||||||
"+/device/a707000000000000",
|
|
||||||
"+/device/811b4eb0f8e99c12",
|
|
||||||
"+/device/c2c574a5c691bf69",
|
|
||||||
"+/device/5265899ad223c157",
|
|
||||||
"+/device/517664ba87ac49ec",
|
|
||||||
"+/device/27d83a2844ff5866",
|
|
||||||
"+/device/77ba753718908d1a",
|
|
||||||
"+/device/b602b10956119d39",
|
|
||||||
"+/device/4c7dd125b6da91fd",
|
|
||||||
"+/device/581bf6724737da0c",
|
|
||||||
"+/device/8a2396ad453891b1",
|
|
||||||
"+/device/917ca24a9ccdf809",
|
|
||||||
"+/device/a8402702a1d41d88",
|
|
||||||
"+/device/7a5202c7dc74afd6",
|
|
||||||
"+/device/bfe7a19ced50c54d",
|
|
||||||
"+/device/21f835330b485415",
|
|
||||||
"+/device/a978d559eeb0a32e",
|
|
||||||
"+/device/4dddf8b0caae7d8b",
|
|
||||||
"+/device/beff9c2ea2d210c4",
|
|
||||||
"+/device/a5af67550fd4dc50",
|
|
||||||
"+/device/0c3e8eadd58f8a51",
|
|
||||||
"+/device/14ed724c77b73494",
|
|
||||||
"+/device/d12d361c6bfef025",
|
|
||||||
"+/device/781c2bf41a6ffa5a",
|
|
||||||
"+/device/ac10829b20169da0",
|
|
||||||
"+/device/ec939740502f3a66",
|
|
||||||
"+/device/e0c812e00ac4e006",
|
|
||||||
"+/device/0000000000000000",
|
|
||||||
"+/device/5e9b285116453b1a",
|
|
||||||
"+/device/eeb34d0de2b6a953",
|
|
||||||
"+/device/56501a13712f9a6e",
|
|
||||||
"+/device/e8d98e91aaa7b04f",
|
|
||||||
"+/device/6c6978a7fb9a8f6d",
|
|
||||||
"+/device/6803ef0410fb7c02",
|
|
||||||
"+/device/fe828101e353b919",
|
|
||||||
"+/device/42ff4118453e41ca",
|
|
||||||
"+/device/d9f866f14483c92d",
|
|
||||||
"+/device/1deae4a5f1400666",
|
|
||||||
"+/device/a608ea4ffb5221d7",
|
|
||||||
"+/device/bd0ccfe06c1d3596",
|
|
||||||
"+/device/262cdfc279065aa0",
|
|
||||||
"+/device/3df87897c35ae0c5",
|
|
||||||
"+/device/8ca0297304c266b6",
|
|
||||||
"+/device/1200000000000000",
|
|
||||||
"+/device/333470f1dccfb19b",
|
|
||||||
"+/device/02bd28350b1c2619",
|
|
||||||
"+/device/9688431d4f01806e",
|
|
||||||
"+/device/a2f3973e0c3b4835",
|
|
||||||
"+/device/f91779c511763a5b",
|
|
||||||
"+/device/2b8924e509ee8559",
|
|
||||||
"+/device/9e4ee680a26303f7",
|
|
||||||
"+/device/56d9bb7131c724b5",
|
|
||||||
"+/device/9511bebccc477456",
|
|
||||||
"+/device/0a3146610bcc5440",
|
|
||||||
"+/device/e817466c6127ab44",
|
|
||||||
"+/device/99efbb96bc40fd15",
|
|
||||||
"+/device/43687f5b1ebecb64",
|
|
||||||
"+/device/b9e0cdfdd4df7736",
|
|
||||||
"+/device/ed76d5ab39f6c42d",
|
|
||||||
"+/device/63f8d5df0c9d647c",
|
|
||||||
"+/device/98b61a1f166b8419",
|
|
||||||
"+/device/201913c33e0318ee",
|
|
||||||
"+/device/9c74bebb12d05635",
|
|
||||||
"+/device/1f237999be964f42",
|
|
||||||
"+/device/104cebca14ffa98c",
|
|
||||||
"+/device/2d1cab6edbfaeb94",
|
|
||||||
"+/device/c8c30d1decff167d",
|
|
||||||
"+/device/984423fdfda19376",
|
|
||||||
"+/device/18db1248acf66a3e",
|
|
||||||
"+/device/e18710921a53bfff",
|
|
||||||
"+/device/04878a29f87e237d",
|
|
||||||
"+/device/c336512bd77d6cbc",
|
|
||||||
"+/device/01ac2a161029e555",
|
|
||||||
"+/device/4eeccb413407a4e4",
|
|
||||||
"+/device/14e7f5c9b123360d",
|
|
||||||
"+/device/daf25437cbc31a00",
|
|
||||||
"+/device/44dfc09110e1f994",
|
|
||||||
"+/device/2dd522056c132349",
|
|
||||||
"+/device/bd7f78f9d070abe6",
|
|
||||||
"+/device/e932c594ce083810",
|
|
||||||
"+/device/b80c3b7513773c7f",
|
|
||||||
"+/device/7f0d37c30d28ed0f",
|
|
||||||
"+/device/53be81deba3b9c74",
|
|
||||||
"+/device/fe5f56cc9029bf20",
|
|
||||||
"+/device/60723affac3821a5",
|
|
||||||
"+/device/d3e22616db04dc52",
|
|
||||||
"+/device/36c12afabd8fa201",
|
|
||||||
"+/device/71db70b8ce2eb0d1",
|
|
||||||
"+/device/69f319418cfe13a2",
|
|
||||||
"+/device/f043173d1fd8cb0d",
|
|
||||||
"+/device/9b5084678310c4da",
|
|
||||||
"+/device/fa3936fdeb8f8cd1",
|
|
||||||
"+/device/0819c35644808b72",
|
|
||||||
"+/device/40442c5a0a29de37",
|
|
||||||
"+/device/75fa0ee5048bd500",
|
|
||||||
"+/device/39674be356de68ad",
|
|
||||||
"+/device/b490b672a5f76716",
|
|
||||||
"+/device/6a3ba96ed146872b",
|
|
||||||
"+/device/3a785a63862c213d",
|
|
||||||
"+/device/2d29a0fbac938329",
|
|
||||||
"+/device/7d97391a68f8d6af",
|
|
||||||
"+/device/b50a1edd44549876",
|
|
||||||
"+/device/7c31d3c5c077228f",
|
|
||||||
"+/device/99e513be6075f8c6",
|
|
||||||
"+/device/5d4297256f02ebc2",
|
|
||||||
"+/device/67aa37e699e1e08f",
|
|
||||||
"+/device/ea0ebfbfa1487bd2",
|
|
||||||
"+/device/aa8a43d326dddb3f",
|
|
||||||
"1/device/+"
|
"1/device/+"
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -163,4 +52,13 @@ public class MqttConfigUtil {
|
|||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取SN配置合集
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static List<String> getSnList(){
|
||||||
|
List<String> strings = Arrays.asList(commonTopic);
|
||||||
|
return strings;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,13 +7,14 @@ server:
|
|||||||
|
|
||||||
#mqtt
|
#mqtt
|
||||||
mqtt:
|
mqtt:
|
||||||
url: tcp://123.60.190.77:1883
|
url: tcp://1.95.170.86:1883
|
||||||
userName: admin
|
userName: admin
|
||||||
passWord: public
|
passWord: zzkj688737
|
||||||
timeout: 5000
|
timeout: 5000
|
||||||
keepAlive: 60
|
keepAlive: 60
|
||||||
|
|
||||||
#主题 todo 先死一个用于测试
|
|
||||||
|
#主题 todo
|
||||||
topic:
|
topic:
|
||||||
cloudFileRequest: +/cloud/+/file/request
|
cloudFileRequest: +/cloud/+/file/request
|
||||||
cloudFileResponse: +/cloud/+/file/response
|
cloudFileResponse: +/cloud/+/file/response
|
||||||
@ -61,9 +62,9 @@ spring:
|
|||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.100.244:3306/file_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
url: jdbc:mysql://1.95.170.86:3306/file_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
username: root
|
username: file_center_db
|
||||||
password: 123456
|
password: zzkj@688737
|
||||||
druid:
|
druid:
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
minIdle: 5
|
minIdle: 5
|
||||||
@ -80,22 +81,9 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 3000ms #连接超时
|
timeout: 3000ms #连接超时
|
||||||
host: 192.168.100.244 #单机
|
host: 1.95.170.86 #单机
|
||||||
password: 123456
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
#port: 6379 #端口
|
|
||||||
#timeout: 5000ms #连接超时
|
|
||||||
#host: 127.0.0.1 #单机
|
|
||||||
#password:
|
|
||||||
#database: 0
|
|
||||||
#集群 真实环境开启
|
|
||||||
# cluster:
|
|
||||||
# nodes:
|
|
||||||
# - 127.0.0.1:6379
|
|
||||||
# - 127.0.0.1:6380
|
|
||||||
# - 127.0.0.1:6381
|
|
||||||
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8 #连接池最大连接 默认8
|
max-active: 8 #连接池最大连接 默认8
|
||||||
@ -104,8 +92,8 @@ spring:
|
|||||||
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
accessKey: admin
|
accessKey: minioadmin
|
||||||
secretKey: zzkj@688737
|
secretKey: minioadmin
|
||||||
endpoint: http://192.168.0.236:9000
|
endpoint: http://1.95.170.86:9000
|
||||||
prefixUrl: http://192.168.0.236:9000
|
prefixUrl: http://1.95.170.86:9000
|
||||||
|
|
||||||
|
|||||||
98
file-center/src/main/resources/application-prod.yml
Normal file
98
file-center/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
#文件中心
|
||||||
|
server:
|
||||||
|
port: 8017
|
||||||
|
servlet:
|
||||||
|
#上下文统一使用api,屏蔽前端路径差异
|
||||||
|
context-path: /api
|
||||||
|
|
||||||
|
#mqtt
|
||||||
|
mqtt:
|
||||||
|
url: tcp://172.31.9.103:1883
|
||||||
|
userName: admin
|
||||||
|
passWord: zzkj@688737
|
||||||
|
timeout: 5000
|
||||||
|
keepAlive: 60
|
||||||
|
|
||||||
|
#主题 todo
|
||||||
|
topic:
|
||||||
|
cloudFileRequest: +/cloud/+/file/request
|
||||||
|
cloudFileResponse: +/cloud/+/file/response
|
||||||
|
edgeFileResponse: +/device/+/file/response
|
||||||
|
edgeFileRequest: +/device/+/file/request
|
||||||
|
|
||||||
|
cloudControlRequest: +/cloud/+/control/request
|
||||||
|
edgeControlResponse: +/device/+/control/response
|
||||||
|
|
||||||
|
#路径 todo 先再本地
|
||||||
|
path:
|
||||||
|
local: /opt/file_center
|
||||||
|
#下发文件路径
|
||||||
|
copy: /opt/file_copy
|
||||||
|
#天气ip2region.db路径
|
||||||
|
weather: /opt/ip2region.db
|
||||||
|
chartPath: /opt/image/
|
||||||
|
|
||||||
|
#指定字节大小
|
||||||
|
size:
|
||||||
|
byteSize: 102400
|
||||||
|
|
||||||
|
|
||||||
|
#通用文件
|
||||||
|
files:
|
||||||
|
upload:
|
||||||
|
path: D:\upload
|
||||||
|
format: .jpg,.png,.doc,.docx,.xlsx,.xls,.pdf
|
||||||
|
maxByte: 10485760
|
||||||
|
|
||||||
|
#swagger2配置
|
||||||
|
swagger2:
|
||||||
|
enable: true #开启标志 生产环境要关闭
|
||||||
|
projectName: 云平台-文件中心-接口
|
||||||
|
controllerPath: com.ho.filecenter.controller
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: file-center
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://172.31.35.125:3306/file_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
|
||||||
|
username: file_center_db
|
||||||
|
password: zzkj@688737
|
||||||
|
druid:
|
||||||
|
initialSize: 5
|
||||||
|
minIdle: 5
|
||||||
|
maxActive: 5
|
||||||
|
keepAlive: true #保持长连接
|
||||||
|
connection-error-retry-attempts: 3
|
||||||
|
#设备文件上传大小
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 500MB
|
||||||
|
max-request-size: 500MB
|
||||||
|
enabled: true
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 3000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
|
||||||
|
minio:
|
||||||
|
accessKey: admin
|
||||||
|
secretKey: zzkj@688737
|
||||||
|
endpoint: http://172.31.35.125:9000
|
||||||
|
prefixUrl: http://172.31.35.125:9000
|
||||||
|
|
||||||
@ -78,3 +78,11 @@ switch:
|
|||||||
fileDefaultLogic: true
|
fileDefaultLogic: true
|
||||||
#命令下发默认逻辑的开关 true 为打开 ,false为关闭
|
#命令下发默认逻辑的开关 true 为打开 ,false为关闭
|
||||||
orderSendDefaultLogic: true
|
orderSendDefaultLogic: true
|
||||||
|
|
||||||
|
#mqtt接外部数据使用
|
||||||
|
mqtt1:
|
||||||
|
url: tcp://1.95.131.171:1883
|
||||||
|
userName: root
|
||||||
|
passWord: zzkj@688737
|
||||||
|
timeout: 5000
|
||||||
|
keepAlive: 60
|
||||||
Binary file not shown.
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/file-center/file-center.log</file>
|
<file>/www/zzkjcloud/logs/file-center/file-center.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/file-center/file-center.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/file-center/file-center.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
|
|||||||
@ -63,6 +63,9 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>2.2.12.RELEASE</version>
|
<version>2.2.12.RELEASE</version>
|
||||||
|
<configuration>
|
||||||
|
<includeSystemScope>true</includeSystemScope>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|||||||
@ -17,9 +17,9 @@ spring:
|
|||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://192.168.100.244:3306/flow_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowMultiQueries=true
|
url: jdbc:mysql://1.95.170.86:3306/flow_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowMultiQueries=true
|
||||||
username: root
|
username: flow_db
|
||||||
password: 123456
|
password: zzkj@688737
|
||||||
druid:
|
druid:
|
||||||
initialSize: 5
|
initialSize: 5
|
||||||
minIdle: 5
|
minIdle: 5
|
||||||
@ -31,21 +31,9 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 300000ms #连接超时
|
timeout: 300000ms #连接超时
|
||||||
host: 192.168.100.244 #单机
|
host: 1.95.170.86 #单机
|
||||||
password: 123456
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
#port: 6379 #端口
|
|
||||||
#timeout: 5000ms #连接超时
|
|
||||||
#host: 127.0.0.1 #单机
|
|
||||||
#password:
|
|
||||||
#database: 0
|
|
||||||
#集群 真实环境开启
|
|
||||||
# record:
|
|
||||||
# nodes:
|
|
||||||
# - 127.0.0.1:6379
|
|
||||||
# - 127.0.0.1:6380
|
|
||||||
# - 127.0.0.1:6381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8 #连接池最大连接 默认8
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
|||||||
84
flowable-center/src/main/resources/application-prod.yml
Normal file
84
flowable-center/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
#文件中心
|
||||||
|
server:
|
||||||
|
port: 8021
|
||||||
|
servlet:
|
||||||
|
#上下文统一使用api,屏蔽前端路径差异
|
||||||
|
context-path: /api
|
||||||
|
tomcat:
|
||||||
|
min-spare-threads: 30
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: flowable-center
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://172.31.35.125:3306/flow_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowMultiQueries=true
|
||||||
|
username: flow_db
|
||||||
|
password: zzkj@688737
|
||||||
|
druid:
|
||||||
|
initialSize: 5
|
||||||
|
minIdle: 5
|
||||||
|
maxActive: 5
|
||||||
|
keepAlive: true #保持长连接
|
||||||
|
connection-error-retry-attempts: 3
|
||||||
|
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 300000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
#工作流
|
||||||
|
activiti:
|
||||||
|
# 自动部署,验证设置:true-开启(默认)、false-关闭
|
||||||
|
check-process-definitions: false
|
||||||
|
# 保存历史数据
|
||||||
|
history-level: full
|
||||||
|
# 检测历史表是否存在
|
||||||
|
db-history-used: true
|
||||||
|
# 关闭自动部署
|
||||||
|
deployment-mode: never-fail
|
||||||
|
# 对数据库中所有表进行更新操作,如果表不存在,则自动创建
|
||||||
|
# create_drop:启动时创建表,在关闭时删除表(必须手动关闭引擎,才能删除表)
|
||||||
|
# drop-create:启动时删除原来的旧表,然后在创建新表(不需要手动关闭引擎)
|
||||||
|
database-schema-update: true
|
||||||
|
# 解决频繁查询SQL问题
|
||||||
|
async-executor-activate: false
|
||||||
|
use-strong-uuids: false
|
||||||
|
initialDelay: 5
|
||||||
|
flag: 0
|
||||||
|
|
||||||
|
#自定义工作量变量
|
||||||
|
flow:
|
||||||
|
#工单流程配置
|
||||||
|
workOrder:
|
||||||
|
#流程定义的key ,根据实际的名称来
|
||||||
|
procDefKey: workOrder
|
||||||
|
#处理工单的岗位 ,后续可能是多个
|
||||||
|
doing: tro,worker
|
||||||
|
#验收工单的岗位
|
||||||
|
check: tro,worker
|
||||||
|
#评价工单的岗位
|
||||||
|
appraise: ceo
|
||||||
|
|
||||||
|
#swagger2配置
|
||||||
|
swagger2:
|
||||||
|
enable: true #开启swagger
|
||||||
|
projectName: 云平台--flow-前端接口
|
||||||
|
controllerPath: com.ho.flow.controller
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/flowable-center/flowable-center.log</file>
|
<file>/www/zzkjcloud/logs/flowable-center/flowable-center.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/flowable-center/flowable-center.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/flowable-center/flowable-center.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>7</maxHistory>
|
<maxHistory>7</maxHistory>
|
||||||
@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
<!--Error级别-->
|
<!--Error级别-->
|
||||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/flowable-center/flowable-center-error.log</file>
|
<file>/www/zzkjcloud/logs/flowable-center/flowable-center-error.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/flowable-center/flowable-center-error.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/flowable-center/flowable-center-error.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>7</maxHistory>
|
<maxHistory>7</maxHistory>
|
||||||
|
|||||||
30
pom.xml
30
pom.xml
@ -166,11 +166,11 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--JWT-->
|
<!--JWT-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<!-- <groupId>io.jsonwebtoken</groupId>-->
|
||||||
<artifactId>jjwt</artifactId>
|
<!-- <artifactId>jjwt</artifactId>-->
|
||||||
<version>${jjwt.version}</version>
|
<!-- <version>${jjwt.version}</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<!--Lombok-->
|
<!--Lombok-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
@ -335,16 +335,16 @@
|
|||||||
<version>${ip2region.version}</version>
|
<version>${ip2region.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- skywalking 整合 logback -->
|
<!-- skywalking 整合 logback -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.apache.skywalking</groupId>
|
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||||
<artifactId>apm-toolkit-logback-1.x</artifactId>
|
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
|
||||||
<version>${apm-toolkit.version}</version>
|
<!-- <version>${apm-toolkit.version}</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>org.apache.skywalking</groupId>
|
<!-- <groupId>org.apache.skywalking</groupId>-->
|
||||||
<artifactId>apm-toolkit-trace</artifactId>
|
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
|
||||||
<version>${apm-toolkit.version}</version>
|
<!-- <version>${apm-toolkit.version}</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
<!--<build>
|
<!--<build>
|
||||||
|
|||||||
@ -13,23 +13,9 @@ spring:
|
|||||||
discovery:
|
discovery:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
datasource:
|
datasource:
|
||||||
# tdengine-server:
|
|
||||||
# #jdbc-url: jdbc:TAOS://192.168.1.198:6030/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
|
||||||
# jdbc-url: jdbc:TAOS-RS://123.60.64.124:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
|
||||||
# username: root
|
|
||||||
# password: taosdata
|
|
||||||
# type: com.zaxxer.hikari.HikariDataSource # Hikari连接池的设置
|
|
||||||
# minimum-idle: 5 #最小连接
|
|
||||||
# maximum-pool-size: 15 #最大连接
|
|
||||||
# auto-commit: true #自动提交
|
|
||||||
# idle-timeout: 30000 #最大空闲时常
|
|
||||||
# pool-name: TDengineDruidCP #连接池名
|
|
||||||
# max-lifetime: 1800000 #最大生命周期
|
|
||||||
# connection-timeout: 30000 #连接超时时间
|
|
||||||
# connection-test-query: show tables
|
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
|
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
|
||||||
url: jdbc:TAOS-RS://1.95.153.121:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
url: jdbc:TAOS-RS://1.95.170.86:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
||||||
username: root
|
username: root
|
||||||
password: taosdata
|
password: taosdata
|
||||||
druid:
|
druid:
|
||||||
@ -39,19 +25,12 @@ spring:
|
|||||||
max-wait: 10000
|
max-wait: 10000
|
||||||
time-between-eviction-runs-millis: 60000
|
time-between-eviction-runs-millis: 60000
|
||||||
validation-query: SELECT 1 as nums
|
validation-query: SELECT 1 as nums
|
||||||
# test-while-idle: true
|
|
||||||
# test-on-borrow: false
|
|
||||||
# test-on-return: false
|
|
||||||
# pool-prepared-statements: true
|
|
||||||
# max-pool-prepared-statement-per-connection-size: 20
|
|
||||||
# connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
|
||||||
# filters: stat # 拦截sql的开
|
|
||||||
#Redis
|
#Redis
|
||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 3000ms #连接超时
|
timeout: 3000ms #连接超时
|
||||||
host: 1.95.153.121 #单机
|
host: 1.95.170.86 #单机
|
||||||
password: zzkj@688737
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
boot:
|
boot:
|
||||||
|
|||||||
39
td-service/src/main/resources/application-prod.yml
Normal file
39
td-service/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
server:
|
||||||
|
port: 8013
|
||||||
|
servlet:
|
||||||
|
context-path: /td
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: td-service
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
|
||||||
|
url: jdbc:TAOS-RS://172.31.35.125:6041/test_td_db?user=root&password=taosdata&charset=UTF-8&locale=zh_CN.UTF-8&timezone=UTC-8
|
||||||
|
username: root
|
||||||
|
password: taosdata
|
||||||
|
druid:
|
||||||
|
initial-size: 6
|
||||||
|
min-idle: 6
|
||||||
|
max-active: 12
|
||||||
|
max-wait: 10000
|
||||||
|
time-between-eviction-runs-millis: 60000
|
||||||
|
validation-query: SELECT 1 as nums
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 3000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
url: http://localhost:8019/boot
|
||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/td-service/td-service.log</file>
|
<file>/www/zzkjcloud/logs/td-service/td-service.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/td-service/td-service.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/td-service/td-service.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
@ -27,9 +27,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/td-service/td-service-error.log</file>
|
<file>/www/zzkjcloud/logs/td-service/td-service-error.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/td-service/td-service-error.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/td-service/td-service-error.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
|
|||||||
@ -19,4 +19,8 @@ public class QueryPermissionReqVo {
|
|||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
@ApiParam
|
@ApiParam
|
||||||
Integer status;
|
Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "语言切换")
|
||||||
|
@ApiParam
|
||||||
|
String lang;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.ho.user.controller;
|
|||||||
|
|
||||||
import com.ho.common.tools.annotation.LogAnnotation;
|
import com.ho.common.tools.annotation.LogAnnotation;
|
||||||
import com.ho.common.tools.constant.ContextConstant;
|
import com.ho.common.tools.constant.ContextConstant;
|
||||||
|
import com.ho.common.tools.constant.RedisKeyConstant;
|
||||||
import com.ho.common.tools.entity.PageVO;
|
import com.ho.common.tools.entity.PageVO;
|
||||||
import com.ho.common.tools.exception.BaseResponseCode;
|
import com.ho.common.tools.exception.BaseResponseCode;
|
||||||
import com.ho.common.tools.exception.BusinessException;
|
import com.ho.common.tools.exception.BusinessException;
|
||||||
@ -16,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -47,10 +49,12 @@ public class DictController {
|
|||||||
@PostMapping("typeList")
|
@PostMapping("typeList")
|
||||||
@ApiOperation(value = "查询字典列表接口(根据类型)")
|
@ApiOperation(value = "查询字典列表接口(根据类型)")
|
||||||
// @LogAnnotation(title = "字典管理",action = "根据类型查询字典")
|
// @LogAnnotation(title = "字典管理",action = "根据类型查询字典")
|
||||||
public DataResult<DictRespVo> dictList(@RequestBody @Valid DictSearchReqVO vo) {
|
public DataResult<DictRespVo> dictList(@RequestBody @Valid DictSearchReqVO vo,HttpServletRequest request) {
|
||||||
|
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||||
DataResult<DictRespVo> result = DataResult.success();
|
DataResult<DictRespVo> result = DataResult.success();
|
||||||
DictTypeAndLabelReqVO typeAndLabelReqVO = new DictTypeAndLabelReqVO();
|
DictTypeAndLabelReqVO typeAndLabelReqVO = new DictTypeAndLabelReqVO();
|
||||||
typeAndLabelReqVO.setType(vo.getType());
|
typeAndLabelReqVO.setType(vo.getType());
|
||||||
|
typeAndLabelReqVO.setLang(lang);
|
||||||
result.setData(dictService.selectDict(typeAndLabelReqVO));
|
result.setData(dictService.selectDict(typeAndLabelReqVO));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -75,9 +79,10 @@ public class DictController {
|
|||||||
|
|
||||||
@PostMapping("typeAll")
|
@PostMapping("typeAll")
|
||||||
@ApiOperation(value = "查询所有字典列表接口")
|
@ApiOperation(value = "查询所有字典列表接口")
|
||||||
public DataResult<List<DictRespVo>> typeList() {
|
public DataResult<List<DictRespVo>> typeList(HttpServletRequest request) {
|
||||||
|
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||||
DataResult<List<DictRespVo>> result = DataResult.success();
|
DataResult<List<DictRespVo>> result = DataResult.success();
|
||||||
result.setData(dictService.selectDictType());
|
result.setData(dictService.selectDictType(lang));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -294,9 +294,10 @@ public class PermissionController {
|
|||||||
public DataResult<List<PermissionRespNode>> getStationPer(@RequestBody PermStationRelation permStationRelation, HttpServletRequest request) {
|
public DataResult<List<PermissionRespNode>> getStationPer(@RequestBody PermStationRelation permStationRelation, HttpServletRequest request) {
|
||||||
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
|
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
|
||||||
String userTokenKey = RedisKeyConstant.User.TOKEN + token;
|
String userTokenKey = RedisKeyConstant.User.TOKEN + token;
|
||||||
|
String lang=request.getHeader(RedisKeyConstant.User.LANG);
|
||||||
UserDetailRespVO user = (UserDetailRespVO) redisService.get(userTokenKey);
|
UserDetailRespVO user = (UserDetailRespVO) redisService.get(userTokenKey);
|
||||||
DataResult<List<PermissionRespNode>> result = DataResult.success();
|
DataResult<List<PermissionRespNode>> result = DataResult.success();
|
||||||
result.setData(permissionService.getStationPer(permStationRelation.getStationId(),user));
|
result.setData(permissionService.getStationPer(permStationRelation.getStationId(),user,lang));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,6 +96,7 @@ public class UserController {
|
|||||||
public DataResult<UserDetailRespVO> yourSelfInfo(@RequestParam(required = false) String type,HttpServletRequest request) {
|
public DataResult<UserDetailRespVO> yourSelfInfo(@RequestParam(required = false) String type,HttpServletRequest request) {
|
||||||
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
|
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
|
||||||
String userTokenKey = RedisKeyConstant.User.TOKEN + token;
|
String userTokenKey = RedisKeyConstant.User.TOKEN + token;
|
||||||
|
String lang =request.getHeader(RedisKeyConstant.User.LANG);
|
||||||
//根据用户的登陆方式(账号还是手机号),延长对应缓存
|
//根据用户的登陆方式(账号还是手机号),延长对应缓存
|
||||||
if (redisService.hasKey(userTokenKey)) {
|
if (redisService.hasKey(userTokenKey)) {
|
||||||
//每次获取用户信息,都会进行过期时间的延长
|
//每次获取用户信息,都会进行过期时间的延长
|
||||||
@ -105,7 +106,7 @@ public class UserController {
|
|||||||
if(null != type){
|
if(null != type){
|
||||||
user.setConfigType(type);
|
user.setConfigType(type);
|
||||||
}
|
}
|
||||||
UserDetailRespVO vo = userService.yourSelfInfo(user, simpleUser.getPlatSuper());
|
UserDetailRespVO vo = userService.yourSelfInfo(user, simpleUser.getPlatSuper(),lang);
|
||||||
//延长token时间
|
//延长token时间
|
||||||
//redisCommon.extendKeyTime(userTokenKey, null);
|
//redisCommon.extendKeyTime(userTokenKey, null);
|
||||||
//String userNameKey = RedisKeyConstant.User.USER_NAME + user.getUsername();
|
//String userNameKey = RedisKeyConstant.User.USER_NAME + user.getUsername();
|
||||||
|
|||||||
@ -39,7 +39,7 @@ public interface SysDictMapper {
|
|||||||
SysSubDict selectBySubId(Integer id);
|
SysSubDict selectBySubId(Integer id);
|
||||||
|
|
||||||
|
|
||||||
List<SysSubDict> selectSubDictByType(String type);
|
List<SysSubDict> selectSubDictByType(@Param("type") String type,@Param("lang") String lang);
|
||||||
|
|
||||||
List<SysSubDict> selectSubDictByTypeList(@Param("typeList") List<String> typeList);
|
List<SysSubDict> selectSubDictByTypeList(@Param("typeList") List<String> typeList);
|
||||||
|
|
||||||
|
|||||||
@ -50,5 +50,5 @@ public interface SysPermissionMapper {
|
|||||||
|
|
||||||
List<SysPermission> selectByScope();
|
List<SysPermission> selectByScope();
|
||||||
|
|
||||||
List<SysPermission> selectByIds(@Param("ids") List<Integer> perIds);
|
List<SysPermission> selectByIds(@Param("ids") List<Integer> perIds,@Param("lang") String lang);
|
||||||
}
|
}
|
||||||
@ -34,11 +34,11 @@ public interface DictService {
|
|||||||
|
|
||||||
// void deletedByType(String type);
|
// void deletedByType(String type);
|
||||||
|
|
||||||
List<DictRespVo> selectDictType();
|
List<DictRespVo> selectDictType(String lang);
|
||||||
|
|
||||||
SysSubDict selectSubDictByValue(DictAddReqVO vo);
|
SysSubDict selectSubDictByValue(DictAddReqVO vo);
|
||||||
|
|
||||||
List<SysSubDict> selectSubDictByType(String type);
|
List<SysSubDict> selectSubDictByType(String type,String lang);
|
||||||
|
|
||||||
List<SysSubDict> selectSubDictByTypeList(List<String> typeList);
|
List<SysSubDict> selectSubDictByTypeList(List<String> typeList);
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ public interface PermissionService {
|
|||||||
|
|
||||||
List<SysPermission> getPermission(String userId);
|
List<SysPermission> getPermission(String userId);
|
||||||
|
|
||||||
List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds);
|
List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds,String lang);
|
||||||
|
|
||||||
List<SysPermission> getPermissionByTop();
|
List<SysPermission> getPermissionByTop();
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ public interface PermissionService {
|
|||||||
List<SysPermission> getSysMangeMenus(List<SysPermission> list, List<Integer> queryIds);
|
List<SysPermission> getSysMangeMenus(List<SysPermission> list, List<Integer> queryIds);
|
||||||
|
|
||||||
|
|
||||||
List<PermissionRespNode> getStationPer(Integer stationId, UserDetailRespVO user);
|
List<PermissionRespNode> getStationPer(Integer stationId, UserDetailRespVO user,String lang);
|
||||||
|
|
||||||
List<PermissionRespNode> getAll(QueryPermissionReqVo query);
|
List<PermissionRespNode> getAll(QueryPermissionReqVo query);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,7 +75,7 @@ public interface UserService {
|
|||||||
|
|
||||||
List<SysUser> selectIds(List<String> userIds);
|
List<SysUser> selectIds(List<String> userIds);
|
||||||
|
|
||||||
UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper);
|
UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper,String lang);
|
||||||
|
|
||||||
//清除用户缓存
|
//清除用户缓存
|
||||||
void removeUserCache(String username, String loginChannel);
|
void removeUserCache(String username, String loginChannel);
|
||||||
|
|||||||
@ -65,7 +65,7 @@ public class DictServiceImpl implements DictService {
|
|||||||
}
|
}
|
||||||
int upDictRet = dictMapper.updateDict(dict);
|
int upDictRet = dictMapper.updateDict(dict);
|
||||||
log.info("修改sys_dict记录数:" + upDictRet);
|
log.info("修改sys_dict记录数:" + upDictRet);
|
||||||
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType());
|
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType(),null);
|
||||||
int upSubDictRet = 0;
|
int upSubDictRet = 0;
|
||||||
for (SysSubDict sysSubDict : sysSubDicts) {
|
for (SysSubDict sysSubDict : sysSubDicts) {
|
||||||
sysSubDict.setType(vo.getType());
|
sysSubDict.setType(vo.getType());
|
||||||
@ -96,7 +96,7 @@ public class DictServiceImpl implements DictService {
|
|||||||
|
|
||||||
SysSubDict subDict = new SysSubDict();
|
SysSubDict subDict = new SysSubDict();
|
||||||
BeanUtils.copyProperties(vo,subDict);
|
BeanUtils.copyProperties(vo,subDict);
|
||||||
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType());
|
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType(),null);
|
||||||
if (sysSubDicts.size() == 0){
|
if (sysSubDicts.size() == 0){
|
||||||
throw new BusinessException(BaseResponseCode.DICT_DELETED_EXISTS);
|
throw new BusinessException(BaseResponseCode.DICT_DELETED_EXISTS);
|
||||||
}
|
}
|
||||||
@ -150,8 +150,8 @@ public class DictServiceImpl implements DictService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysSubDict> selectSubDictByType(String type) {
|
public List<SysSubDict> selectSubDictByType(String type,String lang) {
|
||||||
List<SysSubDict> sysSubDicts = dictMapper.selectSubDictByType(type);
|
List<SysSubDict> sysSubDicts = dictMapper.selectSubDictByType(type,lang);
|
||||||
return sysSubDicts;
|
return sysSubDicts;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +166,7 @@ public class DictServiceImpl implements DictService {
|
|||||||
SysDict sysDict = dictMapper.selectByType(vo.getType());
|
SysDict sysDict = dictMapper.selectByType(vo.getType());
|
||||||
DictRespVo dictRespVo = new DictRespVo();
|
DictRespVo dictRespVo = new DictRespVo();
|
||||||
BeanUtils.copyProperties(sysDict,dictRespVo);
|
BeanUtils.copyProperties(sysDict,dictRespVo);
|
||||||
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType());
|
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType(),vo.getLang());
|
||||||
dictRespVo.setList(sysSubDicts);
|
dictRespVo.setList(sysSubDicts);
|
||||||
return dictRespVo;
|
return dictRespVo;
|
||||||
}
|
}
|
||||||
@ -190,13 +190,13 @@ public class DictServiceImpl implements DictService {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DictRespVo> selectDictType() {
|
public List<DictRespVo> selectDictType(String lang) {
|
||||||
List<SysDict> sysDicts = dictMapper.selectTypeAll();
|
List<SysDict> sysDicts = dictMapper.selectTypeAll();
|
||||||
List<DictRespVo> respVos = new ArrayList<>();
|
List<DictRespVo> respVos = new ArrayList<>();
|
||||||
for (SysDict sysDict : sysDicts) {
|
for (SysDict sysDict : sysDicts) {
|
||||||
DictRespVo vo = new DictRespVo();
|
DictRespVo vo = new DictRespVo();
|
||||||
BeanUtils.copyProperties(sysDict,vo);
|
BeanUtils.copyProperties(sysDict,vo);
|
||||||
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType());
|
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType(),lang);
|
||||||
vo.setList(sysSubDicts);
|
vo.setList(sysSubDicts);
|
||||||
respVos.add(vo);
|
respVos.add(vo);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,12 +91,13 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
|
|
||||||
//根据roleIds查询菜单
|
//根据roleIds查询菜单
|
||||||
@Override
|
@Override
|
||||||
public List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds) {
|
public List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds,String lang) {
|
||||||
List<Integer> permissionIds = rolePermissionService.getPermissionIdsByRoles(roleIds);
|
List<Integer> permissionIds = rolePermissionService.getPermissionIdsByRoles(roleIds);
|
||||||
if (permissionIds.isEmpty()) {
|
if (permissionIds.isEmpty()) {
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
QueryPermissionReqVo query = new QueryPermissionReqVo();
|
QueryPermissionReqVo query = new QueryPermissionReqVo();
|
||||||
|
query.setLang(lang);
|
||||||
List<SysPermission> result = sysPermissionMapper.selectInfoByIds(query, permissionIds);
|
List<SysPermission> result = sysPermissionMapper.selectInfoByIds(query, permissionIds);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -1120,21 +1121,21 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PermissionRespNode> getStationPer(Integer stationId, UserDetailRespVO user) {
|
public List<PermissionRespNode> getStationPer(Integer stationId, UserDetailRespVO user,String lang) {
|
||||||
List<SysPermission> list = new ArrayList<>();
|
List<SysPermission> list = new ArrayList<>();
|
||||||
//查询当前登录人所拥有的菜单
|
//查询当前登录人所拥有的菜单
|
||||||
List<Integer> roleIds = user.getRoleIds();
|
List<Integer> roleIds = user.getRoleIds();
|
||||||
List<SysPermission> userPermissions = new ArrayList<>();
|
List<SysPermission> userPermissions = new ArrayList<>();
|
||||||
if (!roleIds.isEmpty()) {
|
if (!roleIds.isEmpty()) {
|
||||||
//到关联表中根据角色id 拿到对应的菜单id
|
//到关联表中根据角色id 拿到对应的菜单id
|
||||||
List<SysPermission> result = getPermissionByRoleIds(roleIds);
|
List<SysPermission> result = getPermissionByRoleIds(roleIds,lang);
|
||||||
List<Integer> perIds = result.stream().map(s -> {
|
List<Integer> perIds = result.stream().map(s -> {
|
||||||
return s.getId();
|
return s.getId();
|
||||||
}
|
}
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
// List<Integer> permissionIdsByRoles = rolePermissionService.getPermissionIdsByRoles(roleIds);
|
// List<Integer> permissionIdsByRoles = rolePermissionService.getPermissionIdsByRoles(roleIds);
|
||||||
//根据菜单Id拿到菜单列表
|
//根据菜单Id拿到菜单列表
|
||||||
List<SysPermission> sysPermissions = selectByIds(perIds);
|
List<SysPermission> sysPermissions = selectByIds(perIds,lang);
|
||||||
//过滤掉按钮类型的数据
|
//过滤掉按钮类型的数据
|
||||||
userPermissions = sysPermissions.stream().filter(s -> !s.getType().equals(CommonConstant.THREE)).collect(Collectors.toList());
|
userPermissions = sysPermissions.stream().filter(s -> !s.getType().equals(CommonConstant.THREE)).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@ -1147,7 +1148,7 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
}
|
}
|
||||||
).collect(Collectors.toList());
|
).collect(Collectors.toList());
|
||||||
if (!perIds.isEmpty()) {
|
if (!perIds.isEmpty()) {
|
||||||
permissions = selectByIds(perIds);
|
permissions = selectByIds(perIds,lang);
|
||||||
}
|
}
|
||||||
if (permissions.isEmpty()) {
|
if (permissions.isEmpty()) {
|
||||||
list = userPermissions;
|
list = userPermissions;
|
||||||
@ -1178,8 +1179,8 @@ public class PermissionServiceImpl implements PermissionService {
|
|||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<SysPermission> selectByIds(List<Integer> perIds){
|
private List<SysPermission> selectByIds(List<Integer> perIds,String lang){
|
||||||
List<SysPermission> sysPermissions = sysPermissionMapper.selectByIds(perIds);
|
List<SysPermission> sysPermissions = sysPermissionMapper.selectByIds(perIds,lang);
|
||||||
return sysPermissions;
|
return sysPermissions;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -115,13 +115,13 @@ public class UserServiceImpl implements UserService {
|
|||||||
private String env;
|
private String env;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper) {
|
public UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper,String lang) {
|
||||||
if (user.getRoleIds() == null) {
|
if (user.getRoleIds() == null) {
|
||||||
//该用户无有效角色
|
//该用户无有效角色
|
||||||
throw new BusinessException(BaseResponseCode.USER_DOES_NOT_VALID_ROLE);
|
throw new BusinessException(BaseResponseCode.USER_DOES_NOT_VALID_ROLE);
|
||||||
}
|
}
|
||||||
//根据RoleIds在sys_role_permission关联表中拿到 permission_id,在根据permission_id拿到菜单
|
//根据RoleIds在sys_role_permission关联表中拿到 permission_id,在根据permission_id拿到菜单
|
||||||
List<SysPermission> result = permissionService.getPermissionByRoleIds(user.getRoleIds());
|
List<SysPermission> result = permissionService.getPermissionByRoleIds(user.getRoleIds(),lang);
|
||||||
//将其组成树结构返回
|
//将其组成树结构返回
|
||||||
//全量的菜单集合
|
//全量的菜单集合
|
||||||
List<SysPermission> permissions = new ArrayList<>();
|
List<SysPermission> permissions = new ArrayList<>();
|
||||||
@ -890,7 +890,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
}
|
}
|
||||||
//非超管,查询角色该有的
|
//非超管,查询角色该有的
|
||||||
else {
|
else {
|
||||||
permissions = permissionService.getPermissionByRoleIds(roleIds);
|
permissions = permissionService.getPermissionByRoleIds(roleIds,null);
|
||||||
}
|
}
|
||||||
if (permissions.isEmpty()) {
|
if (permissions.isEmpty()) {
|
||||||
userDetail.setMenuList(new ArrayList<>());
|
userDetail.setMenuList(new ArrayList<>());
|
||||||
@ -1115,7 +1115,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, String> checkSpecialUser() {
|
public Map<String, String> checkSpecialUser() {
|
||||||
Map<String,String> userMap = new HashMap<>();
|
Map<String,String> userMap = new HashMap<>();
|
||||||
List<SysSubDict> sysSubDictList = dictService.selectSubDictByType(CommonConstant.SPECIAL_USER);
|
List<SysSubDict> sysSubDictList = dictService.selectSubDictByType(CommonConstant.SPECIAL_USER,null);
|
||||||
for (SysSubDict sysSub:sysSubDictList) {
|
for (SysSubDict sysSub:sysSubDictList) {
|
||||||
userMap.put(sysSub.getValue(),sysSub.getValue());
|
userMap.put(sysSub.getValue(),sysSub.getValue());
|
||||||
}
|
}
|
||||||
@ -1125,7 +1125,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, String> getSysSubDict(SysSubDictVO vo) {
|
public Map<String, String> getSysSubDict(SysSubDictVO vo) {
|
||||||
Map<String,String> userMap = new HashMap<>();
|
Map<String,String> userMap = new HashMap<>();
|
||||||
List<SysSubDict> sysSubDictList = dictService.selectSubDictByType(vo.getType());
|
List<SysSubDict> sysSubDictList = dictService.selectSubDictByType(vo.getType(),null);
|
||||||
for (SysSubDict sysSub:sysSubDictList) {
|
for (SysSubDict sysSub:sysSubDictList) {
|
||||||
if(CommonConstant.ONE.equals(vo.getKeyVal())){
|
if(CommonConstant.ONE.equals(vo.getKeyVal())){
|
||||||
userMap.put(sysSub.getLabel(),sysSub.getValue());
|
userMap.put(sysSub.getLabel(),sysSub.getValue());
|
||||||
|
|||||||
@ -20,4 +20,7 @@ public class DictTypeAndLabelReqVO {
|
|||||||
@ApiModelProperty(value = "字典value类型")
|
@ApiModelProperty(value = "字典value类型")
|
||||||
@NotBlank(message = "字典value类型不能为空")
|
@NotBlank(message = "字典value类型不能为空")
|
||||||
private String value;
|
private String value;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "中英切换")
|
||||||
|
private String lang;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ spring:
|
|||||||
server-addr: 127.0.0.1:8848
|
server-addr: 127.0.0.1:8848
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://1.95.153.121:3306/user_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://1.95.170.86:3306/user_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
username: user_center_db
|
username: user_center_db
|
||||||
password: zzkj@688737
|
password: zzkj@688737
|
||||||
druid:
|
druid:
|
||||||
@ -38,21 +38,9 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 3000ms #连接超时
|
timeout: 3000ms #连接超时
|
||||||
host: 1.95.153.121 #单机
|
host: 1.95.170.86 #单机
|
||||||
password: zzkj@688737
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
#port: 6379 #端口
|
|
||||||
#timeout: 5000ms #连接超时
|
|
||||||
#host: 127.0.0.1 #单机
|
|
||||||
#password:
|
|
||||||
#database: 0
|
|
||||||
#集群 真实环境开启
|
|
||||||
# cluster:
|
|
||||||
# nodes:
|
|
||||||
# - 127.0.0.1:6379
|
|
||||||
# - 127.0.0.1:6380
|
|
||||||
# - 127.0.0.1:6381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8 #连接池最大连接 默认8
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
|||||||
66
user-service/src/main/resources/application-prod.yml
Normal file
66
user-service/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
#用户中心
|
||||||
|
server:
|
||||||
|
port: 8012
|
||||||
|
servlet:
|
||||||
|
context-path: /api
|
||||||
|
|
||||||
|
#swagger2配置
|
||||||
|
swagger2:
|
||||||
|
enable: true #开启标志 生产环境要关闭
|
||||||
|
projectName: 云平台-用户中心-接口
|
||||||
|
controllerPath: com.ho.user.controller
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: user-center
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
datasource:
|
||||||
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
|
url: jdbc:mysql://172.31.35.125:3306/user_center_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
|
||||||
|
username: user_center_db
|
||||||
|
password: zzkj@688737
|
||||||
|
druid:
|
||||||
|
initialSize: 5
|
||||||
|
minIdle: 5
|
||||||
|
maxActive: 5
|
||||||
|
keepAlive: true #保持长连接
|
||||||
|
connection-error-retry-attempts: 3
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
client:
|
||||||
|
url: http://localhost:8019/boot
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 3000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
|
||||||
|
#jwt配置
|
||||||
|
jwt:
|
||||||
|
secretKey: 78944878877848fg)
|
||||||
|
accessTokenExpireTime: PT2H
|
||||||
|
refreshTokenExpireTime: PT8H
|
||||||
|
refreshTokenExpireAppTime: P30D
|
||||||
|
issuer: hocloudSystem
|
||||||
|
|
||||||
|
#加解密
|
||||||
|
rsa:
|
||||||
|
pubKey: 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCuG6ZABNgLQCI9iVPDuJEb7xb5zR9UGKyKXshLuJFZxyNtaEzfpjSMqsshUYA1QpwUvkmZE0lcRE4F4QtZO9rDnH2PoW1FWRbjgg0+MKWOmZr9hSPKM/BIE+knTtTaj4/0TK7QwDd9q/QAIduC1hIyxIIkxfWx0gFuTnxui0waCwIDAQAB'
|
||||||
|
privateKey: 'MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAK4bpkAE2AtAIj2JU8O4kRvvFvnNH1QYrIpeyEu4kVnHI21oTN+mNIyqyyFRgDVCnBS+SZkTSVxETgXhC1k72sOcfY+hbUVZFuOCDT4wpY6Zmv2FI8oz8EgT6SdO1NqPj/RMrtDAN32r9AAh24LWEjLEgiTF9bHSAW5OfG6LTBoLAgMBAAECgYA614NfXYO6galQzMmvewAnxa0pLYbqABDIDvJ4jN8qzV+OyVI5v81AwTQ3hXjkBygC5rCu+FKxyS/pUr5oIQ90vbKvy+kozg9l0qWHfa8XrfC+E36CVuDrZYdZzl0C6J6BoNB9osJJ6HCnMA7kWLRRwU5VJBsK8CmgcJlfHNH60QJBAPz4rZgqgor69SonHG4xjRz+u4QkXIP8I+lorBSFEuUF03u22Kcxz7mcOq63m8K+oc22ql0g8QNrq6YPrEgpAPMCQQCwMUQcdZLWJrRbHp1ZA3jbt4vYg7xb1LklAM6Qmz1R9xVY0itDMtFRSTlVnrbTPZ+rldrkLUOzLJwKLHniIQiJAkEAmfeBMKwu6Af2T8GePDNMf+lKmBLJfEtqUBW1JogYB+yT2yhelORsWbwMu2plExKTyHD1H9l812ghAOFpKkJKoQJBAJ7lz2dbIXHAtib3FTCR0Q1WGujI5bZrwg19DM2dM1AYZUgVQq73xY5pWyu8V2VqzfUQ0Le3mracJJ2IPuOQpwECQF/b7Tv3auIHRaO9AD7xWIOCMYGlKhqeheMZb/mDRHedsdRvigiojDaaFbtnkvXlRbWlkOu5P5GNDpv7EuPbUs8='
|
||||||
|
|
||||||
|
phone:
|
||||||
|
regexp: ^[1][3,4,5,6,7,8,9][0-9]{9}$
|
||||||
|
|
||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/user-center/user-center.log</file>
|
<file>/www/zzkjcloud/logs/user-center/user-center.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/user-center/user-center.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/user-center/user-center.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
@ -27,9 +27,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/user-center/user-center-error.log</file>
|
<file>/www/zzkjcloud/logs/user-center/user-center-error.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/user-center/user-center-error.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>//www/zzkjcloud/logs/user-center/user-center-error.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始,
|
||||||
|
|||||||
@ -9,6 +9,9 @@
|
|||||||
<sql id="Base_Column_DictSubList">
|
<sql id="Base_Column_DictSubList">
|
||||||
id,label, type,`value`, sort, `desc`,create_time, update_time, deleted
|
id,label, type,`value`, sort, `desc`,create_time, update_time, deleted
|
||||||
</sql>
|
</sql>
|
||||||
|
<sql id="Base_Column_DictSubList1">
|
||||||
|
id,label_en label, type,`value`, sort, `desc`,create_time, update_time, deleted
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultType="com.ho.user.entity.SysDict">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultType="com.ho.user.entity.SysDict">
|
||||||
select
|
select
|
||||||
@ -81,7 +84,14 @@
|
|||||||
|
|
||||||
<select id="selectSubDictByType" resultType="com.ho.user.api.entity.SysSubDict">
|
<select id="selectSubDictByType" resultType="com.ho.user.api.entity.SysSubDict">
|
||||||
select
|
select
|
||||||
<include refid="Base_Column_DictSubList"/>
|
<choose>
|
||||||
|
<when test="lang != null and lang=='en_US' ">
|
||||||
|
<include refid="Base_Column_DictSubList1"></include>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
<include refid="Base_Column_DictSubList"></include>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
from sys_sub_dict
|
from sys_sub_dict
|
||||||
where
|
where
|
||||||
type = #{type}
|
type = #{type}
|
||||||
|
|||||||
@ -8,6 +8,12 @@
|
|||||||
update_time, deleted, `scope`,is_config ,component, menu_name
|
update_time, deleted, `scope`,is_config ,component, menu_name
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List1">
|
||||||
|
id
|
||||||
|
, code, name_en name, perms, url,url_app, icon, icon_app,`method`, pid, order_num, `type`,`show`, color, `status`, create_time,
|
||||||
|
update_time, deleted, `scope`,is_config ,component, menu_name
|
||||||
|
</sql>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer"
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer"
|
||||||
resultType="com.ho.common.tools.entity.SysPermission">
|
resultType="com.ho.common.tools.entity.SysPermission">
|
||||||
select
|
select
|
||||||
@ -278,7 +284,14 @@
|
|||||||
|
|
||||||
<select id="selectInfoByIds" resultType="com.ho.common.tools.entity.SysPermission">
|
<select id="selectInfoByIds" resultType="com.ho.common.tools.entity.SysPermission">
|
||||||
select
|
select
|
||||||
|
<choose>
|
||||||
|
<when test="query.lang != null and query.lang=='en_US' ">
|
||||||
|
<include refid="Base_Column_List1"></include>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
<include refid="Base_Column_List"></include>
|
<include refid="Base_Column_List"></include>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
from sys_permission
|
from sys_permission
|
||||||
<where>
|
<where>
|
||||||
and deleted = 1
|
and deleted = 1
|
||||||
@ -408,7 +421,14 @@
|
|||||||
|
|
||||||
<select id="selectByIds" resultType="com.ho.common.tools.entity.SysPermission">
|
<select id="selectByIds" resultType="com.ho.common.tools.entity.SysPermission">
|
||||||
select
|
select
|
||||||
|
<choose>
|
||||||
|
<when test="lang != null and lang=='en_US' ">
|
||||||
|
<include refid="Base_Column_List1"></include>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
<include refid="Base_Column_List"></include>
|
<include refid="Base_Column_List"></include>
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
from sys_permission
|
from sys_permission
|
||||||
<where>
|
<where>
|
||||||
<if test="ids != null and ids.size != 0">
|
<if test="ids != null and ids.size != 0">
|
||||||
|
|||||||
@ -26,7 +26,7 @@ mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
|
|||||||
#mybatis.type-aliases-package=com.xxl.job.admin.core.model
|
#mybatis.type-aliases-package=com.xxl.job.admin.core.model
|
||||||
|
|
||||||
### xxl-job, datasource
|
### xxl-job, datasource
|
||||||
spring.datasource.url=jdbc:mysql://1.95.153.121:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
|
spring.datasource.url=jdbc:mysql://1.95.170.86:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||||
spring.datasource.username=xxl_job
|
spring.datasource.username=xxl_job
|
||||||
spring.datasource.password=zzkj@688737
|
spring.datasource.password=zzkj@688737
|
||||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
|||||||
67
xxl-job-admin/src/main/resources/application-prod.properties
Normal file
67
xxl-job-admin/src/main/resources/application-prod.properties
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
### web
|
||||||
|
server.port=8015
|
||||||
|
server.servlet.context-path=/job-admin
|
||||||
|
|
||||||
|
### actuator
|
||||||
|
management.server.servlet.context-path=/actuator
|
||||||
|
management.health.mail.enabled=false
|
||||||
|
|
||||||
|
spring.application.name=xxl-job-admin
|
||||||
|
###nacos
|
||||||
|
spring.cloud.nacos.discovery.server-addr=172.31.9.103:8848
|
||||||
|
### resources
|
||||||
|
spring.mvc.servlet.load-on-startup=0
|
||||||
|
spring.mvc.static-path-pattern=/static/**
|
||||||
|
spring.resources.static-locations=classpath:/static/
|
||||||
|
|
||||||
|
### freemarker
|
||||||
|
spring.freemarker.templateLoaderPath=classpath:/templates/
|
||||||
|
spring.freemarker.suffix=.ftl
|
||||||
|
spring.freemarker.charset=UTF-8
|
||||||
|
spring.freemarker.request-context-attribute=request
|
||||||
|
spring.freemarker.settings.number_format=0.##########
|
||||||
|
|
||||||
|
### mybatis
|
||||||
|
mybatis.mapper-locations=classpath:/mybatis-mapper/*Mapper.xml
|
||||||
|
#mybatis.type-aliases-package=com.xxl.job.admin.core.model
|
||||||
|
|
||||||
|
### xxl-job, datasource
|
||||||
|
spring.datasource.url=jdbc:mysql://172.31.35.125:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai
|
||||||
|
spring.datasource.username=xxl_job
|
||||||
|
spring.datasource.password=zzkj@688737
|
||||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||||
|
|
||||||
|
### datasource-pool
|
||||||
|
spring.datasource.type=com.zaxxer.hikari.HikariDataSource
|
||||||
|
spring.datasource.hikari.minimum-idle=10
|
||||||
|
spring.datasource.hikari.maximum-pool-size=30
|
||||||
|
spring.datasource.hikari.auto-commit=true
|
||||||
|
spring.datasource.hikari.idle-timeout=30000
|
||||||
|
spring.datasource.hikari.pool-name=HikariCP
|
||||||
|
spring.datasource.hikari.max-lifetime=900000
|
||||||
|
spring.datasource.hikari.connection-timeout=10000
|
||||||
|
spring.datasource.hikari.connection-test-query=SELECT 1
|
||||||
|
|
||||||
|
### xxl-job, email
|
||||||
|
spring.mail.host=smtp.qq.com
|
||||||
|
spring.mail.port=25
|
||||||
|
spring.mail.username=xxx@qq.com
|
||||||
|
spring.mail.password=xxx
|
||||||
|
spring.mail.properties.mail.smtp.auth=true
|
||||||
|
spring.mail.properties.mail.smtp.starttls.enable=true
|
||||||
|
spring.mail.properties.mail.smtp.starttls.required=true
|
||||||
|
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
|
||||||
|
|
||||||
|
### xxl-job, access token
|
||||||
|
xxl.job.accessToken=
|
||||||
|
|
||||||
|
### xxl-job, i18n (default is zh_CN, and you can choose "zh_CN", "zh_TC" and "en")
|
||||||
|
xxl.job.i18n=zh_CN
|
||||||
|
|
||||||
|
## xxl-job, triggerpool max size
|
||||||
|
xxl.job.triggerpool.fast.max=200
|
||||||
|
xxl.job.triggerpool.slow.max=100
|
||||||
|
|
||||||
|
### xxl-job, log retention days
|
||||||
|
xxl.job.logretentiondays=30
|
||||||
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
<configuration debug="false" scan="true" scanPeriod="1 seconds">
|
<configuration debug="false" scan="true" scanPeriod="1 seconds">
|
||||||
|
|
||||||
<contextName>logback</contextName>
|
<contextName>logback</contextName>
|
||||||
<property name="log.path" value="/data/applogs/xxl-job/xxl-job-admin.log"/>
|
<property name="log.path" value="/www/zzkjcloud/logs/xxl-job-admin/xxl-job-admin.log"/>
|
||||||
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
|
|||||||
@ -14,21 +14,9 @@ spring:
|
|||||||
redis:
|
redis:
|
||||||
port: 6379 #端口
|
port: 6379 #端口
|
||||||
timeout: 3000ms #连接超时
|
timeout: 3000ms #连接超时
|
||||||
host: 1.95.153.121 #单机
|
host: 1.95.170.86 #单机
|
||||||
password: zzkj@688737
|
password: 123456
|
||||||
database: 0
|
database: 0
|
||||||
|
|
||||||
#port: 6379 #端口
|
|
||||||
#timeout: 5000ms #连接超时
|
|
||||||
#host: 127.0.0.1 #单机
|
|
||||||
#password:
|
|
||||||
#database: 0
|
|
||||||
#集群 真实环境开启
|
|
||||||
# record:
|
|
||||||
# nodes:
|
|
||||||
# - 127.0.0.1:6379
|
|
||||||
# - 127.0.0.1:6380
|
|
||||||
# - 127.0.0.1:6381
|
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
max-active: 8 #连接池最大连接 默认8
|
max-active: 8 #连接池最大连接 默认8
|
||||||
@ -45,6 +33,6 @@ xxl:
|
|||||||
address:
|
address:
|
||||||
ip: 127.0.0.1
|
ip: 127.0.0.1
|
||||||
port: 9999
|
port: 9999
|
||||||
logpath: /home/hocloud/logs/xxl-job/
|
logpath: /www/zzkjcloud/logs/xxl-job/
|
||||||
logretentiondays: 30
|
logretentiondays: 30
|
||||||
|
|
||||||
|
|||||||
38
xxl-job/src/main/resources/application-prod.yml
Normal file
38
xxl-job/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
server:
|
||||||
|
port: 8016
|
||||||
|
|
||||||
|
spring:
|
||||||
|
jackson:
|
||||||
|
time-zone: GMT+8
|
||||||
|
application:
|
||||||
|
name: xxl-job
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 172.31.9.103:8848
|
||||||
|
#Redis
|
||||||
|
redis:
|
||||||
|
port: 6379 #端口
|
||||||
|
timeout: 3000ms #连接超时
|
||||||
|
host: 172.31.35.125 #单机
|
||||||
|
password: zzkj@688737
|
||||||
|
database: 0
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
max-active: 8 #连接池最大连接 默认8
|
||||||
|
max-idle: 8 #连接池中最大空闲连接 默认8
|
||||||
|
min-idle: 1 #连接池中最小空闲连接 默认0
|
||||||
|
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
|
||||||
|
xxl:
|
||||||
|
job:
|
||||||
|
admin:
|
||||||
|
addresses: http://127.0.0.1:8015/job-admin
|
||||||
|
accessToken:
|
||||||
|
executor:
|
||||||
|
appname: job-executor-sample
|
||||||
|
address:
|
||||||
|
ip: 127.0.0.1
|
||||||
|
port: 9999
|
||||||
|
logpath: /www/zzkjcloud/logs/xxl-job/
|
||||||
|
logretentiondays: 30
|
||||||
|
|
||||||
@ -9,9 +9,9 @@
|
|||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="rollingFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/xxl-job/xxl-job.log</file>
|
<file>/www/zzkjcloud/logs/xxl-job/xxl-job.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/xxl-job/xxl-job.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/xxl-job/xxl-job.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
@ -29,9 +29,9 @@
|
|||||||
|
|
||||||
<!--Error级别-->
|
<!--Error级别-->
|
||||||
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<appender name="errorFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
<file>/home/hocloud/logs/xxl-job/xxl-job-error.log</file>
|
<file>/www/zzkjcloud/logs/xxl-job/xxl-job-error.log</file>
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
<fileNamePattern>/home/hocloud/logs/xxl-job/xxl-job-error.%d{yyyy-MM-dd}-%i.log
|
<fileNamePattern>/www/zzkjcloud/logs/xxl-job/xxl-job-error.%d{yyyy-MM-dd}-%i.log
|
||||||
</fileNamePattern>
|
</fileNamePattern>
|
||||||
<!--180天-->
|
<!--180天-->
|
||||||
<maxHistory>10</maxHistory>
|
<maxHistory>10</maxHistory>
|
||||||
|
|||||||
Reference in New Issue
Block a user