Pu Zhibing
2024-10-10 19d2b6427ebed89895b402d5e61ab78f4687b550
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -426,14 +426,21 @@
            new Timer().schedule(new TimerTask() {
                @Override
                public void run() {
                    Process process = null;
                    try {
                        process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                    if (process != null) {
                        process.destroy();
                        // 使用Runtime执行命令
                        Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
                        // 读取命令的输出
                        BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                        String line;
                        while ((line = reader.readLine()) != null) {
                            System.out.println(line);
                        }
                        // 等待命令执行完成
                        process.waitFor();
                        // 关闭流
                        reader.close();
                    } catch (IOException | InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }, 30000);
@@ -543,14 +550,21 @@
                        new Timer().schedule(new TimerTask() {
                            @Override
                            public void run() {
                                Process process = null;
                                try {
                                    process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                                } catch (IOException e) {
                                    throw new RuntimeException(e);
                                }
                                if (process != null) {
                                    process.destroy();
                                    // 使用Runtime执行命令
                                    Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
                                    // 读取命令的输出
                                    BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                                    String line;
                                    while ((line = reader.readLine()) != null) {
                                        System.out.println(line);
                                    }
                                    // 等待命令执行完成
                                    process.waitFor();
                                    // 关闭流
                                    reader.close();
                                } catch (IOException | InterruptedException e) {
                                    e.printStackTrace();
                                }
                            }
                        }, 30000);
@@ -653,7 +667,7 @@
        BaseWarpper baseWarpper = new BaseWarpper();
        double amount = 0;
        CancleOrder query = cancleOrderService.query(orderPrivateCar.getCompanyId());
        if(null == query || null == orderPrivateCar.getDriverId()){
        if(null == query || null == orderPrivateCar.getDriverId() || orderPrivateCar.getState() == 11){
            baseWarpper.setAmount(amount);
            return ResultUtil.success(baseWarpper);
        }
@@ -808,23 +822,23 @@
                    switch (language1){
                        case 1:
                            if(orderPrivateCar.getState() == 6){
                                audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-CN.mp3";
                                audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-CN.mp3";
                            }else{
                                audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3";
                                audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-CN.mp3";
                            }
                            break;
                        case 2:
                            if(orderPrivateCar.getState() == 6){
                                audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-EN.mp3";
                                audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-EN.mp3";
                            }else{
                                audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3";
                                audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-EN.mp3";
                            }
                            break;
                        case 3:
                            if(orderPrivateCar.getState() == 6){
                                audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-FR.mp3";
                                audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-FR.mp3";
                            }else{
                                audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3";
                                audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-FR.mp3";
                            }
                            break;
                    }
@@ -899,8 +913,8 @@
                checkoutRequest.setRequestDescription("Cancel a trip");
                checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi");
                checkoutRequest.setPendingRedirectUrl("");
                checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
                checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
                checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
                checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
                resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
                if(resultUtil.getCode()==200){
                    paymentRecordService.saveData(1, null, null, id, 1, 1, amount, null, 1);//添加预支付数据
@@ -924,8 +938,8 @@
                checkoutRequest.setRequestDescription("Cancel a trip");
                checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi");
                checkoutRequest.setPendingRedirectUrl("");
                checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
                checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
                checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
                checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
                resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
                if(resultUtil.getCode()==200){
                    paymentRecordService.saveData(1, null, null, id, 1, 2, amount, null, 1);//添加预支付数据
@@ -1072,14 +1086,21 @@
                                new Timer().schedule(new TimerTask() {
                                    @Override
                                    public void run() {
                                        Process process = null;
                                        try {
                                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                                        } catch (IOException e) {
                                            throw new RuntimeException(e);
                                        }
                                        if (process != null) {
                                            process.destroy();
                                            // 使用Runtime执行命令
                                            Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
                                            // 读取命令的输出
                                            BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                                            String line;
                                            while ((line = reader.readLine()) != null) {
                                                System.out.println(line);
                                            }
                                            // 等待命令执行完成
                                            process.waitFor();
                                            // 关闭流
                                            reader.close();
                                        } catch (IOException | InterruptedException e) {
                                            e.printStackTrace();
                                        }
                                    }
                                }, 30000);
@@ -1259,12 +1280,12 @@
                    //获取红包id
                    JSONArray jsonArray = new JSONArray();
                    for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) {
                        JSONObject jsonObject = new JSONObject();
                        jsonObject.put("id", userRedPacketRecord.getId());
                        BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount());
                        if(multiply1.compareTo(BigDecimal.ZERO) == 0){
                            break;
                        }
                        JSONObject jsonObject = new JSONObject();
                        jsonObject.put("id", userRedPacketRecord.getId());
                        BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount());
                        if(multiply1.compareTo(remainingAmount) >= 0){
                            userRedPacketRecord.setRemainingAmount(0D);
                            userRedPacketRecord.setEndTime(new Date());
@@ -1272,14 +1293,15 @@
                            multiply1 = multiply1.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN);
                            jsonObject.put("money", remainingAmount);
                            jsonArray.add(jsonObject);
                            userRedPacketRecordService.updateById(userRedPacketRecord);
                        }else if(remainingAmount.compareTo(multiply1) > 0){
                            userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
                            jsonObject.put("money", multiply1);
                            jsonArray.add(jsonObject);
                            userRedPacketRecordService.updateById(userRedPacketRecord);
                            multiply1 = BigDecimal.ZERO;
                        }
                    }
                    if(userRedPacketRecords.size() > 0){
                        userRedPacketRecordService.updateBatchById(userRedPacketRecords);
                    }
                    orderPrivateCar.setRedPacketId(jsonArray.toJSONString());
                }
@@ -1288,29 +1310,18 @@
                    orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN);
                    //获取红包id
                    JSONArray jsonArray = new JSONArray();
                    BigDecimal multiply = new BigDecimal(total);
                    for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) {
                        JSONObject jsonObject = new JSONObject();
                        jsonObject.put("id", userRedPacketRecord.getId());
                        BigDecimal remainingAmount = BigDecimal.valueOf(userRedPacketRecord.getRemainingAmount());
                        if(multiply.compareTo(BigDecimal.ZERO) == 0){
                            break;
                        }
                        if(multiply.compareTo(remainingAmount) >= 0){
                            userRedPacketRecord.setRemainingAmount(0D);
                            userRedPacketRecord.setEndTime(new Date());
                            userRedPacketRecord.setState(2);
                            multiply = multiply.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN);
                            jsonObject.put("money", remainingAmount);
                            jsonArray.add(jsonObject);
                            userRedPacketRecordService.updateById(userRedPacketRecord);
                        }else if(remainingAmount.compareTo(multiply) > 0){
                            userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
                            jsonObject.put("money", multiply);
                            jsonArray.add(jsonObject);
                            userRedPacketRecordService.updateById(userRedPacketRecord);
                            multiply = BigDecimal.ZERO;
                        }
                        jsonObject.put("money", userRedPacketRecord.getRemainingAmount());
                        jsonArray.add(jsonObject);
                        userRedPacketRecord.setRemainingAmount(0D);
                        userRedPacketRecord.setEndTime(new Date());
                        userRedPacketRecord.setState(2);
                    }
                    if(userRedPacketRecords.size() > 0){
                        userRedPacketRecordService.updateBatchById(userRedPacketRecords);
                    }
                    orderPrivateCar.setRedPacketId(jsonArray.toJSONString());
                }
