|
@@ -0,0 +1,70 @@
|
|
|
+package cn.hmsoft.art.enrol.control.score;
|
|
|
+
|
|
|
+import cn.hmsoft.application.web.Ajax;
|
|
|
+import cn.hmsoft.art.constants.StdLogType;
|
|
|
+import cn.hmsoft.art.data.dao.std.StdEnrolDao;
|
|
|
+import cn.hmsoft.art.data.model.sc.ScStdAspect;
|
|
|
+import cn.hmsoft.art.data.model.std.StdEnrol;
|
|
|
+import cn.hmsoft.art.data.model.std.StdLog;
|
|
|
+import cn.hmsoft.art.data.model.std.StdReg;
|
|
|
+import cn.hmsoft.art.enrol.control.EnrolStdAbstractControl;
|
|
|
+import cn.hmsoft.art.helper.ArtParamHelper;
|
|
|
+import cn.hmsoft.frame.exception.BusinessException;
|
|
|
+import cn.hmsoft.helper.LocalDateHelper;
|
|
|
+import cn.hmsoft.log.LogHelper;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description 央美附中成绩查询
|
|
|
+ * @Author haoguanghui
|
|
|
+ * @date 2024/10/28
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+public class EnrolStdScoreYmfzControl extends EnrolStdAbstractControl {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private StdEnrolDao stdEnrolDao;
|
|
|
+
|
|
|
+ @RequestMapping("/enrol/std/score/search")
|
|
|
+ public Ajax fzScore() {
|
|
|
+ StdReg stdReg = this.getStdReg();
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ // 成绩查询 起止时间
|
|
|
+ LocalDateTime scoreStartTime = LocalDateHelper.parseDateTime(ArtParamHelper.getParamValue("FzScoreStartTime", null));
|
|
|
+ LocalDateTime scoreEndTime = LocalDateHelper.parseDateTime(ArtParamHelper.getParamValue("FzScoreEndTime", null));
|
|
|
+ if (scoreStartTime == null || scoreEndTime == null) {
|
|
|
+ LogHelper.warn("[成绩查询] 未设置成绩查询起止时间");
|
|
|
+ throw new BusinessException("未到成绩查询时间");
|
|
|
+ }
|
|
|
+ if (LocalDateTime.now().isBefore(scoreStartTime) || LocalDateTime.now().isAfter(scoreEndTime)) {
|
|
|
+ throw new BusinessException(
|
|
|
+ "成绩查询时间为:[" + LocalDateHelper.format(scoreStartTime) + " ~ " + LocalDateHelper.format(scoreEndTime) + "]");
|
|
|
+ }
|
|
|
+
|
|
|
+ // 考生成绩信息
|
|
|
+ List<Map<String, Object>> scoreList = stdEnrolDao.listMapBySql("select * from fz_score where std_name=? and cert_id=?", stdReg.getStd_name(),
|
|
|
+ stdReg.getCert_id());
|
|
|
+
|
|
|
+ if(scoreList == null || scoreList.isEmpty()) {
|
|
|
+ throw new BusinessException("未查询到考生成绩");
|
|
|
+ }
|
|
|
+
|
|
|
+ map.put("scoreList", scoreList);
|
|
|
+
|
|
|
+ //记录日志
|
|
|
+ StdLog log = new StdLog();
|
|
|
+ log.setStd_id(stdReg.getStd_id());
|
|
|
+ log.setLog_time(LocalDateTime.now());
|
|
|
+ log.setLog_type(StdLogType.ScoreQuery);
|
|
|
+ stdEnrolDao.insert(log);
|
|
|
+
|
|
|
+ return new Ajax(map);
|
|
|
+ }
|
|
|
+}
|