| | |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | |
| | | @Autowired |
| | | private TEmailService emailService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得包裹订单,请及时联系客户!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得包裹订单,请及时联系客户!" : |
| | | language == 2 ? "You have successfully captured the parcel order, please contact the customer in time!" |
| | | : "Vous avez saisi avec succès la commande de colis, veuillez contacter le client à temps!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" : |
| | | language == 2 ? "Your order has been assigned to " + driver.getFirstName() + " master, please keep the phone open!" |
| | | : "Votre commande a été attribuée à " + driver.getFirstName() + " master, veuillez garder le téléphone ouvert!", orderLogistics.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | if(orderLogistics.getPayType() != 4){ |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = company.getCrossLogisticsMoney(); |
| | | Double speMoney = company.getSameLogisticsMoney(); |
| | | BigDecimal d = null;//企业收入 |
| | | BigDecimal c = null;//司机收入 |
| | | if(company.getIsCrossLogisticsFixedOrProportional() == 2){//固定 |
| | | if(company.getIsSameLogisticsFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机 |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | if(company.getIsSameLogisticsFixedOrProportional() == 1){//比例 |
| | | Double price = orderLogistics.getOrderMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))); |
| | | c = new BigDecimal(orderLogistics.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | |
| | | } |
| | | 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(userInfo.getId()); |
| | | 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); |
| | | |
| | | } |
| | | } |
| | | if(orderLogistics.getPayType() == 2){ |
| | |
| | | } |
| | | 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(userInfo.getId()); |
| | | 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); |
| | | |
| | | } |
| | | } |
| | | if(orderLogistics.getPayType() == 3){ |
| | |
| | | } |
| | | 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(userInfo.getId()); |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getLastName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | systemNoticeService.addSystemNotice(2, language == 1 ? "您已成功抢得出租车订单,请及时联系客户!" : |
| | | language == 2 ? "You have successfully captured the taxi order, please contact the customer in time!" |
| | | : "Vous avez saisi avec succès la commande de taxi, veuillez contacter le client à temps!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您的订单已指派给" + driver.getFirstName() + "师傅,请保持电话畅通!" : |
| | | language == 2 ? "Your order has been assigned to " + driver.getFirstName() + " master, please keep the phone open!" |
| | | : "Votre commande a été attribuée à " + driver.getFirstName() + " master, veuillez garder le téléphone ouvert!", orderLogistics.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | email2_content.text("Vous êtes lié à une adresse e-mail. Le code de vérification e-mail pour cette demande est: " + random + ". Veuillez compléter la vérification dans les 5 minutes"); |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "取件码" : language == 2 ? "Pickup code" : "Code de prise en charge", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/usr/local/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/usr/local/nginx/html/files/html/code_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | | FileWriter fileWriter = new FileWriter(file); |
| | | fileWriter.write(document.html()); |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | FileInputStream fileInputStream = new FileInputStream(file); |
| | | File file1 = new File("/usr/local/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/usr/local/nginx/html/files/pdf/code_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf(fileInputStream, "IGO", fileOutputStream); |
| | | |
| | | String link ="http://182.160.16.251:81/files/html/code_" + orderId + ".html"; |
| | | TEmail tEmail = new TEmail(); |
| | | tEmail.setLink(link); |
| | | tEmail.setUserId(userInfo.getId()); |
| | | tEmail.setType(1); |
| | | tEmail.setName(language == 1 ? "取件码" : language == 2 ? "Pickup code" : "Code de prise en charge"); |
| | | 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); |
| | | } |
| | | |
| | | } |