浏览代码

获奖登记导出报错解决

dzx 1 年之前
父节点
当前提交
d4a6377961

+ 30 - 0
src/main/java/com/xjrsoft/module/teacher/controller/TeacherAwardController.java

@@ -45,6 +45,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
 import java.net.URLConnection;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -142,8 +143,37 @@ public class TeacherAwardController {
             int index = 1;
             Map<String, byte[]> byteAryMap = new HashMap<>();
             String folderName = "附件材料";
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             for (TeacherAwardDetailPageVo el : list) {
                 TeacherAwardDetailExcelVo rowData = BeanUtil.toBean(el, TeacherAwardDetailExcelVo.class);
+                if(el.getIssueDate() == null){
+                    rowData.setIssueDate("");
+                }else{
+                    rowData.setIssueDate(sdf.format(el.getIssueDate()));
+                }
+                if(rowData.getRemark() == null){
+                    rowData.setRemark("");
+                }
+                if(rowData.getJournalLevel() == null){
+                    rowData.setJournalLevel("");
+                }
+                if(rowData.getJournalNumber() == null){
+                    rowData.setJournalNumber("");
+                }
+                if(rowData.getApplicantUserIdCn() == null){
+                    rowData.setApplicantUserIdCn("");
+                }
+                if(rowData.getIsThesis() == null){
+                    rowData.setIsThesis("");
+                }
+                if(rowData.getCompetitionName() == null){
+                    rowData.setCompetitionName("");
+                }
+                if(rowData.getMediaType() == null){
+                    rowData.setMediaType("");
+                }
+
+
                 if(el.getIsThesis() == 1){
                     rowData.setIsThesis("是");
                 }else if(el.getIsThesis() == 0){

+ 1 - 1
src/main/java/com/xjrsoft/module/teacher/vo/TeacherAwardDetailExcelVo.java

@@ -50,7 +50,7 @@ public class TeacherAwardDetailExcelVo {
 
     @ExcelProperty("发表/获奖时间")
     @ApiModelProperty("发表时间")
-    private Date issueDate;
+    private String issueDate;
 
     @ExcelProperty("备注")
     @ApiModelProperty("备注")