|
@@ -272,6 +272,18 @@ public class ExamApi extends ControllerSupport {
|
|
|
public ResponseEntity<?> addCourseGroup(@RequestBody CourseGroup courseGroup, HttpServletRequest request) {
|
|
|
|
|
|
courseGroupRepo.save(courseGroup);
|
|
|
+ Long groupId = courseGroup.getId();
|
|
|
+
|
|
|
+ List<Long> courseIdList = courseGroup.getCourseIdList();
|
|
|
+ jdbcTemplate.update("delete from ecs_exam_course_group_course where group_id=?", groupId);
|
|
|
+
|
|
|
+ if (CollectionUtils.isNotEmpty(courseIdList)) {
|
|
|
+ for (Long courseId : courseIdList) {
|
|
|
+ jdbcTemplate.update("insert into ecs_exam_course_group_course(group_id,course_id) values(?,?)", groupId,
|
|
|
+ courseId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
}
|
|
|
|