| | |
| | | @ApiImplicitParam(value = "终点经纬度(103.23265,30.2312)", name = "endLonLat", required = true, paramType = "query", dataType = "string"), |
| | | @ApiImplicitParam(value = "终点详细地址", name = "endAddress", required = true, paramType = "query", dataType = "string") |
| | | }) |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language){ |
| | | public ResultUtil queryPayMoney(Integer number, Integer type, String startLonLat, String endLonLat, String endAddress, Integer language, HttpServletRequest request){ |
| | | try { |
| | | return orderLogisticsService.queryPayMoney(number, type, startLonLat, endLonLat, endAddress, language); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | return orderLogisticsService.queryPayMoney(uid, number, type, startLonLat, endLonLat, endAddress, language); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language){ |
| | | public ResultUtil<OrderTimeInfo> queryTimeInfo(Integer orderId, Integer language, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | if(null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | OrderTimeInfo orderTimeInfo = new OrderTimeInfo(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | |
| | | usedTime = language == 1 ? h + "小时" + m + "分钟" : language == 2 ? h + "-hour" + m + "-minute(s)" : h + "-hour" + m + "-minute"; |
| | | } |
| | | orderTimeInfo.setUsedTime(usedTime); |
| | | String tripId = redisUtil.getValue("trip" + uid); |
| | | if(null != orderLogistics.getEndServiceTime()){ |
| | | orderTimeInfo.setEndServiceTime(DateUtil.conversionFormat(language, sdf.format(orderLogistics.getEndServiceTime()))); |
| | | }else{ |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long duration = distancematrix.getDuration(); |
| | | orderTimeInfo.setEndServiceTime(DateUtil.conversionFormat(language, sdf.format(new Date(System.currentTimeMillis() + duration * 1000)))); |
| | | } |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long distance = distancematrix.getDistance(); |
| | | orderTimeInfo.setAllMileage(Double.valueOf(distance / 1000)); |
| | | orderTimeInfo.setMileage(orderLogistics.getMileage() / 1000); |
| | | String value = redisUtil.getValue("DRIVER" + orderLogistics.getDriverId()); |
| | | if(ToolUtil.isNotEmpty(value)){ |
| | | String[] split = value.split(","); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon()); |
| | | distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(split[1]), Double.valueOf(split[0]), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | //分钟 |
| | | Long duration = distancematrix.getDuration() / 60; |
| | | h = Double.valueOf(duration / 60).intValue(); |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |