Browse Source

导出数量抽到配置文件去

zhc
review512jwy@163.com 2 weeks ago
parent
commit
ebc2fb5e47
  1. 2
      dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java
  2. 6
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java
  3. 6
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java
  4. 6
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataBaStatusController.java
  5. 6
      dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java
  6. 38
      dongjian-dashboard-back-controller/src/main/resources/config/application.properties

2
dongjian-dashboard-back-common/src/main/java/com/dongjian/dashboard/back/common/Constants.java

@ -13,7 +13,7 @@ public class Constants {
public static final ZoneId ZONE_TOKYO = ZoneId.of("Asia/Tokyo"); public static final ZoneId ZONE_TOKYO = ZoneId.of("Asia/Tokyo");
public static final DateTimeFormatter FORMATTER_YMDHMS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); public static final DateTimeFormatter FORMATTER_YMDHMS = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
public static final int EXPORT_PAGE_SIZE = 600; // public static final int EXPORT_PAGE_SIZE = 600;
//这个很重要,不要随便动 //这个很重要,不要随便动
public static final String DES_SALT = "ci3b512jwy199511"; public static final String DES_SALT = "ci3b512jwy199511";

6
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAccumulateController.java

@ -33,6 +33,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException; import java.io.IOException;
@ -54,6 +55,9 @@ public class DeviceDataAccumulateController {
private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class); private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class);
@Value("${export.page.size}")
private Integer EXPORT_PAGE_SIZE;
@Autowired @Autowired
private DeviceDataAccumulateService deviceDataAccumulateService; private DeviceDataAccumulateService deviceDataAccumulateService;
@Autowired @Autowired
@ -104,7 +108,7 @@ public class DeviceDataAccumulateController {
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// ===== 固定导出分页大小===== // ===== 固定导出分页大小=====
pageSearchParam.setPageSize(Constants.EXPORT_PAGE_SIZE); pageSearchParam.setPageSize(EXPORT_PAGE_SIZE);
// ===== 构建 Excel ===== // ===== 构建 Excel =====
List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceAccumulateDataDTO.class, LanguageType); List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceAccumulateDataDTO.class, LanguageType);

6
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataAlarmController.java

@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException; import java.io.IOException;
@ -56,6 +57,9 @@ public class DeviceDataAlarmController {
private static final Logger logger = LoggerFactory.getLogger(DeviceDataAlarmController.class); private static final Logger logger = LoggerFactory.getLogger(DeviceDataAlarmController.class);
@Value("${export.page.size}")
private Integer EXPORT_PAGE_SIZE;
@Autowired @Autowired
private DeviceDataAlarmService deviceDataAlarmService; private DeviceDataAlarmService deviceDataAlarmService;
@ -104,7 +108,7 @@ public class DeviceDataAlarmController {
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// ===== 固定导出分页大小 ===== // ===== 固定导出分页大小 =====
pageSearchParam.setPageSize(Constants.EXPORT_PAGE_SIZE); pageSearchParam.setPageSize(EXPORT_PAGE_SIZE);
// ===== 构建 Excel ===== // ===== 构建 Excel =====
List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceAlarmDataDTO.class, LanguageType); List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceAlarmDataDTO.class, LanguageType);

6
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataBaStatusController.java

@ -32,6 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException; import java.io.IOException;
@ -53,6 +54,9 @@ public class DeviceDataBaStatusController {
private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class); private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class);
@Value("${export.page.size}")
private Integer EXPORT_PAGE_SIZE;
@Autowired @Autowired
private DeviceDataBaStatusService deviceDataBaStatusService; private DeviceDataBaStatusService deviceDataBaStatusService;
@Autowired @Autowired
@ -103,7 +107,7 @@ public class DeviceDataBaStatusController {
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// ===== 固定导出分页大小 ===== // ===== 固定导出分页大小 =====
pageSearchParam.setPageSize(Constants.EXPORT_PAGE_SIZE); pageSearchParam.setPageSize(EXPORT_PAGE_SIZE);
// ===== 构建 Excel ===== // ===== 构建 Excel =====
List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceBaStatusDataDTO.class, LanguageType); List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceBaStatusDataDTO.class, LanguageType);

