| | |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + orderLogistics.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | orderLogistics.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | this.insert(orderLogistics); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | userInfo.setLanguage(language); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | new Thread(() -> { |
| | | try { |
| | | String vehicleId = null; |
| | |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + orderLogistics.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + orderLogistics.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOfflinePayment(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4); |
| | | pushUtil.pushOfflinePayment(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getPayMoney()); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | long timeOutCancel = 0L; |
| | | long driverTimeOut = 0L; |
| | | if(null != orderLogistics.getEstimateArriveTime()){ |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderLogistics.getCompanyId())); |
| | | JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent()); |
| | | int driverTimeout = jsonObject.getIntValue("driverTimeout") * 60000; |
| | | timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout; |
| | | driverTimeOut = orderLogistics.getEstimateArriveTime().getTime(); |
| | | } |
| | | map.put("driverTimeOut", driverTimeOut); |
| | | map.put("timeOutCancel", timeOutCancel); |
| | | } |
| | | return maps; |
| | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande."); |
| | | } |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 11){ |
| | | if(orderLogistics.getState() > 5 && orderLogistics.getState() != 12){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale."); |
| | | } |
| | | |
| | |
| | | String audioUrl = ""; |
| | | switch (language1){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/UserCancelledOrder-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | break; |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | |
| | | if(state == 11){ |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | if(state == 12){ |
| | | OrderCancel query = orderCancelService.query(orderId, 4, null, null, 1); |
| | | map.put("cancelPayMoney", null == query ? 0 : query.getMoney()); |
| | | map.put("cancelMoney", null == query ? 0 : query.getMoney()); |
| | | } |
| | | if(Integer.valueOf(String.valueOf(map.get("state"))) != 8 && Integer.valueOf(String.valueOf(map.get("state"))) != 9){ |
| | | map.put("redPacketMoney", null); |
| | | map.put("couponMoney", null); |
| | |
| | | Integer orderNum=this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId",orderLogistics.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderLogistics.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getLogistics(); |
| | | map.put("discount", special); |
| | | orderLogistics.setDiscount(special); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | |
| | | |
| | | } |
| | | } |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(map.get("startLon").toString(), map.get("startLat").toString()); |
| | | // map.put("startCity", geocode.get("city")); |
| | | // geocode = gdMapGeocodingUtil.geocode(map.get("endLon").toString(), map.get("endLat").toString()); |
| | | // map.put("endCity", geocode.get("city")); |
| | | // GoogleMapUtil.getReverseGeocode() |
| | | |
| | | |
| | | String driverId = redisUtil.getValue("DEVICE_" + map.get("driverId")); |
| | | map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1); |
| | | map.put("orderType", orderLogistics.getType()); |
| | | if(state == 8){ |
| | | if(state == 8 || state == 9){ |
| | | map.put("receipt", "http://182.160.16.251:81/files/html/parcel_receipt_" + orderId + ".html"); |
| | | }else{ |
| | | map.put("receipt", ""); |
| | |
| | | companyId = Integer.valueOf(String.valueOf(map.get("companyId"))); |
| | | } |
| | | map.put("timeOutCancel", 0); |
| | | map.put("driverTimeOut", 0); |
| | | if(null != orderLogistics.getEstimateArriveTime()){ |
| | | CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", companyId)); |
| | | JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent()); |
| | | int driverTimeout = jsonObject.getIntValue("driverTimeout"); |
| | | long timeOutCancel = orderLogistics.getEstimateArriveTime().getTime() + driverTimeout; |
| | | map.put("timeOutCancel", timeOutCancel); |
| | | map.put("driverTimeOut", orderLogistics.getEstimateArriveTime().getTime()); |
| | | } |
| | | return map; |
| | | } |
| | |
| | | if(null == orderLogistics){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,订单信息有误" : language == 2 ? "Failed to cancel order, order-information error." : "Échec de l’annulation de la commande, erreur d’information de commande.", ""); |
| | | } |
| | | if(orderLogistics.getState() != 13){ |
| | | if(orderLogistics.getState() != 12){ |
| | | return ResultUtil.error(language == 1 ? "取消订单失败,不合法的操作" : language == 2 ? "Failed to cancel order, illegal operation." : "Échec de l’annulation de la commande, opération illégale.", ""); |
| | | } |
| | | OrderCancel orderCancel = null; |
| | |
| | | orderCancel = orderCancelService.selectById(cancleId); |
| | | } |
| | | |
| | | Double amount = queryCancleAmount(id, language).getData().getAmount(); |
| | | Double amount = orderCancel.getMoney(); |
| | | if(0 < amount){ |
| | | if(payType == 1){//手机支付 |
| | | orderCancel.setPayType(1); |
| | |
| | | String audioUrl = ""; |
| | | switch (language1){ |
| | | case 1: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-CN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3"; |
| | | break; |
| | | case 2: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-EN.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3"; |
| | | break; |
| | | case 3: |
| | | audioUrl = "http://182.160.16.251:81/files/audio/ChangeAddress-FR.mp3"; |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3"; |
| | | break; |
| | | } |
| | | pushUtil.pushModifyAddress(2, orderLogistics.getDriverId(), orderId, 4, 1, audioUrl); |