| | |
| | | data.add(questionImportVO3); |
| | | |
| | | // 查出所有的课目(excel下拉数据) |
| | | List<Subject> subjects = subjectMapper.allSubject(); |
| | | List<Subject> subjects = subjectMapper.allSubject(new ArrayList<>()); |
| | | List<String> subjectNameList = subjects.stream().map(Subject::getName).collect(Collectors.toList()); |
| | | |
| | | EasyExcel.write(response.getOutputStream(), QuestionImportVO.class) |
| | |
| | | .doWrite(data); |
| | | } |
| | | |
| | | @GetMapping("/question/export") |
| | | public void importQuestion(QuestionExportVO query, HttpServletResponse response) throws IOException { |
| | | query.formartTime(); |
| | | @PostMapping("/question/export") |
| | | public void exportQuestion(@RequestBody QuestionExportVO query, HttpServletResponse response) throws IOException { |
| | | // 查询导出数据 |
| | | List<QuestionImportVO> exportData = questionService.export(query); |
| | | // 构建数据 |
| | |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | |
| | | // 查出所有的课目(excel下拉数据) |
| | | List<Subject> subjects = subjectMapper.allSubject(); |
| | | List<Subject> subjects = subjectMapper.allSubject(new ArrayList<>()); |
| | | List<String> subjectNameList = subjects.stream().map(Subject::getName).collect(Collectors.toList()); |
| | | EasyExcel.write(response.getOutputStream(), QuestionImportVO.class) |
| | | .sheet("题目导出数据") |
| | |
| | | |
| | | |
| | | // 查出所有的课目 |
| | | List<Subject> subjects = subjectMapper.allSubject(); |
| | | List<Subject> subjects = subjectMapper.allSubject(new ArrayList<>()); |
| | | List<String> subjectNames = Arrays.asList(excelQuestion.getSubjectName().split(SPLIT)); |
| | | List<Subject> targetSubject = subjects.stream() |
| | | .filter(subject -> subjectNames.contains(subject.getName())) |