|
@@ -12,6 +12,7 @@ import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
|
|
import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
|
|
import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
|
|
import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
|
|
import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
|
|
import cn.cslg.pas.common.vo.EsConfigVO;
|
|
import cn.cslg.pas.common.vo.EsConfigVO;
|
|
|
|
+import cn.cslg.pas.common.vo.NoveltyProjectVO.NoveltyCompareRecordVO;
|
|
import cn.cslg.pas.common.vo.PatentWithIdVO;
|
|
import cn.cslg.pas.common.vo.PatentWithIdVO;
|
|
import cn.cslg.pas.common.vo.ScratchWordsVO;
|
|
import cn.cslg.pas.common.vo.ScratchWordsVO;
|
|
import cn.cslg.pas.domain.business.ScratchWords;
|
|
import cn.cslg.pas.domain.business.ScratchWords;
|
|
@@ -89,10 +90,10 @@ public class EsScratchWordsService {
|
|
try {
|
|
try {
|
|
markingLast = this.getById(id);
|
|
markingLast = this.getById(id);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new XiaoShiException("错误");
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR,"查询错误");
|
|
}
|
|
}
|
|
if (markingLast == null) {
|
|
if (markingLast == null) {
|
|
- throw new XiaoShiException("划词信息不存在");
|
|
|
|
|
|
+ throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR,"id不存在");
|
|
}
|
|
}
|
|
BeanUtils.copyProperties(marking, markingLast);
|
|
BeanUtils.copyProperties(marking, markingLast);
|
|
this.updateToEs(marking, id);
|
|
this.updateToEs(marking, id);
|
|
@@ -134,7 +135,7 @@ public class EsScratchWordsService {
|
|
return records;
|
|
return records;
|
|
}
|
|
}
|
|
|
|
|
|
- public Query getSearchQuerys(StringRequest stringRequest) {
|
|
|
|
|
|
+ public Query getSearchQuerys(StringRequest stringRequest) {
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
String createId = personnelVO.getId();
|
|
String createId = personnelVO.getId();
|
|
Integer tenantId = personnelVO.getTenantId();
|
|
Integer tenantId = personnelVO.getTenantId();
|
|
@@ -398,4 +399,42 @@ public class EsScratchWordsService {
|
|
return maps;
|
|
return maps;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public Records queryNoveltyRecord(StringRequest stringRequest) throws Exception{
|
|
|
|
+ Long current = stringRequest.getCurrent();
|
|
|
|
+ Long size = stringRequest.getSize();
|
|
|
|
+ String condition =stringRequest.getSearchQuery();
|
|
|
|
+ Records records = new Records();
|
|
|
|
+ List<NoveltyCompareRecordVO> vos = new ArrayList<>();
|
|
|
|
+ Query searchQuerys = this.getSearchQQuery(condition);
|
|
|
|
+ SearchRequest.Builder builder = new SearchRequest.Builder();
|
|
|
|
+ builder.index("patent_marking");
|
|
|
|
+ if (current == null || size == null || current < 0 || size < 0) {
|
|
|
|
+ current = Long.parseLong(1 + "");
|
|
|
|
+ size = Long.parseLong(1000 + "");
|
|
|
|
+ }
|
|
|
|
+ builder.from((current.intValue() - 1) * size.intValue()).size(size.intValue());
|
|
|
|
+ builder.query(searchQuerys);
|
|
|
|
+
|
|
|
|
+ long total = 0;
|
|
|
|
+ try {
|
|
|
|
+ SearchResponse<Marking> response = client.search(builder.build(), Marking.class);
|
|
|
|
+ List<Hit<Marking>> hits = response.hits().hits();
|
|
|
|
+ total = response.hits().total().value();
|
|
|
|
+ for (Hit<Marking> hit : hits) {
|
|
|
|
+ Marking marking = hit.source();
|
|
|
|
+ NoveltyCompareRecordVO noveltyCompareRecordVO = new NoveltyCompareRecordVO();
|
|
|
|
+ BeanUtils.copyProperties(marking, noveltyCompareRecordVO);
|
|
|
|
+ noveltyCompareRecordVO.setId(hit.id());
|
|
|
|
+ vos.add(noveltyCompareRecordVO);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ records.setTotal(total);
|
|
|
|
+ records.setData(vos);
|
|
|
|
+ return records;
|
|
|
|
+ }
|
|
}
|
|
}
|