|
@@ -109,7 +109,7 @@ public class ImportSinglePatentService {
|
|
|
|
|
|
|
|
|
public PatentWithIdVO addSinglePatent(String patentNo) {
|
|
|
- PatentWithIdVO patentWithIdVO =new PatentWithIdVO();
|
|
|
+ PatentWithIdVO patentWithIdVO = new PatentWithIdVO();
|
|
|
StarPatentVO starPatentVO = new StarPatentVO();
|
|
|
starPatentVO = this.getPatentFromWeb(patentNo);
|
|
|
if (starPatentVO == null) {
|
|
@@ -121,11 +121,11 @@ public class ImportSinglePatentService {
|
|
|
patentJoin.setName("patent");
|
|
|
patent.setPatentJoin(patentJoin);
|
|
|
try {
|
|
|
- patentWithIdVO = esService.getIdByPatentNo(patent.getPatentNo());
|
|
|
+ patentWithIdVO = esService.getIdByPatentNo(patent.getPatentNo());
|
|
|
if (patentWithIdVO != null) {
|
|
|
return patentWithIdVO;
|
|
|
}
|
|
|
- patentWithIdVO =new PatentWithIdVO();
|
|
|
+ patentWithIdVO = new PatentWithIdVO();
|
|
|
String patentId = esService.addPatent(patent);
|
|
|
patentWithIdVO.setPatent(patent);
|
|
|
patentWithIdVO.setId(patentId);
|
|
@@ -143,17 +143,17 @@ public class ImportSinglePatentService {
|
|
|
*/
|
|
|
public Patent getPatentCataloguingFromWeb(StarPatentVO starPatentVO) {
|
|
|
String patentZhuLuStr = "";
|
|
|
- if (starPatentVO.getApplicationNo().startsWith("CN")) {
|
|
|
- patentZhuLuStr = patentStarApiService.getCnBibApi(starPatentVO.getRowApplicationNo());
|
|
|
+ if (starPatentVO.getAN().startsWith("CN")) {
|
|
|
+ patentZhuLuStr = patentStarApiService.getCnBibApi(starPatentVO.getANO());
|
|
|
} else {
|
|
|
- patentZhuLuStr = patentStarApiService.getENBibApi(starPatentVO.getPublicNo());
|
|
|
+ patentZhuLuStr = patentStarApiService.getENBibApi(starPatentVO.getPN());
|
|
|
}
|
|
|
UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
|
|
|
uploadPatentWebDTO.setPatent(new Patent());
|
|
|
uploadPatentWebDTO.setStarPatentVO(starPatentVO);
|
|
|
this.loadPatent(uploadPatentWebDTO);
|
|
|
if (patentZhuLuStr != null && !patentZhuLuStr.trim().equals("") && !patentZhuLuStr.equals("{}") && !patentZhuLuStr.contains("请求不合法")) {
|
|
|
- if (starPatentVO.getApplicationNo().startsWith("CN")) {
|
|
|
+ if (starPatentVO.getAN().startsWith("CN")) {
|
|
|
this.loadCNPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent(), starPatentVO);
|
|
|
//装载专利号
|
|
|
if (uploadPatentWebDTO.getPatent().getAppNo() != null) {
|
|
@@ -186,7 +186,7 @@ public class ImportSinglePatentService {
|
|
|
StarPatentVO starPatentVO = uploadPatentWebDTO.getStarPatentVO();
|
|
|
|
|
|
//装载专利类型
|
|
|
- Integer patentType = starPatentVO.getPatentType();
|
|
|
+ Integer patentType = starPatentVO.getPT();
|
|
|
if (patentType != null) {
|
|
|
if (patentType.equals(2) || patentType.equals(9)) {
|
|
|
patent.setPatentType("1"); //实用新型
|
|
@@ -198,16 +198,16 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
|
|
|
//装载申请人地址
|
|
|
- if (starPatentVO.getApplicationAddress() != null && !starPatentVO.getApplicationAddress().equals("")) {
|
|
|
- String applicationAddress = starPatentVO.getApplicationAddress();
|
|
|
- PersonAddress personAddress = AddressSplitter.splitAddress(applicationAddress, starPatentVO.getProvinceStr());
|
|
|
+ if (starPatentVO.getDZ() != null && !starPatentVO.getDZ().equals("")) {
|
|
|
+ String applicationAddress = starPatentVO.getDZ();
|
|
|
+ PersonAddress personAddress = AddressSplitter.splitAddress(applicationAddress, starPatentVO.getCO());
|
|
|
patent.setApplicantAddr(personAddress);
|
|
|
}
|
|
|
|
|
|
//装载IPC分类号
|
|
|
- if (starPatentVO.getIpcListStr() != null && !starPatentVO.getIpcListStr().equals("")) {
|
|
|
+ if (starPatentVO.getIC() != null && !starPatentVO.getIC().equals("")) {
|
|
|
List<PatentClassify> patentClassifies = new ArrayList<>();
|
|
|
- List<String> ipcArr = Arrays.asList(starPatentVO.getIpcListStr().split(";"));
|
|
|
+ List<String> ipcArr = Arrays.asList(starPatentVO.getIC().split(";"));
|
|
|
for (int i = 0; i < ipcArr.size(); i++) {
|
|
|
PatentClassify patentClassify = PatentClassifySplitter.split(ipcArr.get(i));
|
|
|
patentClassifies.add(patentClassify);
|
|
@@ -219,32 +219,32 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
|
|
|
//装载公告日
|
|
|
- if (starPatentVO.getPublicAccreditDate() != null && !starPatentVO.getPublicAccreditDate().equals("")) {
|
|
|
+ if (starPatentVO.getGN() != null && !starPatentVO.getGN().equals("")) {
|
|
|
//
|
|
|
// patent.setGrantDate();
|
|
|
- Date date = DateUtils.strToDate(starPatentVO.getPublicAccreditDate());
|
|
|
+ Date date = DateUtils.strToDate(starPatentVO.getGN());
|
|
|
patent.setGrantDate(date);
|
|
|
}
|
|
|
|
|
|
//装载摘要
|
|
|
- if (starPatentVO.getAbstractStr() != null && !starPatentVO.getAbstractStr().equals("")) {
|
|
|
+ if (starPatentVO.getAB() != null && !starPatentVO.getAB().equals("")) {
|
|
|
Text text = new Text();
|
|
|
text.setLanguage(patent.getAppCountry());
|
|
|
text.setIfOrigin(true);
|
|
|
- text.setTextContent(starPatentVO.getAbstractStr());
|
|
|
+ text.setTextContent(starPatentVO.getAB());
|
|
|
patent.setAbstractStr(Arrays.asList(text));
|
|
|
}
|
|
|
|
|
|
//装载申请日
|
|
|
- if (starPatentVO.getApplicationDate() != null && !starPatentVO.getApplicationDate().equals("")) {
|
|
|
- Date date = DateUtils.strToDate(starPatentVO.getApplicationDate());
|
|
|
+ if (starPatentVO.getAD() != null && !starPatentVO.getAD().equals("")) {
|
|
|
+ Date date = DateUtils.strToDate(starPatentVO.getAD());
|
|
|
patent.setAppDate(date);
|
|
|
|
|
|
}
|
|
|
|
|
|
//装载发明人
|
|
|
- if (starPatentVO.getInventorStr() != null && !starPatentVO.getInventorStr().equals("")) {
|
|
|
- List<String> patentInventorNames = Arrays.asList(starPatentVO.getInventorStr().split(";"));
|
|
|
+ if (starPatentVO.getIV() != null && !starPatentVO.getIV().equals("")) {
|
|
|
+ List<String> patentInventorNames = Arrays.asList(starPatentVO.getIV().split(";"));
|
|
|
List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
for (int i = 0; i < patentInventorNames.size(); i++) {
|
|
|
PatentPerson patentPerson = new PatentPerson();
|
|
@@ -257,18 +257,18 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
|
|
|
//装载申请号
|
|
|
- if (starPatentVO.getApplicationNo() != null && !starPatentVO.getApplicationNo().equals("")) {
|
|
|
- patent.setAppNo(starPatentVO.getApplicationNo());
|
|
|
- country = starPatentVO.getApplicationNo().substring(0, 2);
|
|
|
+ if (starPatentVO.getAN() != null && !starPatentVO.getAN().equals("")) {
|
|
|
+ patent.setAppNo(starPatentVO.getAN());
|
|
|
+ country = starPatentVO.getAN().substring(0, 2);
|
|
|
}
|
|
|
|
|
|
//装载公开号
|
|
|
- if (starPatentVO.getPublicNo() != null && !starPatentVO.getPublicNo().equals("")) {
|
|
|
- patent.setPublicNo(starPatentVO.getPublicNo());
|
|
|
+ if (starPatentVO.getPN() != null && !starPatentVO.getPN().equals("")) {
|
|
|
+ patent.setPublicNo(starPatentVO.getPN());
|
|
|
}
|
|
|
|
|
|
- if (starPatentVO.getPublicAccreditNo() != null && !starPatentVO.getPublicAccreditNo().equals("")) {
|
|
|
- patent.setGrantNo(starPatentVO.getPublicAccreditNo());
|
|
|
+ if (starPatentVO.getGN() != null && !starPatentVO.getGN().equals("")) {
|
|
|
+ patent.setGrantNo(starPatentVO.getGN());
|
|
|
}
|
|
|
|
|
|
if (patent.getAppNo().startsWith("CN")) {
|
|
@@ -281,8 +281,8 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
}
|
|
|
//装载申请人
|
|
|
- if (starPatentVO.getApplicantStr() != null && !starPatentVO.getApplicantStr().equals("")) {
|
|
|
- List<String> names = Arrays.asList(starPatentVO.getApplicantStr().split(";"));
|
|
|
+ if (starPatentVO.getPA() != null && !starPatentVO.getPA().equals("")) {
|
|
|
+ List<String> names = Arrays.asList(starPatentVO.getPA().split(";"));
|
|
|
List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
for (int i = 0; i < names.size(); i++) {
|
|
|
PatentPerson patentPerson = new PatentPerson();
|
|
@@ -295,35 +295,35 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
|
|
|
//装载代理人
|
|
|
- if (starPatentVO.getAgentStr() != null && !starPatentVO.getAgentStr().equals("")) {
|
|
|
- List<String> patentAgents = Arrays.asList(starPatentVO.getAgentStr().split(";"));
|
|
|
+ if (starPatentVO.getAT() != null && !starPatentVO.getAT().equals("")) {
|
|
|
+ List<String> patentAgents = Arrays.asList(starPatentVO.getAT().split(";"));
|
|
|
if (patentAgents != null && patentAgents.size() != 0) {
|
|
|
patent.setAgent(patentAgents);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (starPatentVO.getAgencyStr() != null && !starPatentVO.getAgencyStr().equals("")) {
|
|
|
- patent.setAgency(starPatentVO.getAgencyStr());
|
|
|
+ if (starPatentVO.getAGN() != null && !starPatentVO.getAGN().equals("")) {
|
|
|
+ patent.setAgency(starPatentVO.getAGN());
|
|
|
|
|
|
}
|
|
|
//装载公开日
|
|
|
- if (starPatentVO.getPublicDate() != null && !starPatentVO.getPublicDate().equals("")) {
|
|
|
- Date date = DateUtils.strToDate(starPatentVO.getPublicDate());
|
|
|
+ if (starPatentVO.getPD() != null && !starPatentVO.getPD().equals("")) {
|
|
|
+ Date date = DateUtils.strToDate(starPatentVO.getPD());
|
|
|
patent.setPublicDate(date);
|
|
|
}
|
|
|
|
|
|
//装载标题
|
|
|
- if (starPatentVO.getName() != null && !starPatentVO.getName().equals("")) {
|
|
|
+ if (starPatentVO.getTI() != null && !starPatentVO.getTI().equals("")) {
|
|
|
Text text = new Text();
|
|
|
text.setLanguage(country);
|
|
|
text.setIfOrigin(true);
|
|
|
- text.setTextContent(starPatentVO.getName());
|
|
|
+ text.setTextContent(starPatentVO.getTI());
|
|
|
patent.setTitle(Arrays.asList(text));
|
|
|
}
|
|
|
|
|
|
//装载权利人
|
|
|
- if (starPatentVO.getCurrentApplicantStr() != null && !starPatentVO.getCurrentApplicantStr().equals("")) {
|
|
|
- List<String> names = Arrays.asList(starPatentVO.getCurrentApplicantStr().split(";"));
|
|
|
+ if (starPatentVO.getPE() != null && !starPatentVO.getPE().equals("")) {
|
|
|
+ List<String> names = Arrays.asList(starPatentVO.getPE().split(";"));
|
|
|
List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
for (int i = 0; i < names.size(); i++) {
|
|
|
PatentPerson patentPerson = new PatentPerson();
|
|
@@ -353,21 +353,21 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
|
|
|
//装载优先权
|
|
|
- if (starPatentVO.getPriorityNo() != null && !starPatentVO.getPriorityNo().equals("")) {
|
|
|
+ if (starPatentVO.getPR() != null && !starPatentVO.getPR().equals("")) {
|
|
|
Priorities priorities = new Priorities();
|
|
|
- priorities.setPriorityNo(starPatentVO.getPriorityNo());
|
|
|
- String pCountry = starPatentVO.getApplicationNo().substring(0, 2);
|
|
|
+ priorities.setPriorityNo(starPatentVO.getPR());
|
|
|
+ String pCountry = starPatentVO.getAN().substring(0, 2);
|
|
|
priorities.setPriorityCountry(pCountry);
|
|
|
//装载优先权日
|
|
|
- if (starPatentVO.getPriorityDate() != null && !starPatentVO.getPriorityDate().equals("")) {
|
|
|
- DateUtils.str2Date(starPatentVO.getPriorityDate());
|
|
|
+ if (starPatentVO.getPRD() != null && !starPatentVO.getPRD().equals("")) {
|
|
|
+ DateUtils.str2Date(starPatentVO.getPRD());
|
|
|
}
|
|
|
patent.setPriorities(Arrays.asList(priorities));
|
|
|
}
|
|
|
|
|
|
//装载受理局
|
|
|
- if (starPatentVO.getBureau() != null && !starPatentVO.getBureau().equals("")) {
|
|
|
- patent.setAppCountry(starPatentVO.getBureau());
|
|
|
+ if (starPatentVO.getCO() != null && !starPatentVO.getCO().equals("")) {
|
|
|
+ patent.setAppCountry(starPatentVO.getCO());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -381,7 +381,7 @@ public class ImportSinglePatentService {
|
|
|
//装载申请人地址
|
|
|
if (patent.getApplicantAddr() == null) {
|
|
|
if (chinaPatentZhuLu.getDZ() != null && !chinaPatentZhuLu.getDZ().equals("")) {
|
|
|
- PersonAddress personAddress = AddressSplitter.splitAddress(chinaPatentZhuLu.getDZ(), starPatentVO.getProvinceStr());
|
|
|
+ PersonAddress personAddress = AddressSplitter.splitAddress(chinaPatentZhuLu.getDZ(), starPatentVO.getCO());
|
|
|
patent.setApplicantAddr(personAddress);
|
|
|
patent.setApplicantAddr(personAddress);
|
|
|
}
|
|
@@ -554,7 +554,7 @@ public class ImportSinglePatentService {
|
|
|
|
|
|
|
|
|
public void getFullXmlStr(Patent patent, StarPatentVO starPatentVO, List<Integer> contents) throws Exception {
|
|
|
- String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(starPatentVO.getRowApplicationNo());
|
|
|
+ String cnFullXmlStr = patentStarApiService.getCnFullXmlApi(starPatentVO.getANO());
|
|
|
if (contents.contains(3)) {
|
|
|
this.loadClaim(patent, cnFullXmlStr);
|
|
|
|
|
@@ -583,7 +583,6 @@ public class ImportSinglePatentService {
|
|
|
String claim = item.getText();
|
|
|
claim = claim.replaceAll("\r\n|\r|\n|\t| ", "");
|
|
|
reClaims.add(claim);
|
|
|
-
|
|
|
});
|
|
|
String reClaim = "";
|
|
|
if (reClaims.size() != 0) {
|
|
@@ -661,21 +660,21 @@ public class ImportSinglePatentService {
|
|
|
public void getPDFFromWeb(StarPatentVO starPatentVO) throws Exception {
|
|
|
|
|
|
String usedPatentNo;
|
|
|
- if (starPatentVO.getPublicNo() != null && !starPatentVO.getPublicNo().equals("")) {
|
|
|
- usedPatentNo = starPatentVO.getPublicNo();
|
|
|
+ if (starPatentVO.getPN() != null && !starPatentVO.getPN().equals("")) {
|
|
|
+ usedPatentNo = starPatentVO.getPN();
|
|
|
} else {
|
|
|
- usedPatentNo = starPatentVO.getPublicAccreditNo();
|
|
|
+ usedPatentNo = starPatentVO.getGN();
|
|
|
}
|
|
|
|
|
|
String pdfUrl = "", pdfUrl1 = "", pdfUrl2 = "";
|
|
|
//先根据公开号判断国家,若没有公开号再根据申请号判断,调用"获得中国专利pdf"接口,获得1个或2个pdf的url地址
|
|
|
- if ((starPatentVO.getPublicNo() != null && starPatentVO.getPublicNo().contains("CN")) || (starPatentVO.getPublicNo() == null && starPatentVO.getPatentNo().contains("CN")) || (starPatentVO.getPublicAccreditNo() != null && starPatentVO.getPublicAccreditNo().contains("CN"))) {
|
|
|
+ if ((starPatentVO.getPN() != null && starPatentVO.getPN().contains("CN")) || (starPatentVO.getPN() == null && starPatentVO.getPatentNo().contains("CN")) || (starPatentVO.getGN() != null && starPatentVO.getGN().contains("CN"))) {
|
|
|
|
|
|
- String pdfUrlStr = patentStarApiService.getCnPdfApi(starPatentVO.getRowApplicationNo());
|
|
|
+ String pdfUrlStr = patentStarApiService.getCnPdfApi(starPatentVO.getANO());
|
|
|
|
|
|
//若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
|
|
|
if (!pdfUrlStr.equals("")) {
|
|
|
-// recordQuestionPatent(starPatent.getApplicationNo(), task.getId(), 4);
|
|
|
+// recordQuestionPatent(starPatent.getAN(), task.getId(), 4);
|
|
|
|
|
|
|
|
|
if (pdfUrlStr.contains("|http")) { //若包含公开和授权两个pdf
|
|
@@ -686,17 +685,17 @@ public class ImportSinglePatentService {
|
|
|
|
|
|
|
|
|
if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
|
- String guid1 = FormatUtil.getPDFFormat(starPatentVO.getApplicationNo(), 0);
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(starPatentVO.getAN(), 0);
|
|
|
File file1 = FileUtils.getFileByUrl(pdfUrl1);
|
|
|
fileManagerService.uploadFileWithGuid(file1, guid1);
|
|
|
- String guid2 = FormatUtil.getPDFFormat(starPatentVO.getApplicationNo(), 1);
|
|
|
+ String guid2 = FormatUtil.getPDFFormat(starPatentVO.getAN(), 1);
|
|
|
File file2 = FileUtils.getFileByUrl(pdfUrl2);
|
|
|
fileManagerService.uploadFileWithGuid(file2, guid2);
|
|
|
} else {
|
|
|
- String guid1 = FormatUtil.getPDFFormat(starPatentVO.getApplicationNo(), 1);
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(starPatentVO.getAN(), 1);
|
|
|
File file1 = FileUtils.getFileByUrl(pdfUrl1);
|
|
|
fileManagerService.uploadFileWithGuid(file1, guid1);
|
|
|
- String guid2 = FormatUtil.getPDFFormat(starPatentVO.getApplicationNo(), 0);
|
|
|
+ String guid2 = FormatUtil.getPDFFormat(starPatentVO.getAN(), 0);
|
|
|
File file2 = FileUtils.getFileByUrl(pdfUrl2);
|
|
|
fileManagerService.uploadFileWithGuid(file2, guid2);
|
|
|
}
|
|
@@ -707,11 +706,11 @@ public class ImportSinglePatentService {
|
|
|
pdfUrl1 = pdfUrlStr.substring(pdfUrlStr.indexOf("http"));
|
|
|
}
|
|
|
if (pdfUrl1.contains("0A_CN_0.pdf")) {
|
|
|
- String guid1 = FormatUtil.getPDFFormat(starPatentVO.getApplicationNo(), 0);
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(starPatentVO.getAN(), 0);
|
|
|
File file1 = FileUtils.getFileByUrl(pdfUrl1);
|
|
|
fileManagerService.uploadFileWithGuid(file1, guid1);
|
|
|
} else {
|
|
|
- String guid1 = FormatUtil.getPDFFormat(starPatentVO.getApplicationNo(), 1);
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(starPatentVO.getAN(), 1);
|
|
|
File file1 = FileUtils.getFileByUrl(pdfUrl1);
|
|
|
fileManagerService.uploadFileWithGuid(file1, guid1);
|
|
|
}
|
|
@@ -722,7 +721,7 @@ public class ImportSinglePatentService {
|
|
|
pdfUrl = patentStarApiService.getEnPdfApi(usedPatentNo);
|
|
|
//若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
|
|
|
// if (pdfUrl.equals("") || pdfUrl.equals("{}")) {
|
|
|
-// recordQuestionPatent(starPatent.getApplicationNo(), task.getId(), 4);
|
|
|
+// recordQuestionPatent(starPatent.getAN(), task.getId(), 4);
|
|
|
// return;
|
|
|
// }
|
|
|
if (!pdfUrl.equals("")) {
|
|
@@ -736,10 +735,10 @@ public class ImportSinglePatentService {
|
|
|
public void getPictureFromWeb(StarPatentVO starPatentVO) throws Exception {
|
|
|
|
|
|
|
|
|
- String pictureUrl = patentStarApiService.getPictureApi(starPatentVO.getRowApplicationNo());
|
|
|
+ String pictureUrl = patentStarApiService.getPictureApi(starPatentVO.getANO());
|
|
|
if (pictureUrl != null && pictureUrl != "{}") {
|
|
|
File file = FileUtils.getPictureFileByUrl(pictureUrl);
|
|
|
- String guid = FormatUtil.getPictureFormat(starPatentVO.getApplicationNo());
|
|
|
+ String guid = FormatUtil.getPictureFormat(starPatentVO.getAN());
|
|
|
fileManagerService.uploadFileWithGuid(file, guid);
|
|
|
}
|
|
|
|