| | |
| | | |
| | | |
| | | /** |
| | | * 获取正在进行中的订单 |
| | | * 获取正在sudo rm -rf的订单 |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | }) |
| | | public ResultUtil queryTrack_(Integer orderId, Integer orderType){ |
| | | try { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("lon", orderPrivateCar.getStartLon()); |
| | | map.put("lat", orderPrivateCar.getStartLat()); |
| | | list.add(map); |
| | | map = new HashMap<>(); |
| | | map.put("lon", orderPrivateCar.getEndLon()); |
| | | map.put("lat", orderPrivateCar.getEndLat()); |
| | | list.add(map); |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("lon", orderLogistics.getStartLon()); |
| | | map1.put("lat", orderLogistics.getStartLat()); |
| | | list.add(map1); |
| | | map1 = new HashMap<>(); |
| | | map1.put("lon", orderLogistics.getEndLon()); |
| | | map1.put("lat", orderLogistics.getEndLat()); |
| | | list.add(map1); |
| | | break; |
| | | } |
| | | List<Map<String, Object>> list = orderPositionService.queryTrack(orderId, orderType); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String format = String.format("uid=%s&id=%s&orderType=%s&payType=%s&type=%s", uid, id, orderType, payType, type); |
| | | String key = MD5Util.encrypt(format); |
| | | String value = redisUtil.getValue(key); |
| | | if(ToolUtil.isNotEmpty(value) && (System.currentTimeMillis() - Long.valueOf(value)) <= 1000){ |
| | | return ResultUtil.error(language == 1 ? "请勿重复操作" : language == 2 ? "Don't repeat the operation" : "Ne répétez pas l’opération"); |
| | | } |
| | | redisUtil.setStrValue(key, System.currentTimeMillis() + "", 5); |
| | | switch (orderType){ |
| | | case 1: |
| | | return orderPrivateCarService.cancleOrderPrivateCar(id, payType, bankCardId, cancleId, type, language); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | String format = String.format("payType=%s&orderId=%s&orderType=%s", payType, orderId, orderType); |
| | | String format = String.format("uid=%s&payType=%s&orderId=%s&orderType=%s", uid, payType, orderId, orderType); |
| | | String key = MD5Util.encrypt(format); |
| | | String value = redisUtil.getValue(key); |
| | | if(ToolUtil.isNotEmpty(value) && (System.currentTimeMillis() - Long.valueOf(value)) >= 1000){ |
| | | if(ToolUtil.isNotEmpty(value) && (System.currentTimeMillis() - Long.valueOf(value)) <= 1000){ |
| | | return ResultUtil.error(language == 1 ? "请勿重复操作" : language == 2 ? "Don't repeat the operation" : "Ne répétez pas l’opération"); |
| | | } |
| | | redisUtil.setStrValue(key, System.currentTimeMillis() + "", 5); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/base/wxCancelOrderTaxi") |
| | | public CallbackResponse wxCancelOrderTaxi(@RequestBody CallbackRequest callbackRequest){ |
| | | log.info("取消订单支付回调结果:{}", JSON.toJSONString(callbackRequest)); |
| | | CallbackResponse callbackResponse = new CallbackResponse(); |
| | | try { |
| | | /** |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("取消订单支付回调处理结束:{}", JSON.toJSONString(callbackResponse)); |
| | | return callbackResponse; |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | @PostMapping("/base/wxPayOrderTaxi") |
| | | public CallbackResponse wxPayOrderTaxi(@RequestBody CallbackRequest callbackRequest){ |
| | | log.info("订单完成支付回调结果:{}", JSON.toJSONString(callbackRequest)); |
| | | CallbackResponse callbackResponse = new CallbackResponse(); |
| | | try { |
| | | /** |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | log.info("订单完成支付回调处理结束:{}", JSON.toJSONString(callbackResponse)); |
| | | return callbackResponse; |
| | | } |
| | | |