From 736ab0090700c75af37b8a3456b01609e4e2d329 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期三, 17 七月 2024 11:09:40 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/2.0' into 2.0 --- UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java | 152 +++++++++++++++++++++++++++++++++++++------------- 1 files changed, 113 insertions(+), 39 deletions(-) diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java index e9c2135..419d55f 100644 --- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java +++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushUtil.java @@ -89,41 +89,7 @@ System.err.println(jsonObject1.getString("msg")); } } - - -// /** -// * 线下支付数据推送 -// * @param type -// * @param uid -// * @param orderId -// * @param orderType -// */ -// public void pushOfflinePayment(Integer type, Integer uid, Integer orderId, Integer orderType){ -// JSONObject jsonObject = new JSONObject(); -// jsonObject.put("code", 200); -// jsonObject.put("msg", "SUCCESS"); -// jsonObject.put("method", "OFFLINE_PAYMENT"); -// Map<String, Object> map = new HashMap<>(); -// map.put("orderId", orderId); -// map.put("orderType", orderType); -// jsonObject.put("data", map); -// -// //调用推送 -// HttpHeaders headers = new HttpHeaders(); -// // 以表单的方式提交 -// headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); -// //将请求头部和参数合成一个请求 -// MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); -// params.add("msg", jsonObject.toJSONString()); -// params.add("id", String.valueOf(uid)); -// params.add("type", String.valueOf(type)); -// 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")); -// } -// } + @@ -162,8 +128,78 @@ System.err.println(jsonObject1.getString("msg")); } } - - + + + /** + * 司机超时提醒 + * @param type + * @param uid + * @param orderId + * @param orderType + */ + public void pushDriverTimeOut(Integer type, Integer uid, Integer orderId, Integer orderType){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", 200); + jsonObject.put("msg", "SUCCESS"); + jsonObject.put("method", "DRIVER_TIME_OUT"); + Map<String, Object> map = new HashMap<>(); + map.put("orderId", orderId); + map.put("orderType", orderType); + jsonObject.put("data", map); + + //调用推送 + HttpHeaders headers = new HttpHeaders(); + // 以表单的方式提交 + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + //将请求头部和参数合成一个请求 + MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); + params.add("msg", jsonObject.toJSONString()); + params.add("id", String.valueOf(uid)); + params.add("type", String.valueOf(type)); + 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")); + } + } + + + /** + * 修改目的地推送通知 + * @param type + * @param uid + * @param orderId + * @param orderType + * @param status 1=申请,2=同意,3=拒绝 + */ + public void pushModifyAddress(Integer type, Integer uid, Integer orderId, Integer orderType, Integer status){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", 200); + jsonObject.put("msg", "SUCCESS"); + jsonObject.put("method", "MODIFY_ADDRESS"); + Map<String, Object> map = new HashMap<>(); + map.put("orderId", orderId); + map.put("orderType", orderType); + map.put("status", status); + jsonObject.put("data", map); + + //调用推送 + HttpHeaders headers = new HttpHeaders(); + // 以表单的方式提交 + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + //将请求头部和参数合成一个请求 + MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); + params.add("msg", jsonObject.toJSONString()); + params.add("id", String.valueOf(uid)); + params.add("type", String.valueOf(type)); + 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")); + } + } /** @@ -448,6 +484,44 @@ System.err.println(jsonObject1.getString("msg")); } } - - + + + + /** + * 小件物流差价支付的推送 + * @param type + * @param uid + * @param orderId + * @param orderType + * @param money + * @param status 1=申请,2=同意,3=拒绝 + */ + public void pushPayDifference(Integer type, Integer uid, Integer orderId, Integer orderType, Double money, Integer status){ + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", 200); + jsonObject.put("msg", "SUCCESS"); + jsonObject.put("method", "DIFFERENCE"); + Map<String, Object> map = new HashMap<>(); + map.put("orderId", orderId); + map.put("orderType", orderType); + map.put("money", money); + map.put("status", status); + jsonObject.put("data", map); + + //调用推送 + HttpHeaders headers = new HttpHeaders(); + // 以表单的方式提交 + headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + //将请求头部和参数合成一个请求 + MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); + params.add("msg", jsonObject.toJSONString()); + params.add("id", String.valueOf(uid)); + params.add("type", String.valueOf(type)); + 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")); + } + } } -- Gitblit v1.7.1