|
@@ -1,5 +1,35 @@
|
|
|
package com.qmth.teachcloud.mark.service.impl;
|
|
|
|
|
|
+import java.awt.*;
|
|
|
+import java.awt.color.ColorSpace;
|
|
|
+import java.awt.image.BufferedImage;
|
|
|
+import java.awt.image.ColorConvertOp;
|
|
|
+import java.io.*;
|
|
|
+import java.lang.reflect.Field;
|
|
|
+import java.math.BigDecimal;
|
|
|
+import java.net.URLEncoder;
|
|
|
+import java.util.*;
|
|
|
+import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import javax.imageio.ImageIO;
|
|
|
+import javax.servlet.ServletOutputStream;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
+import org.apache.commons.io.FilenameUtils;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
+import org.apache.poi.ss.usermodel.FillPatternType;
|
|
|
+import org.apache.poi.ss.usermodel.IndexedColors;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.FileCopyUtils;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -55,37 +85,7 @@ import com.qmth.teachcloud.mark.params.MarkHeaderResult;
|
|
|
import com.qmth.teachcloud.mark.service.*;
|
|
|
import com.qmth.teachcloud.mark.utils.BatchGetDataUtil;
|
|
|
import com.qmth.teachcloud.mark.utils.Calculator;
|
|
|
-import com.qmth.teachcloud.mark.utils.FileStoreUtils;
|
|
|
import com.qmth.teachcloud.mark.utils.ScoreCalculateUtil;
|
|
|
-import org.apache.commons.codec.digest.DigestUtils;
|
|
|
-import org.apache.commons.collections4.CollectionUtils;
|
|
|
-import org.apache.commons.io.FilenameUtils;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
-import org.apache.poi.ss.usermodel.FillPatternType;
|
|
|
-import org.apache.poi.ss.usermodel.IndexedColors;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
-import org.springframework.util.FileCopyUtils;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
-import javax.annotation.Resource;
|
|
|
-import javax.imageio.ImageIO;
|
|
|
-import javax.servlet.ServletOutputStream;
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
-import javax.validation.constraints.NotNull;
|
|
|
-import java.awt.*;
|
|
|
-import java.awt.color.ColorSpace;
|
|
|
-import java.awt.image.BufferedImage;
|
|
|
-import java.awt.image.ColorConvertOp;
|
|
|
-import java.io.*;
|
|
|
-import java.lang.reflect.Field;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.net.URLEncoder;
|
|
|
-import java.util.List;
|
|
|
-import java.util.*;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -159,7 +159,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
CommonCacheService commonCacheService;
|
|
|
|
|
|
@Autowired
|
|
|
- private FileStoreUtils fileStoreUtils;
|
|
|
+ private MarkHeaderHistoryService markHeaderHistoryService;
|
|
|
|
|
|
@Override
|
|
|
public List<String> listClassByExamIdAndCourseCode(Long examId, String paperNumber) {
|
|
@@ -2502,4 +2502,24 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
|
|
|
SysConfig sysConfig = commonCacheService.addSysConfigCache(SystemConstant.MARK_SCORE_CALCULATE_JOB_DB_LIMIT);
|
|
|
return this.baseMapper.findNeedScoreCalculateStudent(Objects.isNull(sysConfig) ? "limit 0,500" : sysConfig.getConfigValue());
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void historyExport(ArchiveStudentQuery query, HttpServletResponse response) throws IOException{
|
|
|
+ List<ScoreHistoryVo> list = markHeaderHistoryService.findByExamIdAndPaperNumber(query.getExamId(),query.getPaperNumber());
|
|
|
+ try {
|
|
|
+ log.debug("导出Excel开始...");
|
|
|
+ response.setHeader("Content-Disposition",
|
|
|
+ "inline;filename=" + URLEncoder.encode("成绩复核导出", SystemConstant.CHARSET_NAME) + ".xlsx");
|
|
|
+ response.setContentType("application/vnd.ms-excel");
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ ExcelWriter writer = ExcelWriter.create(ExcelType.XLSX);
|
|
|
+ writer.writeObjects("成绩复核", null, ScoreHistoryVo.class, list.listIterator());
|
|
|
+ writer.output(response.getOutputStream());
|
|
|
+ outputStream.flush();
|
|
|
+ outputStream.close();
|
|
|
+ log.debug("导出Excel结束");
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|