|
@@ -148,6 +148,8 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
|
* @description 装载稳定和无效模板信息
|
|
|
*/
|
|
|
private XWPFTemplate getstabilityTemplate(Report report, String filePath) throws IOException {
|
|
|
+ //装载标的专利信息
|
|
|
+ Map<String,Object> signPatent = this.signPantentMess(report.getSignPatentNo());
|
|
|
//根据报告Id获得报告信息
|
|
|
// 根据拆分人(报告的创建人)Id和报告ID获得所有特征
|
|
|
LambdaQueryWrapper<Features> allFeaturesWrapper = new LambdaQueryWrapper<>();
|
|
@@ -204,14 +206,19 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
|
patentVO.setPatentNos(PatentNos);
|
|
|
//根据专利号查询专利的排序
|
|
|
LambdaQueryWrapper<CompareFiles> comWrapper =new LambdaQueryWrapper<>();
|
|
|
- comWrapper.in(CompareFiles::getPatentNo)
|
|
|
- .eq(CompareFiles::getReportId,report.getId());
|
|
|
+ comWrapper
|
|
|
+ .eq(CompareFiles::getReportId,report.getId())
|
|
|
+ .last("ORDER BY IF(isnull(SYS_ORDER),1,0), SYS_ORDER ASC");;
|
|
|
List<CompareFiles> compareFiles =compareFilesService.list(comWrapper);
|
|
|
//专利号别名的map
|
|
|
Map<String, Object> OtherName = new HashMap<>();
|
|
|
- compareFiles.forEach(item->
|
|
|
- OtherName.put(item.getPatentNo(), item.getSysOrder())
|
|
|
- );
|
|
|
+ int flag=1;
|
|
|
+ for(CompareFiles item:compareFiles)
|
|
|
+ { Integer order = item.getSysOrder()==null?flag:item.getSysOrder();
|
|
|
+ OtherName.put(item.getPatentNo(),order);
|
|
|
+ flag++;
|
|
|
+ }
|
|
|
+
|
|
|
//根据专利号查询专利详细信息
|
|
|
String resBody = outInterfaceService.getPatentDTOListForRMS(patentVO);
|
|
|
JSONObject jsonObject = JSONObject.parseObject(resBody);
|
|
@@ -257,15 +264,17 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
|
patentListMap.put("applicant", applicants);
|
|
|
patentListMap.put("patentNo", item.get("publicNo"));
|
|
|
patentListMap.put("abstractStr", item.get("abstractStr"));
|
|
|
- patentListMap.put("compareFileName", "对比文件" + (i + 1));
|
|
|
+ patentListMap.put("compareFileName", "对比文件" + (order ));
|
|
|
patentListMap.put("applicationDate", item.get("applicationDate"));
|
|
|
patentListMap.put("abstractPath", fileURL + item.get("abstractPath"));
|
|
|
patentListMap.put("disclosures", disclosures);
|
|
|
- patentListMaps.add(order-1,patentListMap);
|
|
|
+ patentListMap.put("order",order);
|
|
|
+ patentListMaps.add(patentListMap);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
//存放对比方案信息的map集合
|
|
|
- List<Map<String, Object>> scenariosMaps = new ArrayList<>();
|
|
|
+ List<Map<String, Object>> scenariosMaps = new ArrayList<>(compareFiles.size());
|
|
|
//存放所有对比方案所有不重复的rightId
|
|
|
List<Integer> rightIds = new ArrayList<>();
|
|
|
for (int i = 0; i < compareScenarios.size(); i++) {
|
|
@@ -464,14 +473,20 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
|
String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
|
String[] ds = date.split("-");
|
|
|
map.put("sys", new SystemMO(ds[0], ds[1], ds[2], "", "reportName"));
|
|
|
+ if(patentListMaps.size()>1){
|
|
|
+ patentListMaps=this.sortMap(patentListMaps);
|
|
|
+ }
|
|
|
map.put("patentList", patentListMaps);
|
|
|
map.put("combinations", allRightScenarios);
|
|
|
map.put("allResults", resultMaps);
|
|
|
+ map.put("signPatent",signPatent);
|
|
|
+ map.put("pantentNo",report.getSignPatentNo());
|
|
|
+ map.put("rights",signPatent.get("rights"));
|
|
|
// 为表格的显示绑定行循环
|
|
|
LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
|
HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
|
// 将bz设置为行循环绑定的数据源的key,即key是bz的value会在模板中的{{bz}}处进行解析
|
|
|
- Configure configure = Configure.builder().bind("patentList", policy).bind("fileDetails", policy).bind("allResults", policy).bind("remark", htmlRenderPolicy).build();
|
|
|
+ Configure configure = Configure.builder().bind("patentList", policy).bind("fileDetails", policy).bind("allResults", policy).bind("rights",policy).bind("remark", htmlRenderPolicy).build();
|
|
|
// 读取模板、数据并渲染
|
|
|
XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
|
return template;
|
|
@@ -718,15 +733,18 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
|
});
|
|
|
//申请日
|
|
|
patentMap.put("applicationDate", patent.get("applicationDate"));
|
|
|
+
|
|
|
//公开日
|
|
|
patentMap.put("publicDate", patent.get("publicDate"));
|
|
|
+ //公开号
|
|
|
+ patentMap.put("publicNo",patent.get("publicNo"));
|
|
|
//专利号
|
|
|
- patentMap.put("publicNo", patent.get("publicNo"));
|
|
|
- patentMap.put("firstPublicDate", patent.get("firstPublicDate"));
|
|
|
+ patentMap.put("patentNo", patent.get("patentNo"));
|
|
|
+ //专利权人
|
|
|
patentMap.put("rightPerson", rightPerson);
|
|
|
//图示
|
|
|
patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
|
|
|
-
|
|
|
+ patentMap.put("name", patent.get("name"));
|
|
|
//查询专利权要
|
|
|
String resBody2 = outInterfaceService.getPatentRightFromPAS(patentNo);
|
|
|
JSONObject jsonObject2 = JSONObject.parseObject(resBody2);
|
|
@@ -735,14 +753,29 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
|
List<Map<String,Object>> rights =new ArrayList<>();
|
|
|
patentRightsOrgin.forEach(item->{
|
|
|
Map<String,Object> temMap =new HashMap<>();
|
|
|
- temMap.put("rightName","权要"+item.getSort());
|
|
|
+ temMap.put("rightName","权"+item.getSort());
|
|
|
temMap.put("content",item.getContent());
|
|
|
rights.add(temMap);
|
|
|
});
|
|
|
patentMap.put("rights",rights);
|
|
|
return patentMap;
|
|
|
}
|
|
|
+ public List<Map<String,Object>> sortMap(List<Map<String,Object>> maps){
|
|
|
+
|
|
|
+ for(int i=0;i<maps.size()-1;i++) {
|
|
|
+ for (int j = 0; j < maps.size() - i - 1; j++) {
|
|
|
+ Integer order1 = Integer.parseInt(maps.get(j).get("order").toString());
|
|
|
+ Integer order2 =Integer.parseInt(maps.get(j+1).get("order").toString());
|
|
|
+ if (order1 > order2) {
|
|
|
+ Map<String,Object> temp = maps.get(j);
|
|
|
+ maps.set(j,maps.get(j+1));
|
|
|
+ maps.set(j+1,temp);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return maps;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|