|
@@ -245,6 +245,28 @@ public class ExamApi extends ControllerSupport {
|
|
|
return new ResponseEntity<List<CourseGroup>>(groupList, HttpStatus.OK);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "查询课程组", notes = "查询课程组")
|
|
|
+ @GetMapping("/exam/queryCourseGroupsByCourseId/{courseId}")
|
|
|
+ public ResponseEntity<?> queryCourseGroupsByCourseId(@PathVariable Long courseId) {
|
|
|
+ List<CourseGroup> groupList = courseGroupRepo.queryCourseGroupsByCourseId(courseId);
|
|
|
+
|
|
|
+ for (CourseGroup courseGroup : groupList) {
|
|
|
+ List<Long> courseIdList = Lists.newArrayList();
|
|
|
+ courseGroup.setCourseIdList(courseIdList);
|
|
|
+
|
|
|
+ List<Map<String, Object>> queryList = jdbcTemplate.queryForList(
|
|
|
+ "select t.course_id from ecs_exam_course_group_course t where t.group_id=?", courseGroup.getId());
|
|
|
+ if (CollectionUtils.isNotEmpty(queryList)) {
|
|
|
+ for (Map<String, Object> map : queryList) {
|
|
|
+ Long curCourseId = Long.valueOf(map.get("COURSE_ID").toString());
|
|
|
+ courseIdList.add(curCourseId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return new ResponseEntity<Object>(HttpStatus.OK);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "添加课程组", notes = "添加课程组")
|
|
|
@PutMapping("/exam/courseGroup")
|
|
|
public ResponseEntity<?> addCourseGroup(@RequestBody CourseGroup courseGroup, HttpServletRequest request) {
|