| | |
| | | import java.io.Serializable; |
| | | import java.lang.reflect.InvocationTargetException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | List<TripOrderVo> tripOrderVos = processTripOrderVos(orderList); |
| | | String filePath = tripSheetGenerator.generatePdf(tripOrderVos); |
| | | File attachment = new File(filePath); |
| | | emailUtil.sendEmailWithAttachment(tripSheet.getRecipientEmail(), "行程单", "请查收您的行程单", attachment); |
| | | String displayFileName = "贵人家园行程单.pdf"; |
| | | emailUtil.sendEmailWithAttachment(tripSheet.getRecipientEmail(), "行程单", "请查收您的行程单", attachment,displayFileName); |
| | | attachment.delete(); // 发送成功后删除临时文件 |
| | | return ResultUtil.success("邮件发送成功"); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("orderNum", orderList.size()); |
| | | return ResultUtil.success(result); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.error("邮件发送失败"); |
| | | return ResultUtil.error("邮件发送失败"+e.getMessage()); |
| | | } |
| | | } |
| | | /** |