|
@@ -60,7 +60,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
@Autowired
|
|
@Autowired
|
|
private ArticleInfoMapper articleInfoMapper;
|
|
private ArticleInfoMapper articleInfoMapper;
|
|
|
|
|
|
- private static final List<String> SPECIAL_KEYWORDS = Arrays.asList("活动", "研讨", "座谈会", "举办", "举行", "培训", "课堂");
|
|
|
|
|
|
+ private static final List<String> SPECIAL_KEYWORDS = Arrays.asList("活动", "研讨", "座谈会", "举办", "举行", "培训",
|
|
|
|
+ "课堂", "论证会", "讨论", "调研", "会议", "召开","招聘","主题","讲座","大会","专利代理师","博览会","资助","参评","年会","参观","学习");
|
|
|
|
|
|
public String selectReportList(SelectReportListDTO vo) {
|
|
public String selectReportList(SelectReportListDTO vo) {
|
|
LambdaQueryWrapper<Report> wrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Report> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -113,6 +114,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
if (!CollectionUtils.isEmpty(articleIds)) {
|
|
if (!CollectionUtils.isEmpty(articleIds)) {
|
|
for (Integer articleId : articleIds) {
|
|
for (Integer articleId : articleIds) {
|
|
Long count = assoReportArticleMapper.selectCount(new LambdaQueryWrapper<AssoReportArticle>()
|
|
Long count = assoReportArticleMapper.selectCount(new LambdaQueryWrapper<AssoReportArticle>()
|
|
|
|
+ .eq(AssoReportArticle::getReportId,report.getId())
|
|
.eq(AssoReportArticle::getArticleId, articleId)
|
|
.eq(AssoReportArticle::getArticleId, articleId)
|
|
.eq(AssoReportArticle::getIfUse, 1));
|
|
.eq(AssoReportArticle::getIfUse, 1));
|
|
if (count > 1) {
|
|
if (count > 1) {
|
|
@@ -167,6 +169,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
if (!CollectionUtils.isEmpty(articleIds)) {
|
|
if (!CollectionUtils.isEmpty(articleIds)) {
|
|
for (Integer articleId : articleIds) {
|
|
for (Integer articleId : articleIds) {
|
|
Long count = assoReportArticleMapper.selectCount(new LambdaQueryWrapper<AssoReportArticle>()
|
|
Long count = assoReportArticleMapper.selectCount(new LambdaQueryWrapper<AssoReportArticle>()
|
|
|
|
+ .eq(AssoReportArticle::getReportId,reportId)
|
|
.eq(AssoReportArticle::getArticleId, articleId)
|
|
.eq(AssoReportArticle::getArticleId, articleId)
|
|
.eq(AssoReportArticle::getIfUse, 1));
|
|
.eq(AssoReportArticle::getIfUse, 1));
|
|
if (count > 1) {
|
|
if (count > 1) {
|
|
@@ -261,6 +264,7 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
return fileGuid;
|
|
return fileGuid;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
|
public String oneClickExport() {
|
|
public String oneClickExport() {
|
|
OneClickExportDTO vo = new OneClickExportDTO();
|
|
OneClickExportDTO vo = new OneClickExportDTO();
|
|
vo.setBeginTime(DateUtil.getFirstDayOfMonthStr());
|
|
vo.setBeginTime(DateUtil.getFirstDayOfMonthStr());
|
|
@@ -290,8 +294,8 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
String htmlLink = "<a href='" + reportArticleVO.getArticleUrl() + "'>" + reportArticleVO.getArticleUrl() + "</a>";
|
|
String htmlLink = "<a href='" + reportArticleVO.getArticleUrl() + "'>" + reportArticleVO.getArticleUrl() + "</a>";
|
|
detailVO.setArticle_url(htmlLink);
|
|
detailVO.setArticle_url(htmlLink);
|
|
detailVOS.add(detailVO);
|
|
detailVOS.add(detailVO);
|
|
- i++;
|
|
|
|
articleIds.add(reportArticleVO.getArticleId());
|
|
articleIds.add(reportArticleVO.getArticleId());
|
|
|
|
+ i++;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
reportVO.setDetailVOS(detailVOS);
|
|
reportVO.setDetailVOS(detailVOS);
|
|
@@ -300,6 +304,17 @@ public class ReportService extends ServiceImpl<ReportMapper, Report> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ String nowDateStr = DateUtil.getNowDateStr();
|
|
|
|
+ String year = nowDateStr.substring(0, 4);
|
|
|
|
+ String month = nowDateStr.substring(4, 6);
|
|
|
|
+ String reportName = nowDateStr + "-知识产权相关法律法规资讯整理(威世博" + year + "年第" + month + "月)-v1r00";
|
|
|
|
+ //添加报告
|
|
|
|
+ ReportDTO reportDTO = new ReportDTO();
|
|
|
|
+ reportDTO.setReportName(reportName);
|
|
|
|
+ reportDTO.setArticleIds(articleIds);
|
|
|
|
+ System.out.println(articleIds.size());
|
|
|
|
+ this.addReport(reportDTO);
|
|
|
|
+
|
|
List<ExportReportDetailVO> list = new ArrayList<>();
|
|
List<ExportReportDetailVO> list = new ArrayList<>();
|
|
List<ExportReportDetailVO> list1 = new ArrayList<>();
|
|
List<ExportReportDetailVO> list1 = new ArrayList<>();
|
|
List<ExportReportDetailVO> list2 = new ArrayList<>();
|
|
List<ExportReportDetailVO> list2 = new ArrayList<>();
|
|
@@ -330,20 +345,11 @@ 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 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, "导出资讯报告失败");
|
|
}
|
|
}
|