| | |
| | | } |
| | | EmailUtil.send(userInfo.getEmail(), language == 1 ? "取件码邮件" : language == 2 ? "Pickup code" : "Code de ramassage", 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/code_" + orderId + ".html"); |
| | | file = new File("/data/nginx/html/files/html/code_" + orderId + ".html"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | } |
| | |
| | | if(orderLogistics.getArriveTime()==null){ |
| | | orderLogistics.setArriveTime(orderLogistics.getStartServiceTime()); |
| | | } |
| | | |
| | | //使用原始里程计算费用 |
| | | orderLogistics = this.setMoney(orderLogistics, 0D, 0D);//计算费用 |
| | | Double mileage = orderLogistics.getMileage(); |
| | | Double orderMoney1 = orderLogistics.getOrderMoney(); |
| | | //使用预估里程计算费用 |
| | | |
| | | //实际里程小于预估里程95%,则使用预估里程进行计算价格 |
| | | Double startLat = orderLogistics.getStartLat(); |
| | | Double startLon = orderLogistics.getStartLon(); |
| | | Double getoffLon = orderLogistics.getGetoffLon(); |
| | | Double getoffLat = orderLogistics.getGetoffLat(); |
| | | DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(startLat, startLon, getoffLat, getoffLon, orderLogistics.getTripId()); |
| | | orderLogistics.setMileage(distancematrix.getDistance().doubleValue()); |
| | | orderLogistics = this.setMoney(orderLogistics, 0D, 0D); |
| | | Double orderMoney2 = orderLogistics.getOrderMoney(); |
| | | //如果原始金额小于预估金额,且比例小于95%,则使用预估金额 |
| | | if(orderMoney1.compareTo(orderMoney2) >= 0 || orderMoney1 / orderMoney2 >= 0.95){ |
| | | //原始金额大于预估金额或者比例大于0.95,则使用原始里程重新计算费用 |
| | | orderLogistics.setMileage(mileage); |
| | | orderLogistics = this.setMoney(orderLogistics, 0D, 0D);//计算费用 |
| | | double ce = orderLogistics.getMileage() / distancematrix.getDistance().doubleValue(); |
| | | if(ce < 0.95 || ce > 1.05){ |
| | | orderLogistics.setMileage(distancematrix.getDistance().doubleValue()); |
| | | } |
| | | |
| | | orderLogistics = this.setMoney(orderLogistics, 0D, 0D);//计算费用 |
| | | orderLogistics.setPayManner(type); |
| | | orderLogistics.setParkMoney(null == parkingFee ? 0D : parkingFee); |
| | | orderLogistics.setRoadTollMoney(null == crossingFee ? 0D : crossingFee); |
| | |
| | | // orderLogistics.setBindId(""); |
| | | // } |
| | | this.updateById(orderLogistics); |
| | | |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | //修改行程数据 |
| | | Car car = carService.selectById(orderLogistics.getCarId()); |
| | | boolean updateTrip = fleetEngineUtil.updateTrip("COMPLETE", car.getVehicleId(), null, orderLogistics.getTripId(), null, null, null, null, orderLogistics.getId(), 4); |
| | |
| | | Integer language1 = userInfo.getLanguage(); |
| | | systemNoticeService.addSystemNotice(1, language1 == 1 ? "司机已结束本次行程,谢谢使用" : language1 == 2 ? |
| | | "The driver has finished the trip,thank you for using I-GO" : "Le chauffeur a terminé le trajet, merci d'utiliser I-GO", orderLogistics.getUserId()); |
| | | |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | |
| | | OrderLogistics finalOrderTaxi = orderLogistics; |
| | | new Thread(new Runnable() { |