派生自 projectDept/qhighschool

111
胡仁荣
2022-12-02 b94deda20c9abd2fb6248b831e10a620eb7daf68
src/main/java/com/qxueyou/scc/admin/classes/service/impl/ClassLectureService.java
@@ -95,20 +95,22 @@
    @Override
    public List<MyLectureV> listLectureV(String learnerId, String chapterId, String keyword, Integer pageSize,
                                         Integer pageNum, String type) {
        StringBuffer hql = new StringBuffer("from MyLectureV where subjectId=? and id.userId=? order by lectureCreateTime desc");
//        StringBuffer hql = new StringBuffer("from MyLectureV where chapterId=? and id.userId=? and status=? order by lectureCreateTime desc");
//        List<Object> args = CollectionUtils.newList(chapterId, learnerId,ClsSubjectLecture.STATUS_DRAFT);
        StringBuffer hql = new StringBuffer("from MyLectureV where subjectId=? and id.userId=?");
        List<Object> args = CollectionUtils.newList(chapterId, learnerId);
        List<MyLectureV> myLectureVList = findList(hql.toString(), new Pager(pageSize, pageNum), args, MyLectureV.class);
        if(myLectureVList.size() < 1){
        }else {
            hql = new StringBuffer("from MyLectureV where chapterId=? and id.userId=? order by lectureCreateTime desc");
            args = CollectionUtils.newList(myLectureVList.get(0).getChapterId(), learnerId);
        }
        if (StringUtils.isNotEmpty(type)) {
            hql.append(" and lectureType=?");
            args.add(type);
        }
        List<MyLectureV> result = findList(hql.toString(), new Pager(pageSize, pageNum), args, MyLectureV.class);
        return result;
    }
@@ -268,6 +270,19 @@
      }
   }
    public Result updateLecturetime(String targetId) {
        ClsSubjectLecture lecture = read(ClsSubjectLecture.class, targetId);
        TraceUtils.setUpdateTrace(lecture);
        lecture.setUpdateTime(new Date());
        lecture.setUpdator(ClientUtils.getUserId());
        save(lecture);
        return new Result(true, "success");
    }
    @Override
    public Result updateLecture(String lectureId, String resId) {