From 31929207a91ad4d215f11401b17446cf09eefd2c Mon Sep 17 00:00:00 2001
From: Pu Zhibing <393733352@qq.com>
Date: 星期一, 17 三月 2025 17:36:21 +0800
Subject: [PATCH] 添加用户手机号码的校验
---
UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java | 877 +++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 555 insertions(+), 322 deletions(-)
diff --git a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
index b025309..5c162c7 100644
--- a/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
+++ b/UserIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -38,12 +38,15 @@
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
@@ -56,10 +59,13 @@
import java.math.RoundingMode;
import java.text.SimpleDateFormat;
import java.util.*;
+import java.util.stream.Collectors;
@Service
public class OrderPrivateCarServiceImpl extends ServiceImpl<OrderPrivateCarMapper, OrderPrivateCar> implements IOrderPrivateCarService {
+
+ private Logger log = LoggerFactory.getLogger(OrderPrivateCarServiceImpl.class);
@Resource
private OrderPrivateCarMapper orderPrivateCarMapper;
@@ -264,7 +270,8 @@
baseWarpper.setId(orderPrivateCars.get(0).getId());
return ResultUtil.success(baseWarpper);
}
-
+
+ String tripId = redisUtil.getValue("trip" + uid);
startAddress = startAddress.replaceAll("& #40;", "(");
startAddress = startAddress.replaceAll("& #41;", ")");
endAddress = endAddress.replaceAll("& #40;", "(");
@@ -281,7 +288,7 @@
orderPrivateCar.setPlacementLon(Double.valueOf(placementLon));
orderPrivateCar.setPlacementLat(Double.valueOf(placementLat));
- ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon));
+ ReverseGeocodeVo reverseGeocode = GoogleMapUtil.getReverseGeocode(Double.valueOf(placementLat), Double.valueOf(placementLon), tripId);
orderPrivateCar.setPlacementAddress(reverseGeocode.getAddress());
orderPrivateCar.setStartLon(Double.valueOf(startLon));
orderPrivateCar.setStartLat(Double.valueOf(startLat));
@@ -346,7 +353,7 @@
String value = redisUtil.getValue("DRIVER" + driver.getId());
if(ToolUtil.isNotEmpty(value)) {
String[] split = value.split(",");
- DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
+ DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId);
//超时时间
long timeOut = System.currentTimeMillis() + (distancematrix.getDuration() * 1000);
orderPrivateCar.setEstimateArriveTime(new Date(timeOut));
@@ -359,8 +366,8 @@
orderPrivateCar.setIsReassign(1);
orderPrivateCar.setIsDelete(1);
- orderPrivateCar.setTripId(UUIDUtil.getRandomCode());
- DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon());
+ orderPrivateCar.setTripId(tripId);
+ DistancematrixVo distancematrix1 = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon(), tripId);
Long distance1 = distancematrix1.getDistance();
orderPrivateCar.setEstimatedMileage(new BigDecimal(distance1).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
this.insert(orderPrivateCar);
@@ -369,33 +376,74 @@
userInfo.setLanguage(language);
userInfoService.updateById(userInfo);
- new Thread(() -> {
- try {
- if(null != orderPrivateCar.getDriverId()){
- Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
- Car car = carMapper.selectById(driver.getCarId());
- if(!StringUtils.hasLength(car.getVehicleId())){
- car.setVehicleId(UUIDUtil.getRandomCode());
- carMapper.updateById(car);
- }
- String vehicleId = car.getVehicleId();
- //查询车辆信息,没有则创建信息
- String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
- if(ToolUtil.isEmpty(vehicles)){
- CarModel carModel = carModelMapper.selectById(car.getCarModelId());
- fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
- fleetEngineUtil.updateVehicles("ONLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
- }
-
- //创建行程数据
- fleetEngineUtil.createTrip(vehicleId, 1, orderPrivateCar.getTripId(),
- orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString());
- }
-
- }catch (Exception e){
- e.printStackTrace();
+ //google创建车辆信息
+ String vehicleId = null;
+ if(null != orderPrivateCar.getDriverId()) {
+ Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
+ Car car = carMapper.selectById(driver.getCarId());
+ if (!StringUtils.hasLength(car.getVehicleId())) {
+ car.setVehicleId(UUIDUtil.getRandomCode());
+ carMapper.updateById(car);
}
- }).start();
+ vehicleId = car.getVehicleId();
+ //查询车辆信息,没有则创建信息
+ String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
+ if (ToolUtil.isEmpty(vehicles)) {
+ CarModel carModel = carModelMapper.selectById(car.getCarModelId());
+ boolean createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if (!createVehicles) {
+ for (int i = 0; i < 5; i++) {
+ createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if (createVehicles) {
+ break;
+ }
+ Thread.sleep(5000L);
+ }
+ }
+ boolean updateVehicles = fleetEngineUtil.updateVehicles("ONLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if (!updateVehicles) {
+ for (int i = 0; i < 5; i++) {
+ updateVehicles = fleetEngineUtil.updateVehicles("ONLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if (updateVehicles) {
+ break;
+ }
+ Thread.sleep(5000L);
+ }
+ }
+ }
+ }
+ //创建行程数据
+ String trip = fleetEngineUtil.getTrip(orderPrivateCar.getTripId());
+ int count = orderLogisticsService.selectCount(new EntityWrapper<OrderLogistics>().eq("tripId", orderPrivateCar.getTripId()));
+ int count1 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("tripId", orderPrivateCar.getTripId()));
+ if(ToolUtil.isNotEmpty(trip) || (count + count1) > 0){
+ String randomCode = UUIDUtil.getRandomCode();
+ redisUtil.setStrValue("trip" + orderPrivateCar.getUserId(), randomCode);
+ OrderPrivateCar orderPrivateCar1 = new OrderPrivateCar();
+ orderPrivateCar1.setId(orderPrivateCar.getId());
+ orderPrivateCar1.setTripId(randomCode);
+ this.updateById(orderPrivateCar1);
+ orderPrivateCar.setTripId(randomCode);
+ }
+ JSONObject createTrip = fleetEngineUtil.createTrip(vehicleId, 1, orderPrivateCar.getTripId(),
+ orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString());
+ JSONObject error = createTrip.getJSONObject("error");
+ if(null != error){
+ for (int i = 0; i < 5; i++) {
+ createTrip = fleetEngineUtil.createTrip(vehicleId, 1, orderPrivateCar.getTripId(),
+ orderPrivateCar.getStartLat().toString(), orderPrivateCar.getStartLon().toString(), orderPrivateCar.getEndLat().toString(), orderPrivateCar.getEndLon().toString());
+ error = createTrip.getJSONObject("error");
+ String tripStatus = createTrip.getString("tripStatus");
+ if(null == error && "NEW".equals(tripStatus)){
+ break;
+ }
+ try {
+ Thread.sleep(3000L);
+ } catch (InterruptedException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
if(orderSource == 2){//扫码下单
@@ -425,14 +473,21 @@
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();
+ // 使用Runtime执行命令
+ Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
+ // 读取命令的输出
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ System.out.println(line);
+ }
+ // 等待命令执行完成
+ process.waitFor();
+ // 关闭流
+ reader.close();
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
}
}
}, 30000);
@@ -449,14 +504,14 @@
// TODO: 2021/5/11 修改,根据后台设定的派单范围查询范围内有无司机,将单子指派给距离最近的司机(距离相同随机取),范围内没有司机再进行推单流程
if(orderPrivateCar.getState() == 1){
- Company query = companyCityService.query1(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString());
+ Company query = companyCityService.query1(uid, orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString());
if(null == query){
return ResultUtil.error(language == 1 ? "起点暂未企业提供服务" : language == 2 ? "Starting point no enterprise to provide services" : "Point de départ pas encore disponible pour les entreprises");
}
AssignOrder assignOrder = assignOrderService.selectOne(new EntityWrapper<AssignOrder>().eq("companyId", query.getId()).eq("type", 1));
if(null != assignOrder && assignOrder.getPeople() > 0){//配置了指派规则才处理
//获取空闲司机
- List<Driver> drivers = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机
+ List<Driver> drivers = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), assignOrder.getDistance(), null);//获取范围内空闲司机
if(drivers.size() > 0){//有司机,直接指派给司机
Driver dr = null;
if(drivers.size() > 1){
@@ -469,7 +524,7 @@
String value = redisUtil.getValue("DRIVER" + drivers.get(j).getId());
if(null != value){
String[] split = value.split(",");
- DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
+ DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId);
Long distance = distancematrix.getDistance();
if((0 == m && null == driver) || (distance < m)){
driver = drivers.get(j);
@@ -488,7 +543,7 @@
String value = redisUtil.getValue("DRIVER" + driver.getId());
if(null != value){
String[] split = value.split(",");
- DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]));
+ DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(split[1]), Double.valueOf(split[0]), tripId);
Long d = distancematrix.getDistance();
if((0 == m && null == dr) || (d.intValue() < m.intValue())){
dr = driver;
@@ -542,14 +597,21 @@
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();
+ // 使用Runtime执行命令
+ Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
+ // 读取命令的输出
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ System.out.println(line);
+ }
+ // 等待命令执行完成
+ process.waitFor();
+ // 关闭流
+ reader.close();
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
}
}
}, 30000);
@@ -652,7 +714,7 @@
BaseWarpper baseWarpper = new BaseWarpper();
double amount = 0;
CancleOrder query = cancleOrderService.query(orderPrivateCar.getCompanyId());
- if(null == query || null == orderPrivateCar.getDriverId()){
+ if(null == query || null == orderPrivateCar.getDriverId() || orderPrivateCar.getState() == 11){
baseWarpper.setAmount(amount);
return ResultUtil.success(baseWarpper);
}
@@ -727,9 +789,10 @@
public ResultUtil addCancle(Integer id, String reason, String remark, Integer uid, Double lon, Double lat, String address, Integer language) throws Exception {
if(ToolUtil.isNotEmpty(remark)){
if(ToolUtil.isNotEmpty(remark)){
+ remark = remark.toLowerCase();
List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null);
- for(SensitiveWords s : sensitiveWords){
- remark = remark.replaceAll(s.getContent(), "***");
+ for(SensitiveWords s : sensitiveWords) {
+ remark = remark.replaceAll(s.getContent().toLowerCase(), "***");
}
}
}
@@ -807,23 +870,23 @@
switch (language1){
case 1:
if(orderPrivateCar.getState() == 6){
- audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-CN.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-CN.mp3";
}else{
- audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-CN.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-CN.mp3";
}
break;
case 2:
if(orderPrivateCar.getState() == 6){
- audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-EN.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-EN.mp3";
}else{
- audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-EN.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-EN.mp3";
}
break;
case 3:
if(orderPrivateCar.getState() == 6){
- audioUrl = "http://182.160.16.251:81/files/audio/system/MidwayCancellation-FR.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/MidwayCancellation-FR.mp3";
}else{
- audioUrl = "http://182.160.16.251:81/files/audio/system/UserCancelledOrder-FR.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/UserCancelledOrder-FR.mp3";
}
break;
}
@@ -839,10 +902,24 @@
}
//修改行程信息
- if((orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12) && null != orderPrivateCar.getDriverId()){
- fleetEngineUtil.updateTrip("CANCELED", null, null, orderPrivateCar.getTripId(), null, null, null, null);
+ if(orderPrivateCar.getState() == 10 || orderPrivateCar.getState() == 12){
+ Car car = carService.selectById(orderPrivateCar.getCarId());
+ boolean updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderPrivateCar.getTripId(), null, null, null, null);
+ if(!updateTrip){
+ for (int i = 0; i < 5; i++) {
+ updateTrip = fleetEngineUtil.updateTrip("CANCELED", (null != car ? car.getVehicleId() : null), null, orderPrivateCar.getTripId(), null, null, null, null);
+ if(updateTrip){
+ orderPrivateCar.setIsover(1);
+ this.updateById(orderPrivateCar);
+ break;
+ }
+ Thread.sleep(3000L);
+ }
+ }else{
+ orderPrivateCar.setIsover(1);
+ this.updateById(orderPrivateCar);
+ }
}
-
//添加消息
systemNoticeService.addSystemNotice(1, language == 1 ? "您已成功取消出行订单,谢谢使用!" : language == 2 ? "You've cancelled the ride order successfully, thank you for using I-GO " : "Vous avez annulé la commande de course avec succès, merci d’utiliser I-GO", orderPrivateCar.getUserId(), 1);
Map<String, Object> map = new HashMap<>();
@@ -898,8 +975,8 @@
checkoutRequest.setRequestDescription("Cancel a trip");
checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi");
checkoutRequest.setPendingRedirectUrl("");
- checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
- checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
+ checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
+ checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
if(resultUtil.getCode()==200){
paymentRecordService.saveData(1, null, null, id, 1, 1, amount, null, 1);//添加预支付数据
@@ -923,8 +1000,8 @@
checkoutRequest.setRequestDescription("Cancel a trip");
checkoutRequest.setCallbackUrl(callbackPath + "/base/wxCancelOrderTaxi");
checkoutRequest.setPendingRedirectUrl("");
- checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
- checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
+ checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
+ checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
if(resultUtil.getCode()==200){
paymentRecordService.saveData(1, null, null, id, 1, 2, amount, null, 1);//添加预支付数据
@@ -946,11 +1023,7 @@
ChinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX());
}
- if(5 == orderPrivateCar.getOldState()){
- orderPrivateCar.setState(6);
- }else{
- orderPrivateCar.setState(10);
- }
+ orderPrivateCar.setState(10);
orderPrivateCar.setTelX("");
orderPrivateCar.setBindId("");
this.updateById(orderPrivateCar);
@@ -1016,12 +1089,12 @@
if(ToolUtil.isNotEmpty(vehicle)){
integers = JSON.parseArray(vehicle).toJavaList(Integer.class);
}
- Company query = companyCityService.query1(String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司
+ Company query = companyCityService.query1(orderPrivateCar.getUserId(), String.valueOf(orderPrivateCar.getStartLon()), String.valueOf(orderPrivateCar.getStartLat()));//获取起点所属分公司
List<PushOrder> querys = pushOrderService.querys(null, 1, query.getId());//获取需要推送的次数
for(int i = 1; i <= querys.size(); i++){
PushOrder pushOrder = pushOrderService.querys(i, 1, query.getId()).get(0);
//获取空闲司机
- List<Driver> list = driverService.queryIdleDriver(1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
+ List<Driver> list = driverService.queryIdleDriver(orderPrivateCar.getUserId(), 1, orderPrivateCar.getServerCarModelId(), orderPrivateCar.getStartLon(), orderPrivateCar.getStartLat(), pushOrder.getPushDistance(), null);//所有附近空闲司机
System.err.println("【" + orderPrivateCar.getId() + "】空闲司机:" + JSON.toJSONString(list));
if(list.size() > 0){
double driverProportion = pushOrder.getDriverProportion() / 100;//推送占比计算成小数
@@ -1071,14 +1144,21 @@
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();
+ // 使用Runtime执行命令
+ Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
+ // 读取命令的输出
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ System.out.println(line);
+ }
+ // 等待命令执行完成
+ process.waitFor();
+ // 关闭流
+ reader.close();
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
}
}
}, 30000);
@@ -1109,7 +1189,7 @@
@Override
public synchronized String getOrderNum() throws Exception{
int size = this.selectCount(null);
- return "PRIVATE" + String.valueOf(1000000 + size + 1).substring(1);
+ return "RIDE" + String.valueOf(1000000 + size + 1).substring(1);
}
/**
@@ -1181,6 +1261,7 @@
@Override
+ @Transactional(rollbackFor = Exception.class)
public ResultUtil payPrivateCarOrder(Integer payType, Integer bankCardId, Integer orderId, Integer couponId, Integer redDeduction, Integer type, Integer language) throws Exception {
OrderPrivateCar orderPrivateCar = this.selectById(orderId);
if(orderPrivateCar.getState() == 8 || orderPrivateCar.getState() == 9){
@@ -1245,10 +1326,9 @@
if(null != redDeduction && 1 == redDeduction && null == orderPrivateCar.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", orderPrivateCar.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){
@@ -1261,55 +1341,43 @@
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());
userRedPacketRecord.setState(2);
multiply1 = multiply1.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN);
- jsonObject.put("money", remainingAmount);
+ jsonObject.put("money", remainingAmount.setScale(2, RoundingMode.HALF_EVEN));
jsonArray.add(jsonObject);
- userRedPacketRecordService.updateById(userRedPacketRecord);
}else if(remainingAmount.compareTo(multiply1) > 0){
userRedPacketRecord.setRemainingAmount(remainingAmount.subtract(multiply1).setScale(2, RoundingMode.HALF_EVEN).doubleValue());
- jsonObject.put("money", multiply1);
+ jsonObject.put("money", multiply1.setScale(2, RoundingMode.HALF_EVEN));
jsonArray.add(jsonObject);
- userRedPacketRecordService.updateById(userRedPacketRecord);
multiply1 = BigDecimal.ZERO;
+ break;
}
}
+ if(userRedPacketRecords.size() > 0){
+ userRedPacketRecordService.updateBatchById(userRedPacketRecords);
+ }
orderPrivateCar.setRedPacketId(jsonArray.toJSONString());
- }
- if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
+ }else if(total > 0 && total.compareTo(multiply1.doubleValue()) < 0){
orderPrivateCar.setRedPacketMoney(total);
orderMoney = orderMoney.subtract(new BigDecimal(total)).setScale(2, RoundingMode.HALF_EVEN);
//获取红包id
JSONArray jsonArray = new JSONArray();
- BigDecimal multiply = new BigDecimal(total);
for (UserRedPacketRecord userRedPacketRecord : userRedPacketRecords) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", userRedPacketRecord.getId());
- BigDecimal remainingAmount = BigDecimal.valueOf(userRedPacketRecord.getRemainingAmount());
- if(multiply.compareTo(BigDecimal.ZERO) == 0){
- break;
- }
- if(multiply.compareTo(remainingAmount) >= 0){
- userRedPacketRecord.setRemainingAmount(0D);
- userRedPacketRecord.setEndTime(new Date());
- userRedPacketRecord.setState(2);
- multiply = multiply.subtract(remainingAmount).setScale(2, RoundingMode.HALF_EVEN);
- jsonObject.put("money", remainingAmount);
- jsonArray.add(jsonObject);
- userRedPacketRecordService.updateById(userRedPacketRecord);
- }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);
- multiply = BigDecimal.ZERO;
- }
+ jsonObject.put("money", userRedPacketRecord.getRemainingAmount());
+ jsonArray.add(jsonObject);
+
+ userRedPacketRecord.setRemainingAmount(0D);
+ userRedPacketRecord.setEndTime(new Date());
+ userRedPacketRecord.setState(2);
+ }
+ if(userRedPacketRecords.size() > 0){
+ userRedPacketRecordService.updateBatchById(userRedPacketRecords);
}
orderPrivateCar.setRedPacketId(jsonArray.toJSONString());
}
@@ -1331,8 +1399,8 @@
checkoutRequest.setRequestDescription("Travel completion payment");
checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi");
checkoutRequest.setPendingRedirectUrl("");
- checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
- checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
+ checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
+ checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
if(resultUtil.getCode()==200){
@@ -1358,8 +1426,8 @@
checkoutRequest.setRequestDescription("Travel completion payment");
checkoutRequest.setCallbackUrl(callbackPath + "/base/wxPayOrderTaxi");
checkoutRequest.setPendingRedirectUrl("");
- checkoutRequest.setSuccessRedirectUrl("http://182.160.16.251:81/payMoney/pages/success.html");
- checkoutRequest.setFailRedirectUrl("http://182.160.16.251:81/payMoney/pages/fail.html");
+ checkoutRequest.setSuccessRedirectUrl("https://igo.i-go.group/payMoney/pages/success.html");
+ checkoutRequest.setFailRedirectUrl("https://igo.i-go.group/payMoney/pages/fail.html");
resultUtil = TinggPayUtil.checkoutRequest(checkoutRequest);
if(resultUtil.getCode()==200){
@@ -1394,30 +1462,28 @@
userCouponRecord.setEndTime(new Date());
userCouponRecordService.updateById(userCouponRecord);
}
-
- if(orderPrivateCar.getIsplatPay()==1){
- //添加已收入明细
- Company company = companyService.selectById(orderPrivateCar.getCompanyId());
- Double speMoney = company.getSpeMoney();
- BigDecimal d = null;//企业收入
- BigDecimal c = null;//司机收入
- if(company.getIsSpeFixedOrProportional() == 2){//固定
- d = new BigDecimal(speMoney);
- c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
- }
- if(company.getIsSpeFixedOrProportional() == 1){//比例
- Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
- d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
- c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
- }
- incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
- incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
- Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
- driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
- driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
- driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
- driverService.updateById(driver);
+
+ //添加已收入明细
+ Company company = companyService.selectById(orderPrivateCar.getCompanyId());
+ Double speMoney = company.getSpeMoney();
+ BigDecimal d = null;//企业收入
+ BigDecimal c = null;//司机收入
+ if(company.getIsSpeFixedOrProportional() == 2){//固定
+ d = new BigDecimal(speMoney);
+ c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
}
+ if(company.getIsSpeFixedOrProportional() == 1){//比例
+ Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
+ d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
+ c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ }
+ incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
+ incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
+ Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
+ driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ driverService.updateById(driver);
if(ToolUtil.isNotEmpty(userInfo.getEmail())){
new Thread(new Runnable() {
@@ -1435,11 +1501,11 @@
if(null != orderPrivateCar.getDriverId()){
aDouble = orderEvaluateService.queryDriverScore(orderPrivateCar.getDriverId());
}
- Double aDouble1 = Double.valueOf(orderPrivateCar.getMileage() / 1000);
+ Double aDouble1 = new BigDecimal(orderPrivateCar.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
if(1 == language){
document.getElementById("english").remove();
document.getElementById("french").remove();
- document.getElementsByTag("title").get(0).text("I-GO电子收据");
+ document.getElementsByTag("title").get(0).text("打车收据");
Element title_chinese = document.getElementById("title_chinese");
title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
Element qbj_chinese = document.getElementById("qbj_chinese");
@@ -1506,12 +1572,18 @@
pay_type_chinese.text("余额支付");
Element pay_money_chinese = document.getElementById("pay_money_chinese");
pay_money_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_chinese = document.getElementById("dispute_chinese");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_chinese.text("(注意: 争议订单,经过三方协商,平台最终定价为 GHS" + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_chinese.remove();
+ }
Element pdf_chinese = document.getElementById("pdf_chinese");
- pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
+ pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
Element lost_item_chinese = document.getElementById("lost_item_chinese");
- lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
+ lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
Element track_chinese = document.getElementById("track_chinese");
- track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
+ track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
Element pay_time_chinese = document.getElementById("pay_time_chinese");
pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_chinese = document.getElementsByClass("driver_chinese");
@@ -1540,7 +1612,7 @@
if(2 == language){
document.getElementById("chinese").remove();
document.getElementById("french").remove();
- document.getElementsByTag("title").get(0).text("Receipt");
+ document.getElementsByTag("title").get(0).text("Ride receipt");
Element title_english = document.getElementById("title_english");
title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
Element qbj_english = document.getElementById("qbj_english");
@@ -1607,12 +1679,18 @@
pay_type_english.text("I-GO Wallet");
Element pay_money_english = document.getElementById("pay_money_english");
pay_money_english.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_english = document.getElementById("dispute_english");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_english.text("(Note: Disputed order, after tripartite negotiation, the final pricing of the platform is GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_english.remove();
+ }
Element pdf_english = document.getElementById("pdf_english");
- pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
+ pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
Element lost_item_english = document.getElementById("lost_item_english");
- lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
+ lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
Element track_english = document.getElementById("track_english");
- track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
+ track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
Element pay_time_english = document.getElementById("pay_time_english");
pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_english = document.getElementsByClass("driver_english");
@@ -1641,7 +1719,7 @@
if(3 == language){
document.getElementById("chinese").remove();
document.getElementById("english").remove();
- document.getElementsByTag("title").get(0).text("Reçu");
+ document.getElementsByTag("title").get(0).text("Reçu de course");
Element title_french = document.getElementById("title_french");
title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
Element qbj_french = document.getElementById("qbj_french");
@@ -1708,12 +1786,18 @@
pay_type_french.text("Portefeuille I-GO");
Element pay_money_french = document.getElementById("pay_money_french");
pay_money_french.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_french = document.getElementById("dispute_french");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_french.text("(Remarque: Il s’agit d’une commande contestée, et après des négociations entre trois parties, la plateforme l’a finalement tarifée à GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_french.remove();
+ }
Element pdf_french = document.getElementById("pdf_french");
- pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
+ pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
Element lost_item_french = document.getElementById("lost_item_french");
- lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
+ lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
Element track_french = document.getElementById("track_french");
- track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
+ track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
Element pay_time_french = document.getElementById("pay_time_french");
pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_french = document.getElementsByClass("driver_french");
@@ -1739,14 +1823,14 @@
Element server_tel_french = document.getElementById("server_tel_french");
server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : ""));
}
- EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html());
+ EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html());
//开始生成pdf收据和html收据
- File file = new File("/usr/local/nginx/html/files/html/");
+ File file = new File("/home/igotechgh/nginx/html/files/html/");
if(!file.exists()){
file.mkdirs();
}
- file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html");
+ file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html");
if(!file.exists()){
file.createNewFile();
}
@@ -1755,27 +1839,27 @@
fileWriter.flush();
fileWriter.close();
- File file1 = new File("/usr/local/nginx/html/files/pdf/");
+ File file1 = new File("/home/igotechgh/nginx/html/files/pdf/");
if(!file1.exists()){
file1.mkdirs();
}
- file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
+ file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
if(!file1.exists()){
file1.createNewFile();
}
try {
FileOutputStream fileOutputStream = new FileOutputStream(file1);
- HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
+ HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
}catch (Exception e){
e.printStackTrace();
System.out.println("html转pdf异常");
}
- String link ="http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html";
+ String link ="https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html";
TEmail tEmail = new TEmail();
tEmail.setLink(link);
tEmail.setUserId(uid);
- tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu");
+ tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course");
tEmail.setType(1);
tEmail.setOrderId(orderId);
tEmail.setCreateTime(new Date());
@@ -1813,8 +1897,6 @@
? "You've paid for the ride order successfully, thank you for using I-GO"
: "Vous avez payé la commande de course avec succès, merci d’utiliser I-GO", orderPrivateCar.getUserId(), 1);
}
-
-
if(payType == 4){//现金支付
SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId());
userInfo.setIntegral(userInfo.getIntegral() + (orderMoney.intValue() * query1.getIntegral()));//积分
@@ -1862,23 +1944,22 @@
driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
driverService.updateById(driver);
}
-
-
- if(orderPrivateCar.getIsplatPay()==1){
- //添加已收入明细
- Company company = companyService.selectById(orderPrivateCar.getCompanyId());
- Double speMoney = company.getSpeMoney();
- BigDecimal d = null;//企业收入
- BigDecimal c = null;//司机收入
- if(company.getIsSpeFixedOrProportional() == 2){//固定
- d = new BigDecimal(speMoney);
- c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
- }
- if(company.getIsSpeFixedOrProportional() == 1){//比例
- Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
- d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
- c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
- }
+
+
+ //添加已收入明细
+ Company company = companyService.selectById(orderPrivateCar.getCompanyId());
+ Double speMoney = company.getSpeMoney();
+ BigDecimal d = null;//企业收入
+ BigDecimal c = null;//司机收入
+ if(company.getIsSpeFixedOrProportional() == 2){//固定
+ d = new BigDecimal(speMoney);
+ c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d);//只有出行金额参与抽成,其余归属司机
+ }
+ if(company.getIsSpeFixedOrProportional() == 1){//比例
+ Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
+ d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
+ c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ }
// incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
// incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
@@ -1886,51 +1967,109 @@
// driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
// driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
// driverService.updateById(driver);
-
-
- //记录司机待结算金额
- if(d.compareTo(new BigDecimal(0)) > 0){
- SettlementDetail settlementDetail = new SettlementDetail();
- settlementDetail.setOrderId(orderId);
- settlementDetail.setOrderType(1);
- settlementDetail.setDriverId(driver.getId());
- settlementDetail.setOrderMoney(orderPrivateCar.getOrderMoney());
- settlementDetail.setPrice(d.doubleValue());
- settlementDetail.setCreateTime(new Date());
- settlementDetailService.insert(settlementDetail);
-
- SettlementAllocation settlementAllocation = settlementAllocationService.selectOne(null);
- if(null != settlementAllocation){
- JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent());
- Double maxPrice = jsonObject.getDouble("maxPrice");
- if(null != maxPrice){
- List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driver.getId())
- .isNull("settlementRecordId").last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(createTime, '%Y-%m-%d')"));
- BigDecimal total = new BigDecimal(0);
- for (SettlementDetail detail : settlementDetailList) {
- total = total.add(new BigDecimal(detail.getPrice()));
+
+
+ //记录司机待结算金额
+ if(d.compareTo(new BigDecimal(0)) > 0){
+ SettlementDetail settlementDetail = new SettlementDetail();
+ settlementDetail.setOrderId(orderId);
+ settlementDetail.setOrderType(1);
+ settlementDetail.setDriverId(driver.getId());
+ settlementDetail.setOrderMoney(orderPrivateCar.getOrderMoney());
+ settlementDetail.setPrice(d.doubleValue());
+ settlementDetail.setCreateTime(new Date());
+ settlementDetailService.insert(settlementDetail);
+
+ SettlementAllocation settlementAllocation = settlementAllocationService.selectOne(null);
+ if(null != settlementAllocation){
+ JSONObject jsonObject = JSON.parseObject(settlementAllocation.getContent());
+ Double maxPrice = jsonObject.getDouble("maxPrice");
+ Integer type1 = jsonObject.getInteger("type");
+ if(null != maxPrice){
+ List<SettlementDetail> settlementDetailList = settlementDetailService.selectList(new EntityWrapper<SettlementDetail>().eq("driverId", driver.getId())
+ .isNull("settlementRecordId").last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(createTime, '%Y-%m-%d')"));
+ BigDecimal total = new BigDecimal(0);
+ for (SettlementDetail detail : settlementDetailList) {
+ total = total.add(new BigDecimal(detail.getPrice()));
+ }
+ //日结算
+ if(maxPrice.compareTo(total.doubleValue()) <= 0){
+ SettlementRecord settlementRecord = settlementRecordService.selectOne(new EntityWrapper<SettlementRecord>().eq("driverId", orderPrivateCar.getDriverId())
+ .eq("type", type1).eq("paymentStatus", 1).last(" and day = DATE_FORMAT(now(), '%Y-%m-%d')"));
+ if(null == settlementRecord){
+ settlementRecord = new SettlementRecord();
+ settlementRecord.setDay(new Date());
+ settlementRecord.setDriverId(orderPrivateCar.getDriverId());
+ settlementRecord.setType(type1);
+ settlementRecord.setPaymentStatus(1);
+ settlementRecord.setPayMoney(total.doubleValue());
+ settlementRecord.setInsertTime(new Date());
+ settlementRecordService.insert(settlementRecord);
+ }else{
+ settlementRecord.setPayMoney(settlementRecord.getPayMoney() + total.doubleValue());
+ settlementRecordService.updateById(settlementRecord);
}
- //日结算
- if(maxPrice.compareTo(total.doubleValue()) <= 0){
- SettlementRecord settlementRecord = settlementRecordService.selectOne(new EntityWrapper<SettlementRecord>().eq("driverId", orderPrivateCar.getDriverId())
- .eq("type", 1).eq("paymentStatus", 1).last(" and day = DATE_FORMAT(now(), '%Y-%m-%d')"));
- if(null == settlementRecord){
- settlementRecord = new SettlementRecord();
- settlementRecord.setDay(new Date());
- settlementRecord.setDriverId(orderPrivateCar.getDriverId());
- settlementRecord.setType(1);
- settlementRecord.setPaymentStatus(1);
- settlementRecord.setPayMoney(total.doubleValue());
- settlementRecord.setInsertTime(new Date());
- settlementRecordService.insert(settlementRecord);
- }else{
- settlementRecord.setPayMoney(settlementRecord.getPayMoney() + total.doubleValue());
- settlementRecordService.updateById(settlementRecord);
+ for (SettlementDetail detail : settlementDetailList) {
+ detail.setSettlementRecordId(settlementRecord.getId());
+ settlementDetailService.updateById(detail);
+ }
+ //强制司机下班
+ DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>()
+ .eq("driverId", orderPrivateCar.getDriverId()).eq("state", 1));
+ if(null != driverWork){
+ driverWork.setEndTime(new Date());
+ driverWork.setState(2);
+ driverWorkService.updateById(driverWork);
+ driver.setState(1);
+ driverService.updateById(driver);
+ Car car = carService.selectById(driver.getCarId());
+ if(!org.apache.shiro.util.StringUtils.hasLength(car.getVehicleId())){
+ car.setVehicleId(UUIDUtil.getRandomCode());
+ carService.updateById(car);
}
- for (SettlementDetail detail : settlementDetailList) {
- detail.setSettlementRecordId(settlementRecord.getId());
- settlementDetailService.updateById(detail);
- }
+
+ //司机下班,修改谷歌上的车辆信息
+ new Thread(()->{
+ try {
+ CarModel carModel = carModelMapper.selectById(car.getCarModelId());
+ String vehicles = fleetEngineUtil.getVehicles(car.getVehicleId());
+ if(ToolUtil.isEmpty(vehicles)){
+ boolean createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if(!createVehicles){
+ for (int i = 0; i < 5; i++) {
+ createVehicles = fleetEngineUtil.createVehicles(carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if(createVehicles){
+ break;
+ }
+ Thread.sleep(5000L);
+ }
+ }
+ boolean updateVehicles = fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if(!updateVehicles){
+ for (int i = 0; i < 5; i++) {
+ updateVehicles = fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if(updateVehicles){
+ break;
+ }
+ Thread.sleep(5000L);
+ }
+ }
+ }else{
+ boolean updateVehicles = fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if(!updateVehicles){
+ for (int i = 0; i < 5; i++) {
+ updateVehicles = fleetEngineUtil.updateVehicles("OFFLINE", carModel.getSeat() - 1, car.getCarLicensePlate(), car.getVehicleId());
+ if(updateVehicles){
+ break;
+ }
+ Thread.sleep(5000L);
+ }
+ }
+ }
+ }catch (Exception e){
+ e.printStackTrace();
+ }
+ }).start();
}
}
}
@@ -1952,12 +2091,12 @@
if(null != orderPrivateCar.getDriverId()){
aDouble = orderEvaluateService.queryDriverScore(orderPrivateCar.getDriverId());
}
- Double aDouble1 = Double.valueOf(orderPrivateCar.getMileage() / 1000);
+ Double aDouble1 = new BigDecimal(orderPrivateCar.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
if(1 == language){
document.getElementById("english").remove();
document.getElementById("french").remove();
- document.getElementsByTag("title").get(0).text("I-GO电子收据");
+ document.getElementsByTag("title").get(0).text("打车收据");
Element title_chinese = document.getElementById("title_chinese");
title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
Element qbj_chinese = document.getElementById("qbj_chinese");
@@ -2024,12 +2163,18 @@
pay_type_chinese.text("现金");
Element pay_money_chinese = document.getElementById("pay_money_chinese");
pay_money_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_chinese = document.getElementById("dispute_chinese");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_chinese.text("(注意: 争议订单,经过三方协商,平台最终定价为 GHS" + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_chinese.remove();
+ }
Element pdf_chinese = document.getElementById("pdf_chinese");
- pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
+ pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
Element lost_item_chinese = document.getElementById("lost_item_chinese");
- lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
+ lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
Element track_chinese = document.getElementById("track_chinese");
- track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
+ track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
Element pay_time_chinese = document.getElementById("pay_time_chinese");
pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_chinese = document.getElementsByClass("driver_chinese");
@@ -2058,7 +2203,7 @@
if(2 == language){
document.getElementById("chinese").remove();
document.getElementById("french").remove();
- document.getElementsByTag("title").get(0).text("Receipt");
+ document.getElementsByTag("title").get(0).text("Ride receipt");
Element title_english = document.getElementById("title_english");
title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
Element qbj_english = document.getElementById("qbj_english");
@@ -2125,12 +2270,18 @@
pay_type_english.text("Cash");
Element pay_money_english = document.getElementById("pay_money_english");
pay_money_english.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_english = document.getElementById("dispute_english");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_english.text("(Note: Disputed order, after tripartite negotiation, the final pricing of the platform is GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_english.remove();
+ }
Element pdf_english = document.getElementById("pdf_english");
- pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
+ pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
Element lost_item_english = document.getElementById("lost_item_english");
- lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
+ lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
Element track_english = document.getElementById("track_english");
- track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
+ track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
Element pay_time_english = document.getElementById("pay_time_english");
pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_english = document.getElementsByClass("driver_english");
@@ -2159,7 +2310,7 @@
if(3 == language){
document.getElementById("chinese").remove();
document.getElementById("english").remove();
- document.getElementsByTag("title").get(0).text("Reçu");
+ document.getElementsByTag("title").get(0).text("Reçu de course");
Element title_french = document.getElementById("title_french");
title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
Element qbj_french = document.getElementById("qbj_french");
@@ -2226,12 +2377,18 @@
pay_type_french.text("En espèces");
Element pay_money_french = document.getElementById("pay_money_french");
pay_money_french.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_french = document.getElementById("dispute_french");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_french.text("(Remarque: Il s’agit d’une commande contestée, et après des négociations entre trois parties, la plateforme l’a finalement tarifée à GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_french.remove();
+ }
Element pdf_french = document.getElementById("pdf_french");
- pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
+ pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + orderId + "&orderType=1");
Element lost_item_french = document.getElementById("lost_item_french");
- lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
+ lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + orderId + "&orderType=1");
Element track_french = document.getElementById("track_french");
- track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + orderId);
+ track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + orderId);
Element pay_time_french = document.getElementById("pay_time_french");
pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_french = document.getElementsByClass("driver_french");
@@ -2258,14 +2415,14 @@
server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : ""));
}
- EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html());
+ EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html());
//开始生成pdf收据和html收据
- File file = new File("/usr/local/nginx/html/files/html/");
+ File file = new File("/home/igotechgh/nginx/html/files/html/");
if(!file.exists()){
file.mkdirs();
}
- file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html");
+ file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html");
if(!file.exists()){
file.createNewFile();
}
@@ -2274,26 +2431,26 @@
fileWriter.flush();
fileWriter.close();
- File file1 = new File("/usr/local/nginx/html/files/pdf/");
+ File file1 = new File("/home/igotechgh/nginx/html/files/pdf/");
if(!file1.exists()){
file1.mkdirs();
}
- file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
+ file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + orderId + ".pdf");
if(!file1.exists()){
file1.createNewFile();
}
try {
FileOutputStream fileOutputStream = new FileOutputStream(file1);
- HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
+ HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + orderId + ".html", "I-GO", fileOutputStream);
}catch (Exception e){
e.printStackTrace();
System.out.println("html转pdf异常");
}
- String link ="http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html";
+ String link ="https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html";
TEmail tEmail = new TEmail();
tEmail.setLink(link);
tEmail.setUserId(uid);
- tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu");
+ tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course");
tEmail.setType(1);
tEmail.setOrderId(orderId);
tEmail.setCreateTime(new Date());
@@ -2323,7 +2480,50 @@
public void run() {
pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
pushUtil.pushOrderState(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getState(), 0, "");
- pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getPayMoney());
+ Integer language1 = driver.getLanguage();
+ String text = "";
+ switch (language1){
+ case 1:
+ text = "客户已选择支付现金,因此您必须收款。确定您已收到此订单费用:现金GHS " + orderPrivateCar.getPayMoney();
+ break;
+ case 2:
+ text = "The client chose to pay in cash, so you must collect the payment.Confirm if you received the charge for this order: Cash GHS " + orderPrivateCar.getPayMoney();
+ break;
+ case 3:
+ text = "Le client a choisi de payer en espèces, vous devez donc encaisser le paiement.Confirmez si vous avez reçu les frais pour cette commande : Espèces GHS " + orderPrivateCar.getPayMoney();
+ break;
+
+ }
+ String audioUrl = "";
+ String fileName = "offlinePayment" + orderPrivateCar.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);
+ }
+ //定时任务删除语音文件
+ new Timer().schedule(new TimerTask() {
+ @Override
+ public void run() {
+ try {
+ // 使用Runtime执行命令
+ Process process = Runtime.getRuntime().exec("sudo rm -rf /home/igotechgh/nginx/html/files/audio/" + fileName);
+ // 读取命令的输出
+ BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
+ String line;
+ while ((line = reader.readLine()) != null) {
+ System.out.println(line);
+ }
+ // 等待命令执行完成
+ process.waitFor();
+ // 关闭流
+ reader.close();
+ } catch (IOException | InterruptedException e) {
+ e.printStackTrace();
+ }
+ }
+ }, 30000);
+ pushUtil.pushOfflinePayment(2, orderPrivateCar.getDriverId(), orderPrivateCar.getId(), 1, orderPrivateCar.getPayMoney(), audioUrl);
}
}).start();
@@ -2439,16 +2639,16 @@
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.getEndTime())) + ". 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());
//开始生成pdf收据和html收据
- File file = new File("/usr/local/nginx/html/files/html/");
+ File file = new File("/home/igotechgh/nginx/html/files/html/");
if(!file.exists()){
file.mkdirs();
}
- file = new File("/usr/local/nginx/html/files/html/redpacket_" + orderId + ".html");
+ file = new File("/home/igotechgh/nginx/html/files/html/redpacket_" + orderId + ".html");
if(!file.exists()){
file.createNewFile();
}
@@ -2457,7 +2657,7 @@
fileWriter.flush();
fileWriter.close();
- String link ="http://182.160.16.251:81/files/html/redpacket_" + orderId + ".html";
+ String link ="https://igo.i-go.group/files/html/redpacket_" + orderId + ".html";
TEmail tEmail = new TEmail();
tEmail.setLink(link);
tEmail.setUserId(userInfo.getId());
@@ -2495,11 +2695,7 @@
if(null != query){
//添加交易明细
transactionDetailsService.saveData(orderPrivateCar.getUserId(), "取消订单", query.getAmount(), 2, 1, 1, 1, query.getOrderId());
- if(5 == orderPrivateCar.getOldState()){
- orderPrivateCar.setState(6);
- }else{
- orderPrivateCar.setState(10);
- }
+ orderPrivateCar.setState(10);
//解除小号绑定
if(orderPrivateCar.getBindId() != null){
ChinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX());
@@ -2588,29 +2784,27 @@
query.setState(2);
query.setCode(order_id);
paymentRecordService.updateById(query);
- if(orderPrivateCar.getIsplatPay()==1){
- //添加已收入明细
- Company company = companyService.selectById(orderPrivateCar.getCompanyId());
- Double taxi = company.getSpeMoney();
- BigDecimal d = null;//企业收入
- BigDecimal c = null;//司机收入
- if(company.getIsSpeFixedOrProportional() == 2){//固定
- d = new BigDecimal(taxi);
- c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
- }
- if(company.getIsSpeFixedOrProportional() == 1){//比例
- Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
- d = new BigDecimal(price).multiply(new BigDecimal(taxi).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
- c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
- }
- incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
- incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
- Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
- driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
- driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
- driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
- driverService.updateById(driver);
+ //添加已收入明细
+ Company company = companyService.selectById(orderPrivateCar.getCompanyId());
+ Double taxi = company.getSpeMoney();
+ BigDecimal d = null;//企业收入
+ BigDecimal c = null;//司机收入
+ if(company.getIsSpeFixedOrProportional() == 2){//固定
+ d = new BigDecimal(taxi);
+ c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
}
+ if(company.getIsSpeFixedOrProportional() == 1){//比例
+ Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
+ d = new BigDecimal(price).multiply(new BigDecimal(taxi).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
+ c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
+ }
+ incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());
+ incomeService.saveData(2, orderPrivateCar.getDriverId(), 2, orderPrivateCar.getId(), 1, c.doubleValue());
+ Driver driver = driverService.selectById(orderPrivateCar.getDriverId());
+ driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ driverService.updateById(driver);
if(ToolUtil.isNotEmpty(userInfo.getEmail())){
@@ -2629,11 +2823,11 @@
if(null != orderPrivateCar.getDriverId()){
aDouble = orderEvaluateService.queryDriverScore(orderPrivateCar.getDriverId());
}
- Double aDouble1 = Double.valueOf(orderPrivateCar.getMileage() / 1000);
+ Double aDouble1 = new BigDecimal(orderPrivateCar.getMileage()).divide(new BigDecimal(1000)).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
if(1 == language){
document.getElementById("english").remove();
document.getElementById("french").remove();
- document.getElementsByTag("title").get(0).text("I-GO电子收据");
+ document.getElementsByTag("title").get(0).text("打车收据");
Element title_chinese = document.getElementById("title_chinese");
title_chinese.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",您在I-GO此订单消费GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
Element qbj_chinese = document.getElementById("qbj_chinese");
@@ -2700,12 +2894,18 @@
pay_type_chinese.text(orderPrivateCar.getPayType() == 1 ? "手机支付" : (orderPrivateCar.getPayType() == 2?"银行卡支付":(orderPrivateCar.getPayType() == 3?"余额支付":"现金支付")));
Element pay_money_chinese = document.getElementById("pay_money_chinese");
pay_money_chinese.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_chinese = document.getElementById("dispute_chinese");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_chinese.text("(注意: 争议订单,经过三方协商,平台最终定价为 GHS" + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_chinese.remove();
+ }
Element pdf_chinese = document.getElementById("pdf_chinese");
- pdf_chinese.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
+ pdf_chinese.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
Element lost_item_chinese = document.getElementById("lost_item_chinese");
- lost_item_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
+ lost_item_chinese.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
Element track_chinese = document.getElementById("track_chinese");
- track_chinese.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id);
+ track_chinese.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id);
Element pay_time_chinese = document.getElementById("pay_time_chinese");
pay_time_chinese.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_chinese = document.getElementsByClass("driver_chinese");
@@ -2734,7 +2934,7 @@
if(2 == language){
document.getElementById("chinese").remove();
document.getElementById("french").remove();
- document.getElementsByTag("title").get(0).text("Receipt");
+ document.getElementsByTag("title").get(0).text("Ride receipt");
Element title_english = document.getElementById("title_english");
title_english.text(DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ",You spent GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " on the trip ");
Element qbj_english = document.getElementById("qbj_english");
@@ -2801,12 +3001,18 @@
pay_type_english.text(orderPrivateCar.getPayType() == 1 ? "Mobile money" :(orderPrivateCar.getPayType() == 2?"Bank card":(orderPrivateCar.getPayType() == 3?"I-GO Wallet":"Cash")));
Element pay_money_english = document.getElementById("pay_money_english");
pay_money_english.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_english = document.getElementById("dispute_english");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_english.text("(Note: Disputed order, after tripartite negotiation, the final pricing of the platform is GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_english.remove();
+ }
Element pdf_english = document.getElementById("pdf_english");
- pdf_english.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
+ pdf_english.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
Element lost_item_english = document.getElementById("lost_item_english");
- lost_item_english.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
+ lost_item_english.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
Element track_english = document.getElementById("track_english");
- track_english.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id);
+ track_english.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id);
Element pay_time_english = document.getElementById("pay_time_english");
pay_time_english.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_english = document.getElementsByClass("driver_english");
@@ -2835,7 +3041,7 @@
if(3 == language){
document.getElementById("chinese").remove();
document.getElementById("english").remove();
- document.getElementsByTag("title").get(0).text("Reçu");
+ document.getElementsByTag("title").get(0).text("Reçu de course");
Element title_french = document.getElementById("title_french");
title_french.text("Le " + DateUtil.conversionFormat(language, sdf.format(orderPrivateCar.getTravelTime())) + ", vous avez dépensé GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue() + " sur le voyage");
Element qbj_french = document.getElementById("qbj_french");
@@ -2902,12 +3108,18 @@
pay_type_french.text(orderPrivateCar.getPayType() == 1 ? "Argent mobile" : (orderPrivateCar.getPayType() == 2?"Carte bancaire":(orderPrivateCar.getPayType() == 3?"Portefeuille I-GO":"En espèces")));
Element pay_money_french = document.getElementById("pay_money_french");
pay_money_french.text("GHS " + new BigDecimal(orderPrivateCar.getPayMoney()).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
+ Element dispute_french = document.getElementById("dispute_french");
+ if(null != orderPrivateCar.getIsDispute() && orderPrivateCar.getIsDispute() == 1){
+ dispute_french.text("(Remarque: Il s’agit d’une commande contestée, et après des négociations entre trois parties, la plateforme l’a finalement tarifée à GHS " + new BigDecimal(orderPrivateCar.getOrderMoney()).setScale(2, RoundingMode.HALF_EVEN) + ")");
+ }else{
+ dispute_french.remove();
+ }
Element pdf_french = document.getElementById("pdf_french");
- pdf_french.attr("href", "http://182.160.16.251:80/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
+ pdf_french.attr("href", "https://igo.i-go.group/user/base/order/uploadReceiptPdf?orderId=" + id + "&orderType=1");
Element lost_item_french = document.getElementById("lost_item_french");
- lost_item_french.attr("href", "http://182.160.16.251:81/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
+ lost_item_french.attr("href", "https://igo.i-go.group/mailbox/user/lossGoods.html?language=" + language + "&orderId=" + id + "&orderType=1");
Element track_french = document.getElementById("track_french");
- track_french.attr("href", "http://182.160.16.251:81/mailbox/user/location.html?orderId=" + id);
+ track_french.attr("href", "https://igo.i-go.group/mailbox/user/location.html?orderId=" + id);
Element pay_time_french = document.getElementById("pay_time_french");
pay_time_french.text(DateUtil.conversionFormat(language, sdf1.format(orderPrivateCar.getEndServiceTime())));
Elements driver_french = document.getElementsByClass("driver_french");
@@ -2934,14 +3146,14 @@
server_tel_french.attr("href", "tel:" + (null != phone ? phone.getPhone() : ""));
}
- EmailUtil.send(userInfo.getEmail(), language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu", document.html());
+ EmailUtil.send(userInfo.getEmail(), language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course", document.html());
//开始生成pdf收据和html收据
- File file = new File("/usr/local/nginx/html/files/html/");
+ File file = new File("/home/igotechgh/nginx/html/files/html/");
if(!file.exists()){
file.mkdirs();
}
- file = new File("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html");
+ file = new File("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html");
if(!file.exists()){
file.createNewFile();
}
@@ -2950,27 +3162,27 @@
fileWriter.flush();
fileWriter.close();
- File file1 = new File("/usr/local/nginx/html/files/pdf/");
+ File file1 = new File("/home/igotechgh/nginx/html/files/pdf/");
if(!file1.exists()){
file1.mkdirs();
}
- file1 = new File("/usr/local/nginx/html/files/pdf/ride_receipt_" + id + ".pdf");
+ file1 = new File("/home/igotechgh/nginx/html/files/pdf/ride_receipt_" + id + ".pdf");
if(!file1.exists()){
file1.createNewFile();
}
try {
FileOutputStream fileOutputStream = new FileOutputStream(file1);
- HtmlToPdfUtils.convertToPdf("/usr/local/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream);
+ HtmlToPdfUtils.convertToPdf("/home/igotechgh/nginx/html/files/html/ride_receipt_" + id + ".html", "I-GO", fileOutputStream);
}catch (Exception e){
e.printStackTrace();
System.out.println("html转pdf异常");
}
- String link ="http://182.160.16.251:81/files/html/ride_receipt_" + id + ".html";
+ String link ="https://igo.i-go.group/files/html/ride_receipt_" + id + ".html";
TEmail tEmail = new TEmail();
tEmail.setLink(link);
- tEmail.setName(language == 1 ? "I-GO电子收据" : language == 2 ? "Receipt" : "Reçu");
+ tEmail.setName(language == 1 ? "打车收据" : language == 2 ? "Ride receipt" : "Reçu de course");
tEmail.setUserId(userInfo.getId());
tEmail.setType(1);
tEmail.setOrderId(id);
@@ -3034,24 +3246,35 @@
map.put("state", map.get("oldState"));
}
if(state == 8 || state == 9){
- map.put("receipt", "http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html");
+ map.put("receipt", "https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html");
}else{
map.put("receipt", "");
}
OrderPrivateCar orderPrivateCar = orderPrivateCarMapper.selectById(orderId);
- long timeOutCancel = 0L;
- if(null != orderPrivateCar.getEstimateArriveTime()){
- CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderPrivateCar.getCompanyId()));
- JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
- int driverTimeout = jsonObject.getIntValue("driverTimeout") * 60000;
- if(orderPrivateCar.getOrderType() == 1){
- timeOutCancel = orderPrivateCar.getEstimateArriveTime().getTime() + driverTimeout;
- }else{
- timeOutCancel = orderPrivateCar.getTravelTime().getTime() + driverTimeout;
+ Integer driverTimeOutTime = 0;
+ Integer driverTimeOut = 0;
+ CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", orderPrivateCar.getCompanyId()));
+ JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
+ int driverTimeout1 = jsonObject.getIntValue("driverTimeout");
+ if(orderPrivateCar.getOrderType() == 1 && null != orderPrivateCar.getEstimateArriveTime()){
+ long time = orderPrivateCar.getEstimateArriveTime().getTime() + driverTimeout1 * 60000L;
+ if(System.currentTimeMillis() > time){
+ driverTimeOutTime = Double.valueOf((System.currentTimeMillis() - time) / 60000).intValue();
+ driverTimeOutTime = driverTimeOutTime == 0 ? 1 : driverTimeOutTime;
+ driverTimeOut = 1;
+ }
+ }else{
+ long time = orderPrivateCar.getTravelTime().getTime() + driverTimeout1 * 60000L;
+ if(System.currentTimeMillis() >= time){
+ driverTimeOutTime = Double.valueOf((System.currentTimeMillis() - time) / 60000).intValue();
+ driverTimeOutTime = driverTimeOutTime == 0 ? 1 : driverTimeOutTime;
+ driverTimeOut = 1;
}
}
- map.put("timeOutCancel", timeOutCancel);
+
+ map.put("driverTimeOutTime", driverTimeOutTime);
+ map.put("driverTimeOut", driverTimeOut);
}
return maps;
}
@@ -3062,7 +3285,7 @@
endTime = dateUtil.getStartOrEndDate(endTime, "end");
List<Map<String, Object>> list = orderPrivateCarMapper.queryInvoiceOrder(type, startTime, endTime, startMoney, endMoney, uid);
for (Map<String, Object> map : list) {
- map.put("orderName", language == 1 ? "打车订单" : language == 2 ? "Ride" : "Course");
+ map.put("orderName", language == 1 ? "打车" : language == 2 ? "Ride" : "Course");
if(null != map.get("time")){
String time = map.get("time").toString();
map.put("time", DateUtil.conversionFormat(language, time));
@@ -3118,7 +3341,7 @@
map.put("device", ToolUtil.isNotEmpty(driverId) ? 2 : 1);
map.put("orderType", 1);
if(state == 8 || state == 9){
- map.put("receipt", "http://182.160.16.251:81/files/html/ride_receipt_" + orderId + ".html");
+ map.put("receipt", "https://igo.i-go.group/files/html/ride_receipt_" + orderId + ".html");
}else{
map.put("receipt", "");
}
@@ -3127,21 +3350,30 @@
companyId = Integer.valueOf(String.valueOf(map.get("companyId")));
}
- long timeOutCancel = 0L;
- long driverTimeOut = 0L;
+ Integer driverTimeOutTime = 0;
+ Integer driverTimeOut = 0;
CancleOrder cancleOrder = cancleOrderService.selectOne(new EntityWrapper<CancleOrder>().eq("companyId", companyId));
JSONObject jsonObject = JSON.parseObject(cancleOrder.getContent());
- int driverTimeout = jsonObject.getIntValue("driverTimeout") * 60000;
+ int driverTimeout1 = jsonObject.getIntValue("driverTimeout");
if(orderPrivateCar.getOrderType() == 1 && null != orderPrivateCar.getEstimateArriveTime()){
- timeOutCancel = orderPrivateCar.getEstimateArriveTime().getTime() + driverTimeout;
- driverTimeOut = orderPrivateCar.getEstimateArriveTime().getTime();
+ long time = orderPrivateCar.getEstimateArriveTime().getTime() + driverTimeout1 * 60000L;
+ if(System.currentTimeMillis() > time){
+ driverTimeOutTime = Double.valueOf((System.currentTimeMillis() - time) / 60000).intValue();
+ driverTimeOutTime = driverTimeOutTime == 0 ? 1 : driverTimeOutTime;
+ driverTimeOut = 1;
+ }
}else{
- timeOutCancel = orderPrivateCar.getTravelTime().getTime() + driverTimeout;
- driverTimeOut = orderPrivateCar.getTravelTime().getTime();
+ long time = orderPrivateCar.getTravelTime().getTime() + driverTimeout1 * 60000L;
+ if(System.currentTimeMillis() >= time){
+ driverTimeOutTime = Double.valueOf((System.currentTimeMillis() - time) / 60000).intValue();
+ driverTimeOutTime = driverTimeOutTime == 0 ? 1 : driverTimeOutTime;
+ driverTimeOut = 1;
+ }
}
- map.put("timeOutCancel", timeOutCancel);
+ map.put("driverTimeOutTime", driverTimeOutTime);
map.put("driverTimeOut", driverTimeOut);
+ map.put("isDispute", orderPrivateCar.getIsDispute());
return map;
}
@@ -3196,10 +3428,11 @@
String lnt = "0";
String lat = "0";
+ String tripId = redisUtil.getValue("trip" + uid);
if(ToolUtil.isNotEmpty(value)){
lnt = value.split(",")[0];
lat = value.split(",")[1];
- DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt));
+ DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(orderPrivateCar.getStartLat(), orderPrivateCar.getStartLon(), Double.valueOf(lat), Double.valueOf(lnt), tripId);
if(null == distancematrix){
System.err.println("查询距离出错了");
@@ -3227,7 +3460,7 @@
orderServerWarpper.setLaveTime("0");
}
if(orderPrivateCar.getState() == 5 || orderPrivateCar.getState() == 6){//服务中
- DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon());
+ DistancematrixVo distancematrix = GoogleMapUtil.getDistancematrix(Double.valueOf(lat), Double.valueOf(lnt), orderPrivateCar.getEndLat(), orderPrivateCar.getEndLon(), tripId);
if(null == distancematrix){
System.err.println("查询距离出错了");
}else if(distancematrix.getDistance() == 0){
@@ -3270,7 +3503,7 @@
public List<Map<String, Object>> queryRedEnvelope(Integer language, Integer uid) throws Exception {
List<Map<String, Object>> list = orderPrivateCarMapper.queryRedEnvelope(uid);
for (Map<String, Object> map : list) {
- map.put("name", language == 1 ? "打车订单" : language == 2 ? "Ride" : "Course");
+ map.put("name", language == 1 ? "打车" : language == 2 ? "Ride" : "Course");
if(null != map.get("time")){
String time = map.get("time").toString();
map.put("time", DateUtil.conversionFormat(language, time));
@@ -3331,13 +3564,13 @@
String audioUrl = "";
switch (language1){
case 1:
- audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-CN.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-CN.mp3";
break;
case 2:
- audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-EN.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-EN.mp3";
break;
case 3:
- audioUrl = "http://182.160.16.251:81/files/audio/system/ChangeAddress-FR.mp3";
+ audioUrl = "https://igo.i-go.group/files/audio/system/ChangeAddress-FR.mp3";
break;
}
pushUtil.pushModifyAddress(2, orderPrivateCar.getDriverId(), orderId, 1, 1, audioUrl);
--
Gitblit v1.7.1