Compare commits

...

8 Commits

Author SHA1 Message Date
805cad8cb9 添加测试机器sn 2025-07-21 13:55:32 +08:00
16aa6099ea 英文翻译 2025-07-15 09:43:30 +08:00
237f79a56f 英文翻译 2025-07-14 15:14:24 +08:00
2b70f531b4 代码修改 2025-07-09 08:43:36 +08:00
a853dafca3 配置修改 2025-07-08 19:00:35 +08:00
2164e77b5a 文件服务双发代码提交 2025-07-08 15:32:43 +08:00
3286204dc0 区分正式与测试配置修改 2025-07-04 21:19:07 +08:00
af7cc98d77 区分正式与测试配置修改 2025-06-30 16:48:50 +08:00
57 changed files with 1019 additions and 235 deletions

View File

@ -0,0 +1,58 @@
#网关
server:
port: 8001
spring:
application:
name: api-gateway
cloud:
nacos:
username: nacos
password: nacos
discovery:
server-addr: 192.168.0.142: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

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始

View File

@ -82,6 +82,7 @@ public class IargeScreenShowServiceImpl implements IargeScreenShowService {
private final static BigDecimal parameter = new BigDecimal("18.3");
private final static BigDecimal four = new BigDecimal("0.4");
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 BigDecimal hundred = new BigDecimal(100);
private final static int FENGStationId = 418;
@ -503,8 +504,8 @@ public class IargeScreenShowServiceImpl implements IargeScreenShowService {
//等效节约煤 等效节约煤=所有电站总充*节约标准煤转换系数(04)
BigDecimal equivalentCoal = totalCharge.multiply(four);
energySavingRespVo.setEquivalentCoal(equivalentCoal);
//等效经济收入 等效经济收入=所有电站总充*对应谷时电价
energySavingRespVo.setIncome(income);
//等效经济收入 等效经济收入=等效节约煤*煤价 (600元/吨) 等效节约煤此处单位为kg,故而单价调整为0.6元/kg
energySavingRespVo.setIncome(equivalentCoal.multiply(coalPrice));
return energySavingRespVo;
}

View File

@ -126,6 +126,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.12.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -20,9 +20,9 @@ spring:
server-addr: 127.0.0.1:8848
datasource:
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
username: root
password: 123456
url: jdbc:mysql://1.95.170.86:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
username: business_db
password: zzkj@688737
druid:
initialSize: 5
minIdle: 5
@ -33,40 +33,25 @@ spring:
redis:
port: 6379 #端口
timeout: 50000ms #连接超时
host: 192.168.100.242 #单机
host: 1.95.170.86 #单机
password: 123456
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:
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://192.168.0.236:9000
prefixUrl: http://192.168.0.236:9000
accessKey: minioadmin
secretKey: minioadmin
endpoint: http://1.95.170.86:9000
prefixUrl: http://1.95.170.86:9000
formula:
fieldmap:

View 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: 192.168.0.142:8848
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&allowMultiQueries=true
username: zzkj
password: zzkj@688737
druid:
initialSize: 5
minIdle: 5
maxActive: 5
keepAlive: true #保持长连接
connection-error-retry-attempts: 3
#Redis
redis:
port: 6379 #端口
timeout: 50000ms #连接超时
host: 192.168.0.236 #单机
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://192.168.0.236:9000
prefixUrl: http://192.168.0.236:9000
formula:
fieldmap:
RT_FIELD_BEAN: RT_FIELD_BEAN

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<!--180天-->
<maxHistory>10</maxHistory>
@ -29,9 +29,9 @@
<!--Error级别-->
<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">
<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>
<!--180天-->
<maxHistory>10</maxHistory>

View File

@ -221,6 +221,8 @@ public interface RedisKeyConstant {
String LOGIN_TYPE_ACCOUNT = "account";
//登陆方式 phone 手机号
String LOGIN_TYPE_PHONE = "phone";
// 语言切换
String LANG="lang";
}
//设备相关

View File

@ -140,6 +140,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.12.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -151,5 +154,4 @@
</plugins>
</build>
</project>

View File

@ -5,6 +5,7 @@ public class AnotherMqttConfigUtil {
public static String[] commonTopic = new String[]{
"+/device/27d83a2844ff5866",
"+/device/77ba753718908d1a",
"+/device/93372fa4f4c4ebcf",
"1/device/+"
};

View File

@ -114,7 +114,21 @@ public class MqttConfigUtil {
"+/device/5d4297256f02ebc2",
"+/device/67aa37e699e1e08f",
"+/device/ea0ebfbfa1487bd2",
"+/device/aa8a43d326dddb3f"
"+/device/aa8a43d326dddb3f",
"+/device/82d40d7dbcfc884e",
"+/device/34ee15e05a3133bc",
"+/device/ee2508ba91664376",
"+/device/48c18f2a756dcc28",
"+/device/056d38ac91f61ffd",
"+/device/60f2bbbc054bfa03",
"+/device/50fdebcf6eb85a49",
"+/device/227a752b9bfb6b02",
"+/device/d60a05bcd086f160",
"+/device/f3c813d5e3d7fd99",
"+/device/cd6cb4a64b42bda5",
"+/device/436de647bbf01b22",
"+/device/e9eee97d793756fa",
"+/device/8c062827b5c1548b"
};
/**

View File

@ -11,9 +11,9 @@ swagger2:
#mqtt
mqtt:
url: tcp://123.60.190.77:1883 # 线上环境MQTT
url: tcp://1.95.170.86:1883
userName: admin
passWord: public
passWord: zzkj688737
timeout: 5000
keepAlive: 60
@ -37,8 +37,6 @@ topic:
cloudControlRequest: +/cloud/+/control/request
edgeControlResponse: +/device/+/control/response
spring:
jackson:
time-zone: GMT+8
@ -50,12 +48,9 @@ spring:
server-addr: 127.0.0.1:8848
datasource:
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://192.168.100.244:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
#username: zzkj
username: root
#password: zzkj@688737
password: 123456
url: jdbc:mysql://1.95.170.86:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: business_db
password: zzkj@688737
druid:
initialSize: 5
minIdle: 5
@ -66,23 +61,9 @@ spring:
redis:
port: 6379 #端口
timeout: 3000ms #连接超时
#host: 1.95.153.121 #单机
host: 192.168.100.242 #单机
#password: zzkj@688737
host: 1.95.170.86 #单机
password: 123456
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:
pool:
max-active: 8 #连接池最大连接 默认8
@ -91,10 +72,10 @@ spring:
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
minio:
accessKey: admin
secretKey: zzkj@688737
endpoint: http://192.168.0.236:9000
prefixUrl: http://192.168.0.236:9000
accessKey: minioadmin
secretKey: minioadmin
endpoint: http://1.95.170.86:9000
prefixUrl: http://1.95.170.86:9000
#跳过登录true ,不跳过false
skipLogin: false

View 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://123.60.190.77:1883 # hz线上环境MQTT
userName: admin
passWord: public
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: 192.168.0.142:8848
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236:3306/business_db?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username: zzkj
password: zzkj@688737
druid:
initialSize: 5
minIdle: 5
maxActive: 5
keepAlive: true #保持长连接
connection-error-retry-attempts: 3
#Redis
redis:
port: 6379 #端口
timeout: 3000ms #连接超时
host: 192.168.0.236 #单机
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://192.168.0.236:9000
prefixUrl: http://192.168.0.236:9000
#跳过登录true ,不跳过false
skipLogin: false

View File

@ -53,7 +53,7 @@ largeScreen:
#mqtt接外部数据使用
mqtt1:
url: tcp://1.95.131.171:1883
userName: root
userName: admin
passWord: zzkj@688737
timeout: 5000
keepAlive: 60

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始
@ -28,9 +28,9 @@
<!--Error级别-->
<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">
<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>
<!--180天-->
<maxHistory>10</maxHistory>

View File

@ -205,6 +205,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.12.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

View File

@ -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;
}
}

View File

@ -13,9 +13,12 @@ import com.ho.common.tools.exception.BusinessException;
import com.ho.common.tools.exception.DataResult;
import com.ho.common.tools.service.RedisService;
import com.ho.common.tools.util.CommonBytesUtil;
import com.ho.common.tools.util.MqttUtil;
import com.ho.common.tools.util.PageResult;
import com.ho.filecenter.entity.MediaFile;
import com.ho.filecenter.service.AnotherFileService;
import com.ho.filecenter.service.FileService;
import com.ho.filecenter.util.MqttConfigUtil;
import com.ho.filecenter.vo.mqtt.*;
import com.ho.filecenter.vo.resp.*;
import io.swagger.annotations.Api;
@ -53,6 +56,8 @@ public class FileController {
@Autowired
CommonBytesUtil bytesUtil;
@Autowired
AnotherFileService anotherFileService;
@PostMapping("filePage")
@ApiOperation(value = "分页查询文件")
public DataResult<PageResult<MediaFile>> filePage(@RequestBody FilePageVO vo, HttpServletRequest request) {
@ -152,7 +157,13 @@ public class FileController {
fileAttributeResp.setList(new ArrayList<>());
return DataResult.success(fileAttributeResp);
}
fileAttributeResp = fileService.getFileAttribute(vo);
String serialNo = vo.getSerialNo();
List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileAttributeResp = fileService.getFileAttribute(vo);
}else{
fileAttributeResp = anotherFileService.getFileAttribute(vo);
}
return DataResult.success(fileAttributeResp);
}
@ -168,7 +179,13 @@ public class FileController {
fileDeleteResp.setMsg(msg + CommonConstant.Heartbeat.FAIL);
return DataResult.success(fileDeleteResp);
}
fileDeleteResp = fileService.deleteDeviceFiles(fileDeleteReqVO);
String serialNo = fileDeleteReqVO.getSerialNo();
List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileDeleteResp = fileService.deleteDeviceFiles(fileDeleteReqVO);
}else{
fileDeleteResp = anotherFileService.deleteDeviceFiles(fileDeleteReqVO);
}
return DataResult.success(fileDeleteResp);
}
@ -193,7 +210,12 @@ public class FileController {
resp.setMsg(CommonConstant.Heartbeat.MSG + serialNo + CommonConstant.Heartbeat.SUCCESS);
resp.setHeartbeatStatus(CommonConstant.ONE);
log.info("文件上传(向边端上传)开始上传");
fileService.fileUploadForDevice(file, stationId, serialNo, filePath);
List<String> snList = MqttConfigUtil.getSnList();
if(snList.stream().anyMatch(s -> s.contains(serialNo))){
fileService.fileUploadForDevice(file, stationId, serialNo, filePath);
}else{
anotherFileService.fileUploadForDevice(file, stationId, serialNo, filePath);
}
}
return DataResult.success(resp);
}
@ -217,6 +239,13 @@ public class FileController {
resp.setHeartbeatStatus(CommonConstant.ONE);
log.info("文件下载(从边端下载到云端)开始下载");
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);
}

View File

@ -18,7 +18,9 @@ import com.ho.common.tools.service.RedisService;
import com.ho.common.tools.util.PageResult;
import com.ho.filecenter.feignclient.BusinessFeignClient;
import com.ho.filecenter.feignclient.UserFeignClient;
import com.ho.filecenter.service.AnotherOrderSendService;
import com.ho.filecenter.service.OrderSendService;
import com.ho.filecenter.util.MqttConfigUtil;
import com.ho.filecenter.vo.mqtt.*;
import com.ho.filecenter.vo.resp.HeartbeatResp;
import com.ho.filecenter.vo.resp.OrderProcessDetailResp;
@ -60,6 +62,9 @@ public class OrderSendController {
@Autowired
UserFeignClient userFeignClient;
@Autowired
AnotherOrderSendService anotherOrderSendService;
public static final Long TIME_LIMIT = 90L;
@PostMapping("orderIssued")
@ -158,7 +163,12 @@ public class OrderSendController {
return DataResult.success(heartbeatResp);
}
log.info("指令下发正常开始下发");
orderSendService.orderIssued(vo);
List<String> snList = MqttConfigUtil.getSnList();
if(snList.contains(sn)){
orderSendService.orderIssued(vo);
}else{
anotherOrderSendService.orderIssued(vo);
}
if(vo.getPlanTemId() != null){
String hourValue ="";
String minuteValue ="";
@ -322,7 +332,14 @@ public class OrderSendController {
// @LogAnnotation(title = "命令下发曲线", action = "命令下发曲线")
@TokenIgnore
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);
}

View File

@ -0,0 +1,67 @@
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",
"+/device/93372fa4f4c4ebcf",
"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;
}
}

View File

@ -1,5 +1,8 @@
package com.ho.filecenter.util;
import java.util.Arrays;
import java.util.List;
public class MqttConfigUtil {
public static String[] commonTopic = new String[]{
@ -117,7 +120,21 @@ public class MqttConfigUtil {
"+/device/67aa37e699e1e08f",
"+/device/ea0ebfbfa1487bd2",
"+/device/aa8a43d326dddb3f",
"1/device/+"
"+/device/82d40d7dbcfc884e",
"+/device/34ee15e05a3133bc",
"+/device/ee2508ba91664376",
"+/device/48c18f2a756dcc28",
"+/device/056d38ac91f61ffd",
"+/device/60f2bbbc054bfa03",
"+/device/50fdebcf6eb85a49",
"+/device/227a752b9bfb6b02",
"+/device/d60a05bcd086f160",
"+/device/f3c813d5e3d7fd99",
"+/device/cd6cb4a64b42bda5",
"+/device/436de647bbf01b22",
"+/device/e9eee97d793756fa",
"+/device/8c062827b5c1548b"
};
/**
@ -163,4 +180,13 @@ public class MqttConfigUtil {
}
return str;
}
/**
* 获取SN配置合集
* @return
*/
public static List<String> getSnList(){
List<String> strings = Arrays.asList(commonTopic);
return strings;
}
}

View File

@ -7,13 +7,14 @@ server:
#mqtt
mqtt:
url: tcp://123.60.190.77:1883
url: tcp://1.95.170.86:1883
userName: admin
passWord: public
passWord: zzkj688737
timeout: 5000
keepAlive: 60
#主题 todo 先死一个用于测试
#主题 todo
topic:
cloudFileRequest: +/cloud/+/file/request
cloudFileResponse: +/cloud/+/file/response
@ -61,9 +62,9 @@ spring:
server-addr: 127.0.0.1:8848
datasource:
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
username: root
password: 123456
url: jdbc:mysql://1.95.170.86: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
@ -80,22 +81,9 @@ spring:
redis:
port: 6379 #端口
timeout: 3000ms #连接超时
host: 192.168.100.244 #单机
host: 1.95.170.86 #单机
password: 123456
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:
pool:
max-active: 8 #连接池最大连接 默认8
@ -104,8 +92,8 @@ spring:
max-wait: 2000ms #连接池最大阻塞等待时间 使用负值表示没有限制
minio:
accessKey: admin
secretKey: zzkj@688737
endpoint: http://192.168.0.236:9000
prefixUrl: http://192.168.0.236:9000
accessKey: minioadmin
secretKey: minioadmin
endpoint: http://1.95.170.86:9000
prefixUrl: http://1.95.170.86:9000

View File

@ -0,0 +1,98 @@
#文件中心
server:
port: 8017
servlet:
#上下文统一使用api,屏蔽前端路径差异
context-path: /api
#mqtt
mqtt:
url: tcp://123.60.190.77:1883 # hz线上环境MQTT
userName: admin
passWord: public
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: 192.168.0.142:8848
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236: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: 192.168.0.236 #单机
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://192.168.0.236:9000
prefixUrl: http://192.168.0.236:9000

View File

@ -78,3 +78,11 @@ switch:
fileDefaultLogic: true
#命令下发默认逻辑的开关 true 为打开 ,false为关闭
orderSendDefaultLogic: true
#mqtt接外部数据使用
mqtt1:
url: tcp://1.95.131.171:1883
userName: root
passWord: zzkj@688737
timeout: 5000
keepAlive: 60

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始

View File

@ -63,6 +63,9 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.12.RELEASE</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
<plugin>

View File

@ -17,9 +17,9 @@ spring:
server-addr: 127.0.0.1:8848
datasource:
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
username: root
password: 123456
url: jdbc:mysql://1.95.170.86: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
@ -31,21 +31,9 @@ spring:
redis:
port: 6379 #端口
timeout: 300000ms #连接超时
host: 192.168.100.244 #单机
host: 1.95.170.86 #单机
password: 123456
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:
pool:
max-active: 8 #连接池最大连接 默认8

View 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: 192.168.0.142:8848
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236: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: 192.168.0.236 #单机
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

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<!--180天-->
<maxHistory>7</maxHistory>
@ -29,9 +29,9 @@
<!--Error级别-->
<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">
<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>
<!--180天-->
<maxHistory>7</maxHistory>

30
pom.xml
View File

@ -166,11 +166,11 @@
<scope>provided</scope>
</dependency>
<!--JWT-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jjwt.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>io.jsonwebtoken</groupId>-->
<!-- <artifactId>jjwt</artifactId>-->
<!-- <version>${jjwt.version}</version>-->
<!-- </dependency>-->
<!--Lombok-->
<dependency>
<groupId>org.projectlombok</groupId>
@ -335,16 +335,16 @@
<version>${ip2region.version}</version>
</dependency>
<!-- skywalking 整合 logback -->
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-toolkit-logback-1.x</artifactId>
<version>${apm-toolkit.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-toolkit-trace</artifactId>
<version>${apm-toolkit.version}</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-logback-1.x</artifactId>-->
<!-- <version>${apm-toolkit.version}</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.skywalking</groupId>-->
<!-- <artifactId>apm-toolkit-trace</artifactId>-->
<!-- <version>${apm-toolkit.version}</version>-->
<!-- </dependency>-->
</dependencies>
</dependencyManagement>
<!--<build>

View File

@ -13,23 +13,9 @@ spring:
discovery:
server-addr: 127.0.0.1:8848
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
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
password: taosdata
druid:
@ -39,19 +25,12 @@ spring:
max-wait: 10000
time-between-eviction-runs-millis: 60000
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:
port: 6379 #端口
timeout: 3000ms #连接超时
host: 1.95.153.121 #单机
password: zzkj@688737
host: 1.95.170.86 #单机
password: 123456
database: 0
boot:

View 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: 192.168.0.142:8848
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
url: jdbc:TAOS-RS://192.168.0.236: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: 192.168.0.236 #单机
password: zzkj@688737
database: 0
boot:
admin:
client:
url: http://localhost:8019/boot

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始
@ -27,9 +27,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始

View File

@ -19,4 +19,8 @@ public class QueryPermissionReqVo {
@ApiModelProperty(value = "状态")
@ApiParam
Integer status;
@ApiModelProperty(value = "语言切换")
@ApiParam
String lang;
}

View File

@ -2,6 +2,7 @@ package com.ho.user.controller;
import com.ho.common.tools.annotation.LogAnnotation;
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.exception.BaseResponseCode;
import com.ho.common.tools.exception.BusinessException;
@ -16,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.List;
@ -47,10 +49,12 @@ public class DictController {
@PostMapping("typeList")
@ApiOperation(value = "查询字典列表接口(根据类型)")
// @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();
DictTypeAndLabelReqVO typeAndLabelReqVO = new DictTypeAndLabelReqVO();
typeAndLabelReqVO.setType(vo.getType());
typeAndLabelReqVO.setLang(lang);
result.setData(dictService.selectDict(typeAndLabelReqVO));
return result;
}
@ -75,9 +79,10 @@ public class DictController {
@PostMapping("typeAll")
@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();
result.setData(dictService.selectDictType());
result.setData(dictService.selectDictType(lang));
return result;
}

View File

@ -294,9 +294,10 @@ public class PermissionController {
public DataResult<List<PermissionRespNode>> getStationPer(@RequestBody PermStationRelation permStationRelation, HttpServletRequest request) {
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
String userTokenKey = RedisKeyConstant.User.TOKEN + token;
String lang=request.getHeader(RedisKeyConstant.User.LANG);
UserDetailRespVO user = (UserDetailRespVO) redisService.get(userTokenKey);
DataResult<List<PermissionRespNode>> result = DataResult.success();
result.setData(permissionService.getStationPer(permStationRelation.getStationId(),user));
result.setData(permissionService.getStationPer(permStationRelation.getStationId(),user,lang));
return result;
}
}

View File

@ -96,6 +96,7 @@ public class UserController {
public DataResult<UserDetailRespVO> yourSelfInfo(@RequestParam(required = false) String type,HttpServletRequest request) {
String token = request.getHeader(RedisKeyConstant.User.ACCESS_TOKEN);
String userTokenKey = RedisKeyConstant.User.TOKEN + token;
String lang =request.getHeader(RedisKeyConstant.User.LANG);
//根据用户的登陆方式(账号还是手机号),延长对应缓存
if (redisService.hasKey(userTokenKey)) {
//每次获取用户信息,都会进行过期时间的延长
@ -105,7 +106,7 @@ public class UserController {
if(null != type){
user.setConfigType(type);
}
UserDetailRespVO vo = userService.yourSelfInfo(user, simpleUser.getPlatSuper());
UserDetailRespVO vo = userService.yourSelfInfo(user, simpleUser.getPlatSuper(),lang);
//延长token时间
//redisCommon.extendKeyTime(userTokenKey, null);
//String userNameKey = RedisKeyConstant.User.USER_NAME + user.getUsername();

View File

@ -39,7 +39,7 @@ public interface SysDictMapper {
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);

View File

@ -50,5 +50,5 @@ public interface SysPermissionMapper {
List<SysPermission> selectByScope();
List<SysPermission> selectByIds(@Param("ids") List<Integer> perIds);
List<SysPermission> selectByIds(@Param("ids") List<Integer> perIds,@Param("lang") String lang);
}

View File

@ -34,11 +34,11 @@ public interface DictService {
// void deletedByType(String type);
List<DictRespVo> selectDictType();
List<DictRespVo> selectDictType(String lang);
SysSubDict selectSubDictByValue(DictAddReqVO vo);
List<SysSubDict> selectSubDictByType(String type);
List<SysSubDict> selectSubDictByType(String type,String lang);
List<SysSubDict> selectSubDictByTypeList(List<String> typeList);

View File

@ -25,7 +25,7 @@ public interface PermissionService {
List<SysPermission> getPermission(String userId);
List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds);
List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds,String lang);
List<SysPermission> getPermissionByTop();
@ -66,7 +66,7 @@ public interface PermissionService {
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);
}

View File

@ -75,7 +75,7 @@ public interface UserService {
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);

View File

@ -65,7 +65,7 @@ public class DictServiceImpl implements DictService {
}
int upDictRet = dictMapper.updateDict(dict);
log.info("修改sys_dict记录数:" + upDictRet);
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType());
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType(),null);
int upSubDictRet = 0;
for (SysSubDict sysSubDict : sysSubDicts) {
sysSubDict.setType(vo.getType());
@ -96,7 +96,7 @@ public class DictServiceImpl implements DictService {
SysSubDict subDict = new SysSubDict();
BeanUtils.copyProperties(vo,subDict);
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType());
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType(),null);
if (sysSubDicts.size() == 0){
throw new BusinessException(BaseResponseCode.DICT_DELETED_EXISTS);
}
@ -150,8 +150,8 @@ public class DictServiceImpl implements DictService {
}
@Override
public List<SysSubDict> selectSubDictByType(String type) {
List<SysSubDict> sysSubDicts = dictMapper.selectSubDictByType(type);
public List<SysSubDict> selectSubDictByType(String type,String lang) {
List<SysSubDict> sysSubDicts = dictMapper.selectSubDictByType(type,lang);
return sysSubDicts;
}
@ -166,7 +166,7 @@ public class DictServiceImpl implements DictService {
SysDict sysDict = dictMapper.selectByType(vo.getType());
DictRespVo dictRespVo = new DictRespVo();
BeanUtils.copyProperties(sysDict,dictRespVo);
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType());
List<SysSubDict> sysSubDicts = selectSubDictByType(vo.getType(),vo.getLang());
dictRespVo.setList(sysSubDicts);
return dictRespVo;
}
@ -190,13 +190,13 @@ public class DictServiceImpl implements DictService {
}*/
@Override
public List<DictRespVo> selectDictType() {
public List<DictRespVo> selectDictType(String lang) {
List<SysDict> sysDicts = dictMapper.selectTypeAll();
List<DictRespVo> respVos = new ArrayList<>();
for (SysDict sysDict : sysDicts) {
DictRespVo vo = new DictRespVo();
BeanUtils.copyProperties(sysDict,vo);
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType());
List<SysSubDict> sysSubDicts = selectSubDictByType(sysDict.getType(),lang);
vo.setList(sysSubDicts);
respVos.add(vo);
}

View File

@ -91,12 +91,13 @@ public class PermissionServiceImpl implements PermissionService {
//根据roleIds查询菜单
@Override
public List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds) {
public List<SysPermission> getPermissionByRoleIds(List<Integer> roleIds,String lang) {
List<Integer> permissionIds = rolePermissionService.getPermissionIdsByRoles(roleIds);
if (permissionIds.isEmpty()) {
return new ArrayList<>();
}
QueryPermissionReqVo query = new QueryPermissionReqVo();
query.setLang(lang);
List<SysPermission> result = sysPermissionMapper.selectInfoByIds(query, permissionIds);
return result;
}
@ -1120,21 +1121,21 @@ public class PermissionServiceImpl implements PermissionService {
}
@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<Integer> roleIds = user.getRoleIds();
List<SysPermission> userPermissions = new ArrayList<>();
if (!roleIds.isEmpty()) {
//到关联表中根据角色id 拿到对应的菜单id
List<SysPermission> result = getPermissionByRoleIds(roleIds);
List<SysPermission> result = getPermissionByRoleIds(roleIds,lang);
List<Integer> perIds = result.stream().map(s -> {
return s.getId();
}
).collect(Collectors.toList());
// List<Integer> permissionIdsByRoles = rolePermissionService.getPermissionIdsByRoles(roleIds);
//根据菜单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());
}
@ -1147,7 +1148,7 @@ public class PermissionServiceImpl implements PermissionService {
}
).collect(Collectors.toList());
if (!perIds.isEmpty()) {
permissions = selectByIds(perIds);
permissions = selectByIds(perIds,lang);
}
if (permissions.isEmpty()) {
list = userPermissions;
@ -1178,8 +1179,8 @@ public class PermissionServiceImpl implements PermissionService {
return tree;
}
private List<SysPermission> selectByIds(List<Integer> perIds){
List<SysPermission> sysPermissions = sysPermissionMapper.selectByIds(perIds);
private List<SysPermission> selectByIds(List<Integer> perIds,String lang){
List<SysPermission> sysPermissions = sysPermissionMapper.selectByIds(perIds,lang);
return sysPermissions;
}
}

View File

@ -115,13 +115,13 @@ public class UserServiceImpl implements UserService {
private String env;
@Override
public UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper) {
public UserDetailRespVO yourSelfInfo(UserDetailRespVO user, boolean platSuper,String lang) {
if (user.getRoleIds() == null) {
//该用户无有效角色
throw new BusinessException(BaseResponseCode.USER_DOES_NOT_VALID_ROLE);
}
//根据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<>();
@ -890,7 +890,7 @@ public class UserServiceImpl implements UserService {
}
//非超管,查询角色该有的
else {
permissions = permissionService.getPermissionByRoleIds(roleIds);
permissions = permissionService.getPermissionByRoleIds(roleIds,null);
}
if (permissions.isEmpty()) {
userDetail.setMenuList(new ArrayList<>());
@ -1115,7 +1115,7 @@ public class UserServiceImpl implements UserService {
@Override
public Map<String, String> checkSpecialUser() {
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) {
userMap.put(sysSub.getValue(),sysSub.getValue());
}
@ -1125,7 +1125,7 @@ public class UserServiceImpl implements UserService {
@Override
public Map<String, String> getSysSubDict(SysSubDictVO vo) {
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) {
if(CommonConstant.ONE.equals(vo.getKeyVal())){
userMap.put(sysSub.getLabel(),sysSub.getValue());

View File

@ -20,4 +20,7 @@ public class DictTypeAndLabelReqVO {
@ApiModelProperty(value = "字典value类型")
@NotBlank(message = "字典value类型不能为空")
private String value;
@ApiModelProperty(value = "中英切换")
private String lang;
}

View File

@ -21,7 +21,7 @@ spring:
server-addr: 127.0.0.1:8848
datasource:
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
password: zzkj@688737
druid:
@ -38,21 +38,9 @@ spring:
redis:
port: 6379 #端口
timeout: 3000ms #连接超时
host: 1.95.153.121 #单机
password: zzkj@688737
host: 1.95.170.86 #单机
password: 123456
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:
pool:
max-active: 8 #连接池最大连接 默认8

View 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: 192.168.0.142:8848
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.0.236: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: 192.168.0.236 #单机
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}$

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始
@ -27,9 +27,9 @@
</appender>
<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">
<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>
<maxHistory>10</maxHistory>
<!-- 除按日志记录之外还配置了日志文件不能超过2M若超过2M日志文件会以索引0开始

View File

@ -9,6 +9,9 @@
<sql id="Base_Column_DictSubList">
id,label, type,`value`, sort, `desc`,create_time, update_time, deleted
</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
@ -81,7 +84,14 @@
<select id="selectSubDictByType" resultType="com.ho.user.api.entity.SysSubDict">
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
where
type = #{type}

View File

@ -8,6 +8,12 @@
update_time, deleted, `scope`,is_config ,component, menu_name
</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"
resultType="com.ho.common.tools.entity.SysPermission">
select
@ -278,7 +284,14 @@
<select id="selectInfoByIds" resultType="com.ho.common.tools.entity.SysPermission">
select
<include refid="Base_Column_List"></include>
<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>
</otherwise>
</choose>
from sys_permission
<where>
and deleted = 1
@ -408,7 +421,14 @@
<select id="selectByIds" resultType="com.ho.common.tools.entity.SysPermission">
select
<include refid="Base_Column_List"></include>
<choose>
<when test="lang != null and lang=='en_US' ">
<include refid="Base_Column_List1"></include>
</when>
<otherwise>
<include refid="Base_Column_List"></include>
</otherwise>
</choose>
from sys_permission
<where>
<if test="ids != null and ids.size != 0">

View File

@ -26,7 +26,7 @@ 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://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.password=zzkj@688737
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

View 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=192.168.0.142: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://192.168.0.236: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

View File

@ -14,21 +14,9 @@ spring:
redis:
port: 6379 #端口
timeout: 3000ms #连接超时
host: 1.95.153.121 #单机
password: zzkj@688737
host: 1.95.170.86 #单机
password: 123456
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:
pool:
max-active: 8 #连接池最大连接 默认8
@ -45,6 +33,6 @@ xxl:
address:
ip: 127.0.0.1
port: 9999
logpath: /home/hocloud/logs/xxl-job/
logpath: /www/zzkjcloud/logs/xxl-job/
logretentiondays: 30

View File

@ -0,0 +1,38 @@
server:
port: 8016
spring:
jackson:
time-zone: GMT+8
application:
name: xxl-job
cloud:
nacos:
discovery:
server-addr: 192.168.0.142:8848
#Redis
redis:
port: 6379 #端口
timeout: 3000ms #连接超时
host: 192.168.0.236 #单机
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: /home/hocloud/logs/xxl-job/
logretentiondays: 30

View File

@ -9,9 +9,9 @@
</appender>
<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">
<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>
<!--180天-->
<maxHistory>10</maxHistory>
@ -29,9 +29,9 @@
<!--Error级别-->
<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">
<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>
<!--180天-->
<maxHistory>10</maxHistory>