feat:预览生成html

This commit is contained in:
2023-05-11 16:57:35 +08:00
parent 028be3532d
commit 1582c14c09
@@ -1,5 +1,6 @@
package com.adc.da.report.service.impl;
import cn.hutool.core.util.StrUtil;
import com.adc.da.login.util.CommonUtils;
import com.adc.da.login.util.UserUtils;
import com.adc.da.report.constant.ReportConstants;
@@ -351,6 +352,16 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
ReportEntity entity = reportDao.selectById(id);
String key = entity.getId() + "-" + entity.getFileId();
String html = stringRedisTemplate.boundValueOps(key).get();
//没有的话就生成
if (StrUtil.isBlank(html)) {
html = createHtmlString(entity.getFileId());
log.info("执行完成html" + html);
//key:报告id-文件id
stringRedisTemplate.boundValueOps(key).set(html);
log.info(key + "已经存好");
}
return html;
} catch (Exception ex) {
return "";