|
@@ -33,9 +33,8 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
|
|
|
|
private final PatentService patentService;
|
|
private final PatentService patentService;
|
|
|
|
|
|
- public List<PatentRight> getPatentRightByPatentNo(String patentNo)
|
|
|
|
- {
|
|
|
|
- Patent patent = patentService.getByPatentNo(patentNo);
|
|
|
|
|
|
+ public List<PatentRight> getPatentRightByPatentNo(String patentNo) {
|
|
|
|
+ Patent patent = patentService.getByPatentNo(patentNo);
|
|
LambdaQueryWrapper<PatentRight> queryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<PatentRight> queryWrapper = new LambdaQueryWrapper<>();
|
|
queryWrapper.eq(PatentRight::getPatentId, patent.getId());
|
|
queryWrapper.eq(PatentRight::getPatentId, patent.getId());
|
|
queryWrapper.orderByAsc(PatentRight::getSort);
|
|
queryWrapper.orderByAsc(PatentRight::getSort);
|
|
@@ -72,157 +71,152 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
}
|
|
}
|
|
this.saveOrUpdateBatch(patentRightList);
|
|
this.saveOrUpdateBatch(patentRightList);
|
|
}
|
|
}
|
|
- public void importAuthority(PatentRightParams params){
|
|
|
|
- List<Authority> splits = splits(params);
|
|
|
|
- List<Authority> authorities = relationshipAuthority(splits);
|
|
|
|
- List<Authority> authorities1 = relationshipAuthority3(authorities);
|
|
|
|
- List<Authority> authorities2 = relationshipAuthority2(authorities1);
|
|
|
|
- List<Authority> authorities3 = relationshipAuthority4(authorities2);
|
|
|
|
- for(Authority a:authorities3){
|
|
|
|
- Authority authority = new Authority();
|
|
|
|
- authority.setContent(a.getContent());
|
|
|
|
- String join = StringUtils.join(a.getFatherID(), ",");
|
|
|
|
- authority.setFID(join);
|
|
|
|
- String join1 = StringUtils.join(a.getSonID(), ",");
|
|
|
|
- authority.setSID(join1);
|
|
|
|
- authority.setPatentID(params.getPatentId());
|
|
|
|
- authority.setType(a.getType());
|
|
|
|
- authority.insert();
|
|
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ public void importAuthority(PatentRightParams params) {
|
|
|
|
+ List<Authority> splits = splits(params);
|
|
|
|
+ List<Authority> authorities = relationshipAuthority(splits);
|
|
|
|
+ List<Authority> authorities1 = relationshipAuthority3(authorities);
|
|
|
|
+ List<Authority> authorities2 = relationshipAuthority2(authorities1);
|
|
|
|
+ List<Authority> authorities3 = relationshipAuthority4(authorities2);
|
|
|
|
+ for (Authority a : authorities3) {
|
|
|
|
+ Authority authority = new Authority();
|
|
|
|
+ authority.setContent(a.getContent());
|
|
|
|
+ String join = StringUtils.join(a.getFatherID(), ",");
|
|
|
|
+ authority.setFID(join);
|
|
|
|
+ String join1 = StringUtils.join(a.getSonID(), ",");
|
|
|
|
+ authority.setSID(join1);
|
|
|
|
+ authority.setPatentID(params.getPatentId());
|
|
|
|
+ authority.setType(a.getType());
|
|
|
|
+ authority.insert();
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- public List<Authority> splits(PatentRightParams params){
|
|
|
|
|
|
+ public List<Authority> splits(PatentRightParams params) {
|
|
//去掉全要开头的""
|
|
//去掉全要开头的""
|
|
- String selfContent= params.getContent();
|
|
|
|
- selfContent.replaceAll("''","");
|
|
|
|
- selfContent.replaceAll("\n"," ");
|
|
|
|
-// selfContent.replaceAll(" ","");
|
|
|
|
|
|
+
|
|
|
|
+ String selfContent = params.getContent();
|
|
|
|
+ //청구항 2. 삭제(是否删除代办)
|
|
|
|
+ // selfContent.replaceAll("청구항(\\s)(^\\d*$+)(\\s)삭제","");
|
|
|
|
+ selfContent.replaceAll("''", "");
|
|
|
|
+ selfContent.replaceAll("(^\\d*$+)-(^\\d*$+)(\\.)(\\s)(canceled)","");
|
|
|
|
+// selfContent.replaceAll("(^\\d*$+)(.)(\\s)(canceled)","");
|
|
|
|
+ selfContent.replaceAll("\n", " ");
|
|
List<Authority> list = new ArrayList<>();
|
|
List<Authority> list = new ArrayList<>();
|
|
//找到1. 2. ...这种格式的正则表达式
|
|
//找到1. 2. ...这种格式的正则表达式
|
|
- String str1="(^\\d*$+)(\\.)";
|
|
|
|
|
|
+ String str1 = "(^\\d*$+)(\\.)";
|
|
//找到[001]或者[002]这种格式的
|
|
//找到[001]或者[002]这种格式的
|
|
- String str2="(\\[)(^[1-9]/d*$+)(\\])";
|
|
|
|
|
|
+ String str2 = "(\\[)(^[1-9]/d*$+)(\\])";
|
|
//【請求項 1】
|
|
//【請求項 1】
|
|
- String str3="(\\【請求項)(^[1-9]/d*$+)(\\】)";
|
|
|
|
|
|
+ String str3 = "(\\【請求項)(^[1-9]/d*$+)(\\】)";
|
|
//청구항 1()
|
|
//청구항 1()
|
|
- String str4="청구항(^[1-9]/d*$+)";
|
|
|
|
|
|
+ String str4 = "청구항(\\s)(^[1-9]/d*$+)(\\.)";
|
|
Pattern p4 = Pattern.compile(str4);
|
|
Pattern p4 = Pattern.compile(str4);
|
|
Matcher m4 = p4.matcher(selfContent);
|
|
Matcher m4 = p4.matcher(selfContent);
|
|
- if(m4.find()) {
|
|
|
|
- String str5=".";
|
|
|
|
- Pattern p5 = Pattern.compile(str4);
|
|
|
|
- Matcher m5 = p5.matcher(selfContent);
|
|
|
|
- List<Integer> integers1=new ArrayList<>();
|
|
|
|
- while (m5.find()){
|
|
|
|
- integers1.add(m5.start());
|
|
|
|
|
|
+ List<Integer> integers1 = new ArrayList<>();
|
|
|
|
+ while (m4.find()) {
|
|
|
|
+ integers1.add(m4.start());
|
|
}
|
|
}
|
|
- for(int i=integers1.size()-1;i>=0;i--){
|
|
|
|
- String str=selfContent.substring(integers1.get(i));
|
|
|
|
- Authority authority=new Authority();
|
|
|
|
|
|
+ if(integers1.size()!=0) {
|
|
|
|
+ for (int i = integers1.size() - 1; i >= 0; i--) {
|
|
|
|
+ String str = selfContent.substring(integers1.get(i));
|
|
|
|
+ Authority authority = new Authority();
|
|
authority.setContent(str);
|
|
authority.setContent(str);
|
|
list.add(authority);
|
|
list.add(authority);
|
|
|
|
|
|
}
|
|
}
|
|
- Authority authority=new Authority();
|
|
|
|
|
|
+ Authority authority = new Authority();
|
|
authority.setContent(selfContent);
|
|
authority.setContent(selfContent);
|
|
list.add(authority);
|
|
list.add(authority);
|
|
return list;
|
|
return list;
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
Pattern p = Pattern.compile(str1);
|
|
Pattern p = Pattern.compile(str1);
|
|
Matcher m = p.matcher(selfContent);
|
|
Matcher m = p.matcher(selfContent);
|
|
//判断找到的数量
|
|
//判断找到的数量
|
|
- List<Integer> integers=new ArrayList<>();
|
|
|
|
- while (m.find()){
|
|
|
|
|
|
+ List<Integer> integers = new ArrayList<>();
|
|
|
|
+ while (m.find()) {
|
|
integers.add(m.start());
|
|
integers.add(m.start());
|
|
}
|
|
}
|
|
- if(integers.size()!=0){
|
|
|
|
- for(int i=integers.size()-1;i>=0;i--){
|
|
|
|
- String str=selfContent.substring(integers.get(i));
|
|
|
|
- Authority authority=new Authority();
|
|
|
|
- authority.setContent(str);
|
|
|
|
- list.add(authority);
|
|
|
|
|
|
+ if (integers.size() != 0) {
|
|
|
|
+ for (int i = integers.size() - 1; i > 0; i--) {
|
|
|
|
+ String str = selfContent.substring(integers.get(i));
|
|
|
|
+ Authority authority1 = new Authority();
|
|
|
|
+ authority1.setContent(str);
|
|
|
|
+ list.add(authority1);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ Authority authority1 = new Authority();
|
|
|
|
+ authority1.setContentOut(selfContent);
|
|
|
|
+ list.add(authority1);
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
Pattern compile = Pattern.compile(str2);
|
|
Pattern compile = Pattern.compile(str2);
|
|
Matcher matcher = compile.matcher(selfContent);
|
|
Matcher matcher = compile.matcher(selfContent);
|
|
- List<Integer> start=new ArrayList<>();
|
|
|
|
- List<Integer> end=new ArrayList<>();
|
|
|
|
- while (matcher.find()){
|
|
|
|
- start.add( matcher.start());
|
|
|
|
- end.add(matcher.end());
|
|
|
|
|
|
+ List<Integer> start = new ArrayList<>();
|
|
|
|
+ while (matcher.find()) {
|
|
|
|
+ start.add(matcher.start());
|
|
|
|
+
|
|
}
|
|
}
|
|
- if(start.size()!=0){
|
|
|
|
- for(int i=start.size()-1;i>=0;i--) {
|
|
|
|
- if(i==start.size()-1){
|
|
|
|
- String substring = selfContent.substring(end.get(i));
|
|
|
|
- String string=new String(String.valueOf(i));
|
|
|
|
- string=string+"."+substring;
|
|
|
|
- Authority authority=new Authority();
|
|
|
|
- list.add(authority);
|
|
|
|
|
|
+ if (start.size() != 0) {
|
|
|
|
+ for (int i = start.size() - 1; i > 0; i--) {
|
|
|
|
+ String str = selfContent.substring(integers.get(i));
|
|
|
|
+ Authority authority2 = new Authority();
|
|
|
|
+ authority2.setContent(str);
|
|
|
|
+ list.add(authority2);
|
|
|
|
|
|
- }
|
|
|
|
- String substring = selfContent.substring(end.get(i),start.get(i+1));
|
|
|
|
- String string=new String(String.valueOf(i));
|
|
|
|
- string=string+"."+substring;
|
|
|
|
- Authority authority=new Authority();
|
|
|
|
- list.add(authority);
|
|
|
|
}
|
|
}
|
|
- return list;
|
|
|
|
|
|
+ Authority authority2 = new Authority();
|
|
|
|
+ authority2.setContent(selfContent);
|
|
|
|
+ list.add(authority2);
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
Pattern compile1 = Pattern.compile(str3);
|
|
Pattern compile1 = Pattern.compile(str3);
|
|
Matcher matcher1 = compile1.matcher(selfContent);
|
|
Matcher matcher1 = compile1.matcher(selfContent);
|
|
- List<Integer> start1=new ArrayList<>();
|
|
|
|
- List<Integer> end1=new ArrayList<>();
|
|
|
|
- while (matcher1.find()){
|
|
|
|
- start1.add( matcher1.start());
|
|
|
|
- end1.add(matcher1.end());
|
|
|
|
- }
|
|
|
|
- if(start1.size()!=0){
|
|
|
|
- for(int i=start1.size()-1;i>=0;i--) {
|
|
|
|
- if(i==start1.size()-1){
|
|
|
|
- String substring = selfContent.substring(end.get(i));
|
|
|
|
- String string=new String(String.valueOf(i));
|
|
|
|
- string=string+"."+substring;
|
|
|
|
- Authority authority=new Authority();
|
|
|
|
- list.add(authority);
|
|
|
|
|
|
+ List<Integer> start1 = new ArrayList<>();
|
|
|
|
|
|
- }
|
|
|
|
- String substring = selfContent.substring(end.get(i),start.get(i+1));
|
|
|
|
- String string=new String(String.valueOf(i));
|
|
|
|
- string=string+"."+substring;
|
|
|
|
- Authority authority=new Authority();
|
|
|
|
- list.add(authority);
|
|
|
|
|
|
+ while (matcher1.find()) {
|
|
|
|
+ start1.add(matcher1.start());
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if (start1.size() != 0) {
|
|
|
|
+ for (int i = start1.size() - 1; i >= 0; i--) {
|
|
|
|
+ String str = selfContent.substring(integers.get(i));
|
|
|
|
+ Authority authority3 = new Authority();
|
|
|
|
+ authority3.setContent(str);
|
|
|
|
+ list.add(authority3);
|
|
}
|
|
}
|
|
- return list;
|
|
|
|
|
|
+
|
|
|
|
+ Authority authority3 = new Authority();
|
|
|
|
+ authority3.setContent(selfContent);
|
|
|
|
+ list.add(authority3);
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 英文下的处理方式(草稿)
|
|
* 英文下的处理方式(草稿)
|
|
*/
|
|
*/
|
|
- private List<Authority> relationshipAuthority(List<Authority> list){
|
|
|
|
|
|
+ private List<Authority> relationshipAuthority(List<Authority> list) {
|
|
|
|
|
|
- List<Authority> authorities=list;
|
|
|
|
|
|
+ List<Authority> authorities = list;
|
|
//英文下的claim 1,claim2 的正则表达式
|
|
//英文下的claim 1,claim2 的正则表达式
|
|
- String str1="(claim)(\\s)(^\\d*$+)";
|
|
|
|
|
|
+ String str1 = "(claim)(\\s)(^\\d*$+)";
|
|
Pattern p = Pattern.compile(str1);
|
|
Pattern p = Pattern.compile(str1);
|
|
- for(int i=0;i<list.size();i++){
|
|
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
//去掉空格
|
|
//去掉空格
|
|
- authorities.get(i).getContent().replaceAll(" ","");
|
|
|
|
|
|
+ authorities.get(i).getContent().replaceAll(" ", "");
|
|
Matcher m = p.matcher(authorities.get(i).getContent());
|
|
Matcher m = p.matcher(authorities.get(i).getContent());
|
|
- if(!m.find()){
|
|
|
|
|
|
+ if (!m.find()) {
|
|
list.get(i).setFID(null);
|
|
list.get(i).setFID(null);
|
|
list.get(i).setType(0);
|
|
list.get(i).setType(0);
|
|
return list;
|
|
return list;
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
//找到了
|
|
//找到了
|
|
String group = m.group(0);
|
|
String group = m.group(0);
|
|
//把claim去掉只剩下面的数字
|
|
//把claim去掉只剩下面的数字
|
|
@@ -232,32 +226,31 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
sonID.add(authorities.get(i).getId());
|
|
sonID.add(authorities.get(i).getId());
|
|
list.get(j - 1).setSonID(sonID);
|
|
list.get(j - 1).setSonID(sonID);
|
|
List<Integer> fatherID = list.get(i).getFatherID();
|
|
List<Integer> fatherID = list.get(i).getFatherID();
|
|
- fatherID.add( list.get(j - 1).getId());
|
|
|
|
|
|
+ fatherID.add(list.get(j - 1).getId());
|
|
list.get(i).setFatherID(fatherID);
|
|
list.get(i).setFatherID(fatherID);
|
|
//设置为
|
|
//设置为
|
|
list.get(i).setType(1);
|
|
list.get(i).setType(1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return list;
|
|
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 小日子的语言下的处理模式
|
|
* 小日子的语言下的处理模式
|
|
*/
|
|
*/
|
|
- private List<Authority> relationshipAuthority3( List<Authority> list){
|
|
|
|
- List<Authority> authorities=list;
|
|
|
|
|
|
+ private List<Authority> relationshipAuthority3(List<Authority> list) {
|
|
|
|
+ List<Authority> authorities = list;
|
|
//英文下的claim 1,claim2 的正则表达式
|
|
//英文下的claim 1,claim2 的正则表达式
|
|
- String str1="(前記第)(^\\d*$+)";
|
|
|
|
|
|
+ String str1 = "(前記第)(^\\d*$+)";
|
|
Pattern p = Pattern.compile(str1);
|
|
Pattern p = Pattern.compile(str1);
|
|
- for(int i=0;i<list.size();i++){
|
|
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
|
|
Matcher m = p.matcher(authorities.get(i).getContent());
|
|
Matcher m = p.matcher(authorities.get(i).getContent());
|
|
- if(!m.find()){
|
|
|
|
|
|
+ if (!m.find()) {
|
|
list.get(i).setFID(null);
|
|
list.get(i).setFID(null);
|
|
list.get(i).setType(0);
|
|
list.get(i).setType(0);
|
|
return list;
|
|
return list;
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+ } else {
|
|
//找到了
|
|
//找到了
|
|
String group = m.group(0);
|
|
String group = m.group(0);
|
|
//把claim去掉只剩下面的数字
|
|
//把claim去掉只剩下面的数字
|
|
@@ -267,47 +260,47 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
sonID.add(authorities.get(i).getId());
|
|
sonID.add(authorities.get(i).getId());
|
|
list.get(j - 1).setSonID(sonID);
|
|
list.get(j - 1).setSonID(sonID);
|
|
List<Integer> fatherID = list.get(i).getFatherID();
|
|
List<Integer> fatherID = list.get(i).getFatherID();
|
|
- fatherID.add( list.get(j - 1).getId());
|
|
|
|
|
|
+ fatherID.add(list.get(j - 1).getId());
|
|
list.get(i).setFatherID(fatherID);
|
|
list.get(i).setFatherID(fatherID);
|
|
//设置为
|
|
//设置为
|
|
list.get(i).setType(1);
|
|
list.get(i).setType(1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return list;
|
|
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
* 中文下的处理方式
|
|
* 中文下的处理方式
|
|
*/
|
|
*/
|
|
- public List<Authority> relationshipAuthority2( List<Authority> list){
|
|
|
|
|
|
+ public List<Authority> relationshipAuthority2(List<Authority> list) {
|
|
//中文下权利要求1,权利要求2,权利要求3
|
|
//中文下权利要求1,权利要求2,权利要求3
|
|
- String str1="(权利要求)(^\\d*$+)";
|
|
|
|
|
|
+ String str1 = "(权利要求)(^\\d*$+)";
|
|
//中文下权利要求1至
|
|
//中文下权利要求1至
|
|
- String str2="(权利要求)(^\\d*$+)(至)(^\\d*$+)";
|
|
|
|
|
|
+ String str2 = "(权利要求)(^\\d*$+)(至)(^\\d*$+)";
|
|
//中文下权利要求 或
|
|
//中文下权利要求 或
|
|
- String str3="(权利要求)(^\\d*$+)(或)(^\\d*$+)";
|
|
|
|
|
|
+ String str3 = "(权利要求)(^\\d*$+)(或)(^\\d*$+)";
|
|
|
|
|
|
Pattern p = Pattern.compile(str1);
|
|
Pattern p = Pattern.compile(str1);
|
|
Pattern p1 = Pattern.compile(str2);
|
|
Pattern p1 = Pattern.compile(str2);
|
|
Pattern p2 = Pattern.compile(str3);
|
|
Pattern p2 = Pattern.compile(str3);
|
|
- for(int i=0;i<list.size();i++){
|
|
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
Matcher matcher = p.matcher(list.get(i).getContent());
|
|
Matcher matcher = p.matcher(list.get(i).getContent());
|
|
- if(matcher.find()){
|
|
|
|
|
|
+ if (matcher.find()) {
|
|
list.get(i).setType(1);
|
|
list.get(i).setType(1);
|
|
//找到满足第一情况
|
|
//找到满足第一情况
|
|
Matcher matcher1 = p1.matcher(list.get(i).getContent());
|
|
Matcher matcher1 = p1.matcher(list.get(i).getContent());
|
|
- if(matcher1.find()){
|
|
|
|
|
|
+ if (matcher1.find()) {
|
|
//找到满足第一和第二种情况按第二种情况处理
|
|
//找到满足第一和第二种情况按第二种情况处理
|
|
String group = matcher1.group(0);
|
|
String group = matcher1.group(0);
|
|
- String str5="^\\d*$+";
|
|
|
|
|
|
+ String str5 = "^\\d*$+";
|
|
Pattern p3 = Pattern.compile(str5);
|
|
Pattern p3 = Pattern.compile(str5);
|
|
Matcher matcher2 = p3.matcher(group);
|
|
Matcher matcher2 = p3.matcher(group);
|
|
- if(matcher2.find()){
|
|
|
|
|
|
+ if (matcher2.find()) {
|
|
String group1 = matcher2.group(0);
|
|
String group1 = matcher2.group(0);
|
|
String group2 = matcher2.group(1);
|
|
String group2 = matcher2.group(1);
|
|
- Integer j=Integer.parseInt(group1);
|
|
|
|
- Integer k=Integer.parseInt(group2);
|
|
|
|
- for(int l=j-1;l<k;l++){
|
|
|
|
|
|
+ Integer j = Integer.parseInt(group1);
|
|
|
|
+ Integer k = Integer.parseInt(group2);
|
|
|
|
+ for (int l = j - 1; l < k; l++) {
|
|
List<Integer> sonID = list.get(l).getSonID();
|
|
List<Integer> sonID = list.get(l).getSonID();
|
|
sonID.add(list.get(i).getId());
|
|
sonID.add(list.get(i).getId());
|
|
list.get(l).setSonID(sonID);
|
|
list.get(l).setSonID(sonID);
|
|
@@ -316,15 +309,15 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
list.get(i).setFatherID(fatherID);
|
|
list.get(i).setFatherID(fatherID);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
Matcher matcher2 = p2.matcher(list.get(i).getContent());
|
|
Matcher matcher2 = p2.matcher(list.get(i).getContent());
|
|
- if(matcher2.find()){
|
|
|
|
|
|
+ if (matcher2.find()) {
|
|
//找到满足第三和第一情况按第三中情况处理
|
|
//找到满足第三和第一情况按第三中情况处理
|
|
String group = matcher1.group(0);
|
|
String group = matcher1.group(0);
|
|
- String str6="^\\d*$+";
|
|
|
|
|
|
+ String str6 = "^\\d*$+";
|
|
Pattern p3 = Pattern.compile(str6);
|
|
Pattern p3 = Pattern.compile(str6);
|
|
Matcher matcher3 = p3.matcher(group);
|
|
Matcher matcher3 = p3.matcher(group);
|
|
- if(matcher3.find()) {
|
|
|
|
|
|
+ if (matcher3.find()) {
|
|
String group1 = matcher2.group(0);
|
|
String group1 = matcher2.group(0);
|
|
String group2 = matcher2.group(1);
|
|
String group2 = matcher2.group(1);
|
|
Integer j = Integer.parseInt(group1);
|
|
Integer j = Integer.parseInt(group1);
|
|
@@ -342,13 +335,13 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
fatherID1.add(list.get(k).getId());
|
|
fatherID1.add(list.get(k).getId());
|
|
list.get(i).setFatherID(fatherID1);
|
|
list.get(i).setFatherID(fatherID1);
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
//只满足第一中情况
|
|
//只满足第一中情况
|
|
String group = matcher.group(0);
|
|
String group = matcher.group(0);
|
|
- String str7="^\\d*$+";
|
|
|
|
|
|
+ String str7 = "^\\d*$+";
|
|
Pattern p3 = Pattern.compile(str7);
|
|
Pattern p3 = Pattern.compile(str7);
|
|
Matcher matcher3 = p3.matcher(group);
|
|
Matcher matcher3 = p3.matcher(group);
|
|
- if(matcher3.find()){
|
|
|
|
|
|
+ if (matcher3.find()) {
|
|
String group1 = matcher2.group(0);
|
|
String group1 = matcher2.group(0);
|
|
Integer j = Integer.parseInt(group1);
|
|
Integer j = Integer.parseInt(group1);
|
|
List<Integer> sonID = list.get(j).getSonID();
|
|
List<Integer> sonID = list.get(j).getSonID();
|
|
@@ -361,7 +354,7 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
|
|
+ } else {
|
|
list.get(i).setType(0);
|
|
list.get(i).setType(0);
|
|
list.get(i).setFID(null);
|
|
list.get(i).setFID(null);
|
|
}
|
|
}
|
|
@@ -370,39 +363,64 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- *
|
|
|
|
* 韩文下的处理
|
|
* 韩文下的处理
|
|
*/
|
|
*/
|
|
- public List<Authority> relationshipAuthority4(List<Authority> list){
|
|
|
|
|
|
+ public List<Authority> relationshipAuthority4(List<Authority> list) {
|
|
//韩文情况下的正则表达式
|
|
//韩文情况下的正则表达式
|
|
- String str1="항(^\\d*$+)(\\s)에있어서";
|
|
|
|
-
|
|
|
|
|
|
+ String str1="제(\\s)(^\\d*$+)항" ; //"제 1항에" ;
|
|
|
|
+ String str3="제(\\s)(^\\d*$+)항(\\s)또는(\\s)제(^\\d*$+)항";//제 1항 또는 제 2항에 있어서 这种情况下的正则表达式
|
|
Pattern p = Pattern.compile(str1);
|
|
Pattern p = Pattern.compile(str1);
|
|
- for(int i=0;i<list.size();i++){
|
|
|
|
- //去掉空格
|
|
|
|
- list.get(i).getContent().replaceAll(" ","");
|
|
|
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
|
+
|
|
|
|
+// list.get(i).getContent().replaceAll(" ", "");
|
|
Matcher m = p.matcher(list.get(i).getContent());
|
|
Matcher m = p.matcher(list.get(i).getContent());
|
|
- if(!m.find()){
|
|
|
|
|
|
+ if (!m.find()) {
|
|
list.get(i).setFID(null);
|
|
list.get(i).setFID(null);
|
|
list.get(i).setType(0);
|
|
list.get(i).setType(0);
|
|
- return list;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
|
|
+
|
|
|
|
+ } else {
|
|
//找到了
|
|
//找到了
|
|
|
|
+ Pattern compile = Pattern.compile(str3);
|
|
|
|
+ Matcher matcher1 = compile.matcher(list.get(i).getContent());
|
|
|
|
+ if(matcher1.find()){
|
|
|
|
+ String group = m.group(0);
|
|
|
|
+ String str2 = "(^\\d*$+)";
|
|
|
|
+ Pattern p1 = Pattern.compile(str1);
|
|
|
|
+ Matcher matcher = p1.matcher(group);
|
|
|
|
+ String group1 = matcher.group(0);
|
|
|
|
+ String group2 = matcher.group(1);
|
|
|
|
+ Integer j = Integer.parseInt(group1);
|
|
|
|
+ Integer k = Integer.parseInt(group2);
|
|
|
|
+ List<Integer> sonID = list.get(j).getSonID();
|
|
|
|
+ sonID.add(list.get(i).getId());
|
|
|
|
+ list.get(j).setSonID(sonID);
|
|
|
|
+ List<Integer> fatherID = list.get(i).getFatherID();
|
|
|
|
+ fatherID.add(list.get(j).getId());
|
|
|
|
+ list.get(i).setFatherID(fatherID);
|
|
|
|
+ List<Integer> sonID1 = list.get(k).getSonID();
|
|
|
|
+ sonID1.add(list.get(i).getId());
|
|
|
|
+ list.get(k).setSonID(sonID1);
|
|
|
|
+ List<Integer> fatherID1 = list.get(i).getFatherID();
|
|
|
|
+ fatherID1.add(list.get(k).getId());
|
|
|
|
+ list.get(i).setFatherID(fatherID1);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }else {
|
|
String group = m.group(0);
|
|
String group = m.group(0);
|
|
- String str2="(^\\d*$+)";
|
|
|
|
|
|
+ String str2 = "(^\\d*$+)";
|
|
Pattern p1 = Pattern.compile(str1);
|
|
Pattern p1 = Pattern.compile(str1);
|
|
Matcher matcher = p1.matcher(group);
|
|
Matcher matcher = p1.matcher(group);
|
|
- String substring= matcher.group(0);
|
|
|
|
|
|
+ String substring = matcher.group(0);
|
|
int j = Integer.parseInt(substring);
|
|
int j = Integer.parseInt(substring);
|
|
List<Integer> sonID = list.get(j - 1).getSonID();
|
|
List<Integer> sonID = list.get(j - 1).getSonID();
|
|
sonID.add(list.get(i).getId());
|
|
sonID.add(list.get(i).getId());
|
|
list.get(j - 1).setSonID(sonID);
|
|
list.get(j - 1).setSonID(sonID);
|
|
List<Integer> fatherID = list.get(i).getFatherID();
|
|
List<Integer> fatherID = list.get(i).getFatherID();
|
|
- fatherID.add( list.get(j - 1).getId());
|
|
|
|
|
|
+ fatherID.add(list.get(j - 1).getId());
|
|
list.get(i).setFatherID(fatherID);
|
|
list.get(i).setFatherID(fatherID);
|
|
//设置为
|
|
//设置为
|
|
list.get(i).setType(1);
|
|
list.get(i).setType(1);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return list;
|
|
return list;
|
|
@@ -410,7 +428,6 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
public void updatePatentRight(PatentRightParams params) {
|
|
public void updatePatentRight(PatentRightParams params) {
|
|
List<PatentRight> patentRightList = new ArrayList<>();
|
|
List<PatentRight> patentRightList = new ArrayList<>();
|
|
//获取国家 公开号前两位
|
|
//获取国家 公开号前两位
|
|
@@ -475,6 +492,7 @@ public class PatentRightService extends ServiceImpl<PatentRightMapper, PatentRig
|
|
this.saveOrUpdateBatch(patentRightList);
|
|
this.saveOrUpdateBatch(patentRightList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
-}
|
|
|