@@ -1332,8 +1343,8 @@
            checkoutRequest.setRequestDescription("Travel completion payment");
            checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi");
            checkoutRequest.setPendingRedirectUrl("");
            checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
            checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
            checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
            checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
            resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
            if(resultUtil.getCode()==200){
@@ -1359,8 +1370,8 @@
            checkoutRequest.setRequestDescription("Travel completion payment");
            checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi");
            checkoutRequest.setPendingRedirectUrl("");
            checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
            checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
            checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
            checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
            resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
            if(resultUtil.getCode()==200){
@@ -1440,7 +1451,7 @@
                            if(1 == language){
                                document.getElementById("english").remove();
                                document.getElementById("french").remove();
                                document.getElementsByTag("title").get(0).text("I-GO电子收据");
                                document.getElementsByTag("title").get(0).text("打车收据");
                                Element title_chinese = document.getElementById("title_chinese");
                                title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                                Element qbj_chinese = document.getElementById("qbj_chinese");
@@ -1514,11 +1525,11 @@
                                    dispute_chinese.remove();
                                }
                                Element pdf_chinese = document.getElementById("pdf_chinese");
                                pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                Element lost_item_chinese = document.getElementById("lost_item_chinese");
                                lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                Element track_chinese = document.getElementById("track_chinese");
                                track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
                                track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
                                Element pay_time_chinese = document.getElementById("pay_time_chinese");
                                pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_chinese = document.getElementsByClass("driver_chinese");
@@ -1547,7 +1558,7 @@
                            if(2 == language){
                                document.getElementById("chinese").remove();
                                document.getElementById("french").remove();
                                document.getElementsByTag("title").get(0).text("Receipt");
                                document.getElementsByTag("title").get(0).text("Ride receipt");
                                Element title_english = document.getElementById("title_english");
                                title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
                                Element qbj_english = document.getElementById("qbj_english");
@@ -1621,11 +1632,11 @@
                                    dispute_english.remove();
                                }
                                Element pdf_english = document.getElementById("pdf_english");
                                pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                Element lost_item_english = document.getElementById("lost_item_english");
                                lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                Element track_english = document.getElementById("track_english");
                                track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
                                track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
                                Element pay_time_english = document.getElementById("pay_time_english");
                                pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_english = document.getElementsByClass("driver_english");
@@ -1654,7 +1665,7 @@
                            if(3 == language){
                                document.getElementById("chinese").remove();
                                document.getElementById("english").remove();
                                document.getElementsByTag("title").get(0).text("Reçu");
                                document.getElementsByTag("title").get(0).text("Reçu de course");
                                Element title_french = document.getElementById("title_french");
                                title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
                                Element qbj_french = document.getElementById("qbj_french");
@@ -1728,11 +1739,11 @@
                                    dispute_french.remove();
                                }
                                Element pdf_french = document.getElementById("pdf_french");
                                pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                Element lost_item_french = document.getElementById("lost_item_french");
                                lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                Element track_french = document.getElementById("track_french");
                                track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
                                track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
                                Element pay_time_french = document.getElementById("pay_time_french");
                                pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_french = document.getElementsByClass("driver_french");
@@ -1758,14 +1769,14 @@
                                Element server_tel_french = document.getElementById("server_tel_french");
                                server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : ""));
                            }
                            EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu",  document.html());
                            EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course",  document.html());
                            //开始生成pdf收据和html收据
                            File file = new File("/usr/local/nginx/html/files/html/");
                            File file = new File("/home/igotechgh/nginx/html/files/html/");
                            if(!file.exists()){
                                file.mkdirs();
                            }
                            file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html");
                            file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html");
                            if(!file.exists()){
                                file.createNewFile();
                            }
