|
@@ -611,6 +611,7 @@ public class DdExcelService {
|
|
|
dto.setClearBody(clearBody);
|
|
|
dto.setCourseCode(tempConfig.getCourseCode());
|
|
|
dto.setCourseName(tempConfig.getCourseName());
|
|
|
+ dto.setdNumber(paperDetailUnit.getDetailNumber());
|
|
|
dto.setNumber(paperDetailUnit.getNumber());
|
|
|
dto.setPaperId(basePaper.getId());
|
|
|
dto.setPaperName(basePaper.getName());
|
|
@@ -627,6 +628,21 @@ public class DdExcelService {
|
|
|
Workbook workBook = new XSSFWorkbook(ddExcelFile);
|
|
|
//获取第一个工作页
|
|
|
Sheet sheet = workBook.getSheetAt(0);
|
|
|
+
|
|
|
+ //标题
|
|
|
+ Row titleRow = sheet.createRow(0);
|
|
|
+ titleRow.createCell(0).setCellValue("课程代码");
|
|
|
+ titleRow.createCell(1).setCellValue("课程名称");
|
|
|
+ titleRow.createCell(2).setCellValue("试卷名称");
|
|
|
+ titleRow.createCell(3).setCellValue("原始试卷ID");
|
|
|
+ titleRow.createCell(4).setCellValue("大题号");
|
|
|
+ titleRow.createCell(5).setCellValue("小题号");
|
|
|
+ titleRow.createCell(6).setCellValue("标准分");
|
|
|
+ titleRow.createCell(7).setCellValue("题干");
|
|
|
+ titleRow.createCell(8).setCellValue("题干(含标签)");
|
|
|
+ titleRow.createCell(9).setCellValue("标答");
|
|
|
+ titleRow.createCell(10).setCellValue("标答(含标签)");
|
|
|
+
|
|
|
//向Excle中写入数据,从第2行开始
|
|
|
for (int i = 0; i < dtos.size(); i++) {
|
|
|
//创建一行:从第1行开始,跳过表头
|
|
@@ -635,18 +651,19 @@ public class DdExcelService {
|
|
|
//每列赋值
|
|
|
row.createCell(0).setCellValue(dto.getCourseCode());
|
|
|
row.createCell(1).setCellValue(dto.getCourseName());
|
|
|
- row.createCell(2).setCellValue(dto.getPaperId());
|
|
|
- row.createCell(3).setCellValue(dto.getPaperName());
|
|
|
- row.createCell(4).setCellValue(dto.getNumber());
|
|
|
- row.createCell(5).setCellValue(dto.getBody());
|
|
|
- row.createCell(6).setCellValue(dto.getClearBody());
|
|
|
- if (dto.getAnswer().length() < 32767) {
|
|
|
- row.createCell(7).setCellValue(dto.getAnswer());
|
|
|
- }
|
|
|
+ row.createCell(2).setCellValue(dto.getPaperName());
|
|
|
+ row.createCell(3).setCellValue(dto.getPaperId());
|
|
|
+ row.createCell(4).setCellValue(dto.getdNumber());
|
|
|
+ row.createCell(5).setCellValue(dto.getNumber());
|
|
|
+ row.createCell(6).setCellValue(dto.getScore());
|
|
|
+ row.createCell(7).setCellValue(dto.getClearBody());
|
|
|
+ row.createCell(8).setCellValue(dto.getBody());
|
|
|
if (dto.getClearAnswer().length() < 32767) {
|
|
|
- row.createCell(8).setCellValue(dto.getClearAnswer());
|
|
|
+ row.createCell(9).setCellValue(dto.getClearAnswer());
|
|
|
+ }
|
|
|
+ if (dto.getAnswer().length() < 32767) {
|
|
|
+ row.createCell(10).setCellValue(dto.getAnswer());
|
|
|
}
|
|
|
- row.createCell(9).setCellValue(dto.getScore());
|
|
|
}
|
|
|
File file = new File(quesExcelPathNew);
|
|
|
OutputStream out = new FileOutputStream(file);
|