From 6a90f2d1feaf583c211d5f9fe95dff7f7c748ed3 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期五, 06 九月 2024 17:42:20 +0800 Subject: [PATCH] Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/IgoTravel into 2.0 --- UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-) diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java index e791822..9294048 100644 --- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java +++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/controller/OrderLogisticsController.java @@ -119,9 +119,10 @@ @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(); @@ -317,8 +318,12 @@ @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"); @@ -340,21 +345,22 @@ 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(); @@ -420,7 +426,7 @@ 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); } -- Gitblit v1.7.1