| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(null == lon || null == lat){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | OrderPrivateCar orderPrivateCar = this.selectById(id); |
| | | Integer integer = null; |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ResultUtil payPrivateCarOrder(Integer payType, Integer bankCardId, Integer orderId, Integer couponId, Integer redDeduction, Integer type, Integer language) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){ |
| | | return ResultUtil.error(language == 1 ? "订单已完成支付,不允许重复支付" : language == 2 ? "The order has been paid, recurring payments is not allowed." : "La commande a été payée, les paiements récurrents ne sont pas autorisés.", ""); |
| | | } |
| | | if(orderPrivateCar.getState() != 7){ |
| | | return ResultUtil.error(language == 1 ? "订单不在待支付状态,不允许支付" : language == 2 ? "The order is no longer with Pending Payment, making payments is not allowed." : "La commande n’est plus en attente de paiement, il n’est pas permis d’effectuer des paiements.", ""); |
| | | } |
| | | // if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){ |
| | | // return ResultUtil.error(language == 1 ? "订单已完成支付,不允许重复支付" : language == 2 ? "The order has been paid, recurring payments is not allowed." : "La commande a été payée, les paiements récurrents ne sont pas autorisés.", ""); |
| | | // } |
| | | // if(orderPrivateCar.getState() != 7){ |
| | | // return ResultUtil.error(language == 1 ? "订单不在待支付状态,不允许支付" : language == 2 ? "The order is no longer with Pending Payment, making payments is not allowed." : "La commande n’est plus en attente de paiement, il n’est pas permis d’effectuer des paiements.", ""); |
| | | // } |
| | | Integer uid = orderPrivateCar.getUserId(); |
| | | BigDecimal orderMoney = new BigDecimal(orderPrivateCar.getOrderMoney()); |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | |
| | | if(null != query2){ |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()) |
| | | .eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){ |
| | | if(orderPrivateCar.getMileage() > (query2.getDistance() * 1000) && query2.getOrderNum().compareTo(orderNum) > 0){ |
| | | Double special = query2.getSpecial(); |
| | | if(null != special){ |
| | | orderPrivateCar.setDiscount(special); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html"); |
| | | file = new File("/data/nginx/html/files/html/ride_receipt_" + id + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + id + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/ride_receipt_" + id + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try { |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |