123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623 |
- package cn.cslg.pas.service;
- import cn.cslg.pas.common.dto.*;
- import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
- import cn.cslg.pas.common.dto.business.ReportTempleDTO;
- import cn.cslg.pas.common.dto.business.SelectClaimDTO;
- import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
- import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
- import cn.cslg.pas.common.model.cronModel.Records;
- import cn.cslg.pas.common.model.request.*;
- import cn.cslg.pas.common.utils.Response;
- import cn.cslg.pas.common.utils.StringUtils;
- import cn.cslg.pas.common.utils.parseQueryToTree.expressManager;
- import cn.cslg.pas.common.utils.parseQueryToTree.operateNode;
- import cn.cslg.pas.common.utils.parseQueryToTree.treeNode;
- import cn.cslg.pas.common.vo.EsExplainTextVO;
- import cn.cslg.pas.common.vo.business.*;
- import cn.cslg.pas.controller.EventController;
- import cn.cslg.pas.controller.PatentController;
- import cn.cslg.pas.domain.es.FamilyPatent;
- import cn.cslg.pas.domain.es.Patent;
- import cn.cslg.pas.domain.es.PatentFamilyMessage;
- import cn.cslg.pas.mapper.AssoProjectEventMapper;
- import cn.cslg.pas.service.business.MergePersonService;
- import cn.cslg.pas.service.business.ProductMarketDataService;
- import cn.cslg.pas.service.business.ReportTempleService;
- import cn.cslg.pas.service.business.es.*;
- import cn.cslg.pas.service.common.FileManagerService;
- import cn.cslg.pas.service.common.TranslateService;
- import cn.cslg.pas.service.query.FormatQueryService;
- import co.elastic.clients.elasticsearch.ElasticsearchClient;
- import co.elastic.clients.elasticsearch._types.query_dsl.Query;
- import co.elastic.clients.elasticsearch.core.SearchRequest;
- import co.elastic.clients.elasticsearch.core.SearchResponse;
- import co.elastic.clients.elasticsearch.core.search.Hit;
- import com.alibaba.fastjson.JSONObject;
- import org.apache.http.entity.ContentType;
- import org.junit.jupiter.api.Test;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.boot.test.context.SpringBootTest;
- import org.springframework.mock.web.MockMultipartFile;
- import org.springframework.transaction.annotation.Propagation;
- import org.springframework.transaction.annotation.Transactional;
- import org.springframework.util.CollectionUtils;
- import org.springframework.web.multipart.MultipartFile;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.IOException;
- import java.math.BigDecimal;
- import java.util.*;
- import java.util.function.Function;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import java.util.stream.Collectors;
- /**
- * @author chenyu
- * @date 2023/9/6
- */
- @SpringBootTest
- public class EventServiceTests {
- @Autowired
- private EventController eventController;
- @Autowired
- PatentController patentController;
- @Autowired
- private EsService esService;
- @Autowired
- private EsCountService esCountService;
- @Autowired
- private ReportTempleService templeService;
- @Autowired
- private EsPatentService patentService;
- @Autowired
- private EsCustomFieldService esCustomFieldService;
- @Autowired
- private MergePersonService mergePersonService;
- @Autowired
- private FileManagerService fileManagerService;
- @Autowired
- private ProductMarketDataService productMarketDataService;
- @Autowired
- private AssoProjectEventMapper assoProjectEventMapper;
- @Autowired
- private TranslateService translateService;
- @Test
- void test() throws Exception {
- StringRequest queryRequest = new StringRequest();
- queryRequest.setSearchQuery("id=52");
- List<OrderDTO> dtos = new ArrayList<>();
- OrderDTO orderDTO1 = new OrderDTO();
- orderDTO1.setOrderBy("name");
- orderDTO1.setOrderType(0);
- OrderDTO orderDTO2 = new OrderDTO();
- orderDTO2.setOrderBy("createName");
- orderDTO2.setOrderType(1);
- dtos.add(orderDTO1);
- dtos.add(orderDTO2);
- queryRequest.setOrderDTOList(dtos);
- queryRequest.setCurrent(Long.parseLong("1"));
- queryRequest.setSize(Long.parseLong("10"));
- Response response = eventController.queryEvent(queryRequest);
- System.out.println(response);
- }
- @Test
- void add() throws Exception {
- JSONObject jsonObj = new JSONObject();
- jsonObj.put("name", "事件4");
- jsonObj.put("description", "描述1");
- jsonObj.put("clientId", 1);
- jsonObj.put("scenarioId", 2);
- jsonObj.put("eventDate", "");
- String json_to_string = JSONObject.toJSONString(jsonObj);
- List<MultipartFile> list = new ArrayList<>();
- File file = new File("C:\\Users\\admin\\Desktop\\test.txt");
- MultipartFile mulFile = new MockMultipartFile(
- "th.jpg", //文件名
- "th.jpg", //originalName 相当于上传文件在客户机上的文件名
- ContentType.APPLICATION_OCTET_STREAM.toString(), //文件类型
- new FileInputStream(file) //文件流
- );
- list.add(mulFile);
- eventController.addEvent(json_to_string, list);
- }
- @Test
- void groupEvent() throws Exception {
- StringGroupRequest queryRequest = new StringGroupRequest();
- queryRequest.setSearchQuery("name~事件 and createName=朱");
- List<OrderDTO> dtos = new ArrayList<>();
- OrderDTO orderDTO1 = new OrderDTO();
- orderDTO1.setOrderBy("name");
- orderDTO1.setOrderType(0);
- OrderDTO orderDTO2 = new OrderDTO();
- orderDTO2.setOrderBy("createName");
- orderDTO2.setOrderType(1);
- dtos.add(orderDTO1);
- dtos.add(orderDTO2);
- queryRequest.setOrderDTOList(dtos);
- queryRequest.setCurrent(Long.parseLong("1"));
- queryRequest.setSize(Long.parseLong("10"));
- queryRequest.setGroupBy("name");
- eventController.groupEvent(queryRequest);
- }
- @Test
- void test1() throws Exception {
- StringGroupRequest groupRequest = new StringGroupRequest();
- groupRequest.setGroupBy("groupMonthTime");
- Records records = (Records) productMarketDataService.getGroup(groupRequest, "productMarketData");
- System.out.println(records);
- }
- @Test
- void test11() throws Exception {
- // List<Patent> list = esService.Search("publicDate=2009-03", 0, 50,null);
- // MapRequest mapRequest = new MapRequest();
- // Map<String, Object> map = new HashMap<>();
- // map.put("titleTextContent", "电子");
- // map.put("patentNo", "CN201199922Y");
- // mapRequest.setSearchQuery(map);
- // mapRequest.setCurrent(0L);
- // mapRequest.setSize(50L);
- // mapRequest.setProjectId(1);
- StringRequest stringRequest = new StringRequest();
- // stringRequest.setSearchQuery("appCity=济南");
- // stringRequest.setSearchQuery("mipcLevel1=H");
- // stringRequest.setSearchQuery("agent=李桂存");
- // stringRequest.setSearchQuery("IN=郝旭东");
- // stringRequest.setSearchQuery("simpleStatus=3");
- // stringRequest.setSearchQuery("publicFullText=本申请涉及直流输电技术领域");
- // stringRequest.setSearchQuery("AB=本申请提供一种储能系统机电暂态建模方法、装置、设备及可读存储介质");
- // stringRequest.setSearchQuery("TI=储能系统机电暂态建模方法、装置、设备及可读存储介质");
- // stringRequest.setSearchQuery("PN=CN114513005B");
- // stringRequest.setSearchQuery("AN=CN201810025278.2");
- // stringRequest.setSearchQuery("patentNo=CN");
- stringRequest.setSearchQuery("PD<=200903");
- // stringRequest.setSearchQuery("patentNo=CN201199922Y and (simpleFamilyNum>1 or simpleFamilyNum=0)");
- stringRequest.setCurrent(1L);
- stringRequest.setSize(5L);
- // stringRequest.setProjectId(1);
- //
- PatentDTO patentDTO = esService.esSearch(stringRequest);
- System.out.println(patentDTO);
- }
- @Test
- void test12() throws IOException {
- Boolean bool = esService.searchPatent("YiQCGowBmB3pRkTj4NNG", 5);
- System.out.println(bool);
- }
- @Test
- void getpagetexst() throws IOException {
- //1.添加一批数据(10)
- //2.调用查询取第一页(5笔一页)
- //3.判断5笔数据是正确的;
- //4.删除测试数据
- List<Integer> list = Arrays.asList(1, 2, 3, 4);
- List<Integer> list1 = Arrays.asList(4, 5);
- // list1.removeAll(list);
- System.out.println(list1);
- }
- @Test
- void add1() throws Exception {
- List<FamilyPatent> list = new ArrayList<>();
- FamilyPatent patent = new FamilyPatent();
- patent.setAppNo("CN147258369");
- patent.setGrantNo("CN258369147");
- patent.setPublicNo("CN369258147");
- FamilyPatent patent1 = new FamilyPatent();
- patent1.setAppNo("US147258369");
- patent1.setGrantNo("US258369147");
- patent1.setPublicNo("US369258147");
- list.add(patent);
- list.add(patent1);
- PatentFamilyMessage patentFamilyMessage = new PatentFamilyMessage();
- patentFamilyMessage.setPatent(list);
- patentFamilyMessage.setFamilyType("test");
- String id = esService.addPatentFamily(patentFamilyMessage);
- System.out.println(id);
- }
- @Test
- void test3() throws IOException {
- List<String> stringList = Arrays.asList("US369258147", "US258369147", "14528");
- }
- @Test
- void test4() throws IOException {
- List<String> stringList = Arrays.asList("US369258147", "US258369147", "14528");
- }
- @Test
- void test5() throws IOException {
- SelectClaimDTO dto = esService.selectClaim("CN102324864A");
- System.out.println(dto);
- }
- @Test
- void test8() throws Exception {
- List<EsCountVO> countVOS = new ArrayList<>();
- EsCountVO vo1 = new EsCountVO();
- vo1.setField("childRaw");
- // vo.setField("CO");
- // vo.setField("PT");
- // vo1.setValueOne("国家电网公司");
- // vo.setValueOne("2022");
- // vo.setValueTwo("2024");
- // vo.setField("AD");
- EsCountVO vo2 = new EsCountVO();
- vo2.setField("AD");
- vo2.setValueOne("2022");
- vo2.setValueTwo("2023");
- countVOS.add(vo1);
- // countVOS.add(vo2);
- // EsCountDTO esCountDTO = esCountService.esCountSearch(countVOS);
- // System.out.println(esCountDTO);
- }
- @Test
- void test9() throws IOException {
- // PatentNoVO vo = new PatentNoVO();
- // vo.setPatentNo("CN201910069334.7");
- // PatentColumnDTO columnDTO = patentService.selectPatentDetail(vo);
- // System.out.println(columnDTO);
- String s = "asfassafsafe";
- Map<Character, Long> map = s.chars().mapToObj(c -> (char) c).collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
- System.out.println(map);
- List<String> stringList = Arrays.asList("apple", "apple", "balana", "origin", "apple", "balana");
- Map<String, Long> collect = stringList.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
- System.out.println("----" + collect);
- }
- @Test
- void test10() throws IOException {
- PatentKinVO vo = new PatentKinVO();
- vo.setPatentNo("CN201910069334.7");
- vo.setPageNum(1);
- vo.setPageSize(10);
- vo.setType("inpadoc");
- Records records = patentService.selectKinByPatentNo(vo);
- System.out.println(records);
- }
- @Test
- void test14() {
- TempleByReportTypeVO vo = new TempleByReportTypeVO();
- vo.setReportType(1);
- List<ReportTempleDTO> reportTempleDTOS = templeService.queryTempleByType(vo);
- System.out.println(reportTempleDTOS);
- }
- @Test
- void test15() throws Exception {
- EsCustomFieldDTO dto = new EsCustomFieldDTO();
- dto.setProjectId(83);
- dto.setFieldType(5);
- dto.setFieldId("303");
- dto.setFieldValue(Arrays.asList("多选1", "多选2"));
- dto.setOptionType(1);
- dto.setPatentNo("CN201910069334.7");
- esCustomFieldService.addCustomField(dto);
- }
- @Test
- void test16() throws Exception {
- List<EsCustomFieldValueDTO> customFields = new ArrayList<>();
- EsCustomFieldValueDTO dto1 = new EsCustomFieldValueDTO();
- dto1.setFieldId("1");
- dto1.setFieldValue(Arrays.asList("a"));
- EsCustomFieldValueDTO dto2 = new EsCustomFieldValueDTO();
- dto2.setFieldId("2");
- dto2.setFieldValue(Arrays.asList("a"));
- customFields.add(dto1);
- customFields.add(dto2);
- String s = esService.parseCustomField(customFields, null, null);
- System.out.println("结果为:" + s);
- System.out.println("-----------------------------");
- List<EsCustomFieldValueDTO> fields = new ArrayList<>();
- }
- @Test
- void test17() throws IOException {
- List<String> list = new ArrayList<>();
- list.add("CN201910069334.7");
- list.add("CN201110286649.0");
- list.add("CN200820185104.4");
- SelectClaimDTO dto = esService.selectPatentNo(list);
- System.out.println(dto);
- }
- @Test
- void test18() {
- List<String> list = Arrays.asList("AD");
- if (list.contains("AD")) {
- String str = "AD=2008~201009";
- String s = this.get(str);
- if (s.contains("~")) {
- int i = s.indexOf("~");
- // s.substring()
- String s1 = this.get(s);
- System.out.println("-------------");
- System.out.println("s1是:" + s1);
- }
- } else {
- System.out.println("DDDDDDDDDDDDDDDDDD");
- }
- }
- public String get(String str) {
- int i = str.indexOf("AD");
- String s = str.substring(str.indexOf("AD")).toUpperCase(Locale.ROOT);
- int length = s.length();//------
- String key = s.substring(0, s.indexOf("="));
- int i2 = s.indexOf("=");
- String s1 = s.substring(s.indexOf("=") + 1, s.indexOf("~"));
- String s2 = "";
- if (s.contains("AND")) {
- s2 = s.substring(s.indexOf("~") + 1, s.indexOf("AND"));
- } else {
- s2 = s.substring(s.indexOf("~") + 1).trim();
- }
- int index = str.indexOf(key);
- int index1 = str.indexOf(s2) + s2.length();
- int i1 = index + key.length() + 1 + s1.length() + 1 + s2.length();
- String substring = str.substring(index, i1);
- String concat = key.concat(">=").concat(s1).concat(" and ").concat(key).concat("<=").concat(s2);
- System.out.println(concat);
- String replace = str.replace(substring, concat);
- System.out.println(replace);
- return replace;
- }
- @Test
- public void aaaaa() throws Exception {
- List<String> list = Arrays.asList("gh,ji");
- String str = "[";
- if (list.size() >= 1) {
- for (int i = 0; i < list.size(); i++) {
- String s = list.get(i);
- if (i == list.size() - 1) {
- str = str + "\"" + s + "\"";
- } else {
- str = str + "\"" + s + "\"" + ",";
- }
- }
- } else {
- }
- str = str + "]";
- System.out.println(str + "------------");
- String projectId = "ctx._source.custom_field.project_id = " + 1 + ";" + "\n";
- String field = "ctx._source.custom_field.field=" + 1 + ";" + "\n";
- String fieldType = "ctx._source.custom_field.field_type = " + 1 + ";" + "\n";
- String personId = "ctx._source.custom_field.person_id = " + 1 + ";" + "\n";
- String createTime = "ctx._source.custom_field.create_time = " + new Date().getTime() + ";" + "\n";
- String fieldValue = "ctx._source.custom_field.field_value = " + str + ";" + "\n";
- String statsValue = "ctx._source.custom_field.stats_value = " + list;
- String source = "\"" + projectId + field + fieldType + personId + createTime + fieldValue + statsValue + "\"";
- // String source = "\"\"ctx._source.custom_field.project_id = " + 1 + ";" + "\n" +
- // "ctx._source.custom_field.field=" + 2 + ";" + "\n" + "\"\"";
- System.out.println(source);
- Patent patent = new Patent();
- String id = "hy7ayIwB68vilgBjUWBz";
- String name = "士大夫";
- Integer type = 0;
- esService.delMergePerson(patent, id, type, name);
- }
- @Test
- public void test100() {
- List<GetAllPersonDTO> DTOS = new ArrayList<>();
- List<GetAllPersonDTO> applicantDTOS = new ArrayList<>();
- GetAllPersonDTO dto = new GetAllPersonDTO();
- dto.setName("A");
- dto.setType(0);
- dto.setCountry("CN");
- dto.setAddress("efe");
- applicantDTOS.add(dto);
- GetAllPersonDTO dto1 = new GetAllPersonDTO();
- dto1.setName("B");
- dto1.setType(0);
- dto1.setCountry("CN");
- dto1.setAddress("weew");
- applicantDTOS.add(dto1);
- GetAllPersonDTO dto2 = new GetAllPersonDTO();
- dto2.setName("C");
- dto2.setType(0);
- dto2.setCountry("CN");
- dto2.setAddress("fdsyt");
- applicantDTOS.add(dto2);
- List<GetAllPersonDTO> rightDTOS = new ArrayList<>();
- GetAllPersonDTO dto4 = new GetAllPersonDTO();
- dto4.setName("A");
- dto4.setType(0);
- dto4.setCountry("CN");
- dto4.setAddress("efed");
- rightDTOS.add(dto4);
- GetAllPersonDTO dto5 = new GetAllPersonDTO();
- dto5.setName("D");
- dto5.setType(0);
- dto5.setCountry("CN");
- dto5.setAddress("ete");
- rightDTOS.add(dto5);
- GetAllPersonDTO dto6 = new GetAllPersonDTO();
- dto6.setName("E");
- dto6.setType(0);
- rightDTOS.add(dto6);
- applicantDTOS.removeAll(rightDTOS);
- System.out.println(applicantDTOS + "-----------------");
- for (GetAllPersonDTO applicantDTO : applicantDTOS) {
- rightDTOS.removeIf(rightDTO -> applicantDTO.getName().equals(rightDTO.getName()));
- }
- System.out.println(applicantDTOS);
- System.out.println(rightDTOS);
- DTOS.addAll(applicantDTOS);
- DTOS.addAll(rightDTOS);
- System.out.println("DTOS:" + DTOS);
- }
- @Test
- public void test101() {
- String a = " DESC";
- List<Integer> ids = assoProjectEventMapper.getEventProjectNumOrder(0, a);
- System.out.println(ids);
- }
- @Test
- public void test102() {
- String s = "a47efjerAksu&*s/e";
- String s2 = s.replaceAll("[^a-zA-Z]", "").toLowerCase(Locale.ROOT);
- String p = s.replace("/", "P");
- System.out.println(p);
- System.out.println("s2 = " + s2);
- List<Character> list1 = Arrays.asList('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n');
- String s1 = s.toLowerCase(Locale.ROOT);
- int length = s1.length();
- List<Character> list = new ArrayList<>();
- for (int i = 0; i < length; i++) {
- char c = s1.charAt(i);
- if (list1.contains(c)) {
- list.add(c);
- }
- }
- Collections.sort(list);
- System.out.println(list);
- String join = StringUtils.join(list, "");
- System.out.println("------" + join);
- Map<Character, Long> collect = list.stream().collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));
- System.out.println(collect);
- }
- @Test
- public void test103() throws Exception {
- GetAllPersonVO personVO = new GetAllPersonVO();
- personVO.setProjectId(208);
- personVO.setType(0);
- personVO.setPageNum(1l);
- personVO.setPageSize(10l);
- Records mergePerson = mergePersonService.getAllMergePerson(personVO);
- Object personData = mergePerson.getData();
- System.out.println(personData);
- }
- @Test
- public void test104() throws Exception {
- // List<String> parentIds = esCountService.getParentIds(44, null, 290);
- // System.out.println(parentIds.size());
- // parentIds.forEach(System.out::println);
- // List<String> idsList = esService.getIdsList("(field=44 and fieldValue=48)",null);
- // System.out.println(idsList);
- // Long idsCount = esService.getIdsCount("NCOQKI8Bz9TGU8OYquJE",null,null);
- // System.out.println(idsCount);
- // String s = "(field=44 and fieldValue=48)";
- // String s1 = s.substring(0, s.indexOf("and")-1)+")";
- // System.out.println(s1);
- // if (s.contains("48")) {
- // System.out.println("shduahdi");
- // }
- // String ids = esService.getIds("t53GZY8BdwlBaY8vOJFq", 319, null, "105");
- // System.out.println(ids);
- String s = "CN200380003758.0 OR CN200380024517.4 OR CN200380002092.7 \n" +
- "OR CN200210053627.0 OR CN199210014159.1 OR JP2024032943A OR CN200310042440.5 OR CN199710090727.9 OR CN199610096572.5 OR CN199410009036.8 \n" +
- "OR CN200210043340.X OR CN199710098829.5 OR CN199310003139.9 OR CN198910000939.9 \n" +
- "OR CN198820004617.2 OR CN198910000787.2 OR CN198710003233.9";
- String[] split = s.split("OR");
- List<String> list = Arrays.asList(split);
- System.out.println(list.size());
- List<String> collect = list.stream().distinct().collect(Collectors.toList());
- System.out.println(collect.size());
- }
- @Test
- public void test105() {
- String value = "2003800037580";
- String sub = value.substring(0, 2);
- boolean positiveInteger = StringUtils.isPositiveInteger(sub);
- System.out.println(positiveInteger);
- if ((StringUtils.isPositiveInteger(sub) || sub.equalsIgnoreCase("CN")) && (value.length() == 13 || value.length() == 15)) {
- System.out.println("A");
- } else {
- System.out.println("B");
- }
- }
- @Test
- public void test106() throws Exception {
- String s1 = "1. A compound vibration device in a bone conduction speaker, comprising:\r\na vibration conductive plate, and a vibration board; wherein the vibration conductive plate is physically connected with the vibration board, vibrations generated by the vibration conductive plate and the vibration board have two resonance peaks which are among the frequencies catchable with human ears, and sounds are generated by the vibrations transferred through a human bone.\\r\\n2. The compound vibration device according to claim 1, wherein the vibration conductive plate is set as a first torus, and at least two first rods thereof converge to its center.\\r\\n3. The compound vibration device according to claim 2, wherein the vibration board is set as a second torus, and at least two second rods thereof converge to its center.\\r\\n4. The compound vibration according to claim 3, wherein the first torus is fixed on a magnetic system.\\r\\n5. The compound vibration according to claim 4, further comprising a voice coil, wherein the voice coil is driven by the magnetic system and fixed on the second torus.\\r\\n6. The compound vibration device according to claim 5, wherein the vibration conductive plate rods are staggered with the vibration board rods.\\r\\n7. The compound vibration device according to claim 6, wherein the staggered angle between the rods is 60 degrees.\\r\\n8. The compound vibration device according to claim 5, wherein:\\r\\nthe vibration conductive plate is made of stainless steel, with a thickness of 0.1-0.2 mm,\\r\\nthe width of the first rods in the vibration conductive plate is 0.5-1.0 mm, and\\r\\nthe width of the second rods in the vibration board is 1.6-2.6 mm, with a thickness of 0.8-1.2 mm.\\r\\n9. The compound vibration according to claim 5, wherein the number of the vibration conductive plates and the vibration boards is set to be more than one, and the vibration conductive plates and the vibration boards are fixed together through their centers and/or the torus.\\r\\n10. The compound vibration device according to claim 5, wherein the magnetic system comprising:\\r\\na bottom plate,\\r\\nan annular magnet which is set on the bottom plate,\\r\\nan inner magnet which is concentrically disposed inside the annular magnet,\\r\\nan inner magnetic conductive plate which is set on the inner magnet,\\r\\nan annular magnetic conductive plate which is set on the annular magnet,\\r\\na grommet which is set on the annular magnetic conductive plate to be fixed to the first torus, and\\r\\nthe voice coil is set between the inner magnetic conductive plate and the annular magnetic plate.\\r\\n11. The compound vibration device according to claim 5, wherein the numbers of the first rods and the second rods are both set to be three.\\r\\n12. The compound vibration according to claim 5, wherein the first rods and the second rods are both straight rods.\\r\\n13. The compound vibration device according to claim 5, wherein an indentation is set at the center of the vibration board, which adapts to the vibration conductive plate.\\r\\n14. A bone conduction speaker, comprising a compound vibration device having a vibration conductive plate and a vibration board; wherein:\\r\\n the vibration conductive plate is physically connected with the vibration board, and vibrations generated by the vibration conductive plate and the vibration board have two resonance peaks which are among the frequencies catchable with human ears, and sounds are generated by the vibrations transferred through a human bone.\\r\\n15. The bone conduction speaker according to claim 14, wherein the vibration conductive plate is set as a first torus, and at least two first rods thereof converge to its center.\\r\\n16. The bone conduction speaker according to claim 15, wherein the vibration board is set as a second torus, and at least two second rods thereof converge to its center.\\r\\n17. The bone conduction speaker according to claim 16, wherein the first torus is fixed on a magnetic system.\\r\\n18. The bone conduction speaker according to claim 17, further comprising a voice coil, wherein the voice coil is driven by the magnetic system and is fixed on the second torus.\\r\\n19. The bone conduction speaker according to claim 18, wherein the magnetic system comprising:\\r\\na bottom plate,\\r\\nan annular magnet which is set on the bottom plate,\\r\\nan inner magnet which is concentrically disposed inside the annular magnet,\\r\\nan inner magnetic conductive plate which is set on the inner magnet,\\r\\n an annular magnetic conductive plate which is set on the annular magnet,\\r\\n a grommet which is set on the annular magnetic conductive plate to be fixed to the first torus, and\\r\\n the voice coil is set between the inner magnetic conductive plate and the annular magnetic plate.\\r\\n20. The bone conduction speaker according to claim 18, wherein the vibration conductive plate is made of stainless steel, with a thickness of 0.1-0.2 mm; and the width of the first rods in the vibration conductive plate is 0.5-1.0 mm;\\r\\nand the width of the second rods in the vibration board is 1.6-2.6 mm, with a thickness of 0. 8-1.2 mm.";
- String regex = "(?<!\\d)\\.(?!\\d)|[;。;]";
- String regex1 = "(?<!\\d)\\.(?!\\d)";
- Pattern pattern = Pattern.compile(regex);
- Pattern pattern1 = Pattern.compile(regex1);
- String ss = "";
- while (s1.length() > 5000) {
- String s2 = s1.substring(0, 5000);
- Matcher matcher = pattern.matcher(s2);
- Matcher matcher1 = pattern1.matcher(s2);
- int lastIndex = -1;
- while (matcher.find()) {
- lastIndex = matcher.end() - 1; // matcher.end() 返回的是匹配项之后的索引,所以减1得到最后一个字符的索引
- }
- if (lastIndex == -1) {
- while (matcher1.find()) {
- lastIndex = matcher1.end() - 1; // matcher.end() 返回的是匹配项之后的索引,所以减1得到最后一个字符的索引
- }
- }
- ss = ss + s1.substring(0, lastIndex + 1);
- s1 = s1.substring(lastIndex + 1);
- }
- System.out.println("s1:" + s1);
- ss = ss + s1;
- System.out.println(ss);
- }
- @Autowired
- private FormatQueryService formatQueryService;
- @Autowired
- private ElasticsearchClient client;
- @Test
- public void test107() throws Exception {
- String s = "IFN=3~4"; //条件
- SearchRequest.Builder builder = new SearchRequest.Builder();
- //设置查询索引
- builder.index("patent");
- //2、根据条件生成树结构
- treeNode tree = expressManager.getInstance().Parse(s, false);
- Query query = formatQueryService.EsQueryToQuery((operateNode) tree, "patent", 331);
- builder.query(query);
- SearchResponse<Patent> response = client.search(builder.build(), Patent.class);
- final List<Hit<Patent>> hits = response.hits().hits();
- for (Hit<Patent> hit : hits) {
- System.out.println(1);
- }
- }
- }
|