feat:预览生成html
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.adc.da.report.service.impl;
|
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.CommonUtils;
|
||||||
import com.adc.da.login.util.UserUtils;
|
import com.adc.da.login.util.UserUtils;
|
||||||
import com.adc.da.report.constant.ReportConstants;
|
import com.adc.da.report.constant.ReportConstants;
|
||||||
@@ -351,6 +352,16 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
|||||||
ReportEntity entity = reportDao.selectById(id);
|
ReportEntity entity = reportDao.selectById(id);
|
||||||
String key = entity.getId() + "-" + entity.getFileId();
|
String key = entity.getId() + "-" + entity.getFileId();
|
||||||
String html = stringRedisTemplate.boundValueOps(key).get();
|
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;
|
return html;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
Reference in New Issue
Block a user