Quellcode durchsuchen

2.1.0 试卷导出

xiaofei vor 1 Jahr
Ursprung
Commit
4b5eff1242

+ 10 - 2
distributed-print/src/test/java/com/qmth/distributed/print/ExamTaskPaperExportTest.java

@@ -11,6 +11,7 @@ import com.qmth.distributed.print.business.service.ExamTaskDetailService;
 import com.qmth.distributed.print.business.service.ExamTaskService;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.service.BasicAttachmentService;
+import com.qmth.teachcloud.common.util.DateDisposeUtils;
 import com.qmth.teachcloud.common.util.OssUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.ss.usermodel.*;
@@ -25,6 +26,7 @@ import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 /**
@@ -57,6 +59,7 @@ public class ExamTaskPaperExportTest {
         for (ExamTask examTask : examTaskList) {
             String paperNumberRoot = examRoot + File.separator + String.format("%s(%s)", examTask.getCourseName(), examTask.getCourseCode()) + File.separator + examTask.getPaperNumber();
             ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTask.getId());
+            String applyDate = DateDisposeUtils.dateTime(new Date(examTask.getCreateTime()));
             if (examTaskDetail != null && StringUtils.isNotBlank(examTaskDetail.getPaperAttachmentIds())) {
                 List<JSONObject> objectList = JSON.parseArray(examTaskDetail.getPaperAttachmentIds(), JSONObject.class);
                 boolean success = false;
@@ -88,7 +91,7 @@ public class ExamTaskPaperExportTest {
                     }
                 }
                 if (success) {
-                    examTaskExportVoList.add(new ExamTaskExportVo(examTask.getCourseCode(), examTask.getCourseName(), examTask.getPaperNumber(), examTaskDetail.getPaperType(), examTaskDetail.getExposedPaperType(), examTaskDetail.getUnexposedPaperType()));
+                    examTaskExportVoList.add(new ExamTaskExportVo(examTask.getCourseCode(), examTask.getCourseName(), examTask.getPaperNumber(), examTaskDetail.getPaperType(), examTaskDetail.getExposedPaperType(), examTaskDetail.getUnexposedPaperType(), applyDate));
                 }
             }
         }
@@ -170,7 +173,7 @@ public class ExamTaskPaperExportTest {
 
         XSSFRow headRow = sheet.createRow(0);
         // 表头
-        String[] fieldsNameList = {"课程代码", "课程名称", "试着编号", "上传所有卷型", "已曝光卷型", "未曝光卷型"};
+        String[] fieldsNameList = {"课程代码", "课程名称", "试着编号", "上传所有卷型", "已曝光卷型", "未曝光卷型", "命题时间"};
         for (int i = 0; i < fieldsNameList.length; i++) {
             XSSFCell cell = headRow.createCell(i);
             cell.setCellValue(fieldsNameList[i]);
@@ -210,6 +213,11 @@ public class ExamTaskPaperExportTest {
 //            cell5.setCellStyle(lockStyle);
             cell5.setCellStyle(dataStyle);
             cell5.setCellValue(examTaskExportVo.getUnExposePaperType());
+
+            XSSFCell cell6 = row.createCell(6);
+//            cell5.setCellStyle(lockStyle);
+            cell6.setCellStyle(dataStyle);
+            cell6.setCellValue(examTaskExportVo.getApplyDate());
         }
 
         for (int i = 0; i < fieldsNameList.length; i++) {

+ 11 - 1
distributed-print/src/test/java/com/qmth/distributed/print/bean/ExamTaskExportVo.java

@@ -8,17 +8,19 @@ public class ExamTaskExportVo {
     private String paperType;
     private String exposePaperType;
     private String unExposePaperType;
+    private String applyDate;
 
     public ExamTaskExportVo() {
     }
 
-    public ExamTaskExportVo(String courseCode, String courseName, String paperNumber, String paperType, String exposePaperType, String unExposePaperType) {
+    public ExamTaskExportVo(String courseCode, String courseName, String paperNumber, String paperType, String exposePaperType, String unExposePaperType, String applyDate) {
         this.courseCode = courseCode;
         this.courseName = courseName;
         this.paperNumber = paperNumber;
         this.paperType = paperType;
         this.exposePaperType = exposePaperType;
         this.unExposePaperType = unExposePaperType;
+        this.applyDate = applyDate;
     }
 
     public String getCourseCode() {
@@ -68,4 +70,12 @@ public class ExamTaskExportVo {
     public void setUnExposePaperType(String unExposePaperType) {
         this.unExposePaperType = unExposePaperType;
     }
+
+    public String getApplyDate() {
+        return applyDate;
+    }
+
+    public void setApplyDate(String applyDate) {
+        this.applyDate = applyDate;
+    }
 }