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