@@ -1774,27 +1785,27 @@
                            fileWriter.flush();
                            fileWriter.close();
                            File file1 = new File("/usr/local/nginx/html/files/pdf/");
                            File file1 = new File("/home/igotechgh/nginx/html/files/pdf/");
                            if(!file1.exists()){
                                file1.mkdirs();
                            }
                            file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
                            file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
                            if(!file1.exists()){
                                file1.createNewFile();
                            }
                            try {
                                FileOutputStream fileOutputStream = new FileOutputStream(file1);
                                HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
                                HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
                            }catch (Exception e){
                                e.printStackTrace();
                                System.out.println("html转pdf异常");
                            }
                            String link ="http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html";
                            String link ="https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html";
                            TEmail tEmail = new TEmail();
                            tEmail.setLink(link);
                            tEmail.setUserId(uid);
                            tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu");
                            tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course");
                            tEmail.setType(1);
                            tEmail.setOrderId(orderId);
                            tEmail.setCreateTime(new Date());
@@ -1922,6 +1933,7 @@
                    if(null != settlementAllocation){
                        JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent());
                        Double maxPrice = jsonObject.getDouble("maxPrice");
                        Integer type1 = jsonObject.getInteger("type");
                        if(null != maxPrice){
                            List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driver.getId())
                                    .isNull("settlementRecordId").last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(createTime, '%Y-%m-%d')"));
