From 61a5cdb61ed9caab7f77c4b01e35d58bb68cfef6 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 24 七月 2024 11:24:35 +0800
Subject: [PATCH] feat:用户导入

---
 src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java b/src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
index 0f0e2f8..904e0e2 100644
--- a/src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
+++ b/src/main/java/com/ycl/jxkg/service/impl/ExamServiceImpl.java
@@ -250,7 +250,7 @@
                 .eq(ExamSubmitTemp::getUserId, webContext.getCurrentUser().getId())
                 .one();
         if (Objects.nonNull(hasJoin)) {
-            //TODO锛氬紑鍙戠幆澧冨厛鍏抽棴
+            // 鍏佽鎻愪氦鍚庣户缁綔绛�
 //            if(ExamSubmitTempStatusEnum.finish.equals(hasJoin.getStatus())){
 //                throw new RuntimeException("鎮ㄥ凡鎻愪氦璇曞嵎锛岃鍕块噸澶嶄綔绛�");
 //            }
@@ -597,11 +597,11 @@
 
     @Override
     public Result getMarkPaperInfo(Integer examId, Integer userId) {
+        User student = userMapper.getUserById(userId);
         //濡傛灉宸茬粡闃呰繃鍗蜂簡锛屾煡鎴愮哗琛�
-        Result<ExamPaperMarkVO> paperMarkVO1 = checkHasJudge(examId, userId);
+        Result<ExamPaperMarkVO> paperMarkVO1 = checkHasJudge(examId, student);
         if (paperMarkVO1 != null) return paperMarkVO1;
 
-        User student = userMapper.getUserById(userId);
         ExamVO exam = examMapper.getById(examId);
         //瀛︾敓绛旈琛�
         ExamSubmitTemp userExam = new LambdaQueryChainWrapper<>(examSubmitTempMapper)
@@ -643,11 +643,12 @@
     }
 
     //妫�鏌ユ槸鍚﹂槄鍗�
-    private Result<ExamPaperMarkVO> checkHasJudge(Integer examId, Integer userId) {
-        ExamPaperScore examPaperScore = examPaperScoreMapper.getByExamIdUserId(examId, userId);
+    private Result<ExamPaperMarkVO> checkHasJudge(Integer examId, User student) {
+        ExamPaperScore examPaperScore = examPaperScoreMapper.getByExamIdUserId(examId, student.getId());
         if (examPaperScore != null) {
             ExamPaperMarkVO paperMarkVO = new ExamPaperMarkVO();
             BeanUtils.copyProperties(examPaperScore, paperMarkVO);
+            paperMarkVO.setUserName(student.getRealName());
             paperMarkVO.setTotalScore(examPaperScore.getTotalScore() + "");
             paperMarkVO.setScore(examPaperScore.getScore() + "");
             if (!StringUtils.isEmpty(examPaperScore.getPaperContent())) {
@@ -841,7 +842,7 @@
             paperMarkVO.setTitleItems(JSON.parseArray(userExam.getExamSubmit(), PaperFixQuestionVO.class));
         } else {
             //缂鸿�冿紝瀛︾敓娌℃湁鍋氶淇℃伅
-            paperMarkVO.setExamId(exam.getExamPaperId());
+            paperMarkVO.setExamId(exam.getId());
             paperMarkVO.setUserId(student.getId());
             paperMarkVO.setScore(BigDecimal.ZERO + "");
             paperMarkVO.setDoTime(0);
@@ -914,7 +915,9 @@
     @Override
     public Result monitorList(ExamQuery query) {
         IPage<ExamSubmitTempVO> page = PageUtil.getPage(query, ExamSubmitTempVO.class);
-        return Result.ok((examSubmitTempMapper.monitorList(page, query)));
+        IPage<ExamSubmitTempVO> vo = examSubmitTempMapper.monitorList(page, query);
+
+        return Result.ok(vo);
     }
 
     @Override
@@ -928,7 +931,7 @@
         form.setAddTimeM(sed);
         websocket.setData(form);
         // 鍙戦�亀ebsocket娑堟伅
-        websocketServer.sendOneMessage(form.getUserId(), JSON.toJSONString(form));
+        websocketServer.sendOneMessage(form.getUserId(), JSON.toJSONString(websocket));
         return Result.ok("鎿嶄綔鎴愬姛");
     }
 
@@ -941,7 +944,7 @@
         websocket.setCommend(WebsocketCommendEnum.FORCE_SUBMIT.getCommand());
         websocket.setData(form);
         // 鍙戦�亀ebsocket娑堟伅
-        websocketServer.sendOneMessage(form.getUserId(), JSON.toJSONString(form));
+        websocketServer.sendOneMessage(form.getUserId(), JSON.toJSONString(websocket));
         return Result.ok("鎿嶄綔鎴愬姛");
     }
 }

--
Gitblit v1.8.0