|
@@ -1,10 +1,13 @@
|
|
package cn.cslg.pas.service;
|
|
package cn.cslg.pas.service;
|
|
|
|
|
|
import cn.cslg.pas.common.dto.PatentDTO;
|
|
import cn.cslg.pas.common.dto.PatentDTO;
|
|
|
|
+import cn.cslg.pas.common.model.request.QueryRequest;
|
|
|
|
+import cn.cslg.pas.common.model.request.StringRequest;
|
|
import cn.cslg.pas.common.utils.FormatUtil;
|
|
import cn.cslg.pas.common.utils.FormatUtil;
|
|
import cn.cslg.pas.common.utils.RedisUtil;
|
|
import cn.cslg.pas.common.utils.RedisUtil;
|
|
import cn.cslg.pas.common.vo.PatentWithIdVO;
|
|
import cn.cslg.pas.common.vo.PatentWithIdVO;
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
import cn.cslg.pas.domain.es.Patent;
|
|
|
|
+import cn.cslg.pas.service.business.PatentService;
|
|
import cn.cslg.pas.service.business.es.EsService;
|
|
import cn.cslg.pas.service.business.es.EsService;
|
|
|
|
|
|
import cn.cslg.pas.service.importPatent.SchedulingTaskService;
|
|
import cn.cslg.pas.service.importPatent.SchedulingTaskService;
|
|
@@ -29,12 +32,15 @@ public class EsServiceTests {
|
|
private EsService esService;
|
|
private EsService esService;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private PatentService patentService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
private RedisUtil redisUtil;
|
|
private RedisUtil redisUtil;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private SchedulingTaskService importTaskAdd;
|
|
private SchedulingTaskService importTaskAdd;
|
|
@Test
|
|
@Test
|
|
- void addPatent() throws Exception {
|
|
|
|
|
|
+ public void addPatent() throws Exception {
|
|
Patent patent =new Patent();
|
|
Patent patent =new Patent();
|
|
patent.setPatentNo("CN202023204739.4");
|
|
patent.setPatentNo("CN202023204739.4");
|
|
String id = esService.addPatent(patent);
|
|
String id = esService.addPatent(patent);
|
|
@@ -42,7 +48,7 @@ public class EsServiceTests {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- void getPatentByPatentNo() throws Exception {
|
|
|
|
|
|
+ public void getPatentByPatentNo() throws Exception {
|
|
//根据专利号获得id
|
|
//根据专利号获得id
|
|
PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo("CN201114765Y");
|
|
PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo("CN201114765Y");
|
|
Patent patent =new Patent();
|
|
Patent patent =new Patent();
|
|
@@ -54,12 +60,12 @@ public class EsServiceTests {
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- void updatePatent() throws Exception{
|
|
|
|
|
|
+ public void updatePatent() throws Exception{
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Test
|
|
@Test
|
|
- void addImportTask() throws Exception {
|
|
|
|
|
|
+ public void addImportTask() throws Exception {
|
|
List<Patent> patentList = esService.search("1",1,10);
|
|
List<Patent> patentList = esService.search("1",1,10);
|
|
System.out.println(patentList);
|
|
System.out.println(patentList);
|
|
Thread.sleep(1000000);
|
|
Thread.sleep(1000000);
|
|
@@ -67,7 +73,14 @@ public class EsServiceTests {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
void search() throws Exception {
|
|
void search() throws Exception {
|
|
- List<PatentDTO> list = esService.esSearch("patentNo=CN201199922Y and simpleFamilyNum>1 or simpleFamilyNum=0", 0, 50,null);
|
|
|
|
|
|
+ StringRequest stringRequest = new StringRequest();
|
|
|
|
+ stringRequest.setSearchQuery("titleTextContent=电子");
|
|
|
|
+ stringRequest.setCurrent(0L);
|
|
|
|
+ stringRequest.setSize(50L);
|
|
|
|
+ stringRequest.setProjectId(1);
|
|
|
|
+ Object o = patentService.queryMessage(stringRequest);
|
|
|
|
+ System.out.println(o);
|
|
|
|
+// List<PatentDTO> list = esService.esSearch("patentNo=CN201199922Y and simpleFamilyNum>1 or simpleFamilyNum=0", 0, 50,null);
|
|
// List<Patent> list = esService.Search("titleTextContent=电子 or projectId=1", 0, 50,null);
|
|
// List<Patent> list = esService.Search("titleTextContent=电子 or projectId=1", 0, 50,null);
|
|
// List<Patent> list = esService.Search("patentNo=CN201199922Y and simpleFamilyNum>1", 0, 50,null);
|
|
// List<Patent> list = esService.Search("patentNo=CN201199922Y and simpleFamilyNum>1", 0, 50,null);
|
|
// List<Patent> list = esService.Search("publicDate=2009-03", 0, 50,null);
|
|
// List<Patent> list = esService.Search("publicDate=2009-03", 0, 50,null);
|
|
@@ -75,6 +88,6 @@ public class EsServiceTests {
|
|
// List<Patent> list = esService.Search("titleTextContent=电子", 0, 50,null);
|
|
// List<Patent> list = esService.Search("titleTextContent=电子", 0, 50,null);
|
|
// List<Patent> list = esService.Search("projectId=1", 0, 50,null);
|
|
// List<Patent> list = esService.Search("projectId=1", 0, 50,null);
|
|
// List<Patent> list = esService.search("patentNo=CN201199922Y", 0, 50);
|
|
// List<Patent> list = esService.search("patentNo=CN201199922Y", 0, 50);
|
|
- System.out.println(list);
|
|
|
|
|
|
+// System.out.println(list);
|
|
}
|
|
}
|
|
}
|
|
}
|