|
|
@@ -90,6 +90,12 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
|
|
|
private DevMessageService devMessageService;
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public Page<TExamVo> page(TExamPageParam tExamPageParam) {
|
|
|
if(!StpLoginUserUtil.getLoginUser().getAccount().equals("superAdmin")){
|
|
|
@@ -124,11 +130,12 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
|
|
|
TExam tExam = BeanUtil.toBean(tExamAddParam, TExam.class);
|
|
|
|
|
|
boolean query = false;
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
if(tExamAddParam.getCourseId() != null && !tExamAddParam.getCourseId().isEmpty()){
|
|
|
- map.put("courseId",tExamAddParam.getCourseId());
|
|
|
query = true;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
List<String> studentAccounts=new ArrayList<>();
|
|
|
if(query){
|
|
|
studentAccounts=courseOpenMapper.selectAccount(tExamAddParam.getSemesterId(),tExamAddParam.getCourseId());
|
|
|
@@ -138,6 +145,15 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
|
|
|
}else{
|
|
|
return CommonResult.error("根据学期和课程没有查询到学生信息!!!");
|
|
|
}
|
|
|
+ }else{
|
|
|
+ //课程id为空的时候,根据班级查询,对应的学生
|
|
|
+ studentAccounts= courseOpenMapper.selectByGradesIds(tExamAddParam.getGradesIdsList());
|
|
|
+ if(CollectionUtil.isNotEmpty(studentAccounts)){
|
|
|
+ String studentIdsStr = String.join(",", studentAccounts);
|
|
|
+ tExam.setStudentIds(studentIdsStr);
|
|
|
+ }else{
|
|
|
+ return CommonResult.error("根据班级没有查出对应的学生!!!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -195,9 +211,7 @@ 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;
|
|
|
}
|
|
|
|
|
|
@@ -210,10 +224,19 @@ public class TExamServiceImpl extends ServiceImpl<TExamMapper, TExam> implements
|
|
|
}else{
|
|
|
return CommonResult.error("根据学期和课程没有查询到学生信息!!!");
|
|
|
}
|
|
|
+ }else{
|
|
|
+ //课程id为空的时候,根据班级查询,对应的学生
|
|
|
+ studentAccounts= courseOpenMapper.selectByGradesIds(tExamEditParam.getGradesIdsList());
|
|
|
+ if(CollectionUtil.isNotEmpty(studentAccounts)){
|
|
|
+ String studentIdsStr = String.join(",", studentAccounts);
|
|
|
+ tExam.setStudentIds(studentIdsStr);
|
|
|
+ }else{
|
|
|
+ return CommonResult.error("根据班级没有查出对应的学生!!!");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- tExam.setExamType(tExamEditParam.getExamType());
|
|
|
|
|
|
+ tExam.setExamType(tExamEditParam.getExamType());
|
|
|
|
|
|
if(updateJob){
|
|
|
// 修改定时任务
|