|
@@ -199,17 +199,24 @@ public class ScheduleController {
|
|
public RT<String> preCheck(CourseTablePreCheckDto dto) throws Exception {
|
|
public RT<String> preCheck(CourseTablePreCheckDto dto) throws Exception {
|
|
if(dto.getPreCheckType() != null){
|
|
if(dto.getPreCheckType() != null){
|
|
if(dto.getPreCheckType() == 1){
|
|
if(dto.getPreCheckType() == 1){
|
|
- CourseTable courseTable = courseTableService.getById(dto.getCourseId());
|
|
|
|
- CourseTable swapCourseTable = courseTableService.getById(dto.getSwapCourseId());
|
|
|
|
- JsonObject preCheck = getExtendPreCheck(dto, courseTable, swapCourseTable);
|
|
|
|
- if(preCheck.get("code").getAsInt() != 0){
|
|
|
|
- return RT.error(preCheck.get("msg").getAsString());
|
|
|
|
|
|
+ for (int i = 0; i < dto.getCourseIds().size(); i ++){
|
|
|
|
+ Long courseId = dto.getCourseIds().get(i);
|
|
|
|
+ Long swapCourseId = dto.getSwapCourseIds().get(i);
|
|
|
|
+ CourseTable courseTable = courseTableService.getById(courseId);
|
|
|
|
+ CourseTable swapCourseTable = courseTableService.getById(swapCourseId);
|
|
|
|
+ JsonObject preCheck = getExtendPreCheck(dto, courseTable, swapCourseTable);
|
|
|
|
+ if(preCheck.get("code").getAsInt() != 0){
|
|
|
|
+ return RT.error(preCheck.get("msg").getAsString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
}else if(dto.getPreCheckType() == 2){
|
|
}else if(dto.getPreCheckType() == 2){
|
|
- CourseTable courseTable = courseTableService.getById(dto.getCourseId());
|
|
|
|
- JsonObject jsonObject = substitutePreTestin(dto, courseTable);
|
|
|
|
- if(jsonObject.get("code").getAsInt() != 0){
|
|
|
|
- return RT.error(jsonObject.get("msg").getAsString());
|
|
|
|
|
|
+ for (Long courseId : dto.getCourseIds()) {
|
|
|
|
+ CourseTable courseTable = courseTableService.getById(courseId);
|
|
|
|
+ JsonObject jsonObject = substitutePreTestin(dto, courseTable);
|
|
|
|
+ if(jsonObject.get("code").getAsInt() != 0){
|
|
|
|
+ return RT.error(jsonObject.get("msg").getAsString());
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|