This commit is contained in:
linfso 2024-08-24 10:17:42 +08:00
parent b5ea7a930c
commit b1b40e9cb2

View File

@ -2719,15 +2719,18 @@ public class EmisWaybillServiceImpl extends EmisBaseService implements IEmisWayb
String fileId = UUID.fastUUID().toString(); String fileId = UUID.fastUUID().toString();
String fileSavePath = PayConfig.getUploadPath(); String fileSavePath = PayConfig.getUploadPath();
File fileFullPath = FileUploadUtils.getAbsoluteFile(fileSavePath,fileId+".png"); File localFile = FileUploadUtils.getAbsoluteFile(fileSavePath,fileId+".png");
FileOutputStream os = new FileOutputStream(fileFullPath); FileOutputStream os = new FileOutputStream(localFile);
tplPrint.genPNG(order,tplCode,"", os); tplPrint.genPNG(order,tplCode,"", os);
SysFileInfo sysFileInfo=sysFileInfoService.ossUploadLocalFile(fileFullPath,billCode+"-cm.png","寄件底单图片"); SysFileInfo sysFileInfo=sysFileInfoService.ossUploadLocalFile(localFile.getAbsolutePath(),billCode+"-cm.png","寄件底单图片");
String fileUrl = sysFileInfo.getFileRemoteUrl(); String fileUrl = sysFileInfo.getFileRemoteUrl();
goodsPicAttachment.setFileUrl(fileUrl); goodsPicAttachment.setFileUrl(fileUrl);
emisWaybillAttachmentMapper.insertEmisWaybillAttachment(goodsPicAttachment); emisWaybillAttachmentMapper.insertEmisWaybillAttachment(goodsPicAttachment);
// 删除本地文件
localFile.delete();
}else{ }else{
log.debug("生成寄件图片信息失败"); log.debug("生成寄件图片信息失败");
} }