瀏覽代碼

Merge branch 'dev' of http://192.168.1.245:11111/jinjilong/onlineEducation-fwd into dev

honorfire 7 月之前
父節點
當前提交
1a29808ba8

+ 2 - 0
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/domain/exam/TExamEditParam.java

@@ -76,6 +76,8 @@ public class TExamEditParam {
     private String jobId;
 
 
+    @ApiModelProperty(value = "课程ID", position = 14)
+    private String courseId;
 
     @ApiModelProperty(value = "学期id", position = 15)
     private String semesterId;

+ 24 - 0
snowy-plugin/snowy-plugin-exam/snowy-plugin-exam-func/src/main/java/vip/xiaonuo/exam/service/impl/TExamServiceImpl.java

@@ -169,6 +169,27 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
         }
 
 
+        boolean query = false;
+        Map<String, Object> map = new HashMap<>();
+        if(tExamEditParam.getCourseId() != null && !tExamEditParam.getCourseId().isEmpty()){
+            map.put("courseId",tExamEditParam.getCourseId());
+            query = true;
+        }
+
+
+        if(query){
+            List<String>  studentAccounts=courseOpenMapper.selectAccount(tExamEditParam.getSemesterId(),tExamEditParam.getCourseId());
+            if(studentAccounts != null){
+                String studentIdsStr = String.join(",", studentAccounts);
+                tExamEditParam.setStudentIds(studentIdsStr);
+            }else{
+                throw new CommonException("没有找到学生信息!!!");
+            }
+        }
+
+
+
+
         if(tExamEditParam.getPaperId() != null && !tExamEditParam.getPaperId().isEmpty()){
             ExamPaper examPaper = examPaperService.selectById(Integer.parseInt(tExamEditParam.getPaperId()));
             if(ExamPaperTypeEnum.TimeLimit.getCode() == examPaper.getPaperType()){
@@ -181,6 +202,8 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
             }
         }
 
+
+
         if(updateJob){
             // 修改定时任务
             if(tExam.getStartJobId() != null && tExam.getEndJobId() != null){
@@ -201,6 +224,7 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
                 tExam = this.addJob(tExam, "end");
             }
         }
+
         BeanUtil.copyProperties(tExamEditParam, tExam);
         this.updateById(tExam);
     }