|
@@ -6,6 +6,7 @@ import cn.cslg.pas.common.dto.business.CustomOptionDTO;
|
|
|
import cn.cslg.pas.common.dto.business.EsPatentFamilyDTO;
|
|
|
import cn.cslg.pas.common.dto.business.TreeNodeDTO;
|
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
|
|
|
+import cn.cslg.pas.common.model.importTaskModel.PatentInventor;
|
|
|
import cn.cslg.pas.common.utils.DateUtils;
|
|
|
import cn.cslg.pas.common.utils.FileUtils;
|
|
|
import cn.cslg.pas.common.utils.FormatUtil;
|
|
@@ -187,6 +188,7 @@ public class ImportFromFileToEsService {
|
|
|
} else if (grantNo != null) {
|
|
|
usedNo = grantNo;
|
|
|
}
|
|
|
+
|
|
|
String contry = usedNo.substring(0, 2);
|
|
|
if (contry.equals("CN")) {
|
|
|
patent.setPatentNo(appNo);
|
|
@@ -222,22 +224,24 @@ public class ImportFromFileToEsService {
|
|
|
|
|
|
//装载说明书
|
|
|
List<Text> textInstructions = new ArrayList<>();
|
|
|
- if (oldPatentDTO.getManual() != null) {
|
|
|
- Text text = new Text();
|
|
|
- text.setTextContent(oldPatentDTO.getManual());
|
|
|
- text.setIfOrigin(true);
|
|
|
- text.setLanguage(contry);
|
|
|
- texts.add(text);
|
|
|
- }
|
|
|
- if (oldPatentDTO.getManualOut() != null) {
|
|
|
- Text text = new Text();
|
|
|
- text.setTextContent(oldPatentDTO.getManualOut());
|
|
|
- text.setIfOrigin(false);
|
|
|
- text.setLanguage("CN");
|
|
|
- texts.add(text);
|
|
|
- }
|
|
|
- if (textInstructions.size() != 0) {
|
|
|
- patent.setPublicFullText(textInstructions);
|
|
|
+ if(oldPatentDTO.getInstruction()!=null) {
|
|
|
+ if (oldPatentDTO.getInstruction().getManual() != null) {
|
|
|
+ Text text = new Text();
|
|
|
+ text.setTextContent(oldPatentDTO.getInstruction().getManual());
|
|
|
+ text.setIfOrigin(true);
|
|
|
+ text.setLanguage(contry);
|
|
|
+ textInstructions.add(text);
|
|
|
+ }
|
|
|
+ if (oldPatentDTO.getInstruction().getManualOut() != null) {
|
|
|
+ Text text = new Text();
|
|
|
+ text.setTextContent(oldPatentDTO.getInstruction().getManualOut());
|
|
|
+ text.setIfOrigin(false);
|
|
|
+ text.setLanguage("CN");
|
|
|
+ textInstructions.add(text);
|
|
|
+ }
|
|
|
+ if (textInstructions.size() != 0) {
|
|
|
+ patent.setPublicFullText(textInstructions);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -248,7 +252,8 @@ public class ImportFromFileToEsService {
|
|
|
text.setTextContent(oldPatentDTO.getAbstractStr());
|
|
|
text.setIfOrigin(true);
|
|
|
text.setLanguage(contry);
|
|
|
- texts.add(text);
|
|
|
+
|
|
|
+ textsAbstractStr.add(text);
|
|
|
}
|
|
|
if (oldPatentDTO.getAbstractOut() != null) {
|
|
|
Text text = new Text();
|
|
@@ -256,6 +261,7 @@ public class ImportFromFileToEsService {
|
|
|
text.setIfOrigin(false);
|
|
|
text.setLanguage("CN");
|
|
|
texts.add(text);
|
|
|
+ textsAbstractStr.add(text);
|
|
|
}
|
|
|
if (textsAbstractStr.size() != 0) {
|
|
|
patent.setAbstractStr(textsAbstractStr);
|
|
@@ -310,6 +316,19 @@ public class ImportFromFileToEsService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //发明人
|
|
|
+ List<OldPatentInventor> patentInventorList = oldPatentDTO.getInventor();
|
|
|
+ if (patentInventorList != null && patentInventorList.size() > 0) {
|
|
|
+ List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
+ for (int i = 0; i < patentInventorList.size(); i++) {
|
|
|
+ PatentPerson patentPerson = new PatentPerson();
|
|
|
+ patentPerson.setOrder(i + 1);
|
|
|
+ patentPerson.setType("1");
|
|
|
+ patentPerson.setName(patentInventorList.get(i).getName());
|
|
|
+ patentPeople.add(patentPerson);
|
|
|
+ }
|
|
|
+ patent.setInventor(patentPeople);
|
|
|
+ }
|
|
|
//装载审查员
|
|
|
patent.setExaminer(oldPatentDTO.getExaminer());
|
|
|
|
|
@@ -425,10 +444,47 @@ public class ImportFromFileToEsService {
|
|
|
}
|
|
|
|
|
|
//简单法律状态
|
|
|
- patent.setSimpleStatus(oldPatentDTO.getSimpleStatus());
|
|
|
- //专利类型
|
|
|
- patent.setPatentType(oldPatentDTO.getType());
|
|
|
+ if(oldPatentDTO.getSimpleStatus()!=null) {
|
|
|
+ switch (oldPatentDTO.getSimpleStatus()) {
|
|
|
+ case "有效":
|
|
|
+ patent.setSimpleStatus("1");
|
|
|
+ break;
|
|
|
+ case "审中":
|
|
|
+ patent.setSimpleStatus("3");
|
|
|
+ break;
|
|
|
+ case "失效":
|
|
|
+ patent.setSimpleStatus("2");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ patent.setSimpleStatus("1");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(oldPatentDTO.getType()!=null){
|
|
|
+
|
|
|
|
|
|
+ }
|
|
|
+ //专利类型
|
|
|
+ String type = oldPatentDTO.getType();
|
|
|
+ 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);
|
|
|
+ }
|
|
|
//装载权利要求
|
|
|
if (oldPatentDTO.getRights() != null && oldPatentDTO.getRights().size() > 0) {
|
|
|
List<Text> rightTexts = new ArrayList<>();
|
|
@@ -575,19 +631,26 @@ public class ImportFromFileToEsService {
|
|
|
|
|
|
public void savePatentPicture(File file, Patent patent) throws Exception {
|
|
|
File imageDiretory = FileUtils.getFileByName(file, Constants.PATENT_IMAGE);
|
|
|
+ if(imageDiretory==null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
File[] imageFiles = imageDiretory.listFiles();
|
|
|
- for (int i = 0; i < imageFiles.length; i++) {
|
|
|
- File ImageFile =imageFiles[i];
|
|
|
+ if(imageFiles.length>0){
|
|
|
+ File ImageFile =imageFiles[0];
|
|
|
String guid = FormatUtil.getPictureFormat(patent.getAppNo());
|
|
|
- String guid1 = guid+i;
|
|
|
- fileManagerService.uploadFileWithGuid(ImageFile, guid1);
|
|
|
+ fileManagerService.uploadFileWithGuid(ImageFile, guid);
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
public void savePatentPDF(File file, Patent patent) throws Exception {
|
|
|
- File pdfDiretory = FileUtils.getFileByName(file, Constants.PATENT_IMAGE);
|
|
|
+ File pdfDiretory = FileUtils.getFileByName(file, Constants.PATENT_PDF);
|
|
|
+ if(pdfDiretory==null||!pdfDiretory.exists()){
|
|
|
+
|
|
|
+ System.out.println(patent.getPatentNo());
|
|
|
+ return;
|
|
|
+ }
|
|
|
File[] pdfFiles = pdfDiretory.listFiles();
|
|
|
for (int i = 0; i < pdfFiles.length; i++) {
|
|
|
File pdfFile = pdfFiles[i];
|
|
@@ -597,8 +660,8 @@ public class ImportFromFileToEsService {
|
|
|
if (names[1].contains("2")) {
|
|
|
type = 1;
|
|
|
}
|
|
|
- String guid1 = FormatUtil.getPDFFormat(patent.getAppNo(), type);
|
|
|
- fileManagerService.uploadFileWithGuid(pdfFile, guid1);
|
|
|
+ String guid1 = FormatUtil.getPDFFormat(patent.getPatentNo(), type);
|
|
|
+ fileManagerService.uploadFileWithGuid(pdfFile,guid1);
|
|
|
}
|
|
|
}
|
|
|
|