@@ -1932,12 +1944,12 @@
                            //日结算
                            if(maxPrice.compareTo(total.doubleValue()) <= 0){
                                SettlementRecord settlementRecord = settlementRecordService.selectOne(new EntityWrapper<SettlementRecord>().eq("driverId", orderPrivateCar.getDriverId())
                                        .eq("type", 1).eq("paymentStatus", 1).last(" and day = DATE_FORMAT(now(), '%Y-%m-%d')"));
                                        .eq("type", type1).eq("paymentStatus", 1).last(" and day = DATE_FORMAT(now(), '%Y-%m-%d')"));
                                if(null == settlementRecord){
                                    settlementRecord = new SettlementRecord();
                                    settlementRecord.setDay(new Date());
                                    settlementRecord.setDriverId(orderPrivateCar.getDriverId());
                                    settlementRecord.setType(1);
                                    settlementRecord.setType(type1);
                                    settlementRecord.setPaymentStatus(1);
                                    settlementRecord.setPayMoney(total.doubleValue());
                                    settlementRecord.setInsertTime(new Date());
@@ -1949,6 +1961,37 @@
                                for (SettlementDetail detail : settlementDetailList) {
                                    detail.setSettlementRecordId(settlementRecord.getId());
                                    settlementDetailService.updateById(detail);
                                }
                                //强制司机下班
                                DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>()
                                        .eq("driverId", orderPrivateCar.getDriverId()).eq("state", 1));
                                if(null != driverWork){
                                    driverWork.setEndTime(new Date());
                                    driverWork.setState(2);
                                    driverWorkService.updateById(driverWork);
                                    driver.setState(1);
                                    driverService.updateById(driver);
                                    Car car = carService.selectById(driver.getCarId());
                                    if(!org.apache.shiro.util.StringUtils.hasLength(car.getVehicleId())){
                                        car.setVehicleId(UUIDUtil.getRandomCode());
                                        carService.updateById(car);
                                    }
                                    //司机下班,修改谷歌上的车辆信息
                                    new Thread(()->{
                                        try {
                                            CarModel carModel = carModelMapper.selectById(car.getCarModelId());
                                            String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
                                            if(ToolUtil.isEmpty(vehicles)){
                                                fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                                                fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                                            }else{
                                                fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
                                            }
                                        }catch (Exception e){
                                            e.printStackTrace();
                                        }
                                    }).start();
                                }
                            }
                        }
@@ -1976,7 +2019,7 @@
                            if(1 == language){
                                document.getElementById("english").remove();
                                document.getElementById("french").remove();
                                document.getElementsByTag("title").get(0).text("I-GO电子收据");
                                document.getElementsByTag("title").get(0).text("打车收据");
                                Element title_chinese = document.getElementById("title_chinese");
                                title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                                Element qbj_chinese = document.getElementById("qbj_chinese");
@@ -2050,11 +2093,11 @@
                                    dispute_chinese.remove();
                                }
                                Element pdf_chinese = document.getElementById("pdf_chinese");
                                pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                Element lost_item_chinese = document.getElementById("lost_item_chinese");
                                lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                Element track_chinese = document.getElementById("track_chinese");
                                track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
                                track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
                                Element pay_time_chinese = document.getElementById("pay_time_chinese");
                                pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_chinese = document.getElementsByClass("driver_chinese");
@@ -2083,7 +2126,7 @@
                            if(2 == language){
                                document.getElementById("chinese").remove();
                                document.getElementById("french").remove();
                                document.getElementsByTag("title").get(0).text("Receipt");
                                document.getElementsByTag("title").get(0).text("Ride receipt");
                                Element title_english = document.getElementById("title_english");
                                title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
                                Element qbj_english = document.getElementById("qbj_english");
@@ -2157,11 +2200,11 @@
                                    dispute_english.remove();
                                }
                                Element pdf_english = document.getElementById("pdf_english");
                                pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                Element lost_item_english = document.getElementById("lost_item_english");
                                lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                Element track_english = document.getElementById("track_english");
                                track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
                                track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
                                Element pay_time_english = document.getElementById("pay_time_english");
                                pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_english = document.getElementsByClass("driver_english");
@@ -2190,7 +2233,7 @@
                            if(3 == language){
                                document.getElementById("chinese").remove();
                                document.getElementById("english").remove();
                                document.getElementsByTag("title").get(0).text("Reçu");
                                document.getElementsByTag("title").get(0).text("Reçu de course");
                                Element title_french = document.getElementById("title_french");
                                title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
                                Element qbj_french = document.getElementById("qbj_french");
@@ -2264,11 +2307,11 @@
                                    dispute_french.remove();
                                }
                                Element pdf_french = document.getElementById("pdf_french");
                                pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
                                Element lost_item_french = document.getElementById("lost_item_french");
                                lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
                                Element track_french = document.getElementById("track_french");
                                track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
                                track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
                                Element pay_time_french = document.getElementById("pay_time_french");
                                pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_french = document.getElementsByClass("driver_french");
@@ -2295,14 +2338,14 @@
                                server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : ""));
                            }
                            EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu",  document.html());
                            EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course",  document.html());
                            //开始生成pdf收据和html收据
                            File file = new File("/usr/local/nginx/html/files/html/");
                            File file = new File("/home/igotechgh/nginx/html/files/html/");
                            if(!file.exists()){
                                file.mkdirs();
                            }
                            file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html");
                            file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html");
                            if(!file.exists()){
                                file.createNewFile();
                            }
