|
@@ -33,6 +33,8 @@ import org.springframework.stereotype.Service;
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.IOException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
|
|
|
@Slf4j
|
|
@@ -103,9 +105,9 @@ public class ReportExportService {
|
|
|
} else if (report.getReportType() == 3) {
|
|
|
template = this.FTOTemplate(projectId, templateFilePath, templeId);
|
|
|
} else if (report.getReportType() == 4) {
|
|
|
- template = this.Torttemplate(projectId, templateFilePath);
|
|
|
+ template = this.Torttemplate(projectId, templateFilePath);
|
|
|
} else if (report.getReportType() == 5) {
|
|
|
- template = this.avoidDesignTemplate(projectId, templateFilePath);
|
|
|
+ template = this.avoidDesignTemplate(projectId, templateFilePath);
|
|
|
} else if (report.getReportType() == 1) {
|
|
|
// template = this.getThirdTemplate(report, filePath);
|
|
|
}
|
|
@@ -142,9 +144,9 @@ public class ReportExportService {
|
|
|
|
|
|
private XWPFTemplate Torttemplate(Integer reportId, String filePath) throws IOException {
|
|
|
//根据报告Id查询标的专利号
|
|
|
- LambdaQueryWrapper<ReportProject> projectLambdaQueryWrapper =new LambdaQueryWrapper<>();
|
|
|
- projectLambdaQueryWrapper.eq(ReportProject::getProjectId,reportId);
|
|
|
- ReportProject report = reportProjectService.getOne(projectLambdaQueryWrapper,false);
|
|
|
+ LambdaQueryWrapper<ReportProject> projectLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ projectLambdaQueryWrapper.eq(ReportProject::getProjectId, reportId);
|
|
|
+ ReportProject report = reportProjectService.getOne(projectLambdaQueryWrapper, false);
|
|
|
String patentNo = report.getSignPatentNo();
|
|
|
// PatentVO patentVO = new PatentVO();
|
|
|
// patentVO.setPatentNos(Arrays.asList(patentNo));
|
|
@@ -219,7 +221,7 @@ public class ReportExportService {
|
|
|
return template;
|
|
|
}
|
|
|
|
|
|
- private XWPFTemplate avoidDesignTemplate(Integer projectId,String path) throws IOException {
|
|
|
+ private XWPFTemplate avoidDesignTemplate(Integer projectId, String path) throws IOException {
|
|
|
String filePath = fileUtils.getPath(path);
|
|
|
|
|
|
log.info("开始处理导出规避设计报告,参数为:{}, {}", projectId, filePath);
|
|
@@ -268,11 +270,11 @@ public class ReportExportService {
|
|
|
PictureRenderData pictureRenderData = null;
|
|
|
byte[] bytes = null;
|
|
|
|
|
|
- try {
|
|
|
- bytes = fileManagerService.downloadSystemFileFromFMS(guid);
|
|
|
- } catch (Exception e) {
|
|
|
+ try {
|
|
|
+ bytes = fileManagerService.downloadSystemFileFromFMS(guid);
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
FileInputStream fileInputStream = FileUtils.byteToFile(bytes);
|
|
|
pictureRenderData = Pictures.ofStream(fileInputStream, PictureType.PNG)
|
|
@@ -349,14 +351,17 @@ public class ReportExportService {
|
|
|
List<Map<String, Object>> lapsePatents = new ArrayList<>();
|
|
|
for (PatentColumnDTO patent : patentColumnDTOS) {
|
|
|
String applicants = "";
|
|
|
- StringBuilder rightPerson = new StringBuilder();
|
|
|
+ String rightPerson = "";
|
|
|
if (patent.getApplicant() != null && patent.getApplicant().size() != 0) {
|
|
|
- applicants = StringUtils.join(patent.getApplicant(), "\r");
|
|
|
+ applicants = StringUtils.join(patent.getApplicant(), "\n");
|
|
|
+ }
|
|
|
+ if (patent.getRightHolder() != null && patent.getRightHolder().size() != 0) {
|
|
|
+ rightPerson = StringUtils.join(patent.getRightHolder(), "\n");
|
|
|
}
|
|
|
List<String> affairs = esLegalEventService.getStrLegalEvent(patent.getAppNo());
|
|
|
String affairStrs = "";
|
|
|
if (affairs != null && affairs.size() != 0) {
|
|
|
- affairStrs = StringUtils.join(affairs, "\r");
|
|
|
+ affairStrs = StringUtils.join(affairs, "\n");
|
|
|
}
|
|
|
|
|
|
//装载单个专利的信息
|
|
@@ -371,20 +376,21 @@ public class ReportExportService {
|
|
|
if (familyMap.get("nos") != null) {
|
|
|
List<String> nos = (List<String>) familyMap.get("nos");
|
|
|
if (nos != null && nos.size() > 0) {
|
|
|
- String nosStr = StringUtils.join(nos, "\r");
|
|
|
+ String nosStr = StringUtils.join(nos, "\n");
|
|
|
patentMap.put("simpleFamilys", nosStr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
}
|
|
|
+
|
|
|
//引用专利
|
|
|
try {
|
|
|
Map<String, Object> map = esQuotePatentService.getEsQutePatentByNos(patent.getPatentNo());
|
|
|
if (map.get("nos") != null) {
|
|
|
List<String> nos = (List<String>) map.get("nos");
|
|
|
if (nos != null && nos.size() > 0) {
|
|
|
- String nosStr = StringUtils.join(nos, "\r");
|
|
|
+ String nosStr = StringUtils.join(nos, "\n");
|
|
|
patentMap.put("quotePatents", nosStr);
|
|
|
}
|
|
|
}
|
|
@@ -392,10 +398,15 @@ public class ReportExportService {
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
}
|
|
|
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
//申请日
|
|
|
- patentMap.put("applicationDate", patent.getAppDate());
|
|
|
+ if(patent.getAppDate()!=null) {
|
|
|
+ patentMap.put("appDate", dateFormat.format(patent.getAppDate()));
|
|
|
+ }
|
|
|
//公开日
|
|
|
- patentMap.put("publicDate", patent.getPublicDate());
|
|
|
+ if(patent.getPublicDate()!=null) {
|
|
|
+ patentMap.put("publicDate", dateFormat.format(patent.getPublicDate()));
|
|
|
+ }
|
|
|
//专利号
|
|
|
patentMap.put("publicNo", patent.getPatentNo());
|
|
|
patentMap.put("firstPublicDate", patent.getPublicDate());
|
|
@@ -403,6 +414,11 @@ public class ReportExportService {
|
|
|
patentMap.put("rightPerson", rightPerson);
|
|
|
patentMap.put("affair", affairStrs);
|
|
|
|
|
|
+ if (patent.getTitle() != null && patent.getTitle().size() > 0) {
|
|
|
+ patentMap.put("nameOut", patent.getTitle().get(0).getTextContent());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//优先权日
|
|
|
if (patent.getPriorities() != null && patent.getPriorities().size() != 0) {
|
|
|
patentMap.put("priorityDate", patent.getPriorities().get(0).getPriorityDate());
|
|
@@ -414,13 +430,15 @@ public class ReportExportService {
|
|
|
if (pictureData != null) {
|
|
|
patentMap.put("abstractPath", pictureData);
|
|
|
}
|
|
|
+
|
|
|
//获得专利对比记录的信息
|
|
|
Map<String, Object> temMap = ftoCompareRecordService.LoadCompareMessageForExport(projectId, patent.getPatentNo());
|
|
|
List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
|
|
|
//装载对比记录的信息
|
|
|
patentMap.put("cM", compareMessageVOS);
|
|
|
- patentMap.put("rightNum", temMap.get("right"));
|
|
|
- patentMap.put("mainRightNum", temMap.get("mainRight"));
|
|
|
+ patentMap.put("rightNum", temMap.get("rightNum"));
|
|
|
+
|
|
|
+ patentMap.put("mainNum", temMap.get("mainRightNum"));
|
|
|
Integer status = Integer.parseInt(patent.getSimpleStatus());
|
|
|
if (status == 1 || status == 5 || status == 6) {
|
|
|
announcePatents.add(patentMap);
|