| | |
| | | orderLogistics.setTravelTime(null == travelTime ? new Date() : travelTime); |
| | | orderLogistics.setOrderSource(orderSource); |
| | | orderLogistics.setIsDelete(1); |
| | | orderLogistics.setTripId(tripId); |
| | | orderLogistics.setIsover(0); |
| | | this.insert(orderLogistics); |
| | | |
| | | //添加消息 |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | } |
| | | } |
| | | }, 30000); |
| | | pushUtil.pushOrderState(2, driver.getId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), pushOrder.getPushTime(), audioUrl); |
| | | pushUtil.pushOrderState(2, driver.getId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), pushOrder.getPushTime(), audioUrl, "user"); |
| | | } |
| | | } |
| | | Thread.sleep(pushOrder.getPushTime() * 1000);//设置等待时间 |
| | |
| | | } |
| | | |
| | | orderLogistics.setDriverId(driverId); |
| | | orderLogistics.setCompanyId(driver.getFranchiseeId() != null && driver.getFranchiseeId() != 0 ? driver.getFranchiseeId() : ( |
| | | driver.getCompanyId() != null && driver.getCompanyId() != 0 ? driver.getCompanyId() : 1)); |
| | | orderLogistics.setCompanyId(driver.getCompanyId()); |
| | | orderLogistics.setState(2); |
| | | orderLogistics.setCarId(driver.getCarId()); |
| | | CarService query1 = carServiceMapper.query(1, driver.getCarId()); |
| | |
| | | orderLogistics.setIsReassign(1); |
| | | orderLogistics.setIsDelete(1); |
| | | orderLogistics.setTripId(tripId); |
| | | orderLogistics.setIsover(0); |
| | | DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), orderLogistics.getEndLat(), orderLogistics.getEndLon(), tripId); |
| | | Long distance1 = distancematrix1.getDistance(); |
| | | orderLogistics.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue()); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | 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); |
| | | pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl, "user"); |
| | | } |
| | | }).start(); |
| | | } |
| | |
| | | .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.setCompanyId(dr.getCompanyId()); |
| | | orderLogistics.setState(2); |
| | | orderLogistics.setCarId(dr.getCarId()); |
| | | CarService query1 = carServiceMapper.query(1, dr.getCarId()); |
| | | CarService query1 = carServiceMapper.query(4, dr.getCarId()); |
| | | orderLogistics.setServerCarModelId(query1.getServerCarModelId()); |
| | | orderLogistics.setSnatchOrderTime(new Date()); |
| | | |
| | | String value = redisUtil.getValue("DRIVER" + driver1.getId()); |
| | | if(ToolUtil.isNotEmpty(value)) { |
| | | String[] split = value.split(","); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderLogistics.getStartLat(), orderLogistics.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId); |
| | | //超时时间 |
| | | long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000); |
| | | orderLogistics.setEstimateArriveTime(new Date(timeOut)); |
| | | orderLogistics.setEstimateArriveMileage(distancematrix.getDistance()); |
| | | } |
| | | |
| | | dr.setState(3); |
| | | driverService.updateById(dr); |
| | | this.updateById(orderLogistics); |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | 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); |
| | | System.err.println("直推司机后推送司机订单状态"); |
| | | pushUtil.pushOrderState(1, uid, orderLogistics.getId(), 4, 2, 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, 2, 0, finalAudioUrl, "user"); |
| | | } |
| | | }).start(); |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | 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.subtract(new BigDecimal(userCouponRecord.getMoney())).setScale(2, RoundingMode.HALF_EVEN); |
| | | orderMoney = orderMoney.subtract(new BigDecimal(userCouponRecord.getMoney())); |
| | | orderLogistics.setCouponMoney(userCouponRecord.getMoney()); |
| | | orderLogistics.setCouponId(couponId); |
| | | } |
| | |
| | | if(null != redDeduction && 1 == redDeduction && null == orderLogistics.getRedPacketId()){ |
| | | RedEnvelopePaymentSettings redEnvelopePaymentSettings = redEnvelopePaymentSettingsService.getRedEnvelopePaymentSettings(); |
| | | if(null != redEnvelopePaymentSettings){ |
| | | Double total = userRedPacketRecordService.queryRemainingAmount(uid); |
| | | List<UserRedPacketRecord> userRedPacketRecords = userRedPacketRecordService.selectList(new EntityWrapper<UserRedPacketRecord>().eq("userId", uid) |
| | | .eq("state", 1).eq("companyId", orderLogistics.getCompanyId()).gt("remainingAmount", 0).orderBy("insertTime", false)); |
| | | |
| | | Double total = userRedPacketRecords.stream().mapToDouble(UserRedPacketRecord::getRemainingAmount).sum(); |
| | | BigDecimal deductionRatio = redEnvelopePaymentSettings.getDeductionRatio(); |
| | | 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.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN); |
| | | orderMoney = orderMoney.subtract(multiply1); |
| | | |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | |
| | | orderLogistics.setRedPacketId(jsonArray.toJSONString()); |
| | | }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){ |
| | | orderLogistics.setRedPacketMoney(total); |
| | | orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN); |
| | | orderMoney = orderMoney.subtract(new BigDecimal(total)); |
| | | //获取红包id |
| | | JSONArray jsonArray = new JSONArray(); |
| | | for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) { |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | 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.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | if(null != orderLogistics.getDriverId()){ |
| | | aDouble = orderEvaluateService.queryDriverScore(orderLogistics.getDriverId()); |
| | | } |
| | | |
| | | Double aDouble1 = new BigDecimal(orderLogistics.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000), 0, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.HALF_EVEN).longValue(); |
| | | if(1 == finalLanguage1){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | | for (int i = 0; i < driver_chinese.size(); i++) { |
| | | Element element = driver_chinese.get(i); |
| | |
| | | cp_chinese.text("车牌:" + car.getCarLicensePlate()); |
| | | Element pf_chinese = document.getElementById("pf_chinese"); |
| | | pf_chinese.text("司机评分:" + aDouble); |
| | | Element lc_chinese = document.getElementById("lc_chinese"); |
| | | lc_chinese.text("里程:" + aDouble1 + "公里 /" + serviceTime + "分钟"); |
| | | Element start_address_chinese = document.getElementById("start_address_chinese"); |
| | | start_address_chinese.text(orderLogistics.getStartAddress()); |
| | | Element end_address_chinese = document.getElementById("end_address_chinese"); |
| | |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | | for (int i = 0; i < driver_english.size(); i++) { |
| | | Element element = driver_english.get(i); |
| | |
| | | cp_english.text("Number Plate:" + car.getCarLicensePlate()); |
| | | Element pf_english = document.getElementById("pf_english"); |
| | | pf_english.text("Driver Rating:" + aDouble); |
| | | Element lc_english = document.getElementById("lc_english"); |
| | | lc_english.text("Mileage:" + aDouble1 + "KM / " + serviceTime + "Minutes"); |
| | | Element start_address_english = document.getElementById("start_address_english"); |
| | | start_address_english.text(orderLogistics.getStartAddress()); |
| | | Element end_address_english = document.getElementById("end_address_english"); |
| | |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage1, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | | for (int i = 0; i < driver_french.size(); i++) { |
| | | Element element = driver_french.get(i); |
| | |
| | | cp_french.text("Plaque: GS " + car.getCarLicensePlate()); |
| | | Element pf_french = document.getElementById("pf_french"); |
| | | pf_french.text("Note du chauffeur: " + aDouble); |
| | | Element lc_french = document.getElementById("lc_french"); |
| | | lc_french.text("Distance: " + aDouble1 + "km / " + serviceTime + "minutes"); |
| | | Element start_address_french = document.getElementById("start_address_french"); |
| | | start_address_french.text(orderLogistics.getStartAddress()); |
| | | Element end_address_french = document.getElementById("end_address_french"); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), finalLanguage1 == 1 ? "包裹收据" : finalLanguage1 == 2 ? "Delivery receipt" : "Reçu de livraison", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | 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.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | Integer language1 = driver.getLanguage(); |
| | | String text = ""; |
| | | switch (language1){ |
| | |
| | | public void run() { |
| | | try { |
| | | // 使用Runtime执行命令 |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName); |
| | | Process process = Runtime.getRuntime().exec("sudo rm -rf /data/nginx/html/files/audio/" + fileName); |
| | | // 读取命令的输出 |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); |
| | | String line; |
| | |
| | | if(null != orderLogistics.getDriverId()){ |
| | | aDouble = orderEvaluateService.queryDriverScore(orderLogistics.getDriverId()); |
| | | } |
| | | Double aDouble1 = new BigDecimal(orderLogistics.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000), 0, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.HALF_EVEN).longValue(); |
| | | if(1 == finalLanguage){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | | for (int i = 0; i < driver_chinese.size(); i++) { |
| | | Element element = driver_chinese.get(i); |
| | |
| | | cp_chinese.text("车牌:" + car.getCarLicensePlate()); |
| | | Element pf_chinese = document.getElementById("pf_chinese"); |
| | | pf_chinese.text("司机评分:" + aDouble); |
| | | Element lc_chinese = document.getElementById("lc_chinese"); |
| | | lc_chinese.text("里程:" + aDouble1 + "公里 /" + serviceTime + "分钟"); |
| | | Element start_address_chinese = document.getElementById("start_address_chinese"); |
| | | start_address_chinese.text(orderLogistics.getStartAddress()); |
| | | Element end_address_chinese = document.getElementById("end_address_chinese"); |
| | |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_english.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | | for (int i = 0; i < driver_english.size(); i++) { |
| | | Element element = driver_english.get(i); |
| | |
| | | cp_english.text("Number Plate:" + car.getCarLicensePlate()); |
| | | Element pf_english = document.getElementById("pf_english"); |
| | | pf_english.text("Driver Rating:" + aDouble); |
| | | Element lc_english = document.getElementById("lc_english"); |
| | | lc_english.text("Mileage:" + aDouble1 + "KM / " + serviceTime + "Minutes"); |
| | | Element start_address_english = document.getElementById("start_address_english"); |
| | | start_address_english.text(orderLogistics.getStartAddress()); |
| | | Element end_address_english = document.getElementById("end_address_english"); |
| | |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_french.text(DateUtil.conversionFormat(finalLanguage, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | | for (int i = 0; i < driver_french.size(); i++) { |
| | | Element element = driver_french.get(i); |
| | |
| | | cp_french.text("Plaque: GS " + car.getCarLicensePlate()); |
| | | Element pf_french = document.getElementById("pf_french"); |
| | | pf_french.text("Note du chauffeur: " + aDouble); |
| | | Element lc_french = document.getElementById("lc_french"); |
| | | lc_french.text("Distance: " + aDouble1 + "km / " + serviceTime + "minutes"); |
| | | Element start_address_french = document.getElementById("start_address_french"); |
| | | start_address_french.text(orderLogistics.getStartAddress()); |
| | | Element end_address_french = document.getElementById("end_address_french"); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), finalLanguage == 1 ? "包裹收据" : finalLanguage == 2 ? "Delivery receipt" : "Reçu de livraison", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/parcel_receipt_" + orderId + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/parcel_receipt_" + orderId + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | 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.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | 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.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | 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.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | if(null != orderLogistics.getDriverId()){ |
| | | aDouble = orderEvaluateService.queryDriverScore(orderLogistics.getDriverId()); |
| | | } |
| | | Double aDouble1 = new BigDecimal(orderLogistics.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue(); |
| | | Long serviceTime = new BigDecimal(orderLogistics.getEndServiceTime().getTime() - orderLogistics.getStartServiceTime().getTime()).divide(new BigDecimal(60000), 0, RoundingMode.HALF_EVEN).setScale(0, RoundingMode.HALF_EVEN).longValue(); |
| | | if(1 == language){ |
| | | document.getElementById("english").remove(); |
| | | document.getElementById("french").remove(); |
| | |
| | | // Element track_chinese = document.getElementById("track_chinese"); |
| | | // track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_chinese = document.getElementById("pay_time_chinese"); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_chinese = document.getElementsByClass("driver_chinese"); |
| | | for (int i = 0; i < driver_chinese.size(); i++) { |
| | | Element element = driver_chinese.get(i); |
| | |
| | | cp_chinese.text("车牌:" + car.getCarLicensePlate()); |
| | | Element pf_chinese = document.getElementById("pf_chinese"); |
| | | pf_chinese.text("司机评分:" + aDouble); |
| | | Element lc_chinese = document.getElementById("lc_chinese"); |
| | | lc_chinese.text("里程:" + aDouble1 + "公里 /" + serviceTime + "分钟"); |
| | | Element start_address_chinese = document.getElementById("start_address_chinese"); |
| | | start_address_chinese.text(orderLogistics.getStartAddress()); |
| | | Element end_address_chinese = document.getElementById("end_address_chinese"); |
| | |
| | | // Element track_english = document.getElementById("track_english"); |
| | | // track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_english = document.getElementById("pay_time_english"); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_english = document.getElementsByClass("driver_english"); |
| | | for (int i = 0; i < driver_english.size(); i++) { |
| | | Element element = driver_english.get(i); |
| | |
| | | cp_english.text("Number Plate:" + car.getCarLicensePlate()); |
| | | Element pf_english = document.getElementById("pf_english"); |
| | | pf_english.text("Driver Rating:" + aDouble); |
| | | Element lc_english = document.getElementById("lc_english"); |
| | | lc_english.text("Mileage:" + aDouble1 + "KM / " + serviceTime + "Minutes"); |
| | | Element start_address_english = document.getElementById("start_address_english"); |
| | | start_address_english.text(orderLogistics.getStartAddress()); |
| | | Element end_address_english = document.getElementById("end_address_english"); |
| | |
| | | // Element track_french = document.getElementById("track_french"); |
| | | // track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html"); |
| | | Element pay_time_french = document.getElementById("pay_time_french"); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getTravelTime()))); |
| | | pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderLogistics.getEndServiceTime()))); |
| | | Elements driver_french = document.getElementsByClass("driver_french"); |
| | | for (int i = 0; i < driver_french.size(); i++) { |
| | | Element element = driver_french.get(i); |
| | |
| | | cp_french.text("Plaque: GS " + car.getCarLicensePlate()); |
| | | Element pf_french = document.getElementById("pf_french"); |
| | | pf_french.text("Note du chauffeur: " + aDouble); |
| | | Element lc_french = document.getElementById("lc_french"); |
| | | lc_french.text("Distance: " + aDouble1 + "km / " + serviceTime + "minutes"); |
| | | Element start_address_french = document.getElementById("start_address_french"); |
| | | start_address_french.text(orderLogistics.getStartAddress()); |
| | | Element end_address_french = document.getElementById("end_address_french"); |
| | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "包裹收据" : language == 2 ? "Delivery receipt" : "Reçu de livraison", document.html()); |
| | | |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + id + ".html"); |
| | | file = new File("/data/nginx/html/files/html/parcel_receipt_" + id + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | fileWriter.flush(); |
| | | fileWriter.close(); |
| | | |
| | | File file1 = new File("/home/igotechgh/nginx/html/files/pdf/"); |
| | | File file1 = new File("/data/nginx/html/files/pdf/"); |
| | | if(!file1.exists()){ |
| | | file1.mkdirs(); |
| | | } |
| | | file1 = new File("/home/igotechgh/nginx/html/files/pdf/parcel_receipt_" + id + ".pdf"); |
| | | file1 = new File("/data/nginx/html/files/pdf/parcel_receipt_" + id + ".pdf"); |
| | | if(!file1.exists()){ |
| | | file1.createNewFile(); |
| | | } |
| | | try{ |
| | | FileOutputStream fileOutputStream = new FileOutputStream(file1); |
| | | HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/parcel_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | HtmlToPdfUtils.convertToPdf("/data/nginx/html/files/html/parcel_receipt_" + id + ".html", "I-GO", fileOutputStream); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | System.out.println("html转pdf异常"); |
| | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | 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.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), orderLogistics.getType(), orderLogistics.getState(), 0, "", "user"); |
| | | } |
| | | }).start(); |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if(null == lon || null == lat){ |
| | | return ResultUtil.error(language == 1 ? "无效的经纬度" : language == 2 ? "Invalid longitude and latitude" : "Longitude et latitude non valides"); |
| | | } |
| | | language = userInfoService.queryLanguage(uid, language); |
| | | OrderLogistics orderLogistics = this.selectById(id); |
| | | Integer integer = null; |
| | |
| | | audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-FR.mp3"; |
| | | break; |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState() == 12 ? orderLogistics.getState() : 10, 0, audioUrl); |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState() == 12 ? orderLogistics.getState() : 10, 0, audioUrl, "user"); |
| | | } |
| | | }).start(); |
| | | driver.setState(2); |
| | |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | double amount = 0; |
| | | CancleOrder query = cancleOrderService.query(orderLogistics.getCompanyId()); |
| | | if(null == query || null == orderLogistics.getDriverId() || orderLogistics.getState() == 11){ |
| | | if(null == query){ |
| | | return ResultUtil.error("请先添加取消规则"); |
| | | } |
| | | if(null == orderLogistics.getDriverId() || orderLogistics.getState() == 11){ |
| | | baseWarpper.setAmount(amount); |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | |
| | | } |
| | | |
| | | this.deleteTask(id);//删除定时任务 |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); |
| | | }else{ |
| | | incomeService.saveData(1, orderLogistics.getCompanyId(), 3, orderLogistics.getId(), 4, amount.doubleValue()); |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); |
| | | |
| | | |
| | | //添加消息 |
| | |
| | | } |
| | | this.deleteTask(orderLogistics.getId());//删除定时任务 |
| | | |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(2, orderLogistics.getDriverId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); |
| | | }else{ |
| | | incomeService.saveData(1, orderLogistics.getCompanyId(), 3, orderLogistics.getId(), 4, amount.doubleValue()); |
| | | } |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, ""); |
| | | pushUtil.pushOrderState(1, orderLogistics.getUserId(), orderLogistics.getId(), 4, orderLogistics.getState(), 0, "", "user"); |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, language == 1 ? "您已使用余额成功支付取消订单费用,谢谢使用!" : language == 2 |
| | |
| | | |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "红包活动" : language == 2 ? "Lucky-promo activities" : "Activités bonus", document.html()); |
| | | //开始生成pdf收据和html收据 |
| | | File file = new File("/home/igotechgh/nginx/html/files/html/"); |
| | | File file = new File("/data/nginx/html/files/html/"); |
| | | if(!file.exists()){ |
| | | file.mkdirs(); |
| | | } |
| | | file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/redpacket_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |