Commit d3731576 authored by 廖旭伟's avatar 廖旭伟

证照预览根据示例模板单独生成有背景的预览图

parent cfe31f63
......@@ -207,7 +207,8 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
// CertificateCatalogEntity catalog = certificateCatalogService.get(applyLogEntity.getCatalogId());
CertificateCatalogTemplateEntity templateEntity = certificateCatalogTemplateService.get(applyLogEntity.getTemplateId());
// applyLogEntity.setCatalogCode(catalog.getCatalogCode());
DocTemplateVO docTemplate = new DocTemplateVO(templateEntity.getTemplateFileUrl(),applyLogEntity.getFormContent());
String templatefileUrl = StringUtils.isNotEmpty(templateEntity.getExampleFileUrl())?templateEntity.getExampleFileUrl():templateEntity.getTemplateFileUrl();
DocTemplateVO docTemplate = new DocTemplateVO(templatefileUrl,applyLogEntity.getFormContent());
return preview(docTemplate, context,false);
}
......@@ -240,6 +241,14 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
applyLogEntity.setCertificateUrl(vals[0]);
applyLogEntity.setPreviewUrl(vals[1]);
}
//生成预览图片
if(StringUtils.isNotEmpty(templateEntity.getExampleFileUrl())) {
docTemplate = new DocTemplateVO(templateEntity.getExampleFileUrl(), applyLogEntity.getFormContent());
String previewPaths = preview(docTemplate, context, hasPDF);
String[] pVals = previewPaths.split(";");
applyLogEntity.setPreviewUrl(pVals[1]);
}
applyLogEntity.setCreateTime(new Date());
applyLogEntity.setRecordStatus(YesNoEnum.NO.getValue());
if(context!=null && context.getUser()!=null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment