From 0001861cc63fc670646a103284b9eaefb193e91f Mon Sep 17 00:00:00 2001
From: 无关风月 <443237572@qq.com>
Date: 星期六, 10 八月 2024 17:31:48 +0800
Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0

---
 DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java |   48 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
index 187a24e..704a15a 100644
--- a/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
+++ b/DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
@@ -75,7 +75,7 @@
      * @param orderType     订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)
      * @param state         订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中)
      */
-    public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state){
+    public void pushOrderState(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state, Integer time, String audioUrl){
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("code", 200);
         jsonObject.put("msg", "SUCCESS");
@@ -84,6 +84,7 @@
         map.put("orderId", orderId);
         map.put("orderType", orderType);
         map.put("state", state);
+        map.put("audioUrl", audioUrl);
         jsonObject.put("data", map);
 
         //调用推送
@@ -145,7 +146,7 @@
      * @param orderId
      * @param orderType
      */
-    public void pushOrderReassign(Integer uid, Integer type, Integer orderId, Integer orderType){
+    public void pushOrderReassign(Integer uid, Integer type, Integer orderId, Integer orderType, String audioUrl){
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("code", 200);
         jsonObject.put("msg", "SUCCESS");
@@ -153,6 +154,7 @@
         Map<String, Object> map = new HashMap<>();
         map.put("orderId", orderId);
         map.put("orderType", orderType);
+        map.put("audioUrl", audioUrl);
         jsonObject.put("data", map);
 
         //调用推送
@@ -421,13 +423,39 @@
      * @param id
      * @param type
      */
-    public void pushOffline(Integer id, Integer type){
+    public void pushOffline(Integer id, Integer type, Object object){
         JSONObject msg = new JSONObject();
         msg.put("code", 200);
         msg.put("msg", "SUCCESS");
         msg.put("method", "OFFLINE");
-        msg.put("data", new Object());
+        msg.put("data", object);
 
+        //调用推送
+        HttpHeaders headers = new HttpHeaders();
+        // 以表单的方式提交
+        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
+        //将请求头部和参数合成一个请求
+        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
+        params.add("msg", msg.toJSONString());
+        params.add("id", id.toString());
+        params.add("type", type.toString());
+        HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
+        String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class);
+        JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class);
+        if(jsonObject1.getIntValue("code") != 200){
+            System.err.println(jsonObject1.getString("msg"));
+        }
+    }
+    
+    
+    
+    public void afterWork(Integer id, Integer type, Object object){
+        JSONObject msg = new JSONObject();
+        msg.put("code", 200);
+        msg.put("msg", "SUCCESS");
+        msg.put("method", "AFTER_WORK");
+        msg.put("data", object);
+        
         //调用推送
         HttpHeaders headers = new HttpHeaders();
         // 以表单的方式提交
@@ -580,19 +608,23 @@
      * 司机超时推送
      * @param type
      * @param uid
-     * @param orderId
-     * @param orderType
-     * @param describe
+     * @param timeOutType  超时类型(1=用户可免费取消提醒,2=预约单接单提醒,3=超时循环提醒)
+     * @param orderId  订单id
+     * @param orderType  订单类型(1=打车,4=包裹)
+     * @param describe  展示内容
+     * @param audioUrl  语音播报音频地址
      */
-    public void pushOrderTimeOut(Integer type, Integer uid, Integer orderId, Integer orderType, String describe){
+    public void pushOrderTimeOut(Integer type, Integer uid, Integer timeOutType, Integer orderId, Integer orderType, String describe, String audioUrl){
         JSONObject jsonObject = new JSONObject();
         jsonObject.put("code", 200);
         jsonObject.put("msg", "SUCCESS");
         jsonObject.put("method", "ORDER_TIME_OUT");
         Map<String, Object> map = new HashMap<>();
+        map.put("timeOutType", timeOutType);
         map.put("orderId", orderId);
         map.put("orderType", orderType);
         map.put("describe", describe);
+        map.put("audioUrl", audioUrl);
         jsonObject.put("data", map);
         
         //调用推送

--
Gitblit v1.7.1