|
@@ -9,6 +9,7 @@ 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.vo.business.EsCountVO;
|
|
|
import cn.cslg.pas.common.vo.business.PatentKinVO;
|
|
|
import cn.cslg.pas.common.vo.business.PatentNoVO;
|
|
@@ -40,6 +41,7 @@ import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
+import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
@@ -258,18 +260,18 @@ public class EventServiceTests {
|
|
|
|
|
|
@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);
|
|
|
+// 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
|
|
@@ -476,4 +478,30 @@ public class EventServiceTests {
|
|
|
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);
|
|
|
+ }
|
|
|
+
|
|
|
}
|