提交 bad68973 authored 作者: renjianyu's avatar renjianyu

--no commit message

上级 5d667dd8
package com.zrqx.resource.commons.vo.fg.articlelibrary;
import java.math.BigDecimal;
import java.util.List;
import com.zrqx.resource.commons.model.articlelibrary.ArticleToAudio;
import com.zrqx.resource.commons.model.resourcerelation.ResourceRelation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="FgArticleLibraryOneVO",description="前台-单个查询文章返回的实体")
public class FgArticlLibraryVo {
@ApiModelProperty(value = "文章标题")
private String name;
@ApiModelProperty("作者")
private String bookId;
@ApiModelProperty(value = "章节标识号(bookid+txt编号)")
private String markid;
}
...@@ -39,6 +39,7 @@ import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary; ...@@ -39,6 +39,7 @@ import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary;
import com.zrqx.resource.commons.model.articlelibrary.ChapterLibrary; import com.zrqx.resource.commons.model.articlelibrary.ChapterLibrary;
import com.zrqx.resource.commons.model.ebook.Ebook; import com.zrqx.resource.commons.model.ebook.Ebook;
import com.zrqx.resource.commons.model.record.ReadingRecord; import com.zrqx.resource.commons.model.record.ReadingRecord;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticlLibraryVo;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryOneVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryOneVO;
import com.zrqx.resource.commons.vo.fg.diytype.FgDiyTypeVo; import com.zrqx.resource.commons.vo.fg.diytype.FgDiyTypeVo;
...@@ -120,14 +121,10 @@ public class FgArticleLibraryController { ...@@ -120,14 +121,10 @@ public class FgArticleLibraryController {
return CallBack.success(new PageInfo<FgArticleLibraryListVO>(list)); return CallBack.success(new PageInfo<FgArticleLibraryListVO>(list));
} }
@ApiOperation(value = "查询", notes = "根据ID查询") @ApiOperation(value = "查询", notes = "根据名称查询补全加高亮")
@GetMapping(value = "/get/all/name") @GetMapping(value = "/get/all/name")
public CallBack<List<String>> getAllName(FgQueryArticleLibraryForm from) { public CallBack<List<FgArticlLibraryVo>> getAllName(FgQueryArticleLibraryForm form) {
Example example = service.createExample(); return CallBack.success(service.getAllName(form));
example.createCriteria().andLike("name", "%"+from.getName()+"%");
List<ArticleLibrary> list = service.selectByExample(example);
List <String> aa = list.stream().map(ArticleLibrary::getName).collect(Collectors.toList());
return CallBack.success(aa);
} }
......
...@@ -1501,11 +1501,14 @@ public class FgResourceLibraryController { ...@@ -1501,11 +1501,14 @@ public class FgResourceLibraryController {
resultMap.put("ebookOrderNum", solrDocument.get("ebookOrderNum")); resultMap.put("ebookOrderNum", solrDocument.get("ebookOrderNum"));
resultMap.put("resourceType", solrDocument.get("resourceType")); resultMap.put("resourceType", solrDocument.get("resourceType"));
resultMap.put("cover",solrDocument.get("cover")); resultMap.put("cover",solrDocument.get("cover"));
resultMap.put("keywords", solrDocument.get("keywords"));
resultMap.put("bookId", solrDocument.get("bookId"));
resultMap.put("markId", solrDocument.get("markId"));
//resultMap.put("browseNum",solrDocument.get("browseNum")); //resultMap.put("browseNum",solrDocument.get("browseNum"));
//resultMap.put("resourceType",solrDocument.get("resourceType")); //resultMap.put("resourceType",solrDocument.get("resourceType"));
//resultMap.put("name",solrDocument.get("name")); //resultMap.put("name",solrDocument.get("name"));
//resultMap.put("author", solrDocument.get("author")); resultMap.put("author", solrDocument.get("author"));
//resultMap.put("authorId", solrDocument.get("authorId")); //resultMap.put("authorId", solrDocument.get("authorId"));
//将高亮处理的结果存人resultMap //将高亮处理的结果存人resultMap
if(highlightMap != null){ if(highlightMap != null){
......
...@@ -9,6 +9,7 @@ import com.zrqx.core.mapper.BaseMapper; ...@@ -9,6 +9,7 @@ import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryArticleLibraryForm; import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryArticleLibraryForm;
import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryRecommedArticleForm; import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryRecommedArticleForm;
import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary; import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticlLibraryVo;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO;
/** /**
* 文章库 * 文章库
...@@ -126,4 +127,17 @@ public interface FgArticleLibraryMapper extends BaseMapper<ArticleLibrary> { ...@@ -126,4 +127,17 @@ public interface FgArticleLibraryMapper extends BaseMapper<ArticleLibrary> {
+ "</script>") + "</script>")
List<FgArticleLibraryListVO> query(@Param("form")FgQueryArticleLibraryForm form); List<FgArticleLibraryListVO> query(@Param("form")FgQueryArticleLibraryForm form);
/**
* @param
* @return
*/
@Select("<script>"
+ "select c.markid,c.bookid,b.name from res_ebook a INNER JOIN res_article_library b on a.id = b.bookid INNER JOIN res_chapter_library c on c.markid = b.markid where c.level =1 and b.`status` ='1' "
+ " like(b.name,form.name) "
+ "</script>")
List<FgArticlLibraryVo> getAllName(@Param("form")FgQueryArticleLibraryForm form);
} }
...@@ -41,6 +41,7 @@ import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary; ...@@ -41,6 +41,7 @@ import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary;
import com.zrqx.resource.commons.model.articlelibrary.ArticleLibraryDiyType; import com.zrqx.resource.commons.model.articlelibrary.ArticleLibraryDiyType;
import com.zrqx.resource.commons.model.ebook.Book; import com.zrqx.resource.commons.model.ebook.Book;
import com.zrqx.resource.commons.model.ebook.EbookDiyType; import com.zrqx.resource.commons.model.ebook.EbookDiyType;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticlLibraryVo;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryOneVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryOneVO;
import com.zrqx.resource.fg.manage.memberconllection.FgMemberConllectionManage; import com.zrqx.resource.fg.manage.memberconllection.FgMemberConllectionManage;
...@@ -749,4 +750,17 @@ public class FgArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary, ...@@ -749,4 +750,17 @@ public class FgArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,
vo.setVideo("无权限"); vo.setVideo("无权限");
} }
} }
@Override
public List<FgArticlLibraryVo> getAllName(FgQueryArticleLibraryForm form) {
List<FgArticlLibraryVo> list = mapper.getAllName(form);
for (FgArticlLibraryVo fgArticlLibraryVo : list) {
String name = fgArticlLibraryVo.getName();
System.out.println(" <span style='color:red;'>" +form.getName() +"</span>");
String newName = name.replace(form.getName(), " <span style='color:red;'>" +form.getName() +"</span>");
fgArticlLibraryVo.setName(newName);
}
return list;
}
} }
...@@ -12,6 +12,7 @@ import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryArticleLibraryFor ...@@ -12,6 +12,7 @@ import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryArticleLibraryFor
import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryRecommedArticleForm; import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryRecommedArticleForm;
import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryRelatedArticleForm; import com.zrqx.resource.commons.form.fg.articlelibrary.FgQueryRelatedArticleForm;
import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary; import com.zrqx.resource.commons.model.articlelibrary.ArticleLibrary;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticlLibraryVo;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryListVO;
import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryOneVO; import com.zrqx.resource.commons.vo.fg.articlelibrary.FgArticleLibraryOneVO;
/** /**
...@@ -114,4 +115,9 @@ public interface FgArticleLibraryService extends BaseService<ArticleLibrary,Stri ...@@ -114,4 +115,9 @@ public interface FgArticleLibraryService extends BaseService<ArticleLibrary,Stri
* @date: 2019年1月18日 下午1:50:44 * @date: 2019年1月18日 下午1:50:44
*/ */
List<FgArticleLibraryListVO> queryRecommendArticle(FgQueryRecommedArticleForm form); List<FgArticleLibraryListVO> queryRecommendArticle(FgQueryRecommedArticleForm form);
List<FgArticlLibraryVo> getAllName(FgQueryArticleLibraryForm form);
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论