| | |
| | | if (i == 18 && (state == 1 || state==11)) { |
| | | System.err.println("结束改派退单-------------修改订单为取消状态"); |
| | | pushUtil.pushEndPush(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1); |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, 10); |
| | | pushUtil.pushReassignEndCancel(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, 10); |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | orderIds.remove(orderPrivateCar.getId()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 改派推单结束 |
| | | * @param type |
| | | * @param uid |
| | | * @param orderId |
| | | * @param orderType |
| | | * @param state |
| | | */ |
| | | public void pushReassignEndCancel(Integer type, Integer uid, Integer orderId, Integer orderType, Integer state) { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | | jsonObject.put("method", "REASSIGN_END_CANCEL"); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("state", state); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | | HttpRequest post = HttpUtil.createPost(socket_uri + "/netty/sendMsgToClient"); |
| | | post.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED_VALUE); |
| | | //将请求头部和参数合成一个请求 |
| | | Map<String, Object> params = new HashMap<>(); |
| | | params.put("msg", jsonObject.toJSONString()); |
| | | params.put("id", uid); |
| | | params.put("type", type); |
| | | params.put("bussinessType", "dache"); |
| | | post.form(params); |
| | | HttpResponse execute = post.execute(); |
| | | if (200 != execute.getStatus()) { |
| | | System.err.println("推送异常"); |
| | | } else { |
| | | JSONObject jsonObject1 = JSON.parseObject(execute.body(), JSONObject.class); |
| | | if (jsonObject1.getIntValue("code") != 200) { |
| | | System.err.println(jsonObject1.getString("msg")); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 推送订单状态 |
| | | * |