| | |
| | | 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() { |
| | |
| | | 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); |
| | | } |
| | |
| | | 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() { |
| | |
| | | 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); |
| | | } |