/// <summary> /// 单个授权 /// <para>作 者: Huang GaoLiang </para> /// <para>创建时间: 2018-10-18</para> /// </summary> /// <param name="courseIds">课程编号集合</param> public async Task SaveAsync(List <long> courseIds) { List <TblDatSchoolCourse> schoolCourseList = SchoolCouseDataConstructe(ref courseIds); // 1、添加之前先删除对应的数据 await _schoolCourseRepository.Value.BatchDeleteBySchoolId(_schoolId); // 2、添加 await _schoolCourseRepository.Value.AddTask(schoolCourseList); // 3、重新授权后,需要重新生成学习计划 await StudyPlanService.AsyncSchoolCourse(_schoolId); }
/// <summary> /// 批量增加授权 /// <para>作 者: Huang GaoLiang </para> /// <para>创建时间: 2018-09-18 </para> /// </summary> /// <param name="dto">校区批量授权课程数据</param> public static async Task BatchSaveAsync(SchoolCourseSaveBatchRequest dto) { var schools = dto.Schools; // 1、获取所有校区编号 foreach (string schoolId in schools) { SchoolCourseAccessService service = new SchoolCourseAccessService(schoolId, dto.CompanyId); // 处理后数据 var course = dto.Course; await service.SaveCoverAsync(course); // 重新授权后,需要重新生成学习计划 await StudyPlanService.AsyncSchoolCourse(schoolId); } }