6
dongjian-dashboard-back-controller/src/main/java/com/dongjian/dashboard/back/controller/DeviceDataMeasureController.java

@ -32,6 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException; import java.io.IOException;
@ -53,6 +54,9 @@ public class DeviceDataMeasureController {
private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class); private static final Logger logger = LoggerFactory.getLogger(DeviceDataAccumulateController.class);
@Value("${export.page.size}")
private Integer EXPORT_PAGE_SIZE;
@Autowired @Autowired
private DeviceDataMeasureService deviceDataMeasureService; private DeviceDataMeasureService deviceDataMeasureService;
@Autowired @Autowired
@ -103,7 +107,7 @@ public class DeviceDataMeasureController {
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// ===== 固定导出分页大小 ===== // ===== 固定导出分页大小 =====
pageSearchParam.setPageSize(Constants.EXPORT_PAGE_SIZE); pageSearchParam.setPageSize(EXPORT_PAGE_SIZE);
// ===== 构建 Excel ===== // ===== 构建 Excel =====
List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceMeasureDataDTO.class, LanguageType); List<List<String>> head = LanguageDynamicHeaderAdapter.buildHead(ExportDeviceMeasureDataDTO.class, LanguageType);

38
dongjian-dashboard-back-controller/src/main/resources/config/application.properties

