From cb7e84fe6e40f3ce3ed1fe3fb3b4c0da8c847793 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 27 八月 2025 23:51:22 +0800 Subject: [PATCH] 修改bug --- DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java | 83 +++++++++++++++++++++++++---------------- 1 files changed, 50 insertions(+), 33 deletions(-) diff --git a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java index 0aceb7e..6142adf 100644 --- a/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java +++ b/DriverQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderServiceImpl.java @@ -38,6 +38,8 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.net.InetAddress; +import java.net.NetworkInterface; import java.util.*; /** @@ -128,9 +130,18 @@ //获取证联数据 if(null == driver.getCustId() || 0 == driver.getAccOpenFlag()){ TradeTerminalInfo tradeTerminalInfo = new TradeTerminalInfo(); - tradeTerminalInfo.setIp("127.0.0.1"); tradeTerminalInfo.setTerminal("1"); - tradeTerminalInfo.setMac(""); + InetAddress inetAddress = InetAddress.getLocalHost(); + String ip = inetAddress.getHostAddress(); + tradeTerminalInfo.setIp(ip); + NetworkInterface networkInterface = NetworkInterface.getByInetAddress(inetAddress); + byte[] mac = networkInterface.getHardwareAddress(); + StringBuilder macAddress = new StringBuilder(); + for (int i = 0; i < mac.length; i++) { + macAddress.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : "")); + } + + tradeTerminalInfo.setMac(macAddress.toString()); ZLUserInfo userInfo = ZhengLianUtil.getUserInfo(driver.getEmpId().toString(), tradeTerminalInfo); if(null != userInfo){ driver.setCustId(userInfo.getCustId()); @@ -375,19 +386,22 @@ } break; case 2://出租 - OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); - if(null != orderPrivateCar && orderPrivateCar.getType() == 3){ - map = orderPrivateCarService.queryPushOrder(orderId); - }else{ + OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); + if((null != orderTaxi && orderTaxi.getType() == 2) || (null != orderTaxi && orderTaxi.getState() == 11)){ map = orderTaxiService.queryPushOrder(orderId); + }else{ + OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); + if(null != orderPrivateCar && orderPrivateCar.getType() == 3){ + map = orderPrivateCarService.queryPushOrder(orderId); + }else{ + map = orderTaxiService.queryPushOrder(orderId); + } } String order1 = String.valueOf(map.get("startLon")) + "," + String.valueOf(map.get("startLat")); // TODO: 2023/11/4 无法修改 String distance1 = gdMapElectricFenceUtil.getDistance(lon + "," + lat, order1, 1).get("distance"); map.put("startDistance", ToolUtil.isNotEmpty(distance1) ? Double.valueOf(distance1) / 1000 : 0); - //总距离 - String end1 = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); if(end1.equals(",")){ map.put("totalDistance", 0); @@ -402,7 +416,6 @@ } } - Integer orderSource1 = Integer.valueOf(String.valueOf(map.get("orderSource"))); if(orderSource1 == 1 || orderSource1 == 2 || orderSource1 == 3){ @@ -1219,19 +1232,21 @@ orderPrivateCar.setState(8); orderPrivateCarService.updateById(orderPrivateCar); - Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); - Company company1 = companyService.selectById(driver.getCompanyId()); - //中台修改订单状态 - ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); - request1.setOrderId(orderPrivateCar.getTravelId()); - request1.setStatus(orderPrivateCar.getState()); - request1.setDriverId(driver.getEmpId().toString()); - if(2 == orderPrivateCar.getPromotion()){ - Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); - request1.setPromoterId(driver1.getEmpId().toString()); + if(ToolUtil.isNotEmpty(orderPrivateCar.getTravelId())){ + Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); + Company company1 = companyService.selectById(driver.getCompanyId()); + //中台修改订单状态 + ModifyTravelItineraryRequest request1 = new ModifyTravelItineraryRequest(); + request1.setOrderId(orderPrivateCar.getTravelId()); + request1.setStatus(orderPrivateCar.getState()); + request1.setDriverId(driver.getEmpId().toString()); + if(2 == orderPrivateCar.getPromotion()){ + Driver driver1 = driverService.selectById(orderPrivateCar.getPromotionDriverId()); + request1.setPromoterId(driver1.getEmpId().toString()); + } + request1.setSupplierShopId(company1.getEnterCode()); + OrderUtil.modifyTravelItinerary(request1); } - request1.setSupplierShopId(company1.getEnterCode()); - OrderUtil.modifyTravelItinerary(request1); userId = orderPrivateCar.getUserId(); driverId = orderPrivateCar.getDriverId(); @@ -1263,19 +1278,21 @@ orderTaxi.setState(8); orderTaxiService.updateById(orderTaxi); - Driver driver1 = driverService.selectById(orderTaxi.getDriverId()); - Company company = companyService.selectById(driver1.getCompanyId()); - //中台修改订单状态 - ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); - request.setOrderId(orderTaxi.getTravelId()); - request.setStatus(orderTaxi.getState()); - request.setDriverId(driver1.getEmpId().toString()); - if(2 == orderTaxi.getPromotion()){ - Driver driver2 = driverService.selectById(orderTaxi.getPromotionDriverId()); - request.setPromoterId(driver2.getEmpId().toString()); + if(ToolUtil.isNotEmpty(orderTaxi.getTravelId())){ + Driver driver1 = driverService.selectById(orderTaxi.getDriverId()); + Company company = companyService.selectById(driver1.getCompanyId()); + //中台修改订单状态 + ModifyTravelItineraryRequest request = new ModifyTravelItineraryRequest(); + request.setOrderId(orderTaxi.getTravelId()); + request.setStatus(orderTaxi.getState()); + request.setDriverId(driver1.getEmpId().toString()); + if(2 == orderTaxi.getPromotion()){ + Driver driver2 = driverService.selectById(orderTaxi.getPromotionDriverId()); + request.setPromoterId(driver2.getEmpId().toString()); + } + request.setSupplierShopId(company.getEnterCode()); + OrderUtil.modifyTravelItinerary(request); } - request.setSupplierShopId(company.getEnterCode()); - OrderUtil.modifyTravelItinerary(request); userId = orderTaxi.getUserId(); driverId = orderTaxi.getDriverId(); -- Gitblit v1.7.1