|
@@ -6,20 +6,21 @@ import cn.cslg.pas.common.dto.PatentDetailDTO;
|
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldDTO;
|
|
|
import cn.cslg.pas.common.dto.es.EsCustomFieldValueDTO;
|
|
|
import cn.cslg.pas.common.model.SystemMO;
|
|
|
+import cn.cslg.pas.common.model.cronModel.PersonnelVO;
|
|
|
import cn.cslg.pas.common.model.request.StringRequest;
|
|
|
-import cn.cslg.pas.common.utils.DateUtils;
|
|
|
-import cn.cslg.pas.common.utils.FileUtils;
|
|
|
-import cn.cslg.pas.common.utils.FormatUtil;
|
|
|
-import cn.cslg.pas.common.utils.PatentRightUtils;
|
|
|
+import cn.cslg.pas.common.utils.*;
|
|
|
import cn.cslg.pas.common.vo.*;
|
|
|
import cn.cslg.pas.common.vo.business.AllCustomFieldVO;
|
|
|
import cn.cslg.pas.common.vo.business.PatentNoVO;
|
|
|
+import cn.cslg.pas.domain.ReportDocument;
|
|
|
import cn.cslg.pas.domain.business.*;
|
|
|
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.common.FileManagerService;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
@@ -71,6 +72,17 @@ public class ReportExportService {
|
|
|
@Autowired
|
|
|
private FTOCompareRecordService ftoCompareRecordService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private EsQuotePatentService esQuotePatentService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private EsFamilyService esFamilyService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private LoginUtils loginUtils;
|
|
|
+ @Autowired
|
|
|
+ private CacheUtils cacheUtils;
|
|
|
+
|
|
|
/**
|
|
|
* @param projectId
|
|
|
* @param templeId
|
|
@@ -100,7 +112,7 @@ public class ReportExportService {
|
|
|
if (report.getReportType() == 0 || report.getReportType() == 2) {
|
|
|
// template = this.getstabilityTemplate(report, filePath);
|
|
|
} else if (report.getReportType() == 3) {
|
|
|
-// template = this.FTOtemplate(reportId, filePath, templeId);
|
|
|
+ template = this.FTOTemplate(projectId, templateFilePath, templeId);
|
|
|
} else if (report.getReportType() == 4) {
|
|
|
// template = this.Torttemplate(reportId, filePath, templeId);
|
|
|
} else if (report.getReportType() == 5) {
|
|
@@ -111,25 +123,30 @@ public class ReportExportService {
|
|
|
// 读取模板、数据并渲染
|
|
|
// 文件是否已存在,则删除
|
|
|
File file = new File(outPath);
|
|
|
- if (file.exists()) {
|
|
|
- file.delete();
|
|
|
- }
|
|
|
+
|
|
|
// 生成word保存在指定目录
|
|
|
template.writeToFile(outPath);
|
|
|
template.close();
|
|
|
//导出成功后,导出报告记录入库
|
|
|
-// String url = fileUtils.getDirectory2(directoryName) + fileName;
|
|
|
+
|
|
|
+ List<String> ids = fileManagerService.uploadFileGetGuid2(Arrays.asList(file));
|
|
|
+ if (ids == null || ids.size() == 0) {
|
|
|
+ throw new XiaoShiException("保存记录失败");
|
|
|
+ }
|
|
|
// PersonnelVO personnelVO = cacheUtils.getLoginUser(loginUtils.getId());
|
|
|
-// ReportDocument reportDocument = new ReportDocument();
|
|
|
-// reportDocument.setReportId(reportId);
|
|
|
-// reportDocument.setFileName(fileName);
|
|
|
-// reportDocument.setFilePath(url);
|
|
|
-// reportDocument.setPersonId(personnelVO.getId());
|
|
|
-// reportDocument.setTemplateId(reportTemplate.getId());
|
|
|
-// reportDocument.setTemplateName(reportTemplate.getTemplateName());
|
|
|
-// reportDocument.setPersonName(personnelVO.getName());
|
|
|
-// reportDocument.insert();
|
|
|
-// return Response.success(url);
|
|
|
+ PersonnelVO personnelVO =new PersonnelVO();
|
|
|
+ personnelVO.setId("1");
|
|
|
+ ReportDocument reportDocument = new ReportDocument();
|
|
|
+ reportDocument.setProjectId(projectId);
|
|
|
+ reportDocument.setFileName(fileName);
|
|
|
+ reportDocument.setFileGuid(ids.get(0));
|
|
|
+ reportDocument.setCreateId(personnelVO.getId());
|
|
|
+ reportDocument.setTemplateId(reportTemplate.getId());
|
|
|
+ reportDocument.setTemplateName(reportTemplate.getTemplateName());
|
|
|
+ reportDocument.insert();
|
|
|
+ if (file.exists()) {
|
|
|
+ file.delete();
|
|
|
+ }
|
|
|
return "";
|
|
|
}
|
|
|
|
|
@@ -390,24 +407,12 @@ public class ReportExportService {
|
|
|
//存放失效专利信息
|
|
|
List<Map<String, Object>> lapsePatents = new ArrayList<>();
|
|
|
for (PatentColumnDTO patent : patentColumnDTOS) {
|
|
|
-// List<JSONObject> applicantJSONs = JSON.parseArray(patent.get("applicant").toString(), JSONObject.class);
|
|
|
-// StringBuilder applicants = new StringBuilder();
|
|
|
-// StringBuilder rightPerson = new StringBuilder();
|
|
|
-// applicantJSONs.forEach(tem -> {
|
|
|
-// if (Integer.parseInt(tem.get("dataType").toString()) == 1) {
|
|
|
-// applicants.append(tem.get("name") + "\r");
|
|
|
-// } else {
|
|
|
-// rightPerson.append(tem.get("name") + "\r");
|
|
|
-// }
|
|
|
-// });
|
|
|
-// //装载同族信息
|
|
|
-//// JSONObject familys = JSONObject.parseObject(patent.get("family").toString());
|
|
|
-// List<String> patSnaps = JSON.parseArray(familys.get("patSnap").toString(), String.class);
|
|
|
-// List<String> simples = JSON.parseArray(familys.get("simple").toString(), String.class);
|
|
|
-// List<String> inpadocs = JSON.parseArray(familys.get("inpadoc").toString(), String.class);
|
|
|
-// patSnaps.addAll(simples);
|
|
|
-// patSnaps.addAll(inpadocs);
|
|
|
-// String familyStr = StringUtils.join(patSnaps, ",");
|
|
|
+ String applicants = "";
|
|
|
+ StringBuilder rightPerson = new StringBuilder();
|
|
|
+ if (patent.getApplicant() != null && patent.getApplicant().size() != 0) {
|
|
|
+ applicants = StringUtils.join(patent.getApplicant(), "\r");
|
|
|
+ }
|
|
|
+
|
|
|
// //装载法律状态
|
|
|
// StringBuilder affair = new StringBuilder();
|
|
|
// List<JSONObject> affaires = JSON.parseArray(patent.get("affair").toString(), JSONObject.class);
|
|
@@ -418,11 +423,37 @@ public class ReportExportService {
|
|
|
// );
|
|
|
//装载单个专利的信息
|
|
|
Map<String, Object> patentMap = new HashMap<>();
|
|
|
+
|
|
|
//同族专利
|
|
|
-// patentMap.put("simpleFamilys", familyStr);
|
|
|
+ try {
|
|
|
+ //装载同族信息
|
|
|
+ List<Map<String, Object>> familyMaps = esFamilyService.getPatentFamilyByNos(Arrays.asList(patent.getPatentNo()), "inpadoc");
|
|
|
+ if (familyMaps != null && familyMaps.size() > 0) {
|
|
|
+ Map<String, Object> familyMap = familyMaps.get(0);
|
|
|
+ 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");
|
|
|
+ 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");
|
|
|
+ patentMap.put("quotePatents", nosStr);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-// patentMap.put("quotePatents", patent.get("quote"));
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
//申请日
|
|
|
patentMap.put("applicationDate", patent.getAppDate());
|
|
|
//公开日
|
|
@@ -430,13 +461,21 @@ public class ReportExportService {
|
|
|
//专利号
|
|
|
patentMap.put("publicNo", patent.getPatentNo());
|
|
|
patentMap.put("firstPublicDate", patent.getPublicDate());
|
|
|
-// patentMap.put("applicant", applicants);
|
|
|
-// patentMap.put("rightPerson", rightPerson);
|
|
|
+ patentMap.put("applicant", applicants);
|
|
|
+ patentMap.put("rightPerson", rightPerson);
|
|
|
// patentMap.put("affair", affair);
|
|
|
+
|
|
|
//优先权日
|
|
|
- patentMap.put("priorityDate", patent.getPriorities());
|
|
|
+ if (patent.getPriorities() != null && patent.getPriorities().size() != 0) {
|
|
|
+ patentMap.put("priorityDate", patent.getPriorities().get(0).getPriorityDate());
|
|
|
+ }
|
|
|
+
|
|
|
//图示
|
|
|
-// patentMap.put("abstractPath", "http://139.224.24.90:8081" + patent.get("abstractPath"));
|
|
|
+ String guid = FormatUtil.getPictureFormat(patent.getAppNo());
|
|
|
+ PictureRenderData pictureData = this.guidToStream(guid);
|
|
|
+ if (pictureData != null) {
|
|
|
+ patentMap.put("abstractPath", pictureData);
|
|
|
+ }
|
|
|
//获得专利对比记录的信息
|
|
|
Map<String, Object> temMap = ftoCompareRecordService.LoadCompareMessageForExport(projectId, patent.getPatentNo());
|
|
|
List<CompareMessageVO> compareMessageVOS = (List<CompareMessageVO>) temMap.get("compareMessageVOs");
|