|
|
@ -18,7 +18,6 @@ import com.ruoyi.biemo.nlp.SentimentAnalysisUtils;
|
|
|
|
import com.ruoyi.biemo.nlp.SummaryUtils;
|
|
|
|
import com.ruoyi.biemo.nlp.SummaryUtils;
|
|
|
|
import com.ruoyi.biemo.utils.FormatUtil;
|
|
|
|
import com.ruoyi.biemo.utils.FormatUtil;
|
|
|
|
import com.ruoyi.biemo.utils.MyObjects;
|
|
|
|
import com.ruoyi.biemo.utils.MyObjects;
|
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
|
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
@ -31,7 +30,6 @@ import org.springframework.context.ApplicationEvent;
|
|
|
|
import org.springframework.context.event.EventListener;
|
|
|
|
import org.springframework.context.event.EventListener;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.print.Doc;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
@ -59,9 +57,9 @@ public class DocInfoService extends EsService<DocInfo> {
|
|
|
|
protected DocInfo loadData(SearchSourceBuilder context, SearchHit hit) {
|
|
|
|
protected DocInfo loadData(SearchSourceBuilder context, SearchHit hit) {
|
|
|
|
String id = hit.getId();
|
|
|
|
String id = hit.getId();
|
|
|
|
if (Objects.isNull(id) || StringUtil.isEmpty(id)) return null;
|
|
|
|
if (Objects.isNull(id) || StringUtil.isEmpty(id)) return null;
|
|
|
|
System.out.println("hit.getId()===========>:"+id);
|
|
|
|
System.out.println("hit.getId()===========>:" + id);
|
|
|
|
DocInfo byId = mongoHelper.findById(id, DocInfo.class);
|
|
|
|
DocInfo byId = mongoHelper.findById(id, DocInfo.class);
|
|
|
|
System.out.println("mongo.FindById结果======》:"+byId.getId());
|
|
|
|
System.out.println("mongo.FindById结果======》:" + byId.getId());
|
|
|
|
return mongoHelper.findById(id, DocInfo.class);
|
|
|
|
return mongoHelper.findById(id, DocInfo.class);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -84,11 +82,14 @@ public class DocInfoService extends EsService<DocInfo> {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public DocInfo selectDocInfoById(String id) {
|
|
|
|
public DocInfo selectDocInfoById(String id) {
|
|
|
|
if (id == null || id.trim().length() == 0) {
|
|
|
|
if (id == null || id.trim().length() == 0) {
|
|
|
|
|
|
|
|
System.out.println("id为null");
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// List<DocInfo> docInfos = esLambdaQuery().eq(DocInfo::getId,id).query();
|
|
|
|
// List<DocInfo> docInfos = esLambdaQuery().eq(DocInfo::getId,id).query();
|
|
|
|
List<DocInfo> docInfos = esLambdaQuery().getDoc_InfoBy_Id(DocInfo::getId, id).query();
|
|
|
|
List<DocInfo> docInfos = esLambdaQuery().getDoc_InfoBy_Id(DocInfo::getId, id).query();
|
|
|
|
|
|
|
|
if (docInfos==null){
|
|
|
|
|
|
|
|
System.out.println("docInfos为null,接口终止");
|
|
|
|
|
|
|
|
}
|
|
|
|
return docInfos != null && docInfos.size() > 0 ? docInfos.get(0) : null;
|
|
|
|
return docInfos != null && docInfos.size() > 0 ? docInfos.get(0) : null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -466,7 +467,15 @@ public class DocInfoService extends EsService<DocInfo> {
|
|
|
|
List<WordCloudItem> wordCloudItemList = new ArrayList<>();
|
|
|
|
List<WordCloudItem> wordCloudItemList = new ArrayList<>();
|
|
|
|
DocInfo docInfo = new DocInfo();
|
|
|
|
DocInfo docInfo = new DocInfo();
|
|
|
|
docInfo.setCateId(categoryId);
|
|
|
|
docInfo.setCateId(categoryId);
|
|
|
|
|
|
|
|
if (categoryId.equals("631dfec580d94e2b7b697d4a")) {
|
|
|
|
|
|
|
|
System.out.println("cateID=======>" + categoryId);
|
|
|
|
|
|
|
|
}
|
|
|
|
List<DocInfo> docInfoList = selectDocInfoList(docInfo);
|
|
|
|
List<DocInfo> docInfoList = selectDocInfoList(docInfo);
|
|
|
|
|
|
|
|
if (docInfoList == null) {
|
|
|
|
|
|
|
|
System.out.println("docInfoList为null没有查询出来");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
System.out.println("docInfoList值为======》" + docInfoList);
|
|
|
|
|
|
|
|
}
|
|
|
|
List<Term> termList = docInfoList.parallelStream().filter(ObjectUtils::isNotEmpty).flatMap(_docInfo -> {
|
|
|
|
List<Term> termList = docInfoList.parallelStream().filter(ObjectUtils::isNotEmpty).flatMap(_docInfo -> {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
return NLPTokenizer.
|
|
|
|
return NLPTokenizer.
|
|
|
|