派生自 projectDept/qhighschool

Administrator
2022-12-12 888af852af74ecd24f4f4370b61427771e60d314
src/main/java/com/qxueyou/scc/admin/progress/service/impl/item/LectureProgressService.java
@@ -5,6 +5,7 @@
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;
@@ -19,15 +20,18 @@
@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;
@@ -37,27 +41,26 @@
      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;