|
@@ -267,6 +267,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
vo.setEndTime(DateUtil.getLastDayOfMonthStr());
|
|
vo.setEndTime(DateUtil.getLastDayOfMonthStr());
|
|
List<OneClickExportVO> articleVOS = articleInfoMapper.selectArticleList(vo);
|
|
List<OneClickExportVO> articleVOS = articleInfoMapper.selectArticleList(vo);
|
|
List<ExportReportVO> reportVOS = new ArrayList<>();
|
|
List<ExportReportVO> reportVOS = new ArrayList<>();
|
|
|
|
+ List<Integer> articleIds = new ArrayList<>();
|
|
if (!CollectionUtils.isEmpty(articleVOS)) {
|
|
if (!CollectionUtils.isEmpty(articleVOS)) {
|
|
Map<String, List<OneClickExportVO>> map = articleVOS.stream().collect(Collectors.groupingBy(OneClickExportVO::getCategoryName));
|
|
Map<String, List<OneClickExportVO>> map = articleVOS.stream().collect(Collectors.groupingBy(OneClickExportVO::getCategoryName));
|
|
if (!CollectionUtils.isEmpty(map)) {
|
|
if (!CollectionUtils.isEmpty(map)) {
|
|
@@ -290,6 +291,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
detailVO.setArticle_url(htmlLink);
|
|
detailVO.setArticle_url(htmlLink);
|
|
detailVOS.add(detailVO);
|
|
detailVOS.add(detailVO);
|
|
i++;
|
|
i++;
|
|
|
|
+ articleIds.add(reportArticleVO.getArticleId());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
reportVO.setDetailVOS(detailVOS);
|
|
reportVO.setDetailVOS(detailVOS);
|
|
@@ -328,12 +330,20 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
map.put("business_list", list4);
|
|
map.put("business_list", list4);
|
|
ReportTemple reportTemplate = reportTempleService.getById(1);
|
|
ReportTemple reportTemplate = reportTempleService.getById(1);
|
|
String templateFilePath = fileUtils.getPath(reportTemplate.getTemplatePath());
|
|
String templateFilePath = fileUtils.getPath(reportTemplate.getTemplatePath());
|
|
- String reportName = "";
|
|
|
|
|
|
+ String nowDateStr = DateUtil.getNowDateStr();
|
|
|
|
+ String year = nowDateStr.substring(0, 4);
|
|
|
|
+ String month = nowDateStr.substring(4, 6);
|
|
|
|
+ String reportName = nowDateStr + "-知识产权相关法律法规资讯整理(威世博" + year + "年第" + month + "月)-v1r00";
|
|
//生成文档
|
|
//生成文档
|
|
String fileGuid = null;
|
|
String fileGuid = null;
|
|
try {
|
|
try {
|
|
fileGuid = this.generateReportFile(map, templateFilePath, reportName);
|
|
fileGuid = this.generateReportFile(map, templateFilePath, reportName);
|
|
//todo 后续添加导出记录
|
|
//todo 后续添加导出记录
|
|
|
|
+ //添加报告
|
|
|
|
+ ReportDTO reportDTO = new ReportDTO();
|
|
|
|
+ reportDTO.setReportName(reportName);
|
|
|
|
+ reportDTO.setArticleIds(articleIds);
|
|
|
|
+ this.addReport(reportDTO);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导出资讯报告失败");
|
|
throw new XiaoShiException(ExceptionEnum.BUSINESS_ERROR, "导出资讯报告失败");
|
|
}
|
|
}
|