|
@@ -18,10 +18,7 @@ import cn.cslg.pas.domain.es.Text;
|
|
|
import cn.cslg.pas.exception.XiaoShiException;
|
|
|
import cn.cslg.pas.mapper.AvoidDesignMapper;
|
|
|
import cn.cslg.pas.service.business.*;
|
|
|
-import cn.cslg.pas.service.business.es.EsFamilyService;
|
|
|
-import cn.cslg.pas.service.business.es.EsPatentService;
|
|
|
-import cn.cslg.pas.service.business.es.EsQuotePatentService;
|
|
|
-import cn.cslg.pas.service.business.es.EsService;
|
|
|
+import cn.cslg.pas.service.business.es.*;
|
|
|
import cn.cslg.pas.service.common.FileManagerService;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -82,6 +79,8 @@ public class ReportExportService {
|
|
|
private LoginUtils loginUtils;
|
|
|
@Autowired
|
|
|
private CacheUtils cacheUtils;
|
|
|
+ @Autowired
|
|
|
+ private EsLegalEventService esLegalEventService;
|
|
|
|
|
|
/**
|
|
|
* @param projectId
|
|
@@ -134,7 +133,7 @@ public class ReportExportService {
|
|
|
throw new XiaoShiException("保存记录失败");
|
|
|
}
|
|
|
// PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
- PersonnelVO personnelVO =new PersonnelVO();
|
|
|
+ PersonnelVO personnelVO = new PersonnelVO();
|
|
|
personnelVO.setId("1");
|
|
|
ReportDocument reportDocument = new ReportDocument();
|
|
|
reportDocument.setProjectId(projectId);
|
|
@@ -239,14 +238,9 @@ public class ReportExportService {
|
|
|
String signPatentNo = report.getSignPatentNo();
|
|
|
|
|
|
//装载标的专利信息
|
|
|
- Map<String, Object> signPatent = this.signPatentMess(report.getSignPatentNo());
|
|
|
- System.out.println(signPatent.get(""));
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- //装载标的专利信息
|
|
|
- map.put("signPatent", signPatent);
|
|
|
- map.put("rights", signPatent.get("rights"));
|
|
|
- //装载公开/公告号
|
|
|
- map.put("patentNo", signPatentNo);
|
|
|
+
|
|
|
+
|
|
|
+ ;
|
|
|
|
|
|
//装载年月日
|
|
|
String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
@@ -255,12 +249,11 @@ public class ReportExportService {
|
|
|
.setYear(dates[0])
|
|
|
.setMonth(dates[1])
|
|
|
.setDay(dates[2]);
|
|
|
- map.put("sys", systemMO);
|
|
|
//
|
|
|
//装载特征、解释、回避设计方向、回避设计总体方向
|
|
|
List<AvoidFeaturesVO> features = avoidDesignMapper.selectAvoidDesign(projectId);
|
|
|
// String wholeDirection = avoidDesignWholeDirectionMapper.selectWholeDirectionByReportId(reportId);
|
|
|
- map.put("features", features);
|
|
|
+
|
|
|
// map.put("wholeDirection", wholeDirection);
|
|
|
//
|
|
|
//绑定政策(绑定集合和元素循环遍历)
|
|
@@ -274,56 +267,13 @@ public class ReportExportService {
|
|
|
.bind("littleDirection", htmlRenderPolicy)
|
|
|
.bind("wholeDirection", htmlRenderPolicy)
|
|
|
.build();
|
|
|
- XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
|
+ XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(new HashMap<>());
|
|
|
return template;
|
|
|
}
|
|
|
|
|
|
- public Map<String, Object> signPatentMess(String patentNo) throws IOException {
|
|
|
-// PatentNoVO patentVO = new PatentNoVO();
|
|
|
-// patentVO.setPatentNo(patentNo);
|
|
|
-// //根据专利号查询专利详细信息
|
|
|
-// PatentDetailDTO patentDetailDTO = esPatentService.selectPatentDetail(patentVO);
|
|
|
-// //装载单个专利的信息
|
|
|
- Map<String, Object> patentMap = new HashMap<>();
|
|
|
-// StringBuilder applicants = new StringBuilder();
|
|
|
-// StringBuilder rightPerson = new StringBuilder();
|
|
|
-//
|
|
|
-// //申请日
|
|
|
-// patentMap.put("applicationDate", patentDetailDTO.getAppDate());
|
|
|
-//
|
|
|
-// //公开日
|
|
|
-// patentMap.put("publicDate", patentDetailDTO.getPublicDate());
|
|
|
-// //公开号
|
|
|
-// patentMap.put("publicNo", patentDetailDTO.getPublicNo());
|
|
|
-// //专利号
|
|
|
-// patentMap.put("patentNo", patentDetailDTO.getPatentNo());
|
|
|
-// //专利权人
|
|
|
-// patentMap.put("rightPerson", rightPerson);
|
|
|
-// //图示
|
|
|
-// String guid = FormatUtil.getPictureFormat(patentDetailDTO.getAppNo());
|
|
|
-// PictureRenderData pictureData = this.guidToStream(guid);
|
|
|
-// if (pictureData != null) {
|
|
|
-// patentMap.put("abstractPath", pictureData);
|
|
|
-// }
|
|
|
-// //获得标题
|
|
|
-// if (patentDetailDTO.getTitle() != null && patentDetailDTO.getTitle().size() > 0) {
|
|
|
-// Text title = patentDetailDTO.getTitle().stream()
|
|
|
-// .filter(item -> item.getIfOrigin().equals(true)).findFirst().orElse(null);
|
|
|
-// if (title != null) {
|
|
|
-// patentMap.put("name", title.getTextContent());
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// //获得权要
|
|
|
-// List<Map<String, Object>> rights= this.getClaimMaps(patentDetailDTO.getClaim(),patentDetailDTO.getPatentNo());
|
|
|
-//
|
|
|
-// patentMap.put("rights", rights);
|
|
|
- return patentMap;
|
|
|
- }
|
|
|
|
|
|
private PictureRenderData guidToStream(String guid) {
|
|
|
PictureRenderData pictureRenderData = null;
|
|
|
-
|
|
|
byte[] bytes = null;
|
|
|
|
|
|
if (bytes != null) {
|
|
@@ -412,15 +362,12 @@ public class ReportExportService {
|
|
|
if (patent.getApplicant() != null && patent.getApplicant().size() != 0) {
|
|
|
applicants = StringUtils.join(patent.getApplicant(), "\r");
|
|
|
}
|
|
|
+ List<String> affairs = esLegalEventService.getStrLegalEvent(patent.getAppNo());
|
|
|
+ String affairStrs = "";
|
|
|
+ if (affairs != null && affairs.size() != 0) {
|
|
|
+ affairStrs = StringUtils.join(affairs, "\r");
|
|
|
+ }
|
|
|
|
|
|
-// //装载法律状态
|
|
|
-// StringBuilder affair = new StringBuilder();
|
|
|
-// List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
|
|
|
-// affaires.forEach(item -> {
|
|
|
-// affair.append(item.get("status") + "\r");
|
|
|
-// }
|
|
|
-//
|
|
|
-// );
|
|
|
//装载单个专利的信息
|
|
|
Map<String, Object> patentMap = new HashMap<>();
|
|
|
|
|
@@ -463,7 +410,7 @@ public class ReportExportService {
|
|
|
patentMap.put("firstPublicDate", patent.getPublicDate());
|
|
|
patentMap.put("applicant", applicants);
|
|
|
patentMap.put("rightPerson", rightPerson);
|
|
|
-// patentMap.put("affair", affair);
|
|
|
+ patentMap.put("affair", affairStrs);
|
|
|
|
|
|
//优先权日
|
|
|
if (patent.getPriorities() != null && patent.getPriorities().size() != 0) {
|