提交 bc7cffef authored 作者: chaoyanjun's avatar chaoyanjun

--no commit message

上级 ddc8f151
......@@ -42,6 +42,9 @@ import com.zrqx.resource.fg.mapper.ebook.FgBookMapper;
import com.zrqx.resource.fg.mapper.ebook.FgEbookDiyTypeMapper;
import org.apache.commons.lang3.StringUtils;
import org.apache.solr.common.SolrDocument;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -187,7 +190,16 @@ public class FgArticleLibrarySerivceImpl extends BaseServiceImpl<ArticleLibrary,
FgArticleLibraryOneVO one = articleOneInfoById(li.getId(), true);
BeanUtils.copyProperties(one, li);
ArticleLibrary article = mapper.selectByPrimaryKey(li.getId());
if(article != null){
if(StringUtils.isEmpty(article.getImg())){
Document doc = Jsoup.parse(article.getText());
Elements els = doc.select("img");
if(els.size()>0){
li.setImg(els.get(0).attr("src"));
}
}
li.setIsPdf(article.getPdf() == null ? Integer.parseInt(BooleanStatusEnum.NO.getCode()) : Integer.parseInt(BooleanStatusEnum.YES.getCode()));
li.setIsAudio(article.getAudio() == null ? Integer.parseInt(BooleanStatusEnum.NO.getCode()) : Integer.parseInt(BooleanStatusEnum.YES.getCode()));
li.setIsVideo(article.getVideo() == null ? Integer.parseInt(BooleanStatusEnum.NO.getCode()) : Integer.parseInt(BooleanStatusEnum.YES.getCode()));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论