feat(device): 新增批量PDF导出功能并更新服务配置

- 新增BatchExportRequest和BatchPdfWrapper数据传输对象
- 实现DeviceInstallInfoController中的getPdfBatch接口支持批量PDF下载
- 添加ExportTask类用于管理导出任务状态
- 配置PDFGenerator工具类的批量处理功能
- 注入ExecutorService线程池支持异步任务执行
- 更新application-dev.yml中的数据库、ES和Redis连接地址
- 调整Hibernate SQL日志输出配置
- 优化PDF生成过程中的压缩和文件名处理
- 在告警消息中增加设备位置信息
master
alsszer 4 weeks ago
parent 34c2a5f8b4
commit 4812cc8407

@ -53,16 +53,14 @@ public class PDFGenerator {
private static final float CELL_PADDING = 5; private static final float CELL_PADDING = 5;
private static final float[] COLUMN_WIDTHS = {LEFT_COL_WIDTH, RIGHT_COL_WIDTH}; private static final float[] COLUMN_WIDTHS = {LEFT_COL_WIDTH, RIGHT_COL_WIDTH};
private static final float MIN_IMAGE_HEIGHT = 50; private static final float MIN_IMAGE_HEIGHT = 50;
public static void generateInstallationPDF(DeviceInstallInfo entity, OutputStream outputStream) throws IOException {
// 首先生成PDF内容到字节数组
ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
public static void generateInstallationPDFBytes(DeviceInstallInfo entity, ByteArrayOutputStream outputStream) throws IOException {
try (PDDocument document = new PDDocument()) { try (PDDocument document = new PDDocument()) {
// 加载字体(需替换实际路径) // 加载字体
// PDType0Font font = PDType0Font.load(document, new File("D:\\NotoSansCJK-Regular.ttf")); // PDType0Font font = PDType0Font.load(document, new File("D:\\NotoSansCJK-Regular.ttf"));
//PDType0Font font = PDType0Font.load(document, new File("/ttf/simsun.ttf"));
PDType0Font font = PDType0Font.load(document, new File("/ttf/NotoSansCJK-Regular.ttf")); PDType0Font font = PDType0Font.load(document, new File("/ttf/NotoSansCJK-Regular.ttf"));
// 初始化第一页 // 初始化第一页
PDPage currentPage = new PDPage(PDRectangle.A4); PDPage currentPage = new PDPage(PDRectangle.A4);
document.addPage(currentPage); document.addPage(currentPage);
@ -78,13 +76,11 @@ public class PDFGenerator {
// 2. 绘制基本信息表格 // 2. 绘制基本信息表格
String[][] baseData = { String[][] baseData = {
// {"公司名称", entity.getCorporateName()},
{"申请时间", entity.getProposerTime().toString()}, {"申请时间", entity.getProposerTime().toString()},
{"申请人", entity.getProposer()}, {"申请人", entity.getProposer()},
{"申请人班组", entity.getProposerTeam()}, {"申请人班组", entity.getProposerTeam()},
{"小区名字", entity.getCommunityName()}, {"小区名字", entity.getCommunityName()},
{"用户姓名", entity.getUserName()}, {"用户姓名", entity.getUserName()},
// {"用户姓名", entity.getUserName()+"-" + entity.getCommunityName()+entity.getBuildingUnit()+entity.getRoomNo()},
{"电话", entity.getUserIpone()}, {"电话", entity.getUserIpone()},
{"楼栋单元号", entity.getBuildingUnit()}, {"楼栋单元号", entity.getBuildingUnit()},
{"房间号", entity.getRoomNo()}, {"房间号", entity.getRoomNo()},
@ -92,14 +88,11 @@ public class PDFGenerator {
{"切断阀编号", entity.getShutValueNumber()}, {"切断阀编号", entity.getShutValueNumber()},
{"燃气表号", entity.getGasMeterNumber()}, {"燃气表号", entity.getGasMeterNumber()},
{"备注", entity.getBuildingUnit()} {"备注", entity.getBuildingUnit()}
}; };
drawTable(cs, font, TABLE_MARGIN, currentY, baseData, COLUMN_WIDTHS); drawTable(cs, font, TABLE_MARGIN, currentY, baseData, COLUMN_WIDTHS);
currentY -= (ROW_HEIGHT * baseData.length) + 20f; currentY -= (ROW_HEIGHT * baseData.length) + 20f;
// @ApiModelProperty(value = "安装前图片")
// 创建后续页面 - 图片部分 // 3. 图片处理(带自动分页)
// 图片处理(带自动分页)
// 图片处理(带自动分页)
List<String[]> imageGroups = Arrays.asList( List<String[]> imageGroups = Arrays.asList(
new String[]{entity.getDeviceInfoImage(), "设备信息图片"}, new String[]{entity.getDeviceInfoImage(), "设备信息图片"},
new String[]{entity.getBeforeInstallationImage(), "安装前图片"}, new String[]{entity.getBeforeInstallationImage(), "安装前图片"},
@ -184,37 +177,201 @@ public class PDFGenerator {
} }
} }
} }
} finally { } finally {
cs.close(); cs.close();
} }
// 将PDF保存到ByteArrayOutputStream
document.save(pdfBaos);
// ByteArrayOutputStream baos = new ByteArrayOutputStream(); // 将PDF保存到输出流
// document.save(baos); document.save(outputStream);
// outputStream.flush(); }
// baos.writeTo(outputStream); }
public static void generateInstallationPDF(DeviceInstallInfo entity, OutputStream outputStream) throws IOException {
ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
generateInstallationPDFBytes(entity, pdfBaos);
} // 创建ZIP压缩包
// 创建ZIP压缩包并将PDF写入输出流
try (ZipOutputStream zipOut = new ZipOutputStream(outputStream)) { try (ZipOutputStream zipOut = new ZipOutputStream(outputStream)) {
// 设置最高压缩级别
zipOut.setLevel(Deflater.BEST_COMPRESSION); zipOut.setLevel(Deflater.BEST_COMPRESSION);
// 创建ZIP条目
ZipEntry entry = new ZipEntry(entity.getUserName() + entity.getCommunityName() + entity.getBuildingUnit() + entity.getRoomNo() + ".pdf"); ZipEntry entry = new ZipEntry(entity.getUserName() + entity.getCommunityName() + entity.getBuildingUnit() + entity.getRoomNo() + ".pdf");
zipOut.putNextEntry(entry); zipOut.putNextEntry(entry);
// 将PDF数据写入ZIP
byte[] pdfBytes = pdfBaos.toByteArray(); byte[] pdfBytes = pdfBaos.toByteArray();
zipOut.write(pdfBytes, 0, pdfBytes.length); zipOut.write(pdfBytes, 0, pdfBytes.length);
// 关闭当前条目
zipOut.closeEntry(); zipOut.closeEntry();
} }
} }
// 辅助方法:生成文件名
public static String generateFileName(DeviceInstallInfo entity) {
return entity.getUserName() + entity.getCommunityName() +
entity.getBuildingUnit() + entity.getRoomNo() + ".pdf";
}
// public static void generateInstallationPDF(DeviceInstallInfo entity, OutputStream outputStream) throws IOException {
//
// // 首先生成PDF内容到字节数组
// ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
//
// try (PDDocument document = new PDDocument()) {
// // 加载字体(需替换实际路径)
//// PDType0Font font = PDType0Font.load(document, new File("D:\\NotoSansCJK-Regular.ttf"));
// //PDType0Font font = PDType0Font.load(document, new File("/ttf/simsun.ttf"));
// PDType0Font font = PDType0Font.load(document, new File("/ttf/NotoSansCJK-Regular.ttf"));
// // 初始化第一页
// PDPage currentPage = new PDPage(PDRectangle.A4);
// document.addPage(currentPage);
// PDPageContentStream cs = new PDPageContentStream(document, currentPage);
// float currentY = PDRectangle.A4.getHeight() - TABLE_MARGIN;
//
// try {
// // 1. 绘制标题(居中)
// drawCenteredText(cs, font, FONT_SIZE+10,
// "安装信息录入表",
// PDRectangle.A4.getWidth()/2, currentY);
// currentY -= ROW_HEIGHT * 1.5f;
//
// // 2. 绘制基本信息表格
// String[][] baseData = {
// // {"公司名称", entity.getCorporateName()},
// {"申请时间", entity.getProposerTime().toString()},
// {"申请人", entity.getProposer()},
// {"申请人班组", entity.getProposerTeam()},
// {"小区名字", entity.getCommunityName()},
// {"用户姓名", entity.getUserName()},
// // {"用户姓名", entity.getUserName()+"-" + entity.getCommunityName()+entity.getBuildingUnit()+entity.getRoomNo()},
// {"电话", entity.getUserIpone()},
// {"楼栋单元号", entity.getBuildingUnit()},
// {"房间号", entity.getRoomNo()},
// {"报警器编号", entity.getDeviceName()},
// {"切断阀编号", entity.getShutValueNumber()},
// {"燃气表号", entity.getGasMeterNumber()},
// {"备注", entity.getBuildingUnit()}
//
// };
// drawTable(cs, font, TABLE_MARGIN, currentY, baseData, COLUMN_WIDTHS);
// currentY -= (ROW_HEIGHT * baseData.length) + 20f;
//// @ApiModelProperty(value = "安装前图片")
// // 创建后续页面 - 图片部分
// // 图片处理(带自动分页)
// // 图片处理(带自动分页)
// List<String[]> imageGroups = Arrays.asList(
// new String[]{entity.getDeviceInfoImage(), "设备信息图片"},
// new String[]{entity.getBeforeInstallationImage(), "安装前图片"},
// new String[]{entity.getWorkingOfTheDetectorImage(), "安装完成探测器工作图片"},
// new String[]{entity.getSideLeakageImage(), "测漏图片"},
// new String[]{entity.getFormSideLeakageImage(), "泡沫水测漏图片"},
// new String[]{entity.getIgnitionPictureImage(), "点火图片"},
// new String[]{entity.getInstallThePanoramicImage(), "安装完成全景图片"},
// new String[]{entity.getOfGasMeterImage(), "燃气表号图片"},
// new String[]{entity.getWorkOrderImage(), "工单图片"},
// new String[]{entity.getPunchingImage(), "打孔图片"},
// new String[]{entity.getFiexImage(), "安装电源线图片"},
// new String[]{entity.getHouseNumberImage(), "门牌号图片"}
// );
//
// for (String[] group : imageGroups) {
// String urls = group[0];
// String title = group[1];
//
// if (urls != null && !urls.trim().isEmpty()) {
// List<String> validUrls = Arrays.stream(urls.split(","))
// .map(String::trim)
// .filter(url -> !url.isEmpty() && url.startsWith("http"))
// .collect(Collectors.toList());
//
// if (!validUrls.isEmpty()) {
// // 处理可能需要跨页的多图片情况
// if (validUrls.size() > 2) {
// // 对于多于2张的图片逐个或分组处理以支持跨页
// for (int i = 0; i < validUrls.size(); i += 2) { // 每次处理最多2张图片
// List<String> subList = validUrls.subList(i,
// Math.min(i + 2, validUrls.size()));
//
// List<String> wrappedTitleLines = wrapText(title,LEFT_COL_WIDTH - 2 * CELL_PADDING);
// float titleHeight = wrappedTitleLines.size() * LINE_HEIGHT;
// // 计算图片组的自适应高度
// float imagesHeight = calculateAdjustedImagesHeight(document, subList,
// RIGHT_COL_WIDTH - 2 * CELL_PADDING,
// PDRectangle.A4.getHeight() - 2 * TABLE_MARGIN - titleHeight);
//
// float totalHeight = Math.max(imagesHeight, titleHeight);
//
// if (currentY < TABLE_MARGIN + Math.max(totalHeight, titleHeight)) {
// cs.close();
// currentPage = new PDPage(PDRectangle.A4);
// document.addPage(currentPage);
// cs = new PDPageContentStream(document, currentPage);
// currentY = PDRectangle.A4.getHeight() - TABLE_MARGIN;
// }
//
// // 添加标识,表明这是多图片的一部分
// String subTitle = title + " (" + (i+1) + "-" + Math.min(i+2, validUrls.size()) + "/" + validUrls.size() + ")";
// List<String> subWrappedTitleLines = wrapText(subTitle, LEFT_COL_WIDTH - 2 * CELL_PADDING);
//
// drawImageGroup(cs, document, font, subWrappedTitleLines, subList, currentY,
// Math.max(totalHeight, titleHeight));
// currentY -= Math.max(totalHeight, titleHeight);
// }
// } else {
// // 原有的单/双图片处理逻辑
// List<String> wrappedTitleLines = wrapText(title,LEFT_COL_WIDTH - 2 * CELL_PADDING);
// float titleHeight = wrappedTitleLines.size() * LINE_HEIGHT;
// // 计算图片组的自适应高度
// float imagesHeight = calculateAdjustedImagesHeight(document, validUrls,
// RIGHT_COL_WIDTH - 2 * CELL_PADDING,
// PDRectangle.A4.getHeight() - 2 * TABLE_MARGIN - titleHeight);
//
// float totalHeight = Math.max(imagesHeight, titleHeight);
//
// if (currentY < TABLE_MARGIN + Math.max(totalHeight, titleHeight)) {
// cs.close();
// currentPage = new PDPage(PDRectangle.A4);
// document.addPage(currentPage);
// cs = new PDPageContentStream(document, currentPage);
// currentY = PDRectangle.A4.getHeight() - TABLE_MARGIN;
// }
//
// drawImageGroup(cs, document, font, wrappedTitleLines, validUrls, currentY,
// Math.max(totalHeight, titleHeight));
// currentY -= Math.max(totalHeight, titleHeight);
// }
// }
// }
// }
////
// } finally {
// cs.close();
// }
// // 将PDF保存到ByteArrayOutputStream
// document.save(pdfBaos);
//
//// ByteArrayOutputStream baos = new ByteArrayOutputStream();
//// document.save(baos);
//// outputStream.flush();
//// baos.writeTo(outputStream);
//
//
// }
// // 创建ZIP压缩包并将PDF写入输出流
// try (ZipOutputStream zipOut = new ZipOutputStream(outputStream)) {
// // 设置最高压缩级别
// zipOut.setLevel(Deflater.BEST_COMPRESSION);
// // 创建ZIP条目
// ZipEntry entry = new ZipEntry(entity.getUserName()+entity.getCommunityName()+entity.getBuildingUnit()+entity.getRoomNo()+".pdf");
// zipOut.putNextEntry(entry);
//
// // 将PDF数据写入ZIP
// byte[] pdfBytes = pdfBaos.toByteArray();
// zipOut.write(pdfBytes, 0, pdfBytes.length);
//
// // 关闭当前条目
// zipOut.closeEntry();
// }
// }
// 加载字体,确保使用正确的文档实例 // 加载字体,确保使用正确的文档实例
private static PDType0Font loadFont(PDDocument document) throws IOException { private static PDType0Font loadFont(PDDocument document) throws IOException {
// 尝试多个可能的字体路径 // 尝试多个可能的字体路径
@ -855,6 +1012,7 @@ public class PDFGenerator {
currentY -= fontSize * 1.2f; currentY -= fontSize * 1.2f;
} }
} }
// 图片高度预估方法 // 图片高度预估方法
private static float estimateImageHeight(String imageUrl, float targetWidth) throws IOException { private static float estimateImageHeight(String imageUrl, float targetWidth) throws IOException {
try (InputStream is = new URL(imageUrl).openStream()) { try (InputStream is = new URL(imageUrl).openStream()) {
@ -992,8 +1150,6 @@ public class PDFGenerator {
}*/ }*/
private static void drawTable(PDPageContentStream cs, PDType0Font font, private static void drawTable(PDPageContentStream cs, PDType0Font font,
float x, float y, String[][] data, float[] colWidths) throws IOException { float x, float y, String[][] data, float[] colWidths) throws IOException {

@ -37,6 +37,8 @@ import cc.iotkit.common.utils.MapstructUtils;
import cc.iotkit.data.manager.IDeviceInstallInfoData; import cc.iotkit.data.manager.IDeviceInstallInfoData;
import cc.iotkit.manager.config.GasInstallationPDFGenerator; import cc.iotkit.manager.config.GasInstallationPDFGenerator;
import cc.iotkit.manager.config.PDFGenerator; import cc.iotkit.manager.config.PDFGenerator;
import cc.iotkit.manager.dto.bo.BatchPdfWrapper;
import cc.iotkit.manager.dto.bo.ExportTask;
import cc.iotkit.manager.dto.bo.device.DeviceDetectorQueryBo; import cc.iotkit.manager.dto.bo.device.DeviceDetectorQueryBo;
import cc.iotkit.manager.dto.bo.device.DeviceInstallInfoQueryBo; import cc.iotkit.manager.dto.bo.device.DeviceInstallInfoQueryBo;
import cc.iotkit.manager.dto.bo.device.DeviceQueryBo; import cc.iotkit.manager.dto.bo.device.DeviceQueryBo;
@ -100,6 +102,11 @@ import java.net.URLEncoder;
import java.security.SecureRandom; import java.security.SecureRandom;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.zip.Deflater;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static cc.iotkit.data.model.QTbDeviceInstallInfo.tbDeviceInstallInfo; import static cc.iotkit.data.model.QTbDeviceInstallInfo.tbDeviceInstallInfo;
import static com.itextpdf.kernel.pdf.PdfName.*; import static com.itextpdf.kernel.pdf.PdfName.*;
@ -116,6 +123,12 @@ public class DeviceInstallInfoController {
@Autowired @Autowired
private IDeviceInstallInfoData iDeviceInstallInfoData; private IDeviceInstallInfoData iDeviceInstallInfoData;
@Autowired
private ExecutorService taskExecutor;
// 存储任务状态
private static final ConcurrentHashMap<String, ExportTask> exportTasks = new ConcurrentHashMap<>();
@ApiOperation(value = "安装列表", notes = "设备列表", httpMethod = "POST") @ApiOperation(value = "安装列表", notes = "设备列表", httpMethod = "POST")
//@SaCheckPermission("iot:device:query") //@SaCheckPermission("iot:device:query")
@PostMapping("/page") @PostMapping("/page")
@ -201,6 +214,57 @@ public class DeviceInstallInfoController {
PDFGenerator.generateInstallationPDF(data, response.getOutputStream()); PDFGenerator.generateInstallationPDF(data, response.getOutputStream());
} }
@PostMapping("/getPdfBatch")
@SaCheckPermission("device:install:upload")
public void getPdfBatch(@Validated @RequestBody Request<BatchPdfWrapper> request, HttpServletResponse response) throws Exception {
List<String> ids = request.getData().getData();
if (ids == null || ids.isEmpty()) {
throw new BizException(ErrCode.PARAMS_EXCEPTION);
}
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment; filename=\"批量安装信息.zip\"");
// 创建ZIP输出流
try (ZipOutputStream zipOut = new ZipOutputStream(response.getOutputStream())) {
zipOut.setLevel(Deflater.BEST_COMPRESSION);
for (String id : ids) {
DeviceInstallInfo data = iDeviceInstallInfoData.findById(id);
if (data == null) {
continue; // 跳过不存在的记录
}
// 生成PDF字节数组
ByteArrayOutputStream pdfBaos = new ByteArrayOutputStream();
PDFGenerator.generateInstallationPDFBytes(data, pdfBaos);
byte[] pdfBytes = pdfBaos.toByteArray();
// 创建ZIP条目
String fileName = data.getUserName() + "_" +
data.getCommunityName() + "_" +
data.getBuildingUnit() + data.getRoomNo() + ".pdf";
// 清理文件名中的非法字符
fileName = fileName.replaceAll("[\\\\/:*?\"<>|]", "_");
ZipEntry entry = new ZipEntry(fileName);
zipOut.putNextEntry(entry);
zipOut.write(pdfBytes, 0, pdfBytes.length);
zipOut.closeEntry();
}
zipOut.finish();
}
}
@ApiOperation("导出设备列表") @ApiOperation("导出设备列表")
@Log(title = "导出设备列表", businessType = BusinessType.EXPORT) @Log(title = "导出设备列表", businessType = BusinessType.EXPORT)
// @SaCheckPermission("system:user:export")@RequestBody Request<ProductBo> // @SaCheckPermission("system:user:export")@RequestBody Request<ProductBo>

@ -0,0 +1,11 @@
package cc.iotkit.manager.dto.bo;
import lombok.Data;
import java.util.List;
@Data
public class BatchExportRequest {
private List<String> data;
private Long tenantId;
}

@ -0,0 +1,11 @@
package cc.iotkit.manager.dto.bo;
import lombok.Data;
import java.util.List;
@Data
public class BatchPdfWrapper {
private List<String> data;
private Long tenantId;
}

@ -0,0 +1,28 @@
package cc.iotkit.manager.dto.bo;
import lombok.Data;
import java.util.Date;
import java.util.List;
// 任务状态类
@Data
public class ExportTask {
private String taskId;
private List<String> ids;
private String status; // PENDING, PROCESSING, COMPLETED, FAILED
private String filePath;
private String errorMessage;
private Date createTime;
private Date completeTime;
private int progress; // 进度 0-100
public ExportTask(String taskId, List<String> ids, String status) {
this.taskId = taskId;
this.ids = ids;
this.status = status;
this.createTime = new Date();
this.progress = 0;
}
}

@ -402,7 +402,7 @@ public class ThingServiceImpl implements IThingService {
.deptAreaId(device.getDeptAreaId()) .deptAreaId(device.getDeptAreaId())
.readFlg(false) .readFlg(false)
.alertTime(System.currentTimeMillis()) .alertTime(System.currentTimeMillis())
.details("您的设备【" + device.getDeviceName() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。") .details("您的设备【" + device.getDeviceName() + "】,位置【" + device.getSite() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。")
.build()); .build());
// if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) { // if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) {
// for (int j = 0; j < deviceInfoArrayList1.size(); j++) { // for (int j = 0; j < deviceInfoArrayList1.size(); j++) {
@ -451,7 +451,7 @@ public class ThingServiceImpl implements IThingService {
.deptAreaId(device.getDeptAreaId()) .deptAreaId(device.getDeptAreaId())
.readFlg(false) .readFlg(false)
.alertTime(System.currentTimeMillis()) .alertTime(System.currentTimeMillis())
.details("您的设备【" + device.getDeviceName() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。") .details("您的设备【" + device.getDeviceName() + "】,位置【" + device.getSite() + "】触发事件 事件类型为:【" + map.get("eventTypeValue").toString() + "】。")
.build()); .build());
// if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) { // if (ObjectUtil.isNotEmpty(deviceInfoArrayList1)) {
// for (int j = 0; j < deviceInfoArrayList1.size(); j++) { // for (int j = 0; j < deviceInfoArrayList1.size(); j++) {

@ -28,6 +28,9 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Configuration @Configuration
@EnableScheduling @EnableScheduling
public class SchedulerConfig { public class SchedulerConfig {
@ -41,4 +44,10 @@ public class SchedulerConfig {
return scheduler; return scheduler;
} }
@Bean
public ExecutorService taskExecutor() {
// 创建一个固定大小的线程池大小为10
return Executors.newFixedThreadPool(10);
}
} }

@ -60,7 +60,7 @@ spring:
type: com.zaxxer.hikari.HikariDataSource type: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver driverClassName: com.mysql.cj.jdbc.Driver
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562 # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
url: jdbc:mysql://123.57.78.108:3306/hma_iot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false url: jdbc:mysql://172.16.0.64:3306/hma_iot?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
# url: jdbc:mysql://123.57.78.108:3306/hma_iot_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false # url: jdbc:mysql://123.57.78.108:3306/hma_iot_test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&useSSL=false
username: root username: root
password: 1093e4769496a6ed password: 1093e4769496a6ed
@ -83,7 +83,8 @@ spring:
rest: rest:
#使用内置es的配置 #使用内置es的配置
#uris: http://elasticsearch:9200 #uris: http://elasticsearch:9200
uris: http://123.57.78.108:9301 # uris: http://123.57.78.108:9301
uris: http://172.16.0.64:9301
username: elastic username: elastic
password: hmkj@2023 password: hmkj@2023
connection-timeout: 10s connection-timeout: 10s
@ -111,7 +112,8 @@ spring:
embedded: embedded:
enabled: false enabled: false
#host: redis #host: redis
host: 123.57.78.108 # host: 123.57.78.108
host: 172.16.0.64
port: 6379 port: 6379
database: 11 database: 11
password: HMkj@2023 password: HMkj@2023

@ -72,6 +72,12 @@
<appender-ref ref="console"/> <appender-ref ref="console"/>
</logger> </logger>
<logger name="org.hibernate.SQL" level="OFF"/>
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="OFF"/>
<logger name="org.hibernate.type.descriptor.sql" level="OFF"/>
<logger name="org.hibernate.engine.QueryParameters" level="OFF"/>
<logger name="org.hibernate.engine.query.HQLQueryPlan" level="OFF"/>
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="trace"/> <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="trace"/>
<!-- <logger name="org.springframework" level="debug" additivity="false">--> <!-- <logger name="org.springframework" level="debug" additivity="false">-->

Loading…
Cancel
Save