Pu Zhibing
昨天 ddf438536267b9c9bb77369cdccce4e67206842a
UserGOPOSTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java
@@ -74,6 +74,7 @@
        map.put("audioUrl", audioUrl);
        map.put("from", from);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -113,6 +114,7 @@
        map.put("orderId", orderId);
        map.put("orderType", orderType);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -148,6 +150,7 @@
        map.put("orderId", orderId);
        map.put("orderType", orderType);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -186,6 +189,7 @@
        map.put("status", status);
        map.put("audioUrl", audioUrl);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -352,17 +356,20 @@
        }
        msg.put("data", map);
        JSONObject jsonObject = pushMap.get(orderId + "_" + orderType);
        Integer uid = jsonObject.getInteger("id");
        Integer type = jsonObject.getInteger("type");
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
        // 以表单的方式提交
        headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
        //将请求头部和参数合成一个请求
        JSONObject jsonObject = pushMap.get(orderId + "_" + orderType);
        MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
        params.add("msg", msg.toJSONString());
        params.add("id", jsonObject.getString("id"));
        params.add("type", jsonObject.getString("type"));
        params.add("id", uid.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);
@@ -383,6 +390,7 @@
        msg.put("msg", "SUCCESS");
        msg.put("method", "OFFLINE");
        msg.put("data", new Object());
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + id, msg.toJSONString(), 30);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -420,6 +428,7 @@
        map.put("orderType", orderType);
        map.put("state", state);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -470,6 +479,7 @@
        map.put("money", money);
        map.put("audioUrl", audioUrl);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        //调用推送
        HttpHeaders headers = new HttpHeaders();
@@ -511,6 +521,7 @@
        map.put("status", status);
        map.put("audioUrl", audioUrl);
        jsonObject.put("data", map);
        redisUtil.setStrValue( (type == 1 ? "USER_ORDER_MESSAGE:" : "DRIVER_ORDER_MESSAGE") + ":" + uid, jsonObject.toJSONString(), 30);
        
        //调用推送
        HttpHeaders headers = new HttpHeaders();