|
@@ -46,16 +46,21 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
- try {
|
|
|
|
- while ((!ifProductAll || uploadPatentWebDTOs.size() > 0) && importTaskAMVO.getState().equals(1)) {
|
|
|
|
|
|
|
|
|
|
+ while ((!ifProductAll || uploadPatentWebDTOs.size() > 0) && importTaskAMVO.getState().equals(1)) {
|
|
|
|
+
|
|
|
|
+ try {
|
|
//判断任务队列是否有任务,若没有则线程等待唤醒
|
|
//判断任务队列是否有任务,若没有则线程等待唤醒
|
|
if (uploadPatentWebDTOs.size() == 0) {
|
|
if (uploadPatentWebDTOs.size() == 0) {
|
|
taskLock.lock();
|
|
taskLock.lock();
|
|
taskCondition.await();
|
|
taskCondition.await();
|
|
}
|
|
}
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ UploadPatentWebDTO uploadPatentWebDTO = uploadPatentWebDTOs.remove(0);
|
|
|
|
+ try{
|
|
//根据专利申请号查询著录并装载信息
|
|
//根据专利申请号查询著录并装载信息
|
|
- UploadPatentWebDTO uploadPatentWebDTO = uploadPatentWebDTOs.remove(0);
|
|
|
|
StarPatentVO starPatentVO = uploadPatentWebDTO.getStarPatentVO();
|
|
StarPatentVO starPatentVO = uploadPatentWebDTO.getStarPatentVO();
|
|
String patentZhuLuStr = "";
|
|
String patentZhuLuStr = "";
|
|
patentStarApiService = applicationContext.getBean(PatentStarApiService.class);
|
|
patentStarApiService = applicationContext.getBean(PatentStarApiService.class);
|
|
@@ -67,7 +72,7 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
if (patentZhuLuStr != null && !patentZhuLuStr.trim().equals("") && !patentZhuLuStr.equals("{}") && !patentZhuLuStr.contains("请求不合法")) {
|
|
if (patentZhuLuStr != null && !patentZhuLuStr.trim().equals("") && !patentZhuLuStr.equals("{}") && !patentZhuLuStr.contains("请求不合法")) {
|
|
this.loadPatent(uploadPatentWebDTO);
|
|
this.loadPatent(uploadPatentWebDTO);
|
|
if (starPatentVO.getApplicationNo().startsWith("CN")) {
|
|
if (starPatentVO.getApplicationNo().startsWith("CN")) {
|
|
- this.loadCNPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent());
|
|
|
|
|
|
+ this.loadCNPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent(),starPatentVO);
|
|
} else {
|
|
} else {
|
|
this.loadWorldPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent());
|
|
this.loadWorldPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent());
|
|
}
|
|
}
|
|
@@ -79,7 +84,10 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
String familyPatentNoStr = patentStarApiService.getFamilyByPubNoApi(uploadPatentWebDTO.getPatent().getPublicNo());
|
|
String familyPatentNoStr = patentStarApiService.getFamilyByPubNoApi(uploadPatentWebDTO.getPatent().getPublicNo());
|
|
if (!familyPatentNoStr.equals("no data")) {
|
|
if (!familyPatentNoStr.equals("no data")) {
|
|
FamilyPatentNo familyPatentNo = JSON.parseObject(familyPatentNoStr, FamilyPatentNo.class);
|
|
FamilyPatentNo familyPatentNo = JSON.parseObject(familyPatentNoStr, FamilyPatentNo.class);
|
|
- List<String> familyPatentNos = Arrays.asList(familyPatentNo.getFamilyinfo().split(";"));
|
|
|
|
|
|
+ List<String> familyPatentNos = new ArrayList<>();
|
|
|
|
+ if (familyPatentNo != null && familyPatentNo.getFamilyinfo() != null) {
|
|
|
|
+ familyPatentNos = Arrays.asList(familyPatentNo.getFamilyinfo().split(";"));
|
|
|
|
+ }
|
|
if (familyPatentNos.size() != 0) {
|
|
if (familyPatentNos.size() != 0) {
|
|
EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(familyPatentNos, "inpadoc");
|
|
EsPatentFamilyDTO esPatentFamilyDTO = esService.addEsPatentFamily(familyPatentNos, "inpadoc");
|
|
uploadPatentWebDTO.getPatent().setInpadocFamilyNum(esPatentFamilyDTO.getFamilyNum());
|
|
uploadPatentWebDTO.getPatent().setInpadocFamilyNum(esPatentFamilyDTO.getFamilyNum());
|
|
@@ -88,21 +96,22 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
}
|
|
}
|
|
|
|
|
|
//添加法律事务
|
|
//添加法律事务
|
|
- esService.addEsLegalEvent(uploadPatentWebDTO.getPatent().getPublicNo());
|
|
|
|
|
|
+ esService.addEsLegalEvent(uploadPatentWebDTO.getStarPatentVO().getPublicNo());
|
|
|
|
|
|
//添加引用专利
|
|
//添加引用专利
|
|
String nos = starPatentVO.getQuoteNos();
|
|
String nos = starPatentVO.getQuoteNos();
|
|
- if(nos!=null) {
|
|
|
|
|
|
+ if (nos != null) {
|
|
List<String> quotedNos = this.reQuotedNos(nos);
|
|
List<String> quotedNos = this.reQuotedNos(nos);
|
|
esService.addEsQuotePatent(uploadPatentWebDTO.getPatent().getPublicNo(), quotedNos);
|
|
esService.addEsQuotePatent(uploadPatentWebDTO.getPatent().getPublicNo(), quotedNos);
|
|
}
|
|
}
|
|
//加入es保存队列
|
|
//加入es保存队列
|
|
importFromWebToEsService.savePatentToEs(uploadPatentWebDTO);
|
|
importFromWebToEsService.savePatentToEs(uploadPatentWebDTO);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ importFromWebToEsService.savePatentToEs(uploadPatentWebDTO);
|
|
|
|
+ e.printStackTrace();
|
|
}
|
|
}
|
|
- taskThread.awakeTaskThread();
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- e.printStackTrace();
|
|
|
|
}
|
|
}
|
|
|
|
+ importFromWebToEsService.setPatentToEsProductAll();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -110,6 +119,7 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
this.importTaskAMVO = taskThread.getImportTaskAMVO();
|
|
this.importTaskAMVO = taskThread.getImportTaskAMVO();
|
|
this.importFromWebToEsService = importFromWebToEsService;
|
|
this.importFromWebToEsService = importFromWebToEsService;
|
|
this.applicationContext = taskThread.getApplicationContext();
|
|
this.applicationContext = taskThread.getApplicationContext();
|
|
|
|
+ this.taskThread =taskThread;
|
|
}
|
|
}
|
|
|
|
|
|
public void awakeTask(UploadPatentWebDTO uploadPatentWebDTO) {
|
|
public void awakeTask(UploadPatentWebDTO uploadPatentWebDTO) {
|
|
@@ -146,11 +156,7 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
//装载申请人地址
|
|
//装载申请人地址
|
|
if (starPatentVO.getApplicationAddress() != null && !starPatentVO.getApplicationAddress().equals("")) {
|
|
if (starPatentVO.getApplicationAddress() != null && !starPatentVO.getApplicationAddress().equals("")) {
|
|
String applicationAddress = starPatentVO.getApplicationAddress();
|
|
String applicationAddress = starPatentVO.getApplicationAddress();
|
|
- List<String> addresses = AddressSplitter.splitAddress(applicationAddress);
|
|
|
|
- PersonAddress personAddress = new PersonAddress();
|
|
|
|
- personAddress.setProvince(addresses.get(0));
|
|
|
|
- personAddress.setCity(addresses.get(1));
|
|
|
|
- personAddress.setDistrict(addresses.get(2));
|
|
|
|
|
|
+ PersonAddress personAddress = AddressSplitter.splitAddress(applicationAddress,starPatentVO.getProvinceStr());
|
|
patent.setApplicantAddr(personAddress);
|
|
patent.setApplicantAddr(personAddress);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -307,7 +313,7 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
}
|
|
}
|
|
|
|
|
|
//装载中国专利
|
|
//装载中国专利
|
|
- private void loadCNPatent(String chinaPatentZhuLuStr, Patent patent) {
|
|
|
|
|
|
+ private void loadCNPatent(String chinaPatentZhuLuStr, Patent patent,StarPatentVO starPatentVO) {
|
|
patent.setPatentNo(patent.getAppNo());
|
|
patent.setPatentNo(patent.getAppNo());
|
|
if (chinaPatentZhuLuStr != null && !chinaPatentZhuLuStr.trim().equals("") && !chinaPatentZhuLuStr.equals("{}") && !chinaPatentZhuLuStr.contains("请求不合法")) {
|
|
if (chinaPatentZhuLuStr != null && !chinaPatentZhuLuStr.trim().equals("") && !chinaPatentZhuLuStr.equals("{}") && !chinaPatentZhuLuStr.contains("请求不合法")) {
|
|
List<ChinaPatentZhuLu> chinaPatentZhuLus = JSON.parseArray(chinaPatentZhuLuStr, ChinaPatentZhuLu.class);
|
|
List<ChinaPatentZhuLu> chinaPatentZhuLus = JSON.parseArray(chinaPatentZhuLuStr, ChinaPatentZhuLu.class);
|
|
@@ -315,11 +321,8 @@ public class GetCataloguingFromWebThread extends Thread {
|
|
//装载申请人地址
|
|
//装载申请人地址
|
|
if (patent.getApplicantAddr() == null) {
|
|
if (patent.getApplicantAddr() == null) {
|
|
if (chinaPatentZhuLu.getDZ() != null && !chinaPatentZhuLu.getDZ().equals("")) {
|
|
if (chinaPatentZhuLu.getDZ() != null && !chinaPatentZhuLu.getDZ().equals("")) {
|
|
- List<String> addresses = AddressSplitter.splitAddress(chinaPatentZhuLu.getDZ());
|
|
|
|
- PersonAddress personAddress = new PersonAddress();
|
|
|
|
- personAddress.setProvince(addresses.get(0));
|
|
|
|
- personAddress.setCity(addresses.get(1));
|
|
|
|
- personAddress.setDistrict(addresses.get(2));
|
|
|
|
|
|
+ PersonAddress personAddress = AddressSplitter.splitAddress(chinaPatentZhuLu.getDZ(),starPatentVO.getProvinceStr());
|
|
|
|
+ patent.setApplicantAddr(personAddress);
|
|
patent.setApplicantAddr(personAddress);
|
|
patent.setApplicantAddr(personAddress);
|
|
}
|
|
}
|
|
}
|
|
}
|