|
|
|
@ -309,16 +309,18 @@ public class TeacherOpenCourseMergeScheduleSessionService extends CoreBaseServic
|
|
|
|
|
* 教师端-导入课程
|
|
|
|
|
* @param teacherOpenCourseScheduleSessionIds 导入的排课IDs
|
|
|
|
|
*/
|
|
|
|
|
public void importScheduleSession(@NotEmpty(message = "排IDs不能为空!") String teacherOpenCourseScheduleSessionIds) {
|
|
|
|
|
public void importScheduleSession(@NotEmpty(message = "排IDs不能为空!") String teacherOpenCourseScheduleSessionIds,Long teacherOpenCourseId) {
|
|
|
|
|
|
|
|
|
|
for (String id : teacherOpenCourseScheduleSessionIds.split(",")) {
|
|
|
|
|
Long teacherOpenCourseScheduleSessionId = Long.valueOf(id);
|
|
|
|
|
//排课
|
|
|
|
|
TeacherOpenCourseScheduleSession info = teacherOpenCourseScheduleSessionService.getInfo(teacherOpenCourseScheduleSessionId);
|
|
|
|
|
// 先删除,再导入。支持导入重复数据,保证数据唯一
|
|
|
|
|
teacherOpenCourseMergeScheduleSessionDao.deleteByTeacherOpenCourseIdAndSessionId(info.getTeacherOpenCourseId(), teacherOpenCourseScheduleSessionId);
|
|
|
|
|
teacherOpenCourseMergeScheduleSessionDao.deleteByTeacherOpenCourseIdAndSessionId(teacherOpenCourseId, teacherOpenCourseScheduleSessionId);
|
|
|
|
|
|
|
|
|
|
// 保存到关联表
|
|
|
|
|
TeacherOpenCourseMergeScheduleSession scheduleSession = BeanUtil.copyProperties(info, TeacherOpenCourseMergeScheduleSession.class);
|
|
|
|
|
scheduleSession.setTeacherOpenCourseId(teacherOpenCourseId);
|
|
|
|
|
scheduleSession.setTeacherOpenCourseMergeScheduleSessionStatus(1);
|
|
|
|
|
scheduleSession.setTeacherOpenCourseMergeScheduleSessionAddTime(new Date());
|
|
|
|
|
teacherOpenCourseMergeScheduleSessionDao.insert(scheduleSession);
|
|
|
|
|