Pu Zhibing
2024-09-29 adf2ede692b76cf95d0cec80f4087e52d760b219
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -5,9 +5,11 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.stylefeng.guns.core.util.ToolUtil;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics;
import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread;
import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService;
import com.stylefeng.guns.modular.smallLogistics.server.impl.OrderLogisticsSpreadService;
import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar;
import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService;
import com.stylefeng.guns.modular.system.model.OrderPosition;
import com.stylefeng.guns.modular.system.model.Reassign;
@@ -15,6 +17,7 @@
import com.stylefeng.guns.modular.system.service.IOrderService;
import com.stylefeng.guns.modular.system.service.IReassignService;
import com.stylefeng.guns.modular.system.util.*;
import com.stylefeng.guns.modular.system.util.GoogleMap.FleetEngineUtil;
import com.stylefeng.guns.modular.system.util.Tingg.model.CallbackRequest;
import com.stylefeng.guns.modular.system.util.Tingg.model.CallbackResponse;
import com.stylefeng.guns.modular.system.util.Tingg.model.Payments;
@@ -29,6 +32,7 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
@@ -70,6 +74,9 @@
    @Value("${filePath}")
    private String filePath;
    @Resource
    private FleetEngineUtil fleetEngineUtil;
@@ -863,4 +870,35 @@
        }
        return ResultUtil.success();
    }
    @ResponseBody
    @PostMapping("/api/taxi/getTripInfo")
    @ApiOperation(value = "获取google行程详情【2.0】", tags = {"用户端-专车", "用户端-小件物流"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil<String> getTripInfo(Integer orderId, Integer orderType){
        try {
            String tripId = null;
            switch (orderType){
                case 1:
                    OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId);
                    tripId = orderPrivateCar.getTripId();
                    break;
                case 4:
                    OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId);
                    tripId = orderLogistics.getTripId();
                    break;
            }
            String trip = fleetEngineUtil.getTrip(tripId);
            return ResultUtil.success(trip);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
}