|
|
@@ -58,6 +58,7 @@ public class ImportSinglePatentService {
|
|
|
private CacheUtils cacheUtils;
|
|
|
@Autowired
|
|
|
private LoginUtils loginUtils;
|
|
|
+
|
|
|
public StarPatentVO getPatentFromWeb(String patentNo) {
|
|
|
StarPatentVO starPatentVO = null;
|
|
|
String dbType = "";
|
|
|
@@ -576,6 +577,11 @@ public class ImportSinglePatentService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void loadFullText(UploadPatentWebDTO uploadPatentWebDTO, String cnFullXmlStr) {
|
|
|
+ Patent patent = uploadPatentWebDTO.getPatent();
|
|
|
+ this.loadFullText(patent, cnFullXmlStr);
|
|
|
+ }
|
|
|
+
|
|
|
//装载说明书文档
|
|
|
private void loadFullText(Patent patent, String cnFullXmlStr) {
|
|
|
try {
|
|
|
@@ -598,18 +604,16 @@ public class ImportSinglePatentService {
|
|
|
Integer count = 1;
|
|
|
for (Element item : elements) {
|
|
|
String fullText = item.getText().replaceAll("<br/>", "");
|
|
|
- if (!fullText.trim().equals("技术领域")
|
|
|
- && !fullText.trim().equals("发明内容")
|
|
|
- && !fullText.trim().equals("附图说明")
|
|
|
- && !fullText.trim().equals("具体实施方式")
|
|
|
- && !fullText.trim().equals("背景技术")
|
|
|
- && !fullText.trim().equals("实用新型内容")) {
|
|
|
+ List<String> ts = this.getTitleStrs();
|
|
|
+ if (!ts.contains(fullText.trim())) {
|
|
|
String formattedNum = String.format("%04d", count);
|
|
|
fullText = "[" + formattedNum + "]" + fullText;
|
|
|
count++;
|
|
|
}
|
|
|
fullText = fullText.replaceAll("\r\n|\r|\n| ", "");
|
|
|
- fullTexts.add(fullText);
|
|
|
+ if (!fullText.trim().equals("")) {
|
|
|
+ fullTexts.add(fullText);
|
|
|
+ }
|
|
|
}
|
|
|
String fullText = "";
|
|
|
if (fullTexts.size() != 0) {
|
|
|
@@ -688,8 +692,7 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
//根据专利号调用"获得世界专利pdf"接口,获得pdf的url地址
|
|
|
}
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
pdfUrl = patentStarApiService.getEnPdfApi(usedPatentNo);
|
|
|
//若没有取到说明书pdf,则将当前申请号和备注信息存入问题记录表,并返回空对象
|
|
|
// if (pdfUrl.equals("") || pdfUrl.equals("{}")) {
|
|
|
@@ -744,8 +747,7 @@ public class ImportSinglePatentService {
|
|
|
Patent patent = new Patent();
|
|
|
//装载基本信息
|
|
|
|
|
|
- patent = this.getPatentCataloguingFromWeb(starPatentVO);
|
|
|
-
|
|
|
+ patent = this.getPatentCataloguingFromWeb(starPatentVO);
|
|
|
|
|
|
|
|
|
//装载图片
|
|
|
@@ -765,7 +767,7 @@ public class ImportSinglePatentService {
|
|
|
if (contents.contains(2) || contents.contains(3)) {
|
|
|
this.getFullXmlStr(patent, starPatentVO, contents);
|
|
|
if (contents.contains(3) && projectId != null) {
|
|
|
- this.updateReportRight(patent,projectId,patentNo);
|
|
|
+ this.updateReportRight(patent, projectId, patentNo);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -777,8 +779,8 @@ public class ImportSinglePatentService {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private void updateReportRight(Patent patent, Integer projectId,String patentNo) {
|
|
|
- PersonnelVO personnelVO =cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
+ private void updateReportRight(Patent patent, Integer projectId, String patentNo) {
|
|
|
+ PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
//根据projectId 查询报告
|
|
|
LambdaQueryWrapper<ReportProject> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
queryWrapper.eq(ReportProject::getProjectId, projectId);
|
|
|
@@ -795,7 +797,7 @@ public class ImportSinglePatentService {
|
|
|
queryWrapper1.eq(PatentClaim::getProjectId, projectId);
|
|
|
queryWrapper1.isNotNull(PatentClaim::getSysOrder);
|
|
|
List<PatentClaim> patentClaims = patentClaimService.list(queryWrapper1);
|
|
|
- List<Integer> ids =patentClaims.stream().map(PatentClaim::getId).collect(Collectors.toList());
|
|
|
+ List<Integer> ids = patentClaims.stream().map(PatentClaim::getId).collect(Collectors.toList());
|
|
|
|
|
|
List<Text> claims = patent.getClaim();
|
|
|
if (claims == null || claims.size() == 0) {
|
|
|
@@ -814,11 +816,11 @@ public class ImportSinglePatentService {
|
|
|
if (rePatentClaims == null || rePatentClaims.size() == 0) {
|
|
|
return;
|
|
|
}
|
|
|
- List<PatentClaim> patentClaims1 = new ArrayList<>();
|
|
|
- rePatentClaims.forEach(item->{
|
|
|
- PatentClaim patentClaim =patentClaims.stream().filter(i->i.getSysOrder().equals(item.getSort())).findFirst().orElse(null);
|
|
|
- if(patentClaim==null){
|
|
|
- PatentClaim patentClaim1 =new PatentClaim();
|
|
|
+ List<PatentClaim> patentClaims1 = new ArrayList<>();
|
|
|
+ rePatentClaims.forEach(item -> {
|
|
|
+ PatentClaim patentClaim = patentClaims.stream().filter(i -> i.getSysOrder().equals(item.getSort())).findFirst().orElse(null);
|
|
|
+ if (patentClaim == null) {
|
|
|
+ PatentClaim patentClaim1 = new PatentClaim();
|
|
|
patentClaim1.setProjectId(projectId);
|
|
|
patentClaim1.setContentType(0);
|
|
|
patentClaim1.setClaimType(item.getType());
|
|
|
@@ -827,8 +829,7 @@ public class ImportSinglePatentService {
|
|
|
patentClaim1.setSysOrder(item.getSort());
|
|
|
patentClaim1.setCreateId(personnelVO.getId());
|
|
|
patentClaims1.add(patentClaim1);
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
patentClaim.setClaimType(item.getType());
|
|
|
patentClaim.setContent(item.getContent());
|
|
|
patentClaim.setParentOrder(item.getParentSort());
|
|
|
@@ -837,10 +838,26 @@ public class ImportSinglePatentService {
|
|
|
}
|
|
|
});
|
|
|
patentClaimService.saveOrUpdateBatch(patentClaims1);
|
|
|
- if(ids!=null&&ids.size()>0){
|
|
|
+ if (ids != null && ids.size() > 0) {
|
|
|
patentClaimService.removeBatchByIds(ids);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
+ private List<String> getTitleStrs() {
|
|
|
+ String t1 = "技术领域";
|
|
|
+ String t2 = "发明内容";
|
|
|
+ String t3 = "附图说明";
|
|
|
+ String t4 = "具体实施方式";
|
|
|
+ String t5 = "背景技术";
|
|
|
+ String t6 = "实用新型内容";
|
|
|
+ String t7 = "【技术领域】";
|
|
|
+ String t8 = "【背景技术】";
|
|
|
+ String t9 = "【发明内容】";
|
|
|
+ String t10 = "【附图说明】";
|
|
|
+ String t11 = "【具体实施方式】";
|
|
|
+ List<String> ts = Arrays.asList(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11);
|
|
|
+ return ts;
|
|
|
+
|
|
|
+ }
|
|
|
}
|