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);