|
@@ -5,6 +5,7 @@ import cn.cslg.pas.common.dto.UploadPatentWebDTO;
|
|
|
import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
|
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
|
|
|
import cn.cslg.pas.common.model.cronModel.SystemFile;
|
|
|
+import cn.cslg.pas.common.model.importTaskModel.PatentAffair;
|
|
|
import cn.cslg.pas.common.model.importTaskModel.PatentInventor;
|
|
|
import cn.cslg.pas.common.utils.ReadExcelUtils;
|
|
|
import cn.cslg.pas.common.utils.esDataForm.PatentClassifySplitter;
|
|
@@ -66,7 +67,7 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
List<UploadSettingVO.Column> jsonData = excuteUploadSettingService.ExcuteUploadSetting(sourceId.toString());
|
|
|
//解析Excel文件获得工作簿
|
|
|
Sheet sheet = ReadExcelUtils.readExcel(tempFile);
|
|
|
- Integer x =0;
|
|
|
+ Integer x = 0;
|
|
|
//遍历专利总数量,在循环中将专利一个一个存入消费者专利队列
|
|
|
for (int i = lastIndex; i < total; i++) {
|
|
|
if (!importTaskAMVO.getState().equals(1)) {
|
|
@@ -89,12 +90,12 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
}
|
|
|
//专利丢入消费者队列,并唤醒消费者线程
|
|
|
savePatentToEsThread.awakeTask(uploadPatentWebDTO);
|
|
|
- x++;
|
|
|
+ x++;
|
|
|
getPatentPictureFromExcelThread.awakeTask(uploadPatentWebDTO);
|
|
|
}
|
|
|
//专利取完通知消费者线程
|
|
|
savePatentToEsThread.setIfProductAll(true);
|
|
|
- System.out.println("从excel获取专利:"+x);
|
|
|
+ System.out.println("从excel获取专利:" + x);
|
|
|
getPatentPictureFromExcelThread.setIfProductAll(true);
|
|
|
//删除临时文件tempFile
|
|
|
new File(tempFile.getPath()).delete();
|
|
@@ -114,29 +115,25 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
public void loadPatent(UploadParamsVO uploadParamsVO) {
|
|
|
Patent patent = uploadParamsVO.getPatent();
|
|
|
String patentNo = patent.getPatentNo();
|
|
|
- String appNo =patent.getAppNo();
|
|
|
- String publicNo =patent.getPublicNo();
|
|
|
- String grantNo =patent.getGrantNo();
|
|
|
- String usedNo =null;
|
|
|
- if(appNo!=null){
|
|
|
- usedNo =appNo;
|
|
|
- }
|
|
|
- else if(publicNo!=null){
|
|
|
- usedNo=publicNo;
|
|
|
- }
|
|
|
- else if(grantNo!=null){
|
|
|
- usedNo=grantNo;
|
|
|
+ String appNo = patent.getAppNo();
|
|
|
+ String publicNo = patent.getPublicNo();
|
|
|
+ String grantNo = patent.getGrantNo();
|
|
|
+ String usedNo = null;
|
|
|
+ if (appNo != null) {
|
|
|
+ usedNo = appNo;
|
|
|
+ } else if (publicNo != null) {
|
|
|
+ usedNo = publicNo;
|
|
|
+ } else if (grantNo != null) {
|
|
|
+ usedNo = grantNo;
|
|
|
}
|
|
|
String contry = usedNo.substring(0, 2);
|
|
|
- if(contry.equals("CN")){
|
|
|
- patentNo=appNo;
|
|
|
- }
|
|
|
- else {
|
|
|
- if(publicNo!=null){
|
|
|
- patentNo=publicNo;
|
|
|
- }
|
|
|
- else if(grantNo!=null){
|
|
|
- patentNo=grantNo;
|
|
|
+ if (contry.equals("CN")) {
|
|
|
+ patentNo = appNo;
|
|
|
+ } else {
|
|
|
+ if (publicNo != null) {
|
|
|
+ patentNo = publicNo;
|
|
|
+ } else if (grantNo != null) {
|
|
|
+ patentNo = grantNo;
|
|
|
}
|
|
|
}
|
|
|
patent.setPatentNo(patentNo);
|
|
@@ -277,7 +274,7 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
|
|
|
//发明人
|
|
|
List<PatentInventor> patentInventorList = uploadParamsVO.getPatentInventorList();
|
|
|
- if (patentInventorList != null && patentInventorList.size()>0) {
|
|
|
+ if (patentInventorList != null && patentInventorList.size() > 0) {
|
|
|
List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
for (int i = 0; i < patentInventorList.size(); i++) {
|
|
|
PatentPerson patentPerson = new PatentPerson();
|
|
@@ -294,16 +291,16 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
String mainIpc = uploadParamsVO.getMainIpc();
|
|
|
|
|
|
//装载IPC分类号
|
|
|
- if (ipcList == null && mainIpc!= null) {
|
|
|
- ipcList=new ArrayList<>();
|
|
|
+ if (ipcList == null && mainIpc != null) {
|
|
|
+ ipcList = new ArrayList<>();
|
|
|
ipcList.add(uploadParamsVO.getMainIpc());
|
|
|
}
|
|
|
|
|
|
- if (ipcList != null&&ipcList.size()>0) {
|
|
|
+ if (ipcList != null && ipcList.size() > 0) {
|
|
|
List<PatentClassify> patentClassifies = new ArrayList<>();
|
|
|
for (int i = 0; i < ipcList.size(); i++) {
|
|
|
PatentClassify patentClassify = PatentClassifySplitter.split(ipcList.get(i));
|
|
|
- if(patentClassify!=null) {
|
|
|
+ if (patentClassify != null) {
|
|
|
patentClassifies.add(patentClassify);
|
|
|
if (i == 0) {
|
|
|
patent.setMipc(patentClassify);
|
|
@@ -325,7 +322,7 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
}
|
|
|
|
|
|
//装载说明书
|
|
|
- if ( uploadParamsVO.getPatentInstructionText()!=null) {
|
|
|
+ if (uploadParamsVO.getPatentInstructionText() != null) {
|
|
|
List<Text> texts = new ArrayList<>();
|
|
|
if (uploadParamsVO.getPatentInstructionText().getManual() != null) {
|
|
|
Text text = new Text();
|
|
@@ -347,27 +344,76 @@ public class GetPatentFromExcelThread extends Thread {
|
|
|
}
|
|
|
|
|
|
//装载优先权
|
|
|
- if(uploadParamsVO.getPriorityNo()!=null&&uploadParamsVO.getPriorityNo().size()>0){
|
|
|
- List<String> prDates =uploadParamsVO.getPriorityDate();
|
|
|
- List<Priorities> priorities =new ArrayList<>();
|
|
|
- for(int i=0;i<uploadParamsVO.getPriorityNo().size();i++)
|
|
|
- {
|
|
|
- String prNo =uploadParamsVO.getPriorityNo().get(i);
|
|
|
-
|
|
|
- Priorities prioritie = new Priorities();
|
|
|
- prioritie.setPriorityNo(prNo);
|
|
|
- String pCountry = prNo.substring(0, 2);
|
|
|
- prioritie.setPriorityCountry(pCountry);
|
|
|
- if(prDates!=null&&prDates.size()>i){
|
|
|
- prioritie.setPriorityDate(prDates.get(i));}
|
|
|
- priorities.add(prioritie);
|
|
|
- }
|
|
|
-
|
|
|
- patent.setPriorities(priorities);
|
|
|
-
|
|
|
- }
|
|
|
+ if (uploadParamsVO.getPriorityNo() != null && uploadParamsVO.getPriorityNo().size() > 0) {
|
|
|
+ List<String> prDates = uploadParamsVO.getPriorityDate();
|
|
|
+ List<Priorities> priorities = new ArrayList<>();
|
|
|
+ for (int i = 0; i < uploadParamsVO.getPriorityNo().size(); i++) {
|
|
|
+ String prNo = uploadParamsVO.getPriorityNo().get(i);
|
|
|
+
|
|
|
+ Priorities prioritie = new Priorities();
|
|
|
+ prioritie.setPriorityNo(prNo);
|
|
|
+ String pCountry = prNo.substring(0, 2);
|
|
|
+ prioritie.setPriorityCountry(pCountry);
|
|
|
+ if (prDates != null && prDates.size() > i) {
|
|
|
+ prioritie.setPriorityDate(prDates.get(i));
|
|
|
+ }
|
|
|
+ priorities.add(prioritie);
|
|
|
+ }
|
|
|
+
|
|
|
+ patent.setPriorities(priorities);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ this.loadLegalStatus(patent);
|
|
|
+ this.loadPatentType(patent);
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 装载法律状态
|
|
|
+ */
|
|
|
+ private void loadLegalStatus(Patent patent) {
|
|
|
+ if (patent != null && patent.getSimpleStatus() != null) {
|
|
|
+ String status = patent.getSimpleStatus().trim();
|
|
|
+ if (status != null) {
|
|
|
+
|
|
|
+ switch (status) {
|
|
|
+ case "有效":
|
|
|
+ patent.setSimpleStatus("3");
|
|
|
+ break;
|
|
|
+ case "审中":
|
|
|
+ patent.setSimpleStatus("1");
|
|
|
+ case "失效":
|
|
|
+ patent.setSimpleStatus("2");
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ private void loadPatentType(Patent patent) {
|
|
|
+ String type = patent.getPatentType();
|
|
|
+ if (type != null) {
|
|
|
+ type = type.trim();
|
|
|
+ switch (type) {
|
|
|
+ case "授权发明":
|
|
|
+ case "发明申请":
|
|
|
+ type = "1";
|
|
|
+ break;
|
|
|
+ case "实用新型":
|
|
|
+ type = "2";
|
|
|
+ break;
|
|
|
+ case "外观设计":
|
|
|
+ type = "3";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ type = null;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ patent.setPatentType(type);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|