|
@@ -1,14 +1,15 @@
|
|
package cn.cslg.report.service.business;
|
|
package cn.cslg.report.service.business;
|
|
|
|
|
|
import cn.cslg.report.common.model.SystemMO;
|
|
import cn.cslg.report.common.model.SystemMO;
|
|
-import cn.cslg.report.common.model.vo.CompareMessageVO;
|
|
|
|
-import cn.cslg.report.common.model.vo.PatentVO;
|
|
|
|
-import cn.cslg.report.common.model.vo.PersonnelVO;
|
|
|
|
|
|
+import cn.cslg.report.common.model.vo.*;
|
|
import cn.cslg.report.common.utils.*;
|
|
import cn.cslg.report.common.utils.*;
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.entity.*;
|
|
import cn.cslg.report.entity.*;
|
|
import cn.cslg.report.entity.asso.AssoRecordsFeature;
|
|
import cn.cslg.report.entity.asso.AssoRecordsFeature;
|
|
|
|
+import cn.cslg.report.mapper.AvoidDesignLittleDirectionMapper;
|
|
|
|
+import cn.cslg.report.mapper.AvoidDesignWholeDirectionMapper;
|
|
import cn.cslg.report.mapper.ReportDocumentMapper;
|
|
import cn.cslg.report.mapper.ReportDocumentMapper;
|
|
|
|
+import cn.cslg.report.service.IAvoidDesignDirectionService;
|
|
import cn.cslg.report.service.OutInterfaceService;
|
|
import cn.cslg.report.service.OutInterfaceService;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -55,6 +56,8 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
private final ReportFieldPatentLinkService reportFieldPatentLinkService;
|
|
private final ReportFieldPatentLinkService reportFieldPatentLinkService;
|
|
private final CompareMessageService compareMessageService;
|
|
private final CompareMessageService compareMessageService;
|
|
private final CompareFilesService compareFilesService;
|
|
private final CompareFilesService compareFilesService;
|
|
|
|
+ private final AvoidDesignLittleDirectionMapper avoidDesignLittleDirectionMapper;
|
|
|
|
+ private final AvoidDesignWholeDirectionMapper avoidDesignWholeDirectionMapper;
|
|
@Value("${RMSFile}")
|
|
@Value("${RMSFile}")
|
|
private String rmsFile;
|
|
private String rmsFile;
|
|
@Value("${PASFile}")
|
|
@Value("${PASFile}")
|
|
@@ -109,7 +112,7 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
} else if (report.getType() == 4) {
|
|
} else if (report.getType() == 4) {
|
|
template = this.Torttemplate(reportId, filePath, templeId);
|
|
template = this.Torttemplate(reportId, filePath, templeId);
|
|
} else if (report.getType() == 5) {
|
|
} else if (report.getType() == 5) {
|
|
- template = this.avoidDesignTemplate(reportId, filePath, templeId);
|
|
|
|
|
|
+ template = this.avoidDesignTemplate(reportId, filePath);
|
|
}
|
|
}
|
|
// 读取模板、数据并渲染
|
|
// 读取模板、数据并渲染
|
|
// 文件是否已存在,则删除
|
|
// 文件是否已存在,则删除
|
|
@@ -693,10 +696,42 @@ public class ReportDocumentService extends ServiceImpl<ReportDocumentMapper, Rep
|
|
return template;
|
|
return template;
|
|
}
|
|
}
|
|
|
|
|
|
- private XWPFTemplate avoidDesignTemplate(Integer reportId, String filePath, Integer templateId) {
|
|
|
|
|
|
+ private XWPFTemplate avoidDesignTemplate(Integer reportId, String filePath) {
|
|
|
|
+ log.info("开始处理导出规避设计报告,参数为:{}, {}", reportId, filePath);
|
|
|
|
+ Report report = reportService.getById(reportId);
|
|
|
|
+ String signPatentNo = report.getSignPatentNo();
|
|
|
|
|
|
|
|
+ //装载公开/公告号
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
+ map.put("pantentNo", signPatentNo);
|
|
|
|
|
|
- return null;
|
|
|
|
|
|
+ //装载年月日
|
|
|
|
+ String date = DateUtils.formatDate(new Date(), DateUtils.YYYY_MM_DD);
|
|
|
|
+ String[] dates = date.split("-");
|
|
|
|
+ SystemMO systemMO = new SystemMO()
|
|
|
|
+ .setYear(dates[0])
|
|
|
|
+ .setMonth(dates[1])
|
|
|
|
+ .setDay(dates[2]);
|
|
|
|
+ map.put("sys", systemMO);
|
|
|
|
+
|
|
|
|
+ //装载特征、解释、回避设计方向、回避设计总体方向
|
|
|
|
+ List<AvoidFeaturesVO> features = avoidDesignLittleDirectionMapper.selectWholeByReportId(reportId);
|
|
|
|
+ String wholeDirection = avoidDesignWholeDirectionMapper.selectWholeDirectionByReportId(reportId);
|
|
|
|
+ map.put("features", features);
|
|
|
|
+ map.put("wholeDirection", wholeDirection);
|
|
|
|
+
|
|
|
|
+ //绑定政策(绑定集合和元素循环遍历)
|
|
|
|
+ LoopRowTableRenderPolicy policy = new LoopRowTableRenderPolicy();
|
|
|
|
+ //把指定元素内容识别传输成html格式
|
|
|
|
+ HtmlRenderPolicy htmlRenderPolicy = new HtmlRenderPolicy();
|
|
|
|
+ Configure configure = Configure.builder()
|
|
|
|
+ .bind("features", policy)
|
|
|
|
+ .bind("explainText", htmlRenderPolicy)
|
|
|
|
+ .bind("littleDirection", htmlRenderPolicy)
|
|
|
|
+ .bind("wholeDirection", htmlRenderPolicy)
|
|
|
|
+ .build();
|
|
|
|
+ XWPFTemplate template = XWPFTemplate.compile(filePath, configure).render(map);
|
|
|
|
+ return template;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|