feat:新版选择文件预览功能
This commit is contained in:
@@ -243,19 +243,20 @@ public class ReportManageConroller {
|
||||
|
||||
/**
|
||||
* 获取报告预览
|
||||
* @param id
|
||||
* @param reportId
|
||||
* @param fileId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("获取报告预览")
|
||||
@GetMapping("/getReportHtml/{id}")
|
||||
public ResponseMessage getReportHtml(@PathVariable("id") String id) {
|
||||
String html = reportService.reportHtml(id);
|
||||
@GetMapping("/getReportHtml")
|
||||
public ResponseMessage getReportHtml(@RequestParam String reportId, @RequestParam String fileId) {
|
||||
String html = reportService.reportHtml(reportId, fileId);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("content", html);
|
||||
|
||||
ReportLogBook reportLog = new ReportLogBook();
|
||||
reportLog.setId(UUID.randomUUID().toString().replaceAll("-",""));
|
||||
reportLog.setReportId(id);
|
||||
reportLog.setReportId(reportId);
|
||||
reportLog.setType(1);
|
||||
reportLog.setUpdateTime(new Date());
|
||||
reportLog.setUserId(UserUtils.getUserId());
|
||||
|
||||
@@ -42,10 +42,11 @@ public interface IReportService {
|
||||
|
||||
/**
|
||||
* 获取报告htmlString
|
||||
* @param id
|
||||
* @param reportId
|
||||
* @param fileId
|
||||
* @return
|
||||
*/
|
||||
String reportHtml(String id);
|
||||
String reportHtml(String reportId, String fileId);
|
||||
|
||||
IPage<ReportVo> addReportPage(ReportQueryVo vo) throws Exception;
|
||||
|
||||
|
||||
@@ -422,18 +422,18 @@ public class IReportServiceImpl extends ServiceImpl<ReportDao, ReportEntity>
|
||||
/**
|
||||
* 报告html
|
||||
*
|
||||
* @param id
|
||||
* @param reportId
|
||||
* @param fileId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String reportHtml(String id) {
|
||||
public String reportHtml(String reportId, String fileId) {
|
||||
try {
|
||||
ReportEntity entity = reportDao.selectById(id);
|
||||
String key = entity.getId() + "-" + entity.getFileId();
|
||||
String key = reportId + fileId;
|
||||
String html = stringRedisTemplate.boundValueOps(key).get();
|
||||
//没有的话就生成
|
||||
if (StrUtil.isBlank(html)) {
|
||||
html = createHtmlString(entity.getFileId());
|
||||
html = createHtmlString(fileId);
|
||||
|
||||
log.info("执行完成html" + html);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user