| | |
| | | |
| | | import javax.annotation.PostConstruct; |
| | | |
| | | import com.qxueyou.scc.teach.subject.service.ILectureService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Service("LectureProgressService") |
| | | public class LectureProgressService extends CommonAppService implements IDetailProgressService { |
| | | |
| | | |
| | | @Autowired |
| | | IClassLectureService lectureService; |
| | | |
| | | IClassLectureService clsLectureService; |
| | | |
| | | @Autowired |
| | | ILectureService lectureService; |
| | | |
| | | /** |
| | | * 各类型课件进度服务实现 |
| | | * 各类型课件进度服务实现 |
| | | */ |
| | | private Map<String, IDetailProgressService> resItemServiceMap = new HashMap<String, IDetailProgressService>(6); |
| | | |
| | | |
| | | @Autowired |
| | | private ApplicationContext appContext; |
| | | |
| | |
| | | addLectureProgressService(appContext.getBean("LectureAudioProgressService",IDetailProgressService.class)); |
| | | addLectureProgressService(appContext.getBean("LectureDocProgressService",IDetailProgressService.class)); |
| | | } |
| | | |
| | | |
| | | private void addLectureProgressService(IDetailProgressService service) { |
| | | resItemServiceMap.put(service.getType(), service); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public Result addProgress(String targetId,String learnerId, int start, int end) { |
| | | ClsSubjectLecture lecture = lectureService.readClsLecture(targetId); |
| | | |
| | | ClsSubjectLecture lecture = clsLectureService.readClsLecture(targetId); |
| | | String lectureType = null; |
| | | if(lecture == null) { |
| | | lectureType = this.read(SubjectLecture.class, targetId).getLectureType(); |
| | | }else { |
| | | lectureType = lecture.getLectureType(); |
| | | } |
| | | |
| | | |
| | | return resItemServiceMap.get(lectureType).addProgress(targetId, learnerId, start, end); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getType() { |
| | | return Progress.PROGRESS_TYPE_LECTURE; |