From 62eb499b0c969f246d3245d1429a97da4de1ce28 Mon Sep 17 00:00:00 2001
From: 钟日健 <arsn163@163.com>
Date: Mon, 01 Jun 2026 20:46:13 +0800
Subject: [PATCH] feat: 成绩查询增加年龄查询返回

---
 src/main/java/org/springblade/modules/apply/controller/ApplyController.java |   35 ++++++++++++++++++++++++++---------
 1 files changed, 26 insertions(+), 9 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 a26bdae..3947f58 100644
--- a/src/main/java/org/springblade/modules/apply/controller/ApplyController.java
+++ b/src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -1,6 +1,7 @@
 package org.springblade.modules.apply.controller;
 
 import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -156,7 +157,7 @@
 			"'" + "," + "'" + apply.getApplyStatus() + "'" + "," + "'" + apply.getIsExam() + "'" + ");" +
 			"update blade_user set is_apply = " + user1.getIsApply() + " " + "where id = " + "'" + user1.getId() + "'";
 		//FtpUtil.sqlFileUpload(s);
-		myAsyncService.FTP(s);
+		myAsyncService.dataSync(s);
 	}
 
 
@@ -391,7 +392,7 @@
 			//内网同步
 			String s1 = "delete from sys_apply where id = " + "'" + id + "'";
 			//FtpUtil.sqlFileUpload(s1);
-			myAsyncService.FTP(s1);
+			myAsyncService.dataSync(s1);
 		});
 		return R.status(applyService.removeByIds(Func.toLongList(ids)));
 	}
@@ -493,7 +494,7 @@
 			"update sys_apply set apply_status = " + apply.getApplyStatus() + " " + "where id = " + "'" + apply.getId() + "';" +
 				"update blade_user set is_apply = " + user.getIsApply() + " " + "where id = " + "'" + user.getId() + "'";
 		//FtpUtil.sqlFileUpload(s);
-		myAsyncService.FTP(s);
+		myAsyncService.dataSync(s);
 	}
 
 
@@ -667,7 +668,7 @@
 				"," + "'" + format + "'" +
 				"," + "'" + endTimeFormat + "'" + ")";
 			//FtpUtil.sqlFileUpload(s);
-			myAsyncService.FTP(s);
+			myAsyncService.dataSync(s);
 
 			//修改报名信息
 			applyIds.forEach(apply -> {
@@ -681,7 +682,7 @@
 						"update sys_apply set exam_id = " + apply.getExamId() + ",candidate_no = " + "'" + apply.getCandidateNo() + "'" +
 							" " + "where id = " + "'" + apply.getId() + "'";
 					//FtpUtil.sqlFileUpload(s1);
-					myAsyncService.FTP(s1);
+					myAsyncService.dataSync(s1);
 				}
 			});
 		}
@@ -720,12 +721,26 @@
 	 * @return
 	 */
 	@PostMapping("/updateApplyStatus")
-	public ExamScore updateApplyStatus(@RequestBody ApplyVO apply) {
+	public Map<String, Object> updateApplyStatus(@RequestBody ApplyVO apply) {
+		Map<String, Object> map = new HashMap<>();
+		// 默认第一次进来(调用)
+		map.put("type",0);
+		// 通过准考证号,用户id判断是否已开始考试(登录进来后页面点击)
+		QueryWrapper<ExamScore> wrapper = new QueryWrapper<>();
+		wrapper.eq("user_id", apply.getUserId().toString()).eq("candidate_no", apply.getCandidateNo());
+		// 查询
+		List<ExamScore> examScoreList = examScoreService.list(wrapper);
+		if (examScoreList.size()>0){
+			map.put("type",1);
+			map.put("examScore",examScoreList.get(0));
+			// 直接返回
+			return map;
+		}
 		applyService.updateApplyStatus(apply);
 		//新增考试成绩,没有成绩数据,待提交答题后更新数据
 		ExamScore examScore = new ExamScore();
 		examScore.setExamId(apply.getExamId().toString());
-		examScore.setUserId(apply.getUserId().toString());
+		examScore.setUserId(apply.getUserId());
 		examScore.setApplyId(apply.getId());
 		examScore.setCandidateNo(apply.getCandidateNo());
 		examScore.setExamTime(new Date());
@@ -743,9 +758,11 @@
 				"," + "'" + examScore.getExamId() + "'" +
 				"," + "'" + examScore.getApplyId() + "'" + ")";
 			//FtpUtil.sqlFileUpload(s);
-			myAsyncService.FTP(s);
+			myAsyncService.dataSync(s);
 		}
-		return examScore;
+		map.put("examScore",examScore);
+		// 返回
+		return map;
 	}
 
 

--
Gitblit v1.9.3