|
@@ -21,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -31,7 +33,7 @@ public class IndexController {
|
|
|
|
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@RequestMapping(value = "/paper/init", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/paper/init", method = RequestMethod.GET)
|
|
- public String init() throws Exception {
|
|
|
|
|
|
+ public String init(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
/* 重庆大学xml转paper对象入库 */
|
|
/* 重庆大学xml转paper对象入库 */
|
|
CqdxService cqdxService = SpringContextHolder.getBean(CqdxService.class);
|
|
CqdxService cqdxService = SpringContextHolder.getBean(CqdxService.class);
|
|
// cqdxService.bulidPaper();
|
|
// cqdxService.bulidPaper();
|
|
@@ -39,23 +41,23 @@ public class IndexController {
|
|
DdExcelService ddExcelService = SpringContextHolder.getBean(DdExcelService.class);
|
|
DdExcelService ddExcelService = SpringContextHolder.getBean(DdExcelService.class);
|
|
// ddExcelService.exportPaperStructExcel("371");
|
|
// ddExcelService.exportPaperStructExcel("371");
|
|
|
|
|
|
-// exportExtractExcel();
|
|
|
|
|
|
+// exportExtractExcel(response);
|
|
// exportQuestionExcel();
|
|
// exportQuestionExcel();
|
|
|
|
|
|
return "ok";
|
|
return "ok";
|
|
}
|
|
}
|
|
|
|
|
|
- private void exportExtractExcel() {
|
|
|
|
|
|
+ private void exportExtractExcel(HttpServletResponse response) {
|
|
//用来导出调卷规则中,生成的主观题和客观题的Excel(导出调卷规则)
|
|
//用来导出调卷规则中,生成的主观题和客观题的Excel(导出调卷规则)
|
|
ExtractConfigFileService service = SpringContextHolder.getBean(ExtractConfigFileService.class);
|
|
ExtractConfigFileService service = SpringContextHolder.getBean(ExtractConfigFileService.class);
|
|
ExportPaperInfoModel model = new ExportPaperInfoModel();
|
|
ExportPaperInfoModel model = new ExportPaperInfoModel();
|
|
- model.setExamId("429");
|
|
|
|
|
|
+ model.setExamId("454");
|
|
model.setExportWay(ExportWay.BATCH);
|
|
model.setExportWay(ExportWay.BATCH);
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
list.add(ExamFileType.PAPER_STRUCTURE_OBJECTIVE.name());
|
|
list.add(ExamFileType.PAPER_STRUCTURE_OBJECTIVE.name());
|
|
model.setExportContentList(list);
|
|
model.setExportContentList(list);
|
|
try {
|
|
try {
|
|
- service.exportExamPaperInfo(model, null, "feng", null, null);
|
|
|
|
|
|
+ service.exportExamPaperInfo(model, response, "feng", null, null);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error(e.getMessage(), e);
|
|
log.error(e.getMessage(), e);
|
|
}
|
|
}
|