|
@@ -139,11 +139,11 @@ public class DdExcelService {
|
|
@SuppressWarnings("resource")
|
|
@SuppressWarnings("resource")
|
|
public void exporExcel(String orgId) throws Exception {
|
|
public void exporExcel(String orgId) throws Exception {
|
|
//导出Excel集合
|
|
//导出Excel集合
|
|
- List<DdExcelDto> ddExcelDtos = new ArrayList<DdExcelDto>();
|
|
|
|
|
|
+ List<DdExcelDto> ddExcelDtos = new ArrayList<>();
|
|
//查询所有课程
|
|
//查询所有课程
|
|
long startCourseTime = System.currentTimeMillis();
|
|
long startCourseTime = System.currentTimeMillis();
|
|
//List<Course> courses = courseRepo.findByOrgId(orgId);
|
|
//List<Course> courses = courseRepo.findByOrgId(orgId);
|
|
- List<Course> courses = new ArrayList<Course>();
|
|
|
|
|
|
+ List<Course> courses = new ArrayList<>();
|
|
long endCourseTime = System.currentTimeMillis();
|
|
long endCourseTime = System.currentTimeMillis();
|
|
System.out.println("查询课程耗时:" + (endCourseTime - startCourseTime) + "ms");
|
|
System.out.println("查询课程耗时:" + (endCourseTime - startCourseTime) + "ms");
|
|
if (courses != null && courses.size() > 0) {
|
|
if (courses != null && courses.size() > 0) {
|
|
@@ -154,7 +154,7 @@ public class DdExcelService {
|
|
List<Question> questions = quesRepo.findByCourseAndOrgId(course, orgId);
|
|
List<Question> questions = quesRepo.findByCourseAndOrgId(course, orgId);
|
|
long endQuestionTime = System.currentTimeMillis();
|
|
long endQuestionTime = System.currentTimeMillis();
|
|
System.out.println("查询第" + i + "个课程试题耗时:" + (endQuestionTime - startQuestionTime) + "ms");
|
|
System.out.println("查询第" + i + "个课程试题耗时:" + (endQuestionTime - startQuestionTime) + "ms");
|
|
- List<String> oIds = new ArrayList<String>();
|
|
|
|
|
|
+ List<String> oIds = new ArrayList<>();
|
|
for (Question question : questions) {
|
|
for (Question question : questions) {
|
|
oIds.add(question.getId());
|
|
oIds.add(question.getId());
|
|
}
|
|
}
|
|
@@ -163,7 +163,7 @@ public class DdExcelService {
|
|
List<PaperDetailUnit> oDetailUnits = paperDetailUnitService.findByDDQuestionsAndPaperType(oIds, PaperType.IMPORT, questions);
|
|
List<PaperDetailUnit> oDetailUnits = paperDetailUnitService.findByDDQuestionsAndPaperType(oIds, PaperType.IMPORT, questions);
|
|
long endUnitTime = System.currentTimeMillis();
|
|
long endUnitTime = System.currentTimeMillis();
|
|
System.out.println("查询第" + i + "个课程试题耗时:" + (endUnitTime - startUnitTime) + "ms");
|
|
System.out.println("查询第" + i + "个课程试题耗时:" + (endUnitTime - startUnitTime) + "ms");
|
|
- Map<String, Long> map = new HashMap<String, Long>();
|
|
|
|
|
|
+ Map<String, Long> map = new HashMap<>();
|
|
if (oDetailUnits != null && oDetailUnits.size() > 0) {
|
|
if (oDetailUnits != null && oDetailUnits.size() > 0) {
|
|
for (PaperDetailUnit unit : oDetailUnits) {
|
|
for (PaperDetailUnit unit : oDetailUnits) {
|
|
//大题名称
|
|
//大题名称
|
|
@@ -183,7 +183,7 @@ public class DdExcelService {
|
|
i++;
|
|
i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- Map<String, Long> otherMap = new HashMap<String, Long>();
|
|
|
|
|
|
+ Map<String, Long> otherMap = new HashMap<>();
|
|
//生成Excel对象
|
|
//生成Excel对象
|
|
File ddExcelFile = new File(exportExcelPath);
|
|
File ddExcelFile = new File(exportExcelPath);
|
|
Workbook workBook = new XSSFWorkbook(ddExcelFile);
|
|
Workbook workBook = new XSSFWorkbook(ddExcelFile);
|
|
@@ -369,7 +369,7 @@ public class DdExcelService {
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
- System.out.println("kong" + ddExcelDto.getCourseName());
|
|
|
|
|
|
+ System.out.println("课程:" + ddExcelDto.getCourseName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
File file = new File(xianExcelPath);
|
|
File file = new File(xianExcelPath);
|