| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.*; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | userInfo.setLanguage(language); |
| | | userInfoService.updateById(userInfo); |
| | | List<Map<String, Object>> list = null; |
| | | switch (type){ |
| | | case 1: |
| | |
| | | }) |
| | | public ResultUtil queryTrack_(Integer orderId, Integer orderType){ |
| | | try { |
| | | List<Map<String, Object>> list = orderPositionService.queryTrack(orderId, orderType); |
| | | 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; |
| | | } |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | Double payMoney = 0D; |
| | | Integer companyId = 1; |
| | | switch (orderType){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | payMoney = orderPrivateCar.getPayMoney(); |
| | | Double orderMoney = orderPrivateCar.getOrderMoney(); |
| | | UserActivityDiscount1 query2 = userActivityDiscount1Mapper.query(orderPrivateCar.getCompanyId()); |
| | | if(null != query2){ |
| | | Integer orderNum=orderPrivateCarService.selectCount(new EntityWrapper<OrderPrivateCar>().eq("userId", uid).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getSpecial(); |
| | | if(null != special){ |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | payMoney = v; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case 4: |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | payMoney = orderLogistics.getPayMoney(); |
| | | Double orderMoney1 = orderLogistics.getOrderMoney(); |
| | | UserActivityDiscount1 query1 = userActivityDiscount1Mapper.query(orderLogistics.getCompanyId()); |
| | | if(null != query1){ |
| | | Integer orderNum=orderLogisticsService.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).eq("activityId",query1.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query1.getDistance()*1000>orderLogistics.getMileage() && query1.getOrderNum()>orderNum){ |
| | | Double special = query1.getSpecial(); |
| | | if(null != special){ |
| | | double v = new BigDecimal(orderMoney1).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | payMoney = v; |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | Double aDouble = userRedPacketRecordService.queryRemainingAmount(uid); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("redTotal", aDouble); |
| | |
| | | map.put("deductionAmount", 0D); |
| | | return ResultUtil.success(map); |
| | | } |
| | | Double deductionAmount = new BigDecimal(payMoney).multiply(redEnvelopePaymentSettings.getDeductionRatio().divide(new BigDecimal(100))).doubleValue(); |
| | | Double deductionAmount = new BigDecimal(payMoney).multiply(redEnvelopePaymentSettings.getDeductionRatio().divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | map.put("deductionAmount", deductionAmount); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | |
| | | break; |
| | | |
| | | } |
| | | String fileName = "difference" + driver.getId() + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", text, "difference" + driver.getId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 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/difference" + driver.getId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | (select price from t_order_logistics_spread where orderLogisticsId = a.id) as differenceMoney, |
| | | cancelMidway, |
| | | tripId, |
| | | remark |
| | | remark, |
| | | companyId |
| | | from t_order_logistics as a where userId = #{uid} and isDelete = 1 order by insertTime desc limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | |
| | | h.reason as cancelReason, |
| | | h.remark as cancelRemark, |
| | | a.tripId, |
| | | a.snatchOrderTime |
| | | a.snatchOrderTime, |
| | | a.startDuration |
| | | from t_order_logistics a |
| | | left join t_driver b on (a.driverId = b.id) |
| | | left join t_car c on (a.carId = c.id) |
| | |
| | | |
| | | } |
| | | 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); |
| | |
| | | orderPrivateCar.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | this.insert(orderPrivateCar); |
| | | |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | | userInfo.setLanguage(language); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | new Thread(() -> { |
| | | try { |
| | |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderPrivateCar.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" + orderPrivateCar.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" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderPrivateCar.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" + orderPrivateCar.getDriverId() + ".mp3"); |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | |
| | | if(null == orderPrivateCar){ |
| | | 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(orderPrivateCar.getState() > 5 && orderPrivateCar.getState() != 11){ |
| | | if(orderPrivateCar.getState() > 5 && orderPrivateCar.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"; |
| | | if(orderPrivateCar.getState() == 6){ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-CN.mp3"; |
| | | }else{ |
| | | 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"; |
| | | if(orderPrivateCar.getState() == 6){ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-EN.mp3"; |
| | | }else{ |
| | | 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"; |
| | | if(orderPrivateCar.getState() == 6){ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-FR.mp3"; |
| | | }else{ |
| | | audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | } |
| | | break; |
| | | } |
| | | pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, ""); |
| | |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | String fileName = "pushOrder" + orderPrivateCar.getDriverId() + UUIDUtil.getRandomCode(5) + ".mp3"; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderPrivateCar.getDriverId() + ".mp3"); |
| | | audioUrl = TextToSpeechUtil.create(language == 1 ? "cmn-CN" : language == 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" + orderPrivateCar.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, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, ""); |
| | | pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1); |
| | | pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getPayMoney()); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | if(state == 11){ |
| | | map.put("state", map.get("oldState")); |
| | | } |
| | | if(state == 12){ |
| | | OrderCancel query = orderCancelService.query(orderId, 1, 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<OrderPrivateCar>().eq("userId",orderPrivateCar.getUserId()).eq("activityId",query2.getId()).last(" and to_days(getoffTime) = to_days(now())")); |
| | | if(query2.getDistance()*1000>orderPrivateCar.getMileage() && query2.getOrderNum()>orderNum){ |
| | | Double special = query2.getSpecial(); |
| | | map.put("discount", special); |
| | | orderPrivateCar.setDiscount(special); |
| | | Double orderMoney = orderPrivateCar.getOrderMoney(); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | |
| | | 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, orderPrivateCar.getDriverId(), orderId, 1, 1, audioUrl); |
| | |
| | | * @param orderId |
| | | * @param orderType |
| | | */ |
| | | public void pushOfflinePayment(Integer type, Integer uid, Integer orderId, Integer orderType){ |
| | | public void pushOfflinePayment(Integer type, Integer uid, Integer orderId, Integer orderType, Double money){ |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("code", 200); |
| | | jsonObject.put("msg", "SUCCESS"); |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("orderId", orderId); |
| | | map.put("orderType", orderType); |
| | | map.put("money", money); |
| | | jsonObject.put("data", map); |
| | | |
| | | //调用推送 |
| | |
| | | private Integer cancelId; |
| | | @ApiModelProperty("订单总金额") |
| | | private Double orderMoney; |
| | | @ApiModelProperty("起步里程") |
| | | private Double startMoney; |
| | | @ApiModelProperty("起步价") |
| | | private Double startMoney; |
| | | @ApiModelProperty("起步里程") |
| | | private Double startMileage; |
| | | @ApiModelProperty("里程数") |
| | | private Double mileage; |
| | |
| | | private String remark; |
| | | @ApiModelProperty("超时取消时间") |
| | | private Long timeOutCancel; |
| | | @ApiModelProperty("司机超时时间") |
| | | private Long driverTimeOut; |
| | | |
| | | private String tripId; |
| | | |
| | |
| | | this.timeOutCancel = timeOutCancel; |
| | | } |
| | | |
| | | public Long getDriverTimeOut() { |
| | | return driverTimeOut; |
| | | } |
| | | |
| | | public void setDriverTimeOut(Long driverTimeOut) { |
| | | this.driverTimeOut = driverTimeOut; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderWarpper{" + |
| | |
| | | orderWarpper.setTripId(null != map.get("tripId") ? String.valueOf(map.get("tripId")) : ""); |
| | | orderWarpper.setRemark(null != map.get("remark") ? String.valueOf(map.get("remark")) : ""); |
| | | orderWarpper.setTimeOutCancel(null != map.get("timeOutCancel") ? Long.valueOf(String.valueOf(map.get("timeOutCancel"))) : 0); |
| | | orderWarpper.setDriverTimeOut(null != map.get("driverTimeOut") ? Long.valueOf(String.valueOf(map.get("driverTimeOut"))) : 0); |
| | | list.add(orderWarpper); |
| | | } |
| | | } |
| | |
| | | if(null == orderTaxi){ |
| | | return ResultUtil.error("取消订单失败,订单信息有误"); |
| | | } |
| | | if(orderTaxi.getState() > 5 && orderTaxi.getState() != 11){ |
| | | if(orderTaxi.getState() > 5 && orderTaxi.getState() != 12){ |
| | | return ResultUtil.error("取消订单失败,不合法的操作"); |
| | | } |
| | | if(null == orderTaxi.getDriverId()){//没有接单的情况 |