feat:编辑报告的同时修改报告内容表中的记录
This commit is contained in:
+8
-2
@@ -70,8 +70,14 @@ public class IReportContentServiceImpl extends ServiceImpl<ReportContentDao, Rep
|
||||
//解析出内容
|
||||
String content = FileContentUtil.readFileContent(file);
|
||||
//将内容存入
|
||||
ReportContentEntity reportContentEntity = new ReportContentEntity(UUID.randomUUID10(), reportId, content);
|
||||
save(reportContentEntity);
|
||||
ReportContentEntity reportContent = query().eq("report_id", reportId).one();
|
||||
if (reportContent == null) {
|
||||
ReportContentEntity reportContentEntity = new ReportContentEntity(UUID.randomUUID10(), reportId, content);
|
||||
save(reportContentEntity);
|
||||
} else {
|
||||
reportContent.setReportContent(content);
|
||||
saveOrUpdate(reportContent);
|
||||
}
|
||||
//将文件删除
|
||||
outputStream.close();
|
||||
FileUtil.deleteFile(path);
|
||||
|
||||
@@ -213,9 +213,6 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
});
|
||||
}
|
||||
|
||||
//插入报表内容表
|
||||
iReportContentService.insertReportContent(entity.getId(), entity.getFileId());
|
||||
|
||||
CommonUtils.threadPoolExecutor().execute(() -> {
|
||||
//生成html
|
||||
try {
|
||||
|
||||
+6
-9
@@ -128,14 +128,6 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
||||
|
||||
@Override
|
||||
public void saveOrUpdataReport(TtReportManageAct ttReportManageAct) {
|
||||
//插入报表内容表
|
||||
try {
|
||||
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
|
||||
log.info("抽取报告内容");
|
||||
} catch (IOException e) {
|
||||
log.error("获取报告内容失败", e);
|
||||
}
|
||||
|
||||
ReportEntity reportEntity = reportDao.selectById(ttReportManageAct.getDataId());
|
||||
if (reportEntity == null){
|
||||
//保存报告
|
||||
@@ -147,6 +139,11 @@ public class ITtReportManageActServiceImpl extends ServiceImpl<TtReportManageAct
|
||||
reportEntity1.setId(ttReportManageAct.getDataId());
|
||||
reportDao.updateById(reportEntity);
|
||||
}
|
||||
|
||||
try {
|
||||
iReportContentService.insertReportContent(ttReportManageAct.getDataId(), ttReportManageAct.getFileId());
|
||||
log.info("抽取报告内容");
|
||||
} catch (IOException e) {
|
||||
log.error("获取报告内容失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user