| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStreamReader; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | String text = ""; |
| | | switch (language){ |
| | | case 1: |
| | | text = "您的包裹订单申请补差价 GSH " + difference + " 已被用户拒绝,请重新与用户协商"; |
| | | text = "您的包裹订单申请补差价 GHS " + difference + " 已被用户拒绝,请重新与用户协商"; |
| | | break; |
| | | case 2: |
| | | text = "Your delivery order,Request difference GSH " + difference + " was rejected, please renegotiate with the subscriber"; |
| | | text = "Your delivery order,Request difference GHS " + difference + " was rejected, please renegotiate with the subscriber"; |
| | | break; |
| | | case 3: |
| | | text = "Votre commande de livraison,Demande de différence GSH " + difference + " a été rejeté, veuillez renégocier avec l’abonné"; |
| | | text = "Votre commande de livraison,Demande de différence GHS " + difference + " a été rejeté, veuillez renégocier avec l’abonné"; |
| | | break; |
| | | |
| | | } |
| | |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | // 使用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); |
| | | } |
| | | if (process != null) { |
| | | process.destroy(); |
| | | // 等待命令执行完成 |
| | | process.waitFor(); |
| | | // 关闭流 |
| | | reader.close(); |
| | | } catch (IOException | InterruptedException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }, 30000); |