派生自 projectDept/qhighschool

Administrator
2022-12-02 b968e4a5a2e374d6eec36113e56d02565a57865c
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 hql1 = new StringBuffer("from MyLectureV where subjectId=? and id.userId=?");
        List<Object> args1 = CollectionUtils.newList(chapterId, learnerId);
        List<MyLectureV> myLectureVList = findList(hql1.toString(), new Pager(pageSize, pageNum), args1, MyLectureV.class);
        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);
        StringBuffer hql = new StringBuffer("from MyLectureV where chapterId=? and id.userId=? order by lectureCreateTime desc");
        List<Object> args = CollectionUtils.newList(myLectureVList.get(0).getChapterId(), learnerId);
        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) {