zhibing.pu
2024-08-01 656ac293601d6da08d25e892a79604fe3edcd086
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverOnlineServiceImpl.java
@@ -241,16 +241,17 @@
                String msg = language == 1 ? "您已连续" + driverActivityOnline.getOfflineTime() + "小时未接单,系统将强制更改您的状态为:下班" :
                        language == 2 ? "You have not been accepting orders for " + driverActivityOnline.getOfflineTime() + " hour(s) System will change your state to Off-work" :
                                "Vous n’acceptez pas de commandes depuis " + driverActivityOnline.getOfflineTime() + " heure(s) Le système changera votre état en Hors travail";
                String fileName = "OffLine" + driver.getId() + ".mp3";
                String audioUrl = null;
                try {
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, "OffLine" + driver.getId() + ".mp3");
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, fileName);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                Map<String, String> map = new HashMap<>();
                map.put("msg", msg);
                map.put("audioUrl", audioUrl);
                pushUtil.pushOffline(driverOnline.getDriverId(), 2, map);
                pushUtil.afterWork(driverOnline.getDriverId(), 2, map);
                
                //定时任务删除语音文件
                new Timer().schedule(new TimerTask() {
@@ -258,7 +259,7 @@
                    public void run() {
                        Process process = null;
                        try {
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/OffLine" + driver.getId() + ".mp3");
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }
@@ -317,16 +318,17 @@
                String msg = language == 1 ? "您已连续" + driverActivityOnline.getOfflineTime() + "小时未接单,系统将强制更改您的状态为:下班" :
                        language == 2 ? "You have not been accepting orders for " + driverActivityOnline.getOfflineTime() + " hour(s) System will change your state to Off-work" :
                                "Vous n’acceptez pas de commandes depuis " + driverActivityOnline.getOfflineTime() + " heure(s) Le système changera votre état en Hors travail";
                String fileName = "OffLine" + driver.getId() + ".mp3";
                String audioUrl = null;
                try {
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, "OffLine" + driver.getId() + ".mp3");
                    audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", msg, fileName);
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
                Map<String, String> map = new HashMap<>();
                map.put("msg", msg);
                map.put("audioUrl", audioUrl);
                pushUtil.pushOffline(driverWork.getDriverId(), 2, map);
                pushUtil.afterWork(driverWork.getDriverId(), 2, map);
    
                //定时任务删除语音文件
                new Timer().schedule(new TimerTask() {
@@ -334,7 +336,7 @@
                    public void run() {
                        Process process = null;
                        try {
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/OffLine" + driver.getId() + ".mp3");
                            process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName);
                        } catch (IOException e) {
                            throw new RuntimeException(e);
                        }