派生自 projectDept/qhighschool

yn147
2022-11-24 c6dd8423a2ca6e225deb93b78891d5565136cd4b
src/main/java/com/qxueyou/scc/teach/subject/service/impl/SubjectLectureService.java
@@ -2,6 +2,7 @@
import java.util.List;
import com.qxueyou.scc.admin.classes.service.IClassLectureService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
@@ -47,6 +48,9 @@
   @Autowired
   IProgressService progressService;
   @Autowired
   IClassLectureService clsLectureService;
   @Override
   public Result addChapter(String subjectId, String parentChapterId, String name) {
@@ -87,7 +91,7 @@
   /**
    * 删除单个章节
    *
    *
    * @param chapterId
    *            章节id
    * @return
@@ -138,7 +142,7 @@
   /**
    * 初始化
    *
    *
    * @param subjectId
    * @return
    */
@@ -173,6 +177,7 @@
      lecture.setRemark(res.getRemark());
      lecture.setSubjectId(chapter.getSubjectId());
      lecture.setResItemId(res.getResId());
      save(lecture);
@@ -209,7 +214,7 @@
   }
   /**
    *
    *
    * @param lectureId
    *            课件id
    * @return
@@ -277,14 +282,14 @@
   @Override
   public int listLectureCount(String chapterId, String keyword, String type) {
      StringBuffer hql = new StringBuffer("from SubjectLecture where chapterId=? and name like ? and deleteFlag is false");
      List<Object> args = CollectionUtils.newList(chapterId,'%' + keyword.trim() + '%');
      if (StringUtils.isNotEmpty(type)) {
         hql.append(" and lectureType=?");
         args.add(type);
      }
      return findCount(hql.toString(),args);
   }
@@ -365,7 +370,7 @@
   @Override
   public Result doStudy(String lectureId, Double from, Double to) {
      String userId = null;
      return progressService.addProgress(Progress.PROGRESS_TYPE_LECTURE, lectureId, from.intValue(), to.intValue(),
      return progressService.addProgress(Progress.PROGRESS_TYPE_LECTURE, lectureId, from.doubleValue(), to.doubleValue(),
            userId);
   }