@@ -2311,26 +2354,26 @@
                            fileWriter.flush();
                            fileWriter.close();
                            File file1 = new File("/usr/local/nginx/html/files/pdf/");
                            File file1 = new File("/home/igotechgh/nginx/html/files/pdf/");
                            if(!file1.exists()){
                                file1.mkdirs();
                            }
                            file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
                            file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
                            if(!file1.exists()){
                                file1.createNewFile();
                            }
                            try {
                                FileOutputStream fileOutputStream = new FileOutputStream(file1);
                                HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
                                HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
                            }catch (Exception e){
                                e.printStackTrace();
                                System.out.println("html转pdf异常");
                            }
                            String link ="http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html";
                            String link ="https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html";
                            TEmail tEmail = new TEmail();
                            tEmail.setLink(link);
                            tEmail.setUserId(uid);
                            tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu");
                            tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course");
                            tEmail.setType(1);
                            tEmail.setOrderId(orderId);
                            tEmail.setCreateTime(new Date());
@@ -2360,7 +2403,50 @@
                public void run() {
                    pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
                    pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
                    pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getPayMoney());
                    Integer language1 = driver.getLanguage();
                    String text = "";
                    switch (language1){
                        case 1:
                            text = "客户已选择支付现金,因此您必须收款。确定您已收到此订单费用:现金GHS " + orderPrivateCar.getPayMoney();
                            break;
                        case 2:
                            text = "The client chose to pay in cash, so you must collect the payment.Confirm if you received the charge for this order: Cash GHS " + orderPrivateCar.getPayMoney();
                            break;
                        case 3:
                            text = "Le client a choisi de payer en espèces, vous devez donc encaisser le paiement.Confirmez si vous avez reçu les frais pour cette commande : Espèces GHS " + orderPrivateCar.getPayMoney();
                            break;
                    }
                    String audioUrl = "";
                    String fileName = "offlinePayment" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3";
                    try {
                        audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName);
                    } catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                    //定时任务删除语音文件
                    new Timer().schedule(new TimerTask() {
                        @Override
                        public void run() {
                            try {
                                // 使用Runtime执行命令
                                Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
                                // 读取命令的输出
                                BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
                                String line;
                                while ((line = reader.readLine()) != null) {
                                    System.out.println(line);
                                }
                                // 等待命令执行完成
                                process.waitFor();
                                // 关闭流
                                reader.close();
                            } catch (IOException | InterruptedException e) {
                                e.printStackTrace();
                            }
                        }
                    }, 30000);
                    pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getPayMoney(), audioUrl);
                }
            }).start();
@@ -2481,11 +2567,11 @@
                EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus",  document.html());
                //开始生成pdf收据和html收据
                File file = new File("/usr/local/nginx/html/files/html/");
                File file = new File("/home/igotechgh/nginx/html/files/html/");
                if(!file.exists()){
                    file.mkdirs();
                }
                file = new File("/usr/local/nginx/html/files/html/redpacket_" + orderId + ".html");
                file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html");
                if(!file.exists()){
                    file.createNewFile();
                }
@@ -2494,7 +2580,7 @@
                fileWriter.flush();
                fileWriter.close();
                String link ="http://182.160.16.251:81/files/html/redpacket_" + orderId + ".html";
                String link ="https://igo.i-go.group/files/html/redpacket_" + orderId + ".html";
                TEmail tEmail = new TEmail();
                tEmail.setLink(link);
                tEmail.setUserId(userInfo.getId());
@@ -2670,7 +2756,7 @@
                            if(1 == language){
                                document.getElementById("english").remove();
                                document.getElementById("french").remove();
                                document.getElementsByTag("title").get(0).text("I-GO电子收据");
                                document.getElementsByTag("title").get(0).text("打车收据");
                                Element title_chinese = document.getElementById("title_chinese");
                                title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                                Element qbj_chinese = document.getElementById("qbj_chinese");
@@ -2744,11 +2830,11 @@
                                    dispute_chinese.remove();
                                }
                                Element pdf_chinese = document.getElementById("pdf_chinese");
                                pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
                                pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
                                Element lost_item_chinese = document.getElementById("lost_item_chinese");
                                lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
                                lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
                                Element track_chinese = document.getElementById("track_chinese");
                                track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id);
                                track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id);
                                Element pay_time_chinese = document.getElementById("pay_time_chinese");
                                pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_chinese = document.getElementsByClass("driver_chinese");
