From ff395e93f2ca618999af8bf0c04586c2c80c0914 Mon Sep 17 00:00:00 2001 From: sunxiqing <2240398334@qq.com> Date: Sat, 4 Jan 2025 15:14:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E6=96=87=E4=BB=B6=E5=B1=85?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/dataset/DatasetQuestionController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/controller/admin/dataset/DatasetQuestionController.java b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/controller/admin/dataset/DatasetQuestionController.java index 0aefcc44a..a53e90ace 100644 --- a/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/controller/admin/dataset/DatasetQuestionController.java +++ b/yudao-module-llm/yudao-module-llm-biz/src/main/java/cn/iocoder/yudao/module/llm/controller/admin/dataset/DatasetQuestionController.java @@ -10,6 +10,7 @@ import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.springframework.web.bind.annotation.*; @@ -75,11 +76,14 @@ public class DatasetQuestionController { // 创建样式并设置垂直居中 HSSFCellStyle cellStyle = template.createCellStyle(); cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); + cellStyle.setAlignment(HorizontalAlignment.CENTER); int count = 0; List id = new ArrayList<>(); HSSFRow row = sheet.createRow(count); row.createCell(0).setCellValue("问题内容"); + row.getCell(0).setCellStyle(cellStyle); row.createCell(1).setCellValue("标注内容"); + row.getCell(1).setCellStyle(cellStyle); id.add(count); count++; pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); @@ -91,14 +95,18 @@ public class DatasetQuestionController { if (collect.size() == 0){ row = sheet.createRow(count); row.createCell(0).setCellValue(question); + row.getCell(0).setCellStyle(cellStyle); row.createCell(1).setCellValue(""); + row.getCell(1).setCellStyle(cellStyle); id.add(count); count++; }else { for (String s : collect) { row = sheet.createRow(count); row.createCell(0).setCellValue(question); + row.getCell(0).setCellStyle(cellStyle); row.createCell(1).setCellValue(s); + row.getCell(1).setCellStyle(cellStyle); count++; } id.add(count-1);