|
@@ -0,0 +1,473 @@
|
|
|
+package cn.cslg.pas.service.importPatent;
|
|
|
+
|
|
|
+import cn.cslg.pas.common.dto.PatentStarListDTO;
|
|
|
+import cn.cslg.pas.common.dto.UploadPatentWebDTO;
|
|
|
+import cn.cslg.pas.common.utils.DateUtils;
|
|
|
+import cn.cslg.pas.common.utils.esDataForm.AddressSplitter;
|
|
|
+import cn.cslg.pas.common.utils.esDataForm.PatentClassifySplitter;
|
|
|
+import cn.cslg.pas.common.vo.ChinaPatentZhuLu;
|
|
|
+import cn.cslg.pas.common.vo.PatentWithIdVO;
|
|
|
+import cn.cslg.pas.common.vo.StarPatentVO;
|
|
|
+import cn.cslg.pas.common.vo.WorldPatentZhuLu;
|
|
|
+import cn.cslg.pas.domain.es.*;
|
|
|
+import cn.cslg.pas.service.business.es.EsService;
|
|
|
+import cn.cslg.pas.service.common.PatentStarApiService;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import lombok.experimental.Accessors;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+@Service
|
|
|
+@RequiredArgsConstructor
|
|
|
+public class ImportSinglePatentService {
|
|
|
+ @Autowired
|
|
|
+ private PatentStarApiService patentStarApiService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private EsService esService;
|
|
|
+
|
|
|
+ public StarPatentVO getPatentFromWeb(String patentNo) {
|
|
|
+ StarPatentVO starPatentVO = null;
|
|
|
+ String dbType = "";
|
|
|
+ if (patentNo.startsWith("CN")) {
|
|
|
+ dbType = "CN";
|
|
|
+ } else {
|
|
|
+ dbType = "WD";
|
|
|
+ }
|
|
|
+ //根据专利号查询
|
|
|
+ String conditions = "AN=(" + patentNo + ") OR PN=(" + patentNo + ") OR GN=(" + patentNo + ")";
|
|
|
+ PatentStarListDTO patentStarListDTO1 = new PatentStarListDTO();
|
|
|
+ patentStarListDTO1.setCurrentQuery(conditions);
|
|
|
+ patentStarListDTO1.setPageNum(1);
|
|
|
+ patentStarListDTO1.setDBType(dbType);
|
|
|
+ patentStarListDTO1.setCurrentQuery(conditions);
|
|
|
+ patentStarListDTO1.setRowCount(50);
|
|
|
+ try {
|
|
|
+ Map<String, Object> resultMap = patentStarApiService.patentStarSearchApi(patentStarListDTO1);
|
|
|
+ if (resultMap == null || (Integer) resultMap.get("total") == 0) {
|
|
|
+
|
|
|
+ }
|
|
|
+ List<StarPatentVO> starPatents = (List<StarPatentVO>) resultMap.get("records");
|
|
|
+ if (starPatents != null && starPatents.size() != 0) {
|
|
|
+ starPatentVO = starPatents.get(0);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ return starPatentVO;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public Patent addSinglePatent(String patentNo) {
|
|
|
+ StarPatentVO starPatentVO = new StarPatentVO();
|
|
|
+ starPatentVO = this.getPatentFromWeb(patentNo);
|
|
|
+ if (starPatentVO == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ Patent patent = this.getPatentCataloguingFromWeb(starPatentVO);
|
|
|
+ PatentJoin patentJoin = new PatentJoin();
|
|
|
+ patentJoin.setName("patent");
|
|
|
+ patent.setPatentJoin(patentJoin);
|
|
|
+ try {
|
|
|
+ PatentWithIdVO patentWithIdVO = esService.getIdByPatentNo(patent.getPatentNo());
|
|
|
+ if (patentWithIdVO != null) {
|
|
|
+ return patentWithIdVO.getPatent();
|
|
|
+ }
|
|
|
+ String patentId = esService.addPatent(patent);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return patent;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Patent getPatentCataloguingFromWeb(StarPatentVO starPatentVO) {
|
|
|
+ String patentZhuLuStr = "";
|
|
|
+ if (starPatentVO.getApplicationNo().startsWith("CN")) {
|
|
|
+ patentZhuLuStr = patentStarApiService.getCnBibApi(starPatentVO.getRowApplicationNo());
|
|
|
+ } else {
|
|
|
+ patentZhuLuStr = patentStarApiService.getENBibApi(starPatentVO.getRowApplicationNo());
|
|
|
+ }
|
|
|
+ UploadPatentWebDTO uploadPatentWebDTO = new UploadPatentWebDTO();
|
|
|
+ uploadPatentWebDTO.setPatent(new Patent());
|
|
|
+ uploadPatentWebDTO.setStarPatentVO(starPatentVO);
|
|
|
+ if (patentZhuLuStr != null && !patentZhuLuStr.trim().equals("") && !patentZhuLuStr.equals("{}") && !patentZhuLuStr.contains("请求不合法")) {
|
|
|
+ this.loadPatent(uploadPatentWebDTO);
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+ } 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());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ 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 (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);
|
|
|
+ }
|
|
|
+
|
|
|
+ //装载法律状态(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));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 装载世界专利
|
|
|
+ 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) {
|
|
|
+ Date date = DateUtils.strToDate(worldPatentZhuLu.getAppDate());
|
|
|
+ patent.setAppDate(date);
|
|
|
+ }
|
|
|
+ //装载公开日
|
|
|
+ if (patent.getPublicDate() == null) {
|
|
|
+ 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.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));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|