提交 7edd273e authored 作者: renjianyu's avatar renjianyu

--no commit message

上级 a8b26c7f
......@@ -191,24 +191,24 @@ public class FgArticleLibraryController {
id = articleLibrary.getId();
}
//判断权限
FgArticleLibraryOneVO vo = service.articleOneInfoById(id, false);
articleLibraryOneVO.setMessageCode(vo.getMessageCode());
articleLibraryOneVO.setMessage(vo.getMessage());
if(vo.getMessageCode() != null){
if(StringUtils.isNotBlank(vo.getText())){
String text = vo.getText().replaceAll("\\<.*?>", "");
Integer totalCount = text.length();
Integer count = totalCount/10;
vo.setText(text.substring(0, count));
}else{
vo.setText(null);
}
articleLibraryOneVO.setVideo(null);
articleLibraryOneVO.setAudio(null);
}
vo.setOrderNum(articleLibraryOneVO.getOrderNum());
// FgArticleLibraryOneVO vo = service.articleOneInfoById(id, false);
// articleLibraryOneVO.setMessageCode(vo.getMessageCode());
// articleLibraryOneVO.setMessage(vo.getMessage());
// if(vo.getMessageCode() != null){
// if(StringUtils.isNotBlank(vo.getText())){
// String text = vo.getText().replaceAll("\\<.*?>", "");
// Integer totalCount = text.length();
// Integer count = totalCount/10;
// vo.setText(text.substring(0, count));
// }else{
// vo.setText(null);
// }
// articleLibraryOneVO.setVideo(null);
// articleLibraryOneVO.setAudio(null);
// }
// vo.setOrderNum(articleLibraryOneVO.getOrderNum());
// 保存阅读记录
readingRecordService.saveOrUpdateRecord(vo);
// readingRecordService.saveOrUpdateRecord(vo);
// 更新浏览量
service.updateBrowseNum(articleLibraryOneVO.getId());
Integer orderMaxNum = chapterLibraryService.selectMaxOrderNum(form.getBookId());
......
......@@ -171,6 +171,23 @@ public class FgEbookController {
return CallBack.success(volist);
}
@ApiOperation("首页三本书,册为基础,只到导读的文章")
@GetMapping("/get/all/tree")
public CallBack<List<FgEbookChapterVO>> allechoArtice() {
List<FgEbookChapterVO> volist = new ArrayList<FgEbookChapterVO>();
PageHelper.orderBy(" updatetime asc");
List<Ebook> list = ebookservice.selectAll();
for (Ebook ebook : list) {
FgEbookChapterVO vo= clmapper.selectchapter(ebook.getId(),1);
// 目录
List<ChapterLibrary> chapterList = this.getDirectoryAll(null,ebook.getId(),1);
vo.setChapterList(chapterList);
volist.add(vo);
}
return CallBack.success(volist);
}
/**
* 根据图书id查询目录
* @param form
......@@ -420,6 +437,39 @@ public class FgEbookController {
}
/**
* 根据图书id查询目录
* @param form
* @return
* @author ycw
* @date: 2019年1月11日 上午9:30:06
*/
public List<ChapterLibrary> getDirectoryAll(String chapterName, String bookId,Integer orderNum) {
if(StringUtils.isBlank(bookId)){
throw new BaseException("参数不能为空!");
}
Example example = clservice.createExample();
if(StringUtils.isNotBlank(chapterName)){
example.createCriteria().andEqualTo("bookId", bookId).andLike("chapterName", "%" + chapterName +"%");
PageHelper.orderBy(" orderNum asc, pdfNum asc");
List<ChapterLibrary> list = clservice.selectByExample(example);
return list;
} else {
// example.createCriteria().andEqualTo("bookId", bookId).andNotEqualTo("orderNum", orderNum);
// PageHelper.orderBy(" orderNum asc, pdfNum asc");
// List<ChapterLibrary> list = clservice.selectByExample(example);
List<ChapterLibrary> list =clmapper.selectchapterListTree(bookId, orderNum);
//List<ChapterLibrary> voList = Copy.copyList(list , ChapterLibrary.class, obj -> obj.getLevel().intValue() == 0);
return list;
}
}
public List<ChapterLibrary> tree(List<ChapterLibrary> list,List<ChapterLibrary> voList){
voList.forEach(entity ->{
//第一次设置 一级分类的子类 后续递归设置 子类的子类
......
......@@ -23,5 +23,8 @@ public interface FgChapterLibraryMapper extends BaseMapper<ChapterLibrary> {
@Select("select *,(select GROUP_CONCAT(DISTINCT c.resourcetype) from res_article_library a inner join res_resource_relation c on a.id = c.objectid where a.markid = b.markid ORDER BY c.resourcetype ) resourceType from res_chapter_library b where bookid = #{bookid} and orderNum != #{orderNum} order by orderNum asc, pdfNum asc")
List<ChapterLibrary> selectchapterList(@Param("bookid")String bookid ,@Param("orderNum")Integer orderNum );
@Select("select *,(select GROUP_CONCAT(DISTINCT c.resourcetype) from res_article_library a inner join res_resource_relation c on a.id = c.objectid where a.markid = b.markid ORDER BY c.resourcetype ) resourceType from res_chapter_library b where bookid = #{bookid} and orderNum != #{orderNum} and level = 0 order by orderNum asc, pdfNum asc")
List<ChapterLibrary> selectchapterListTree(@Param("bookid")String bookid ,@Param("orderNum")Integer orderNum );
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论