| | |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public void pushSystemMessage(Integer type, Integer uid, String message){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", message); |
| | | jsonObject.put("method", "SYSTEM_MESSAGE"); |
| | | |
| | | //调用推送 |
| | | 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")); |
| | | } |
| | | } |
| | | |
| | | public void pushOrderStateVedio(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state, Integer time,String url){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | driverId = orderTaxi.getDriverId(); |
| | | startLonLat = orderTaxi.getStartLon() + "," + orderTaxi.getStartLat(); |
| | | startLonLat = orderTaxi.getStartLat() + "," + orderTaxi.getStartLon(); |
| | | state = orderTaxi.getState(); |
| | | oldState = orderTaxi.getOldState(); |
| | | startServiceTime = null != orderTaxi.getStartServiceTime() ? orderTaxi.getStartServiceTime().getTime() : null; |
| | | servedMileage = orderTaxi.getMileage(); |
| | | endLonLat = orderTaxi.getEndLon() + "," + orderTaxi.getEndLat(); |
| | | endLonLat = orderTaxi.getEndLat() + "," + orderTaxi.getEndLon(); |
| | | break; |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | |
| | | if(null == value || "".equals(value)){ |
| | | System.err.println("司机没有上传位置信息"); |
| | | } |
| | | // todo 注意 因更换地图为百度 两者lon和lat位置互换了 |
| | | String[] split = value.split(","); |
| | | value = split[1] + "," + split[0]; |
| | | Map<String, String> distance = gdMapElectricFenceUtil.getDistance(value, startLonLat, 1); |
| | | String d = "0"; |
| | | String t = "0"; |