Browse Source

[feat]修改导出pdf

pull/7/head
杨威 4 weeks ago
parent
commit
994b40dd2d
  1. 2
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java
  2. 8
      dk-modules/business/src/main/resources/templates/pdfAlert.ftl

2
dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java

@ -902,7 +902,7 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
FreemarkerUtil.renderTplFileToWord("预警导出.docx","alert.ftl",resultMap,response); FreemarkerUtil.renderTplFileToWord("预警导出.docx","alert.ftl",resultMap,response);
} else if (bo.getExportType().equalsIgnoreCase("pdf")) { } else if (bo.getExportType().equalsIgnoreCase("pdf")) {
try { try {
HtmlConvertPdfHelper.htmlConvertPDF(resultMap,"pdfAlert.ftl"); HtmlConvertPdfHelper.renderTplFileToPDF("预警导出.pdf","pdfAlert.ftl",resultMap,response);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(),e);
} }

8
dk-modules/business/src/main/resources/templates/pdfAlert.ftl

@ -85,12 +85,12 @@
<td style="height: 50px;">后期影像</td> <td style="height: 50px;">后期影像</td>
</tr> </tr>
<tr> <tr>
<td><img src="${item.maxImages}" alt="前期影像1" style="width: 330px; height: 290px;"/></td> <td><img src="${item.mateSourceImgUrl?if_exists}" alt="前期影像1" style="width: 330px; height: 290px;"/></td>
<td><img src="${item.images}" alt="前期影像2" style="width: 330px; height: 290px;"/></td> <td><img src="${item.images?if_exists}" alt="前期影像2" style="width: 330px; height: 290px;"/></td>
</tr> </tr>
<tr> <tr>
<td><img src="${item.maxMateSourceImgUrl}" alt="后期影像1" style="width: 330px; height: 290px;"/></td> <td><img src="${item.maxMateSourceImgUrl?if_exists}" alt="后期影像1" style="width: 330px; height: 290px;"/></td>
<td><img src="${item.mateSourceImgUrl}" alt="后期影像2" style="width: 330px; height: 290px;"/></td> <td><img src="${item.maxImages?if_exists}" alt="后期影像2" style="width: 330px; height: 290px;"/></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

Loading…
Cancel
Save