|
|
|
@ -2,6 +2,7 @@ package com.msdw.tms.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
@ -601,22 +602,18 @@ public class QuestionsServiceImpl extends ServiceImpl<QuestionsDao, QuestionsEnt |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<QuestionsImportFailureVO> parse = (List<QuestionsImportFailureVO>) JSON.parse(record); |
|
|
|
|
|
|
|
|
|
List<QuestionsImportFailureVO> parse = JSON.parseObject(record, new TypeReference<List<QuestionsImportFailureVO>>() { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
parse.sort(Comparator.comparing(QuestionsImportFailureVO::getIndex)); |
|
|
|
|
// Collections.sort(parse, new Comparator<QuestionsImportFailureVO>() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public int compare(QuestionsImportFailureVO o1, QuestionsImportFailureVO o2) {
|
|
|
|
|
// //升序
|
|
|
|
|
// return o1.getIndex().compareTo(o2.getIndex());
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
//2.加载模板流数据
|
|
|
|
|
org.springframework.core.io.Resource resource = new ClassPathResource("excel-template/试题导入失败数据导出模板.xlsx"); |
|
|
|
|
FileInputStream fis = new FileInputStream(resource.getFile()); |
|
|
|
|
|
|
|
|
|
//3、通过工具类下载文件
|
|
|
|
|
new ExcelExportUtil(QuestionsImportRequest.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). |
|
|
|
|
new ExcelExportUtil(QuestionsImportFailureVO.class, Constant.ROW_INDEX, Constant.STYLE_INDEX). |
|
|
|
|
export(response, fis, parse, "导入失败数据表.xlsx"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|