Commit bdbaee4f authored by liuyuanjun's avatar liuyuanjun

修改bug29524

parent 358635c5
...@@ -88,10 +88,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -88,10 +88,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
" bf.file_name AS fileName ," + " bf.file_name AS fileName ," +
" bf.file_time AS fileTime ," + " bf.file_time AS fileTime ," +
" bf.file_size AS fileSize ," + " bf.file_size AS fileSize ," +
" if((SELECT count(0) from b_file bbf\n" + " if((SELECT count(0) from b_file bff where bff.video_url = bf.video_url and bff.lesson_id = #{lessonId}) isCutPdf " +
" left join b_lesson bl on bl.business_id = bbf.lesson_id\n" +
" where bbf.video_url = bf.video_url\n" +
" and bl.corp_id != '###')>1,1,0) isCutPdf " +
" FROM " + " FROM " +
" b_chapter bc " + " b_chapter bc " +
" LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id " + " LEFT JOIN b_file bf ON bf.chapter_id = bc.business_id " +
...@@ -101,7 +98,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> { ...@@ -101,7 +98,7 @@ public interface BChapterRepository extends BaseMapper<BChapter> {
" ORDER BY " + " ORDER BY " +
" bc.sort asc</script>") " bc.sort asc</script>")
@ResultMap(value = "SupperChildListResultMap") @ResultMap(value = "SupperChildListResultMap")
List<QueryChapterListResDTO> queryBChaptersByPid(String pid); List<QueryChapterListResDTO> queryBChaptersByPid(@Param("pid") String pid,@Param("lessonId") String lessonId);
/** /**
* 根据章节id查找该章节学生分数列表 * 根据章节id查找该章节学生分数列表
......
...@@ -719,7 +719,7 @@ public class BChapterServiceImpl implements BChapterService { ...@@ -719,7 +719,7 @@ public class BChapterServiceImpl implements BChapterService {
if ((ReleaseStateEnum.RELEASED.getCode().equals(bLesson.getReleaseState()) || ReleaseStateEnum.CLOSED.getCode().equals(bLesson.getReleaseState())) && chapterCount == 1 && bChapter.getChapterLevel() != 1) { if ((ReleaseStateEnum.RELEASED.getCode().equals(bLesson.getReleaseState()) || ReleaseStateEnum.CLOSED.getCode().equals(bLesson.getReleaseState())) && chapterCount == 1 && bChapter.getChapterLevel() != 1) {
throw new ServiceException(ResultServiceEnums.CHAPTER_ONLY_ONE); throw new ServiceException(ResultServiceEnums.CHAPTER_ONLY_ONE);
} }
List<QueryChapterListResDTO> childList = bChapterRepository.queryBChaptersByPid(id); List<QueryChapterListResDTO> childList = bChapterRepository.queryBChaptersByPid(id,lessonId);
boolean hasChild = childList != null && childList.size() > 0; boolean hasChild = childList != null && childList.size() > 0;
boolean isChapter = bChapter.getChapterLevel() == ChapterLevelEnum.CHAPTER.getCode(); boolean isChapter = bChapter.getChapterLevel() == ChapterLevelEnum.CHAPTER.getCode();
if (isChapter && hasChild) { if (isChapter && hasChild) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment