| | |
| | | @Autowired |
| | | private ICarService carService; |
| | | |
| | | @Resource |
| | | private IDriverWorkService driverWorkService; |
| | | |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | |
| | | if(bo){ |
| | | continue; |
| | | } |
| | | |
| | | Driver driver1 = driverService.selectById(driver.getId()); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "4")); |
| | | if(null == driverWork || driver1.getState() != 2){ |
| | | continue; |
| | | } |
| | | String text = ""; |
| | | Integer language1 = driver.getLanguage(); |
| | | switch (language1){ |
| | |
| | | |
| | | } |
| | | 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); |
| | | } |
| | |
| | | * 1.下了即时单就不能下预约单和即时单 |
| | | * 2.下了预约单和再下一张即时单不能再下预约单 |
| | | */ |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 11); |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12); |
| | | if(orderPrivateCars.size() > 0){ |
| | | return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)"); |
| | | } |
| | | int selectCount = this.selectCount(new EntityWrapper<OrderLogistics>().eq("userId", uid).eq("isDelete", 1) |
| | | .in("state", Arrays.asList(1, 2, 3, 4, 5, 7, 11, 12))); |
| | | .in("state", Arrays.asList(1, 2, 3, 4, 5, 6, 7, 11, 12))); |
| | | if(0 < selectCount){ |
| | | return ResultUtil.error(language == 1 ? "有未完成的订单" : language == 2 ? "Uncompleted order(s)" : "Commande(s) non complétée(s)"); |
| | | } |
| | |
| | | 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); |
| | | } |
| | |
| | | dr = drivers.get(0); |
| | | } |
| | | |
| | | orderLogistics.setDriverId(dr.getId()); |
| | | orderLogistics.setCompanyId(dr.getFranchiseeId() != null && dr.getFranchiseeId() != 0 ? dr.getFranchiseeId() : ( |
| | | dr.getCompanyId() != null && dr.getCompanyId() != 0 ? dr.getCompanyId() : 1)); |
| | | orderLogistics.setState(2); |
| | | orderLogistics.setCarId(dr.getCarId()); |
| | | CarService query1 = carServiceMapper.query(1, dr.getCarId()); |
| | | orderLogistics.setServerCarModelId(query1.getServerCarModelId()); |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | |
| | | dr.setState(3); |
| | | driverService.updateById(dr); |
| | | this.updateById(orderLogistics); |
| | | Driver driver1 = driverService.selectById(dr.getId()); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", driver1.getId()) |
| | | .eq("state", 1).like("type", "4")); |
| | | if(driver1.getState() == 2 || null != driverWork){ |
| | | orderLogistics.setDriverId(dr.getId()); |
| | | orderLogistics.setCompanyId(dr.getFranchiseeId() != null && dr.getFranchiseeId() != 0 ? dr.getFranchiseeId() : ( |
| | | dr.getCompanyId() != null && dr.getCompanyId() != 0 ? dr.getCompanyId() : 1)); |
| | | orderLogistics.setState(2); |
| | | orderLogistics.setCarId(dr.getCarId()); |
| | | CarService query1 = carServiceMapper.query(1, dr.getCarId()); |
| | | orderLogistics.setServerCarModelId(query1.getServerCarModelId()); |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | |
| | | String text = ""; |
| | | Integer language1 = dr.getLanguage(); |
| | | switch (language1){ |
| | | case 1: |
| | | text = "收到新的包裹订单,从" + orderLogistics.getStartAddress() + "出发,全程约" + orderLogistics.getEstimatedMileage() + "公里"; |
| | | break; |
| | | case 2: |
| | | text = "Received a new delivery order, starting from " + orderLogistics.getStartAddress() + ", the whole journey is about " + orderLogistics.getEstimatedMileage() + "kilometre"; |
| | | break; |
| | | case 3: |
| | | text = "J'ai reçu une nouvelle commande de livraison, à partir de " + orderLogistics.getStartAddress() + ", le trajet complet est d’environ " + orderLogistics.getEstimatedMileage() + "kilométrage"; |
| | | break; |
| | | dr.setState(3); |
| | | driverService.updateById(dr); |
| | | this.updateById(orderLogistics); |
| | | |
| | | String text = ""; |
| | | Integer language1 = dr.getLanguage(); |
| | | switch (language1){ |
| | | case 1: |
| | | text = "收到新的包裹订单,从" + orderLogistics.getStartAddress() + "出发,全程约" + orderLogistics.getEstimatedMileage() + "公里"; |
| | | break; |
| | | case 2: |
| | | text = "Received a new delivery order, starting from " + orderLogistics.getStartAddress() + ", the whole journey is about " + orderLogistics.getEstimatedMileage() + "kilometre"; |
| | | break; |
| | | case 3: |
| | | text = "J'ai reçu une nouvelle commande de livraison, à partir de " + orderLogistics.getStartAddress() + ", le trajet complet est d’environ " + orderLogistics.getEstimatedMileage() + "kilométrage"; |
| | | break; |
| | | |
| | | } |
| | | String audioUrl = ""; |
| | | try { |
| | | audioUrl = TextToSpeechUtil.create(language1 == 1 ? "cmn-CN" : language1 == 2 ? "en-US" : "fr-FR", text, "pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //定时任务删除语音文件 |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/pushOrder" + orderLogistics.getDriverId() + ".mp3"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (process != null) { |
| | | process.destroy(); |
| | | } |
| | | } |
| | | }, 30000); |
| | | String finalAudioUrl = audioUrl; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl); |
| | | 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, fileName); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }).start(); |
| | | //定时任务删除语音文件 |
| | | new Timer().schedule(new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | Process process = null; |
| | | try { |
| | | process = Runtime.getRuntime().exec("rm -rf /usr/local/nginx/html/files/audio/" + fileName); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (process != null) { |
| | | process.destroy(); |
| | | } |
| | | } |
| | | }, 30000); |
| | | String finalAudioUrl = audioUrl; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl); |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | //推单操作 |
| | | if(orderLogistics.getState() == 1){ |
| | | this.pushOrder(orderLogistics); |
| | | }else{ |
| | | // //接单后定时任务判断司机是否去接乘客,没有则推送提醒 |
| | | // CancleOrder cancleOrder = cancleOrderService.query(orderLogistics.getCompanyId()); |
| | | // if(null != cancleOrder){ |
| | | // JSONObject object = JSON.parseObject(cancleOrder.getContent()); |
| | | // long time = object.getInteger("driverTimeout") * 60000L; |
| | | // new Timer().schedule(new TimerTask() { |
| | | // @Override |
| | | // public void run() { |
| | | // OrderLogistics orderLogistics1 = OrderLogisticsServiceImpl.this.selectById(orderLogistics.getId()); |
| | | // if(orderLogistics1.getState() == 2){ |
| | | // pushUtil.pushDriverTimeOut(1, orderLogistics1.getUserId(), orderLogistics1.getId(), 4); |
| | | // } |
| | | // } |
| | | // }, time); |
| | | // } |
| | | } |
| | | |
| | | |
| | |
| | | return ResultUtil.error(language == 1 ? "订单已完成支付,不允许重复支付" : language == 2 ? "The order has been paid, recurring payments is not allowed." : "La commande a été payée, les paiements récurrents ne sont pas autorisés.", ""); |
| | | } |
| | | Integer uid = orderLogistics.getUserId(); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | BigDecimal orderMoney = new BigDecimal(orderLogistics.getOrderMoney()); |
| | | if(orderLogistics.getUrgent() == 2){ |
| | | // orderMoney += null != orderLogistics.getTipMoney() ? orderLogistics.getTipMoney() : 0; |
| | | } |
| | |
| | | Double special = query2.getLogistics(); |
| | | if(null != special){ |
| | | orderLogistics.setDiscount(special); |
| | | double v = new BigDecimal(orderMoney).multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | BigDecimal v = orderMoney.multiply(new BigDecimal(special / 10)).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | if(orderMoney.compareTo(v) > 0){ |
| | | orderLogistics.setDiscountMoney(orderMoney - v); |
| | | orderLogistics.setDiscountMoney(orderMoney.subtract(v).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderLogistics.setActivityId(query2.getId()); |
| | | orderMoney = v; |
| | | } |
| | |
| | | if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 4){ |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupon cannot be used for this order." : "Le coupon ne peut pas être utilisé pour cette commande.", ""); |
| | | } |
| | | if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){ |
| | | if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(new BigDecimal(userCouponRecord.getFullMoney())) < 0){ |
| | | return ResultUtil.error(language == 1 ? "优惠券不能用于此订单" : language == 2 ? "Coupon cannot be used for this order." : "Le coupon ne peut pas être utilisé pour cette commande.", ""); |
| | | } |
| | | orderMoney = orderMoney - userCouponRecord.getMoney(); |
| | | orderMoney = orderMoney.subtract(new BigDecimal(userCouponRecord.getMoney())).setScale(2, RoundingMode.HALF_EVEN); |
| | | orderLogistics.setCouponMoney(userCouponRecord.getMoney()); |
| | | orderLogistics.setCouponId(couponId); |
| | | } |
| | |
| | | .eq("state", 1).eq("companyId", orderLogistics.getCompanyId()).gt("remainingAmount", 0).orderBy("insertTime", false)); |
| | | |
| | | BigDecimal deductionRatio = redEnvelopePaymentSettings.getDeductionRatio(); |
| | | BigDecimal multiply1 = new BigDecimal(orderMoney).multiply(deductionRatio.divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN); |
| | | if(total.compareTo(multiply1.doubleValue()) >= 0){ |
| | | BigDecimal multiply1 = orderMoney.multiply(deductionRatio.divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN); |
| | | if(total > 0 && multiply1.doubleValue() > 0 && total.compareTo(multiply1.doubleValue()) >= 0){ |
| | | orderLogistics.setRedPacketMoney(multiply1.doubleValue()); |
| | | orderMoney = orderMoney - multiply1.doubleValue(); |
| | | orderMoney = orderMoney.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN); |
| | | |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply1.compareTo(BigDecimal.ZERO) == 0){ |
| | | break; |
| | | } |
| | | if(multiply1.compareTo(remainingAmount) >= 0){ |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | |
| | | jsonObject.put("money", remainingAmount); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | }else{ |
| | | }else if(remainingAmount.compareTo(multiply1) > 0){ |
| | | userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | jsonObject.put("money", multiply1); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | break; |
| | | multiply1 = BigDecimal.ZERO; |
| | | } |
| | | } |
| | | orderLogistics.setRedPacketId(jsonArray.toJSONString()); |
| | | }else{ |
| | | } |
| | | if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){ |
| | | orderLogistics.setRedPacketMoney(total); |
| | | orderMoney = orderMoney - total; |
| | | orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN); |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | | BigDecimal multiply = new BigDecimal(total); |
| | |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("id", userRedPacketRecord.getId()); |
| | | BigDecimal remainingAmount = new BigDecimal(userRedPacketRecord.getRemainingAmount()); |
| | | if(multiply.compareTo(BigDecimal.ZERO) == 0){ |
| | | break; |
| | | } |
| | | if(multiply.compareTo(remainingAmount) >= 0){ |
| | | userRedPacketRecord.setRemainingAmount(0D); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | |
| | | jsonObject.put("money", remainingAmount); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | }else{ |
| | | }else if(remainingAmount.compareTo(multiply) > 0){ |
| | | userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | jsonObject.put("money", multiply); |
| | | jsonArray.add(jsonObject); |
| | | userRedPacketRecordService.updateById(userRedPacketRecord); |
| | | break; |
| | | multiply = BigDecimal.ZERO; |
| | | } |
| | | } |
| | | orderLogistics.setRedPacketId(jsonArray.toJSONString()); |
| | |
| | | } |
| | | } |
| | | |
| | | orderMoney=new BigDecimal(orderMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | | |
| | | if(payType == 1) {//手机支付 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String merchantTransactionId = sdf.format(new Date()) + "4" + language + orderId; |
| | |
| | | checkoutRequest.setAccountNumber(userInfo.getPhone()); |
| | | checkoutRequest.setCustomerFirstName(userInfo.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(userInfo.getLastName()); |
| | | checkoutRequest.setRequestAmount(orderMoney); |
| | | checkoutRequest.setRequestAmount(orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | |
| | | checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html"); |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 1, orderMoney, null, 1);//添加预支付数据 |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 1, |
| | | orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue(), null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error(language == 1 ? "支付失败" : language == 2 ? "Payment failure" : "Paiement échoué", ""); |
| | | } |
| | |
| | | checkoutRequest.setAccountNumber(bankCard.getCode()); |
| | | checkoutRequest.setCustomerFirstName(bankCard.getFirstName()); |
| | | checkoutRequest.setCustomerLastName(bankCard.getLastName()); |
| | | checkoutRequest.setRequestAmount(orderMoney); |
| | | checkoutRequest.setRequestAmount(orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | checkoutRequest.setMerchantTransactionId(merchantTransactionId); |
| | | checkoutRequest.setRequestDescription("Travel completion payment"); |
| | | checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi"); |
| | |
| | | resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest); |
| | | |
| | | if(resultUtil.getCode()==200){ |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 2, orderMoney, null, 1);//添加预支付数据 |
| | | paymentRecordService.saveData(1, null, null, orderId, 4, 2, |
| | | orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue(), null, 1);//添加预支付数据 |
| | | }else{ |
| | | resultUtil = ResultUtil.error(language == 1 ? "支付失败" : language == 2 ? "Payment failure" : "Paiement échoué", ""); |
| | | } |
| | |
| | | } |
| | | |
| | | if(payType == 3){//余额支付 |
| | | if(userInfo.getBalance() == null || userInfo.getBalance() < orderMoney){ |
| | | if(userInfo.getBalance() == null || new BigDecimal(userInfo.getBalance()).compareTo(orderMoney) < 0){ |
| | | return ResultUtil.error(language == 1 ? "账户余额不足" : language == 2 ? "Insufficient balance" : "Solde insuffisant", ""); |
| | | } |
| | | |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(orderMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(orderMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | |
| | | SysIntegral query1 = sysIntegralMapper.query(orderLogistics.getCompanyId()); |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | |
| | | } |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "包裹下单支付", orderMoney, 2, 1, 1, 4, orderId); |
| | | transactionDetailsService.saveData(uid, "包裹下单支付", |
| | | orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue(), 2, 1, 1, 4, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderLogistics.setState(8); |
| | | orderLogistics.setPayType(3); |
| | | orderLogistics.setPayMoney(orderMoney); |
| | | orderLogistics.setPayMoney(orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | |
| | | //处理优惠券和红包 |
| | | if(null != userCouponRecord){ |
| | |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element xcf_chinese = document.getElementById("xcf_chinese"); |
| | | xcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | | qbj_chinese.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_chinese = document.getElementById("scf_chinese"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_chinese.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_chinese_div = document.getElementById("scf_chinese_div"); |
| | | scf_chinese_div.remove(); |
| | | } |
| | | Element lcf_chinese = document.getElementById("lcf_chinese"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_chinese_div = document.getElementById("lcf_chinese_div"); |
| | | lcf_chinese_div.remove(); |
| | | } |
| | | Element ddf_chinese = document.getElementById("ddf_chinese"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_chinese.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_chinese_div = document.getElementById("ddf_chinese_div"); |
| | | ddf_chinese_div.remove(); |
| | | } |
| | | Element glf_chinese = document.getElementById("glf_chinese"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_chinese.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_chinese_div = document.getElementById("glf_chinese_div"); |
| | | glf_chinese_div.remove(); |
| | | } |
| | | Element tcf_chinese = document.getElementById("tcf_chinese"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_chinese_div = document.getElementById("tcf_chinese_div"); |
| | | tcf_chinese_div.remove(); |
| | | } |
| | | Element bcj_chinese = document.getElementById("bcj_chinese"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_chinese.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element xcf_english = document.getElementById("xcf_english"); |
| | | xcf_english.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | | qbj_english.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_english = document.getElementById("scf_english"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_english.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_english_div = document.getElementById("scf_english_div"); |
| | | scf_english_div.remove(); |
| | | } |
| | | Element lcf_english = document.getElementById("lcf_english"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_english.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_english_div = document.getElementById("lcf_english_div"); |
| | | lcf_english_div.remove(); |
| | | } |
| | | Element ddf_english = document.getElementById("ddf_english"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_english.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_english_div = document.getElementById("ddf_english_div"); |
| | | ddf_english_div.remove(); |
| | | } |
| | | Element glf_english = document.getElementById("glf_english"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_english.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_english_div = document.getElementById("glf_english_div"); |
| | | glf_english_div.remove(); |
| | | } |
| | | Element tcf_english = document.getElementById("tcf_english"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_english.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_english_div = document.getElementById("tcf_english_div"); |
| | | tcf_english_div.remove(); |
| | | } |
| | | Element bcj_english = document.getElementById("bcj_english"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_english.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le "); |
| | | Element xcf_french = document.getElementById("xcf_french"); |
| | | xcf_french.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | | qbj_french.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_french = document.getElementById("scf_french"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_french.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_french_div = document.getElementById("scf_french_div"); |
| | | scf_french_div.remove(); |
| | | } |
| | | Element lcf_french = document.getElementById("lcf_french"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_french.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_french_div = document.getElementById("lcf_french_div"); |
| | | lcf_french_div.remove(); |
| | | } |
| | | Element ddf_french = document.getElementById("ddf_french"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_french.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_french_div = document.getElementById("ddf_french_div"); |
| | | ddf_french_div.remove(); |
| | | } |
| | | Element glf_french = document.getElementById("glf_french"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_french.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_french_div = document.getElementById("glf_french_div"); |
| | | glf_french_div.remove(); |
| | | } |
| | | Element tcf_french = document.getElementById("tcf_french"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_french.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_french_div = document.getElementById("tcf_french_div"); |
| | | tcf_french_div.remove(); |
| | | } |
| | | Element bcj_french = document.getElementById("bcj_french"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_french.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分 |
| | | |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(uid, "包裹下单支付", orderMoney, 2, 1, 1, 4, orderId); |
| | | transactionDetailsService.saveData(uid, "包裹下单支付", |
| | | orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue(), 2, 1, 1, 4, orderId); |
| | | userInfoService.updateById(userInfo); |
| | | |
| | | orderLogistics.setState(8);//小件物流先支付后司机抢单 |
| | | orderLogistics.setDriverPay(1); |
| | | orderLogistics.setPayType(4); |
| | | orderLogistics.setPayMoney(orderMoney); |
| | | orderLogistics.setPayMoney(orderMoney.setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | | |
| | | //处理优惠券和红包 |
| | | if(null != userCouponRecord){ |
| | |
| | | settlementRecord.setInsertTime(new Date()); |
| | | settlementRecordService.insert(settlementRecord); |
| | | }else{ |
| | | settlementRecord.setPayMoney(total.doubleValue()); |
| | | settlementRecord.setPayMoney(settlementRecord.getPayMoney() + total.doubleValue()); |
| | | settlementRecordService.updateById(settlementRecord); |
| | | } |
| | | for (SettlementDetail detail : settlementDetailList) { |
| | |
| | | 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(); |
| | | |
| | |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element xcf_chinese = document.getElementById("xcf_chinese"); |
| | | xcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | | qbj_chinese.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_chinese = document.getElementById("scf_chinese"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_chinese.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_chinese_div = document.getElementById("scf_chinese_div"); |
| | | scf_chinese_div.remove(); |
| | | } |
| | | Element lcf_chinese = document.getElementById("lcf_chinese"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_chinese_div = document.getElementById("lcf_chinese_div"); |
| | | lcf_chinese_div.remove(); |
| | | } |
| | | Element ddf_chinese = document.getElementById("ddf_chinese"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_chinese.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_chinese_div = document.getElementById("ddf_chinese_div"); |
| | | ddf_chinese_div.remove(); |
| | | } |
| | | Element glf_chinese = document.getElementById("glf_chinese"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_chinese.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_chinese_div = document.getElementById("glf_chinese_div"); |
| | | glf_chinese_div.remove(); |
| | | } |
| | | Element tcf_chinese = document.getElementById("tcf_chinese"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_chinese_div = document.getElementById("tcf_chinese_div"); |
| | | tcf_chinese_div.remove(); |
| | | } |
| | | Element bcj_chinese = document.getElementById("bcj_chinese"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_chinese.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element xcf_english = document.getElementById("xcf_english"); |
| | | xcf_english.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | | qbj_english.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_english = document.getElementById("scf_english"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_english.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_english_div = document.getElementById("scf_english_div"); |
| | | scf_english_div.remove(); |
| | | } |
| | | Element lcf_english = document.getElementById("lcf_english"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_english.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_english_div = document.getElementById("lcf_english_div"); |
| | | lcf_english_div.remove(); |
| | | } |
| | | Element ddf_english = document.getElementById("ddf_english"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_english.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_english_div = document.getElementById("ddf_english_div"); |
| | | ddf_english_div.remove(); |
| | | } |
| | | Element glf_english = document.getElementById("glf_english"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_english.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_english_div = document.getElementById("glf_english_div"); |
| | | glf_english_div.remove(); |
| | | } |
| | | Element tcf_english = document.getElementById("tcf_english"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_english.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_english_div = document.getElementById("tcf_english_div"); |
| | | tcf_english_div.remove(); |
| | | } |
| | | Element bcj_english = document.getElementById("bcj_english"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_english.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le "); |
| | | Element xcf_french = document.getElementById("xcf_french"); |
| | | xcf_french.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | | qbj_french.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_french = document.getElementById("scf_french"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_french.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_french_div = document.getElementById("scf_french_div"); |
| | | scf_french_div.remove(); |
| | | } |
| | | Element lcf_french = document.getElementById("lcf_french"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_french.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_french_div = document.getElementById("lcf_french_div"); |
| | | lcf_french_div.remove(); |
| | | } |
| | | Element ddf_french = document.getElementById("ddf_french"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_french.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_french_div = document.getElementById("ddf_french_div"); |
| | | ddf_french_div.remove(); |
| | | } |
| | | Element glf_french = document.getElementById("glf_french"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_french.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_french_div = document.getElementById("glf_french_div"); |
| | | glf_french_div.remove(); |
| | | } |
| | | Element tcf_french = document.getElementById("tcf_french"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_french.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_french_div = document.getElementById("tcf_french_div"); |
| | | tcf_french_div.remove(); |
| | | } |
| | | Element bcj_french = document.getElementById("bcj_french"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_french.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("I-GO电子收据"); |
| | | Element title_chinese = document.getElementById("title_chinese"); |
| | | title_chinese.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",您在I-GO此订单消费GHS " + orderLogistics.getPayMoney()); |
| | | Element xcf_chinese = document.getElementById("xcf_chinese"); |
| | | xcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_chinese = document.getElementById("qbj_chinese"); |
| | | qbj_chinese.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_chinese = document.getElementById("scf_chinese"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_chinese.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_chinese_div = document.getElementById("scf_chinese_div"); |
| | | scf_chinese_div.remove(); |
| | | } |
| | | Element lcf_chinese = document.getElementById("lcf_chinese"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_chinese_div = document.getElementById("lcf_chinese_div"); |
| | | lcf_chinese_div.remove(); |
| | | } |
| | | Element ddf_chinese = document.getElementById("ddf_chinese"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_chinese.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_chinese_div = document.getElementById("ddf_chinese_div"); |
| | | ddf_chinese_div.remove(); |
| | | } |
| | | Element glf_chinese = document.getElementById("glf_chinese"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_chinese.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_chinese_div = document.getElementById("glf_chinese_div"); |
| | | glf_chinese_div.remove(); |
| | | } |
| | | Element tcf_chinese = document.getElementById("tcf_chinese"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_chinese.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_chinese_div = document.getElementById("tcf_chinese_div"); |
| | | tcf_chinese_div.remove(); |
| | | } |
| | | Element bcj_chinese = document.getElementById("bcj_chinese"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_chinese.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("Receipt"); |
| | | Element title_english = document.getElementById("title_english"); |
| | | title_english.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",You spent GHS " + orderLogistics.getPayMoney() + " on the trip "); |
| | | Element xcf_english = document.getElementById("xcf_english"); |
| | | xcf_english.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_english = document.getElementById("qbj_english"); |
| | | qbj_english.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_english = document.getElementById("scf_english"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_english.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_english_div = document.getElementById("scf_english_div"); |
| | | scf_english_div.remove(); |
| | | } |
| | | Element lcf_english = document.getElementById("lcf_english"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_english.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_english_div = document.getElementById("lcf_english_div"); |
| | | lcf_english_div.remove(); |
| | | } |
| | | Element ddf_english = document.getElementById("ddf_english"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_english.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_english_div = document.getElementById("ddf_english_div"); |
| | | ddf_english_div.remove(); |
| | | } |
| | | Element glf_english = document.getElementById("glf_english"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_english.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_english_div = document.getElementById("glf_english_div"); |
| | | glf_english_div.remove(); |
| | | } |
| | | Element tcf_english = document.getElementById("tcf_english"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_english.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_english_div = document.getElementById("tcf_english_div"); |
| | | tcf_english_div.remove(); |
| | | } |
| | | Element bcj_english = document.getElementById("bcj_english"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_english.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | document.getElementsByTag("title").get(0).text("Reçu"); |
| | | Element title_french = document.getElementById("title_french"); |
| | | title_french.text(DateUtil.conversionFormat(language, sdf2.format(orderLogistics.getTravelTime())) + ",Vous consommez GHS " + orderLogistics.getPayMoney() + " sur votre commande i-go1 le "); |
| | | Element xcf_french = document.getElementById("xcf_french"); |
| | | xcf_french.text("GHS " + new BigDecimal(orderLogistics.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element qbj_french = document.getElementById("qbj_french"); |
| | | qbj_french.text("GHS " + new BigDecimal(orderLogistics.getStartMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | Element scf_french = document.getElementById("scf_french"); |
| | | if(null != orderLogistics.getDurationMoney() && orderLogistics.getDurationMoney() > 0){ |
| | | scf_french.text("GHS " + new BigDecimal(orderLogistics.getDurationMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element scf_french_div = document.getElementById("scf_french_div"); |
| | | scf_french_div.remove(); |
| | | } |
| | | Element lcf_french = document.getElementById("lcf_french"); |
| | | if(null != orderLogistics.getMileageMoney() && orderLogistics.getMileageMoney() > 0){ |
| | | lcf_french.text("GHS " + new BigDecimal(orderLogistics.getMileageMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element lcf_french_div = document.getElementById("lcf_french_div"); |
| | | lcf_french_div.remove(); |
| | | } |
| | | Element ddf_french = document.getElementById("ddf_french"); |
| | | if(null != orderLogistics.getWaitMoney() && orderLogistics.getWaitMoney() > 0){ |
| | | ddf_french.text("GHS " + new BigDecimal(orderLogistics.getWaitMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element ddf_french_div = document.getElementById("ddf_french_div"); |
| | | ddf_french_div.remove(); |
| | | } |
| | | Element glf_french = document.getElementById("glf_french"); |
| | | if(null != orderLogistics.getRoadTollMoney() && orderLogistics.getRoadTollMoney() > 0){ |
| | | glf_french.text("GHS " + new BigDecimal(orderLogistics.getRoadTollMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element glf_french_div = document.getElementById("glf_french_div"); |
| | | glf_french_div.remove(); |
| | | } |
| | | Element tcf_french = document.getElementById("tcf_french"); |
| | | if(null != orderLogistics.getParkMoney() && orderLogistics.getParkMoney() > 0){ |
| | | tcf_french.text("GHS " + new BigDecimal(orderLogistics.getParkMoney()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | }else{ |
| | | Element tcf_french_div = document.getElementById("tcf_french_div"); |
| | | tcf_french_div.remove(); |
| | | } |
| | | Element bcj_french = document.getElementById("bcj_french"); |
| | | if(null != orderLogistics.getPriceDifference() && orderLogistics.getPriceDifference() > 0){ |
| | | bcj_french.text("GHS " + new BigDecimal(orderLogistics.getPriceDifference()).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | |
| | | 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() != 11 && 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, ""); |
| | |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | if(orderLogistics.getState() == 10 || orderLogistics.getState() == 12){ |
| | | if((orderLogistics.getState() == 10 || orderLogistics.getState() == 12) && null != orderLogistics.getDriverId()){ |
| | | //修改行程信息 |
| | | fleetEngineUtil.updateTrip("CANCELED", null, null, orderLogistics.getTripId(), null, null, null, null); |
| | | } |
| | |
| | | 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); |
| | |
| | | Element user_chinese = document.getElementById("user_chinese"); |
| | | user_chinese.text("您好 " + userInfo.getNickName() + ","); |
| | | Element time_chinese = document.getElementById("time_chinese"); |
| | | time_chinese.text("此活动有效期在 " + DateUtil.conversionFormat(language, sdf.format(id.getStartTime())) + " 至 " + DateUtil.conversionFormat(language, sdf.format(id.getEnable())) + ",详情请查看I-GO平台"); |
| | | time_chinese.text("此活动有效期在 " + DateUtil.conversionFormat(language, sdf.format(id.getStartTime())) + " 至 " + DateUtil.conversionFormat(language, sdf.format(id.getEndTime())) + ",详情请查看I-GO平台"); |
| | | } |
| | | if(2 == language){ |
| | | document.getElementById("chinese").remove(); |
| | |
| | | Element user_english = document.getElementById("user_english"); |
| | | user_english.text("Hello " + userInfo.getNickName() + ","); |
| | | Element time_english = document.getElementById("time_english"); |
| | | time_english.text("You could use it from " + DateUtil.conversionFormat(language, sdf.format(id.getStartTime())) + " to " + DateUtil.conversionFormat(language, sdf.format(id.getEnable())) + ",check more details on the app."); |
| | | time_english.text("You could use it from " + DateUtil.conversionFormat(language, sdf.format(id.getStartTime())) + " to " + DateUtil.conversionFormat(language, sdf.format(id.getEndTime())) + ",check more details on the app."); |
| | | } |
| | | if(3 == language){ |
| | | document.getElementById("chinese").remove(); |
| | |
| | | Element user_french = document.getElementById("user_french"); |
| | | user_french.text("Bonjour " + userInfo.getNickName() + ","); |
| | | Element time_french = document.getElementById("time_french"); |
| | | time_french.text("Cette promotion est valable du " + DateUtil.conversionFormat(language, sdf.format(id.getStartTime())) + " au " + DateUtil.conversionFormat(language, sdf.format(id.getEnable())) + ". Veuillez consulter la plateforme i-go pour plus de détails."); |
| | | time_french.text("Cette promotion est valable du " + DateUtil.conversionFormat(language, sdf.format(id.getStartTime())) + " au " + DateUtil.conversionFormat(language, sdf.format(id.getEndTime())) + ". Veuillez consulter la plateforme i-go pour plus de détails."); |
| | | } |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", document.html()); |