@@ -2777,7 +2863,7 @@
                            if(2 == language){
                                document.getElementById("chinese").remove();
                                document.getElementById("french").remove();
                                document.getElementsByTag("title").get(0).text("Receipt");
                                document.getElementsByTag("title").get(0).text("Ride receipt");
                                Element title_english = document.getElementById("title_english");
                                title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
                                Element qbj_english = document.getElementById("qbj_english");
@@ -2851,11 +2937,11 @@
                                    dispute_english.remove();
                                }
                                Element pdf_english = document.getElementById("pdf_english");
                                pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
                                pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
                                Element lost_item_english = document.getElementById("lost_item_english");
                                lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
                                lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
                                Element track_english = document.getElementById("track_english");
                                track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id);
                                track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id);
                                Element pay_time_english = document.getElementById("pay_time_english");
                                pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_english = document.getElementsByClass("driver_english");
@@ -2884,7 +2970,7 @@
                            if(3 == language){
                                document.getElementById("chinese").remove();
                                document.getElementById("english").remove();
                                document.getElementsByTag("title").get(0).text("Reçu");
                                document.getElementsByTag("title").get(0).text("Reçu de course");
                                Element title_french = document.getElementById("title_french");
                                title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
                                Element qbj_french = document.getElementById("qbj_french");
@@ -2958,11 +3044,11 @@
                                    dispute_french.remove();
                                }
                                Element pdf_french = document.getElementById("pdf_french");
                                pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
                                pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
                                Element lost_item_french = document.getElementById("lost_item_french");
                                lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
                                lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
                                Element track_french = document.getElementById("track_french");
                                track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id);
                                track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id);
                                Element pay_time_french = document.getElementById("pay_time_french");
                                pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
                                Elements driver_french = document.getElementsByClass("driver_french");
@@ -2989,14 +3075,14 @@
                                server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : ""));
                            }
                            EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu",  document.html());
                            EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course",  document.html());
                            //开始生成pdf收据和html收据
                            File file = new File("/usr/local/nginx/html/files/html/");
                            File file = new File("/home/igotechgh/nginx/html/files/html/");
                            if(!file.exists()){
                                file.mkdirs();
                            }
                            file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html");
                            file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html");
                            if(!file.exists()){
                                file.createNewFile();
                            }
@@ -3005,27 +3091,27 @@
                            fileWriter.flush();
                            fileWriter.close();
                            File file1 = new File("/usr/local/nginx/html/files/pdf/");
                            File file1 = new File("/home/igotechgh/nginx/html/files/pdf/");
                            if(!file1.exists()){
                                file1.mkdirs();
                            }
                            file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + id + ".pdf");
                            file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + id + ".pdf");
                            if(!file1.exists()){
                                file1.createNewFile();
                            }
                            try {
                                FileOutputStream fileOutputStream = new FileOutputStream(file1);
                                HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream);
                                HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream);
                            }catch (Exception e){
                                e.printStackTrace();
                                System.out.println("html转pdf异常");
                            }
                            String link ="http://182.160.16.251:81/files/html/ride_receipt_" + id + ".html";
                            String link ="https://igo.i-go.group/files/html/ride_receipt_" + id + ".html";
                            TEmail tEmail = new TEmail();
                            tEmail.setLink(link);
                            tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu");
                            tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course");
                            tEmail.setUserId(userInfo.getId());
                            tEmail.setType(1);
                            tEmail.setOrderId(id);
@@ -3089,7 +3175,7 @@
                map.put("state", map.get("oldState"));
            }
            if(state == 8 || state == 9){
                map.put("receipt", "http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html");
                map.put("receipt", "https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html");
            }else{
                map.put("receipt", "");
            }
@@ -3184,7 +3270,7 @@
        map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1);
        map.put("orderType", 1);
        if(state == 8 || state == 9){
            map.put("receipt", "http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html");
            map.put("receipt", "https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html");
        }else{
            map.put("receipt", "");
        }
@@ -3407,13 +3493,13 @@
            String audioUrl = "";
            switch (language1){
                case 1:
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3";
                    audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-CN.mp3";
                    break;
                case 2:
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3";
                    audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-EN.mp3";
                    break;
                case 3:
                    audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3";
                    audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-FR.mp3";
                    break;
            }
            pushUtil.pushModifyAddress(2, orderPrivateCar.getDriverId(), orderId, 1, 1, audioUrl);