|
@@ -10,10 +10,7 @@ import cn.cslg.pas.common.model.vo.outApi.StarPatentVO;
|
|
|
import cn.cslg.pas.common.utils.FormatUtil;
|
|
|
import cn.cslg.pas.common.utils.JsonUtils;
|
|
|
import cn.cslg.pas.common.utils.SecurityUtils.SecurityUtils;
|
|
|
-import cn.cslg.pas.domain.PatentAgency;
|
|
|
-import cn.cslg.pas.domain.PatentAgent;
|
|
|
-import cn.cslg.pas.domain.PatentApplicant;
|
|
|
-import cn.cslg.pas.domain.PubNo;
|
|
|
+import cn.cslg.pas.domain.*;
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -51,11 +48,16 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
|
|
|
public static String formQuery(String query){
|
|
|
+ query = query
|
|
|
+ .replace(" AND ", "*")
|
|
|
+ .replace(" OR ", "+")
|
|
|
+ .replace(" NOT ", "-");
|
|
|
+
|
|
|
//记录偏移量
|
|
|
int t =0;
|
|
|
StringBuilder query2 =new StringBuilder(query);
|
|
|
//匹配形如ab=(cd OR ef);
|
|
|
- String regexOrg = "([^=^\\sOR\\s^\\(^\\)]+=\\([^=^\\)]+\\))+?";
|
|
|
+ String regexOrg = "([^=^\\+^\\(^\\)]+=\\([^=^\\)]+\\))+?";
|
|
|
Pattern patternOrg = Pattern.compile(regexOrg);
|
|
|
Matcher matcherOrg = patternOrg.matcher(query);
|
|
|
while (matcherOrg.find()){
|
|
@@ -66,7 +68,7 @@ public class PatentStarApiService {
|
|
|
query2.delete(matcherOrg.start()+t,matcherOrg.start()+b.length()+1+t);
|
|
|
t=t-b.length()-1;
|
|
|
String c= bc[1];
|
|
|
- String regexOrg1 = "([^\\sOR\\s^\\sAND\\s^\\sNOT\\s^\\(^\\)])+";
|
|
|
+ String regexOrg1 = "([^\\+^\\*^\\-^\\(^\\)])+";
|
|
|
Pattern patternOrg1 = Pattern.compile(regexOrg1);
|
|
|
Matcher matcherOrg1 = patternOrg1.matcher(c);
|
|
|
while (matcherOrg1.find()){
|
|
@@ -82,11 +84,6 @@ public class PatentStarApiService {
|
|
|
|
|
|
public static String formatQuery(String query) {
|
|
|
query= PatentStarApiService.formQuery(query);
|
|
|
- query = query
|
|
|
- .replace(" AND ", "*")
|
|
|
- .replace(" OR ", "+")
|
|
|
- .replace(" NOT ", "-");
|
|
|
-
|
|
|
StringBuilder sb = new StringBuilder(query);
|
|
|
String regex = "(?<=[\\(\\)\\+\\-=\\*])[^\\*^\\-^\\+^\\(^\\)]+?(?=[\\(\\+\\-=\\)\\*])";
|
|
|
Pattern pattern = Pattern.compile(regex);
|
|
@@ -140,7 +137,6 @@ public class PatentStarApiService {
|
|
|
}
|
|
|
item.setApplicant(new ArrayList<>());
|
|
|
item.setAgent(new ArrayList<>());
|
|
|
- item.setInventor(Arrays.asList(item.getInventorStr().split(";")));
|
|
|
item.setIpcList(Arrays.asList(item.getIpcListStr().split(";")));
|
|
|
List<String> applicants = Arrays.asList( item.getApplicantStr().split(";"));
|
|
|
//装载申请人
|
|
@@ -171,6 +167,17 @@ public class PatentStarApiService {
|
|
|
patentAgency.setName(item.getAgencyStr().split(" ")[0]);
|
|
|
item.setAgency(patentAgency);
|
|
|
}
|
|
|
+ //发明人
|
|
|
+ if(item.getInventorStr()!=null&&item.getInventorStr()!=""){
|
|
|
+ List<String> inventors = Arrays.asList(item.getInventorStr().split(";"));
|
|
|
+ inventors.forEach(
|
|
|
+ tem->{
|
|
|
+ PatentInventor patentInventor =new PatentInventor();
|
|
|
+ patentInventor.setName(tem);
|
|
|
+ item.getInventor().add(patentInventor);;
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
//代理人
|
|
|
if(item.getAgentStr()!=null&&item.getAgentStr()!=""){
|
|
|
List<String> agent = Arrays.asList(item.getAgentStr().split(";"));
|