From 92d375e11f68b898cd8a46cf02bcb82cd469ded5 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Thu, 02 Sep 2021 11:58:02 +0800
Subject: [PATCH] 1.ftp

---
 src/main/java/org/springblade/modules/apply/controller/ApplyController.java |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/src/main/java/org/springblade/modules/apply/controller/ApplyController.java b/src/main/java/org/springblade/modules/apply/controller/ApplyController.java
index cd0c513..3055948 100644
--- a/src/main/java/org/springblade/modules/apply/controller/ApplyController.java
+++ b/src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -175,7 +175,18 @@
 	@PostMapping("import-apply")
 	@ApiOperation(value = "导入报名考试数据", notes = "传入excel")
 	public R importUser(MultipartFile file, Integer isCovered) {
-		ApplyImporter applyImporter = new ApplyImporter(applyService, false);
+		ApplyImporter applyImporter = new ApplyImporter(applyService, false,null);
+		ExcelUtil.save(file, applyImporter, ApplyExcel.class);
+		return R.success("操作成功");
+	}
+
+	/**
+	 * 导入报名考试数据(已生成考试)
+	 */
+	@PostMapping("import-applys")
+	@ApiOperation(value = "导入报名考试数据", notes = "传入excel")
+	public R importUser(MultipartFile file, Integer isCovered,Long examId) {
+		ApplyImporter applyImporter = new ApplyImporter(applyService, false,examId);
 		ExcelUtil.save(file, applyImporter, ApplyExcel.class);
 		return R.success("操作成功");
 	}
@@ -592,13 +603,14 @@
 
 
 	/**
-	 * 生成试卷,报名
+	 * 生成考试,报名
 	 * @param ids 报名ids
 	 */
 	@PostMapping("/batchExam")
 	public R batchExam(@RequestParam String ids,
 					   String examTime,
 					   @RequestParam Date startTime,
+					   @RequestParam Integer number,
 					   Date endTime){
 		if (!ids.equals("")){
 			List<String> list = Arrays.asList(ids.split(","));
@@ -642,7 +654,7 @@
 
 		}else {
 			//查询已报名未关联试卷的人员
-			List<Long> applyIds = applyService.getApplyIds();
+			List<Long> applyIds = applyService.getApplyIds(number);
 			if (applyIds.size()>0){
 				//生成考试
 				ExamPaper examPaper = new ExamPaper();
@@ -727,13 +739,13 @@
 		//内网同步
 		Long sid = examScore.getId();
 		String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime());
-		String s = "insert into exam_score(id,exam_time,user_id,exam_id,apply_id) " +
-			"values(" + "'" + sid + "'" + "," + "'" +
-			format + "'" + "," + "'" +
-			examScore.getUserId() +"'" + ","  +"'" +
-			examScore.getExamId() +"'" + ","  +"'" +
-			examScore.getApplyId() + "'" + ")";
-		FtpUtil.sqlFileUpload(s);
+//		String s = "insert into exam_score(id,exam_time,user_id,exam_id,apply_id) " +
+//			"values(" + "'" + sid + "'" + "," + "'" +
+//			format + "'" + "," + "'" +
+//			examScore.getUserId() +"'" + ","  +"'" +
+//			examScore.getExamId() +"'" + ","  +"'" +
+//			examScore.getApplyId() + "'" + ")";
+//		FtpUtil.sqlFileUpload(s);
 		return examScore;
 	}
 

--
Gitblit v1.9.3