| | |
| | | @Value("${spring.mail.template-path}") |
| | | private String templatePath; |
| | | |
| | | |
| | | @Autowired |
| | | private TEmailService emailService; |
| | | |
| | | private static List<Integer> orderIds = new ArrayList<>(); |
| | | |
| | | |
| | |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(uid); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "包裹收据" : language == 2 ? "Parcel receipt" : "Réception de colis"); |
| | | tEmail.setOrderId(orderId); |
| | | tEmail.setCreateTime(new Date()); |
| | | int i = cn.hutool.core.date.DateUtil.dayOfWeek(new Date())-1; |
| | | String week = EmailUtil.getWeek(language, i); |
| | | tEmail.setWeek(week); |
| | | boolean am = cn.hutool.core.date.DateUtil.isAM(new Date()); |
| | | if(am){ |
| | | tEmail.setAmOrPm(language==1?"上午":language==2?"AM":"Dans la matinée"); |
| | | }else { |
| | | tEmail.setAmOrPm(language==1?"下午":language==2?"PM":"après-midi"); |
| | | } |
| | | emailService.insert(tEmail); |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |