| | |
| | | @RequestParam("invoiceUrl") String invoiceUrl){ |
| | | TOrderInvoice orderInvoice = orderInvoiceService.getById(id); |
| | | orderInvoice.setInvoiceUrl(invoiceUrl); |
| | | orderInvoice.setStatus(3); |
| | | orderInvoiceService.updateById(orderInvoice); |
| | | // 发送邮箱 |
| | | // 收件人电子邮箱,TODO 换成自己的收件箱 |
| | |
| | | //组装的顺序非常重要,一定要先组装文本域,再组装文件 |
| | | MimeBodyPart htmlPart = new MimeBodyPart(); |
| | | // 组装内容 |
| | | htmlPart.setContent("This is message content", "text/html;charset=UTF-8"); |
| | | htmlPart.setContent("开票", "text/html;charset=UTF-8"); |
| | | msgMultipart.addBodyPart(htmlPart); |
| | | |
| | | // 组装附件 |
| | |
| | | byte[] imageBytes = IOUtils.toByteArray(inputStream); |
| | | |
| | | // 创建临时文件 |
| | | File tempFile = File.createTempFile("tempImage", ".png"); |
| | | // 截取imageUrl后缀名 |
| | | String fileExtension = imageUrl.substring(imageUrl.lastIndexOf(".")); |
| | | File tempFile = File.createTempFile("tempImage", fileExtension); |
| | | try (FileOutputStream fos = new FileOutputStream(tempFile)) { |
| | | fos.write(imageBytes); |
| | | } |