|
@@ -1,6 +1,5 @@
|
|
package cn.com.qmth.examcloud.tool.controller;
|
|
package cn.com.qmth.examcloud.tool.controller;
|
|
|
|
|
|
-import cn.com.qmth.examcloud.tool.config.Constants;
|
|
|
|
import cn.com.qmth.examcloud.tool.enums.TaskStatus;
|
|
import cn.com.qmth.examcloud.tool.enums.TaskStatus;
|
|
import cn.com.qmth.examcloud.tool.enums.TaskType;
|
|
import cn.com.qmth.examcloud.tool.enums.TaskType;
|
|
import cn.com.qmth.examcloud.tool.service.CommonService;
|
|
import cn.com.qmth.examcloud.tool.service.CommonService;
|
|
@@ -10,8 +9,6 @@ import org.springframework.ui.Model;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
-import java.io.File;
|
|
|
|
-import java.net.URL;
|
|
|
|
|
|
|
|
@Controller
|
|
@Controller
|
|
public class IndexController extends BaseController {
|
|
public class IndexController extends BaseController {
|
|
@@ -90,16 +87,14 @@ public class IndexController extends BaseController {
|
|
|
|
|
|
@GetMapping("/admin/downloadTemplate/importExamStudent")
|
|
@GetMapping("/admin/downloadTemplate/importExamStudent")
|
|
public void downloadTemplate1(HttpServletResponse response) {
|
|
public void downloadTemplate1(HttpServletResponse response) {
|
|
- URL url = Constants.class.getClassLoader().getResource("templates/import_exam_student.xlsx");
|
|
|
|
- File file = new File(url.getPath());
|
|
|
|
- super.download(response, file, "批量导入考生模板.xlsx");
|
|
|
|
|
|
+ byte[] bytes = super.getSourceFile("templates/import_exam_student.xlsx");
|
|
|
|
+ super.download(response, bytes, "批量导入考生模板.xlsx");
|
|
}
|
|
}
|
|
|
|
|
|
@GetMapping("/admin/downloadTemplate/importUser")
|
|
@GetMapping("/admin/downloadTemplate/importUser")
|
|
public void downloadTemplate2(HttpServletResponse response) {
|
|
public void downloadTemplate2(HttpServletResponse response) {
|
|
- URL url = Constants.class.getClassLoader().getResource("templates/import_user.xlsx");
|
|
|
|
- File file = new File(url.getPath());
|
|
|
|
- super.download(response, file, "批量创建用户模板.xlsx");
|
|
|
|
|
|
+ byte[] bytes = super.getSourceFile("templates/import_user.xlsx");
|
|
|
|
+ super.download(response, bytes, "批量创建用户模板.xlsx");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|