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