@ -10,7 +10,7 @@ spring.datasource.admin.name=data_center_aeon_admin
spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} spring.datasource.admin.url=jdbc:mysql://${datasourceDNS}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
spring.datasource.admin.username=${datasourceUsername} spring.datasource.admin.username=${datasourceUsername}
spring.datasource.admin.password=${datasourcePassword} spring.datasource.admin.password=${datasourcePassword}
#使用druid数据源 #使用druid数据源
spring.datasource.admin.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.admin.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.admin.driverClassName=com.mysql.jdbc.Driver spring.datasource.admin.driverClassName=com.mysql.jdbc.Driver
spring.datasource.admin.hikari.driverClassName=com.mysql.jdbc.Driver spring.datasource.admin.hikari.driverClassName=com.mysql.jdbc.Driver
@ -23,7 +23,7 @@ dynamic.jdbc.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.a
spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone} spring.datasource.url=jdbc:mysql://${datasourceDNS:rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306}/data_center_aeon_admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=${datasourceTimeZone}
# Aurora 数据源配置 # Aurora 数据源配置
spring.aurora.datasource.url=${auroraUrl:jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_aeon_admin} spring.aurora.datasource.url=${auroraUrl:jdbc:mysql://rm-bp11k2zm2fr7864428o.mysql.rds.aliyuncs.com:3306/data_center_aeon_admin}
spring.aurora.datasource.username=${auroraUser:zhc} spring.aurora.datasource.username=${auroraUser:zhc}
spring.aurora.datasource.password=${auroraPass:Youqu48bnb1} spring.aurora.datasource.password=${auroraPass:Youqu48bnb1}
@ -33,11 +33,11 @@ spring.aurora.datasource.maximum-pool-size=${auroraMaxPool:30}
spring.aurora.datasource.connection-timeout=${auroraConnTimeout:30000} spring.aurora.datasource.connection-timeout=${auroraConnTimeout:30000}
#配置log日志 #配置log日志
logging.config=classpath:config/logback-boot.xml logging.config=classpath:config/logback-boot.xml
logging_level=${loggingLevel} logging_level=${loggingLevel}
logging_path=${loggingPath} logging_path=${loggingPath}
#部署时使用SYSLOG #部署时使用SYSLOG
logging_appender=${loggingAppender} logging_appender=${loggingAppender}
logging_maxHistory=${loggingMaxHistory:7} logging_maxHistory=${loggingMaxHistory:7}
logging_maxFileSize=100MB logging_maxFileSize=100MB
@ -45,38 +45,38 @@ mybatis_log_level=${mybatisLogLevel}
user.login.keytimeout=360000 user.login.keytimeout=360000
#集群模式cluster #集群模式cluster
spring.redis.cluster.nodes=192.168.0.30:7000,192.168.0.30:7001 spring.redis.cluster.nodes=192.168.0.30:7000,192.168.0.30:7001
#跨集群执行命令时要遵循的最大重定向数量 #跨集群执行命令时要遵循的最大重定向数量
spring.redis.cluster.max-redirects=3 spring.redis.cluster.max-redirects=3
#哨兵模式sentinel #哨兵模式sentinel
spring.redis.sentinel.master=mymaster spring.redis.sentinel.master=mymaster
spring.redis.sentinel.nodes=192.168.0.30:16379,192.168.0.30:16379 spring.redis.sentinel.nodes=192.168.0.30:16379,192.168.0.30:16379
#单机模式standalone #单机模式standalone
spring.redis.host=${redisHost} spring.redis.host=${redisHost}
spring.redis.port=6379 spring.redis.port=6379
spring.redis.password=${redisPassword} spring.redis.password=${redisPassword}
spring.redis.timeout=5000 spring.redis.timeout=5000
#Redis数据库索引(默认为0) #Redis数据库索引(默认为0)
spring.redis.database=0 spring.redis.database=0
#配置启动模式cluster、sentinel、standalone #配置启动模式cluster、sentinel、standalone
spring.redis.mode=standalone spring.redis.mode=standalone
# Lettuce # Lettuce
# 连接池最大连接数(使用负值表示没有限制) # 连接池最大连接数(使用负值表示没有限制)
spring.redis.lettuce.pool.max-active=8 spring.redis.lettuce.pool.max-active=8
# 连接池最大阻塞等待时间(使用负值表示没有限制) # 连接池最大阻塞等待时间(使用负值表示没有限制)
spring.redis.lettuce.pool.max-wait=100 spring.redis.lettuce.pool.max-wait=100
# 连接池中的最大空闲连接 # 连接池中的最大空闲连接
spring.redis.lettuce.pool.max-idle=8 spring.redis.lettuce.pool.max-idle=8
# 连接池中的最 小空闲连接 # 连接池中的最 小空闲连接
spring.redis.lettuce.pool.min-idle=0 spring.redis.lettuce.pool.min-idle=0
# 关闭超时时间 # 关闭超时时间
spring.redis.lettuce.shutdown-timeout=100 spring.redis.lettuce.shutdown-timeout=100
#邮件发送信息 #邮件发送信息
mail.smtp.host=email-smtp.ap-northeast-1.amazonaws.com mail.smtp.host=email-smtp.ap-northeast-1.amazonaws.com
mail.smtp.port=465 mail.smtp.port=465
mail.smtp.auth=true mail.smtp.auth=true
@ -91,9 +91,9 @@ mail.send.switch=true
Spring.mvc.hiddenmethod.filter.enabled=true Spring.mvc.hiddenmethod.filter.enabled=true
#单个文件上传发大小 #单个文件上传发大小
spring.servlet.multipart.max-file-size=20MB spring.servlet.multipart.max-file-size=20MB
#多个文件上传的共大小不得超过100M #多个文件上传的共大小不得超过100M
spring.servlet.multipart.max-request-size=100MB spring.servlet.multipart.max-request-size=100MB
server.servlet.context-path=/api server.servlet.context-path=/api
@ -128,3 +128,5 @@ ai.api_base=${aiApiBase:https://pdf-demo-stg.ttkdatatechbuild.com/api}
oidc.issuer = ${oidcIssuer:https://dongjian.southwave.tech/api} oidc.issuer = ${oidcIssuer:https://dongjian.southwave.tech/api}
oidc.bimviewer-url = ${oidcBimviewerUrl:https://bimviewer-stg.ttkdatatechbuild.com/TTNB} oidc.bimviewer-url = ${oidcBimviewerUrl:https://bimviewer-stg.ttkdatatechbuild.com/TTNB}
oidc.bimviewer-cognito-auth-host = ${oidcBimviewerCognitoAuthHost:https://bimviewer-stg.auth.ap-northeast-1.amazoncognito.com} oidc.bimviewer-cognito-auth-host = ${oidcBimviewerCognitoAuthHost:https://bimviewer-stg.auth.ap-northeast-1.amazoncognito.com}
export.page.size = ${exportPageSize:600}
Loading…
Cancel
Save