|
@@ -74,6 +74,8 @@ public class ImportSinglePatentService {
|
|
|
private OPSService opsService;
|
|
|
@Autowired
|
|
|
private PatentNoUtil patentNoUtil;
|
|
|
+ @Autowired
|
|
|
+ private WebVOTransformService webVOTransformService;
|
|
|
|
|
|
public StarPatentVO getPatentFromWeb(String patentNo) {
|
|
|
StarPatentVO starPatentVO = null;
|
|
@@ -109,7 +111,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 +123,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,418 +145,28 @@ 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")) {
|
|
|
- this.loadCNPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent(), starPatentVO);
|
|
|
- //装载专利号
|
|
|
- if (uploadPatentWebDTO.getPatent().getAppNo() != null) {
|
|
|
- uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getAppNo());
|
|
|
- } else if (uploadPatentWebDTO.getPatent().getGrantNo() != null) {
|
|
|
- uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getGrantNo());
|
|
|
- } else if (uploadPatentWebDTO.getPatent().getPublicNo() != null) {
|
|
|
- uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getPublicNo());
|
|
|
- }
|
|
|
+ if (starPatentVO.getAN().startsWith("CN")) {
|
|
|
+ webVOTransformService.loadCNPatent(patentZhuLuStr, uploadPatentWebDTO);
|
|
|
} else {
|
|
|
- this.loadWorldPatent(patentZhuLuStr, uploadPatentWebDTO.getPatent());
|
|
|
- //装载专利号
|
|
|
- if (uploadPatentWebDTO.getPatent().getGrantNo() != null) {
|
|
|
- uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getGrantNo());
|
|
|
- } else if (uploadPatentWebDTO.getPatent().getPublicNo() != null) {
|
|
|
- uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getPublicNo());
|
|
|
- } else if (uploadPatentWebDTO.getPatent().getAppNo() != null) {
|
|
|
- uploadPatentWebDTO.getPatent().setPatentNo(uploadPatentWebDTO.getPatent().getAppNo());
|
|
|
- }
|
|
|
+ webVOTransformService.loadWorldPatent(patentZhuLuStr, uploadPatentWebDTO);
|
|
|
}
|
|
|
}
|
|
|
return uploadPatentWebDTO.getPatent();
|
|
|
}
|
|
|
|
|
|
- //装载专利信息
|
|
|
- private void loadPatent(UploadPatentWebDTO uploadPatentWebDTO) {
|
|
|
-
|
|
|
- String country = "";
|
|
|
- Patent patent = uploadPatentWebDTO.getPatent();
|
|
|
- StarPatentVO starPatentVO = uploadPatentWebDTO.getStarPatentVO();
|
|
|
-
|
|
|
- //装载专利类型
|
|
|
- Integer patentType = starPatentVO.getPatentType();
|
|
|
- if (patentType != null) {
|
|
|
- if (patentType.equals(2) || patentType.equals(9)) {
|
|
|
- patent.setPatentType("1"); //实用新型
|
|
|
- } else if (patentType.equals(1) || patentType.equals(8)) {
|
|
|
- patent.setPatentType("2"); //发明
|
|
|
- } else if (patentType.equals(3)) {
|
|
|
- patent.setPatentType("3"); //外观设计
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //装载申请人地址
|
|
|
- if (starPatentVO.getApplicationAddress() != null && !starPatentVO.getApplicationAddress().equals("")) {
|
|
|
- String applicationAddress = starPatentVO.getApplicationAddress();
|
|
|
- PersonAddress personAddress = AddressSplitter.splitAddress(applicationAddress, starPatentVO.getProvinceStr());
|
|
|
- patent.setApplicantAddr(personAddress);
|
|
|
- }
|
|
|
-
|
|
|
- //装载IPC分类号
|
|
|
- if (starPatentVO.getIpcListStr() != null && !starPatentVO.getIpcListStr().equals("")) {
|
|
|
- List<PatentClassify> patentClassifies = new ArrayList<>();
|
|
|
- List<String> ipcArr = Arrays.asList(starPatentVO.getIpcListStr().split(";"));
|
|
|
- for (int i = 0; i < ipcArr.size(); i++) {
|
|
|
- PatentClassify patentClassify = PatentClassifySplitter.split(ipcArr.get(i));
|
|
|
- patentClassifies.add(patentClassify);
|
|
|
- if (i == 0) {
|
|
|
- patent.setMipc(patentClassify);
|
|
|
- }
|
|
|
- }
|
|
|
- patent.setIpc(patentClassifies);
|
|
|
- }
|
|
|
-
|
|
|
- //装载公告日
|
|
|
- if (starPatentVO.getPublicAccreditDate() != null && !starPatentVO.getPublicAccreditDate().equals("")) {
|
|
|
-//
|
|
|
-// patent.setGrantDate();
|
|
|
- Date date = DateUtils.strToDate(starPatentVO.getPublicAccreditDate());
|
|
|
- patent.setGrantDate(date);
|
|
|
- }
|
|
|
-
|
|
|
- //装载摘要
|
|
|
- if (starPatentVO.getAbstractStr() != null && !starPatentVO.getAbstractStr().equals("")) {
|
|
|
- Text text = new Text();
|
|
|
- text.setLanguage(patent.getAppCountry());
|
|
|
- text.setIfOrigin(true);
|
|
|
- text.setTextContent(starPatentVO.getAbstractStr());
|
|
|
- patent.setAbstractStr(Arrays.asList(text));
|
|
|
- }
|
|
|
-
|
|
|
- //装载申请日
|
|
|
- if (starPatentVO.getApplicationDate() != null && !starPatentVO.getApplicationDate().equals("")) {
|
|
|
- Date date = DateUtils.strToDate(starPatentVO.getApplicationDate());
|
|
|
- patent.setAppDate(date);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- //装载发明人
|
|
|
- if (starPatentVO.getInventorStr() != null && !starPatentVO.getInventorStr().equals("")) {
|
|
|
- List<String> patentInventorNames = Arrays.asList(starPatentVO.getInventorStr().split(";"));
|
|
|
- List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
- for (int i = 0; i < patentInventorNames.size(); i++) {
|
|
|
- PatentPerson patentPerson = new PatentPerson();
|
|
|
- patentPerson.setOrder(i + 1);
|
|
|
- patentPerson.setType("1");
|
|
|
- patentPerson.setName(patentInventorNames.get(i));
|
|
|
- patentPeople.add(patentPerson);
|
|
|
- }
|
|
|
- patent.setInventor(patentPeople);
|
|
|
- }
|
|
|
-
|
|
|
- //装载申请号
|
|
|
- if (starPatentVO.getApplicationNo() != null && !starPatentVO.getApplicationNo().equals("")) {
|
|
|
- patent.setAppNo(starPatentVO.getApplicationNo());
|
|
|
- country = starPatentVO.getApplicationNo().substring(0, 2);
|
|
|
- }
|
|
|
-
|
|
|
- //装载公开号
|
|
|
- if (starPatentVO.getPublicNo() != null && !starPatentVO.getPublicNo().equals("")) {
|
|
|
- patent.setPublicNo(starPatentVO.getPublicNo());
|
|
|
- }
|
|
|
-
|
|
|
- if (starPatentVO.getPublicAccreditNo() != null && !starPatentVO.getPublicAccreditNo().equals("")) {
|
|
|
- patent.setGrantNo(starPatentVO.getPublicAccreditNo());
|
|
|
- }
|
|
|
-
|
|
|
- if (patent.getAppNo().startsWith("CN")) {
|
|
|
- patent.setPatentNo(patent.getAppNo());
|
|
|
- } else {
|
|
|
- if (patent.getPublicNo() != null) {
|
|
|
- patent.setPatentNo(patent.getPublicNo());
|
|
|
- } else if (patent.getGrantNo() != null) {
|
|
|
- patent.setPatentNo(patent.getGrantNo());
|
|
|
- }
|
|
|
- }
|
|
|
- //装载申请人
|
|
|
- if (starPatentVO.getApplicantStr() != null && !starPatentVO.getApplicantStr().equals("")) {
|
|
|
- List<String> names = Arrays.asList(starPatentVO.getApplicantStr().split(";"));
|
|
|
- List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
- for (int i = 0; i < names.size(); i++) {
|
|
|
- PatentPerson patentPerson = new PatentPerson();
|
|
|
- patentPerson.setOrder(i + 1);
|
|
|
- patentPerson.setType("1");
|
|
|
- patentPerson.setName(names.get(i));
|
|
|
- patentPeople.add(patentPerson);
|
|
|
- }
|
|
|
- patent.setApplicant(patentPeople);
|
|
|
- }
|
|
|
-
|
|
|
- //装载代理人
|
|
|
- if (starPatentVO.getAgentStr() != null && !starPatentVO.getAgentStr().equals("")) {
|
|
|
- List<String> patentAgents = Arrays.asList(starPatentVO.getAgentStr().split(";"));
|
|
|
- if (patentAgents != null && patentAgents.size() != 0) {
|
|
|
- patent.setAgent(patentAgents);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (starPatentVO.getAgencyStr() != null && !starPatentVO.getAgencyStr().equals("")) {
|
|
|
- patent.setAgency(starPatentVO.getAgencyStr());
|
|
|
-
|
|
|
- }
|
|
|
- //装载公开日
|
|
|
- if (starPatentVO.getPublicDate() != null && !starPatentVO.getPublicDate().equals("")) {
|
|
|
- Date date = DateUtils.strToDate(starPatentVO.getPublicDate());
|
|
|
- patent.setPublicDate(date);
|
|
|
- }
|
|
|
-
|
|
|
- //装载标题
|
|
|
- if (starPatentVO.getName() != null && !starPatentVO.getName().equals("")) {
|
|
|
- Text text = new Text();
|
|
|
- text.setLanguage(country);
|
|
|
- text.setIfOrigin(true);
|
|
|
- text.setTextContent(starPatentVO.getName());
|
|
|
- patent.setTitle(Arrays.asList(text));
|
|
|
- }
|
|
|
-
|
|
|
- //装载权利人
|
|
|
- if (starPatentVO.getCurrentApplicantStr() != null && !starPatentVO.getCurrentApplicantStr().equals("")) {
|
|
|
- List<String> names = Arrays.asList(starPatentVO.getCurrentApplicantStr().split(";"));
|
|
|
- List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
- for (int i = 0; i < names.size(); i++) {
|
|
|
- PatentPerson patentPerson = new PatentPerson();
|
|
|
- patentPerson.setOrder(0);
|
|
|
- patentPerson.setType("1");
|
|
|
- patentPerson.setName(names.get(i));
|
|
|
- patentPeople.add(patentPerson);
|
|
|
- }
|
|
|
- patent.setRightHolder(patentPeople);
|
|
|
- } else if (patent.getApplicant() != null) {
|
|
|
- patent.setRightHolder(patent.getApplicant());
|
|
|
- }
|
|
|
-
|
|
|
- //装载法律状态(os_patent表status字段值)
|
|
|
- Integer status = starPatentVO.getLG();
|
|
|
- if (status != null) {
|
|
|
- //有效(有权)
|
|
|
- if (status == 1) {
|
|
|
- patent.setSimpleStatus("3");
|
|
|
- //失效(无权)
|
|
|
- } else if (status == 2) {
|
|
|
- patent.setSimpleStatus("2");
|
|
|
- //审中(审中)
|
|
|
- } else if (status == 3) {
|
|
|
- patent.setSimpleStatus("1");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //装载优先权
|
|
|
- if (starPatentVO.getPriorityNo() != null && !starPatentVO.getPriorityNo().equals("")) {
|
|
|
- Priorities priorities = new Priorities();
|
|
|
- priorities.setPriorityNo(starPatentVO.getPriorityNo());
|
|
|
- String pCountry = starPatentVO.getApplicationNo().substring(0, 2);
|
|
|
- priorities.setPriorityCountry(pCountry);
|
|
|
- //装载优先权日
|
|
|
- if (starPatentVO.getPriorityDate() != null && !starPatentVO.getPriorityDate().equals("")) {
|
|
|
- DateUtils.str2Date(starPatentVO.getPriorityDate());
|
|
|
- }
|
|
|
- patent.setPriorities(Arrays.asList(priorities));
|
|
|
- }
|
|
|
-
|
|
|
- //装载受理局
|
|
|
- if (starPatentVO.getBureau() != null && !starPatentVO.getBureau().equals("")) {
|
|
|
- patent.setAppCountry(starPatentVO.getBureau());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //装载中国专利
|
|
|
- private void loadCNPatent(String chinaPatentZhuLuStr, Patent patent, StarPatentVO starPatentVO) {
|
|
|
- patent.setPatentNo(patent.getAppNo());
|
|
|
- if (chinaPatentZhuLuStr != null && !chinaPatentZhuLuStr.trim().equals("") && !chinaPatentZhuLuStr.equals("{}") && !chinaPatentZhuLuStr.contains("请求不合法")) {
|
|
|
- List<ChinaPatentZhuLu> chinaPatentZhuLus = JSON.parseArray(chinaPatentZhuLuStr, ChinaPatentZhuLu.class);
|
|
|
- ChinaPatentZhuLu chinaPatentZhuLu = chinaPatentZhuLus.get(0);
|
|
|
- //装载申请人地址
|
|
|
- if (patent.getApplicantAddr() == null) {
|
|
|
- if (chinaPatentZhuLu.getDZ() != null && !chinaPatentZhuLu.getDZ().equals("")) {
|
|
|
- PersonAddress personAddress = AddressSplitter.splitAddress(chinaPatentZhuLu.getDZ(), starPatentVO.getProvinceStr());
|
|
|
- patent.setApplicantAddr(personAddress);
|
|
|
- patent.setApplicantAddr(personAddress);
|
|
|
- }
|
|
|
- }
|
|
|
- //装载代理人
|
|
|
- if (patent.getAgent() == null || patent.getAgent().size() == 0) {
|
|
|
- if (chinaPatentZhuLu.getAT() != null && !chinaPatentZhuLu.getAT().equals("")) {
|
|
|
- List<String> patentAgents = Arrays.asList(chinaPatentZhuLu.getAT().split(";"));
|
|
|
- if (patentAgents != null && patentAgents.size() != 0) {
|
|
|
- patent.setAgent(patentAgents);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //装载发明人
|
|
|
- if (patent.getInventor() == null || patent.getInventor().size() == 0) {
|
|
|
-
|
|
|
- if (chinaPatentZhuLu.getIV() != null && !chinaPatentZhuLu.getIV().equals("")) {
|
|
|
- List<String> patentInventorNames = Arrays.asList(chinaPatentZhuLu.getIV().split(";"));
|
|
|
- List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
- for (int i = 0; i < patentInventorNames.size(); i++) {
|
|
|
- PatentPerson patentPerson = new PatentPerson();
|
|
|
- patentPerson.setOrder(0);
|
|
|
- patentPerson.setType("1");
|
|
|
- patentPerson.setName(patentInventorNames.get(i));
|
|
|
- patentPeople.add(patentPerson);
|
|
|
- }
|
|
|
- patent.setInventor(patentPeople);
|
|
|
- }
|
|
|
- }
|
|
|
- //装载优先权号、优先权国家、优先权日
|
|
|
- if (patent.getPriorities() == null && chinaPatentZhuLu.getPR() != null && chinaPatentZhuLu.getPR() != "") {
|
|
|
- Priorities priorities = new Priorities();
|
|
|
- priorities.setPriorityNo(chinaPatentZhuLu.getPR());
|
|
|
- String pCountry = chinaPatentZhuLu.getPR().substring(0, 2);
|
|
|
- priorities.setPriorityCountry(pCountry);
|
|
|
- patent.setPriorities(Arrays.asList(priorities));
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 装载世界专利著录
|
|
|
- *
|
|
|
- * @param worldPatentZhuLuStr
|
|
|
- * @param patent
|
|
|
- */
|
|
|
- private void loadWorldPatent(String worldPatentZhuLuStr, Patent patent) {
|
|
|
- String country = "";
|
|
|
- List<WorldPatentZhuLu> worldPatentZhuLus = JSON.parseArray(worldPatentZhuLuStr, WorldPatentZhuLu.class);
|
|
|
- WorldPatentZhuLu worldPatentZhuLu = worldPatentZhuLus.get(0);
|
|
|
-
|
|
|
- //装载公开号
|
|
|
- if (patent.getPublicNo() == null || patent.getPublicNo().equals("")) {
|
|
|
- patent.setPublicNo(worldPatentZhuLu.getDocdbPubNo());
|
|
|
- }
|
|
|
- //装载申请号
|
|
|
- if (patent.getAppNo() == null || patent.getAppNo().equals("")) {
|
|
|
- patent.setAppNo(worldPatentZhuLu.getEpoAppNo());
|
|
|
- }
|
|
|
- //装载申请日
|
|
|
- if (patent.getAppDate() == null) {
|
|
|
- if (worldPatentZhuLu.getAppDate() != null && !worldPatentZhuLu.getAppDate().equals("")) {
|
|
|
- Date date = DateUtils.strToDate(worldPatentZhuLu.getAppDate());
|
|
|
- patent.setAppDate(date);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- //装载公开日
|
|
|
- if (patent.getPublicDate() == null) {
|
|
|
- if (worldPatentZhuLu.getPubDate() != null && !worldPatentZhuLu.getPubDate().equals("")) {
|
|
|
- Date date = DateUtils.strToDate(worldPatentZhuLu.getPubDate());
|
|
|
- patent.setPublicDate(date);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- //装载IPC分类号
|
|
|
- if (patent.getIpc() == null || patent.getIpc().size() == 0) {
|
|
|
- List<PatentClassify> patentClassifies = new ArrayList<>();
|
|
|
- List<String> ipcArr = Arrays.asList(worldPatentZhuLu.getIpc().split(";"));
|
|
|
- for (int i = 0; i < ipcArr.size(); i++) {
|
|
|
- PatentClassify patentClassify = PatentClassifySplitter.split(ipcArr.get(i));
|
|
|
- patentClassifies.add(patentClassify);
|
|
|
- if (i == 0) {
|
|
|
- patent.setMipc(patentClassify);
|
|
|
- }
|
|
|
- }
|
|
|
- patent.setIpc(patentClassifies);
|
|
|
- }
|
|
|
-
|
|
|
- //装载CPC分类号
|
|
|
- if (patent.getCpc() == null || patent.getCpc().size() == 0) {
|
|
|
- if (worldPatentZhuLu.getCpc() != null && !worldPatentZhuLu.getCpc().equals("")) {
|
|
|
- List<PatentClassify> patentClassifies = new ArrayList<>();
|
|
|
- List<String> cpcArr = Arrays.asList(worldPatentZhuLu.getCpc().split(";"));
|
|
|
- for (int i = 0; i < cpcArr.size(); i++) {
|
|
|
- PatentClassify patentClassify = PatentClassifySplitter.split(cpcArr.get(i));
|
|
|
- patentClassifies.add(patentClassify);
|
|
|
- if (i == 0) {
|
|
|
- patent.setMipc(patentClassify);
|
|
|
- }
|
|
|
- }
|
|
|
- patent.setCpc(patentClassifies);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //装载申请人
|
|
|
- if (patent.getApplicant() == null || patent.getApplicant().size() == 0) {
|
|
|
- List<String> names = Arrays.asList(worldPatentZhuLu.getPa().split(";"));
|
|
|
- List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
- for (int i = 0; i < names.size(); i++) {
|
|
|
- PatentPerson patentPerson = new PatentPerson();
|
|
|
- patentPerson.setOrder(0);
|
|
|
- patentPerson.setType("1");
|
|
|
- patentPerson.setName(names.get(i));
|
|
|
- patentPeople.add(patentPerson);
|
|
|
- }
|
|
|
- patent.setApplicant(patentPeople);
|
|
|
- if (patent.getRightHolder() == null || patent.getRightHolder().size() == 0) {
|
|
|
- patent.setRightHolder(patent.getApplicant());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- //装载发明人
|
|
|
- if (patent.getInventor() == null || patent.getInventor().size() == 0) {
|
|
|
- if (worldPatentZhuLu.getIv() != null && !worldPatentZhuLu.getIv().equals("")) {
|
|
|
- List<String> patentInventorNames = Arrays.asList(worldPatentZhuLu.getIv().split(";"));
|
|
|
- List<PatentPerson> patentPeople = new ArrayList<>();
|
|
|
- for (int i = 0; i < patentInventorNames.size(); i++) {
|
|
|
- PatentPerson patentPerson = new PatentPerson();
|
|
|
- patentPerson.setOrder(0);
|
|
|
- patentPerson.setType("1");
|
|
|
- patentPerson.setName(patentInventorNames.get(i));
|
|
|
- patentPeople.add(patentPerson);
|
|
|
- }
|
|
|
- patent.setInventor(patentPeople);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //装载优先权号、优先权国家、优先权日
|
|
|
- if (patent.getPriorities() == null && worldPatentZhuLu.getPr() != null && worldPatentZhuLu.getPr() != "") {
|
|
|
- Priorities priorities = new Priorities();
|
|
|
- priorities.setPriorityNo(worldPatentZhuLu.getPr());
|
|
|
- String pCountry = worldPatentZhuLu.getPr().substring(0, 2);
|
|
|
- priorities.setPriorityCountry(pCountry);
|
|
|
- patent.setPriorities(Arrays.asList(priorities));
|
|
|
- }
|
|
|
-
|
|
|
- //装载标题
|
|
|
- if (patent.getTitle() == null || patent.getTitle().size() != 0) {
|
|
|
- Text text = new Text();
|
|
|
- text.setLanguage(country);
|
|
|
- text.setIfOrigin(true);
|
|
|
- text.setTextContent(worldPatentZhuLu.getTitle());
|
|
|
- patent.setTitle(Arrays.asList(text));
|
|
|
- }
|
|
|
- //装载摘要
|
|
|
- if (patent.getAbstractStr() == null || patent.getAbstractStr().equals("")) {
|
|
|
- Text text = new Text();
|
|
|
- text.setLanguage(patent.getAppCountry());
|
|
|
- text.setIfOrigin(true);
|
|
|
- text.setTextContent(worldPatentZhuLu.getAbstract());
|
|
|
- patent.setAbstractStr(Arrays.asList(text));
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
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 +195,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 +272,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 +297,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 +318,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 +333,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("")) {
|
|
@@ -734,12 +345,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);
|
|
|
}
|
|
|
|
|
@@ -786,7 +395,6 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
//添加法律事务
|
|
|
if (contents.contains(6)) {
|
|
|
- esService.addEsLegalEvent(starPatentVO);
|
|
|
}
|
|
|
|
|
|
//装载权利要求
|