zhibing.pu
2024-04-12 1a334c1b3703586cd5f463960449d0283125831f
DriverZYTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -35,6 +35,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
 * 订单相关控制器
@@ -368,6 +369,40 @@
        }
    }
    /**
     * 司机流程中创建猎鹰轨迹
     * @param orderId
     * @param orderType
     * @param request
     * @return
     */
    @ResponseBody
    @PostMapping("/api/order/getTrackId")
    @ApiOperation(value = "司机流程中创建猎鹰轨迹-接收轨迹id", tags = {"司机端-服务中"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
            @ApiImplicitParam(value = "订单类型(1=专车,2=快车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"),
            @ApiImplicitParam(value = "轨迹id", name = "trackId", required = true, dataType = "int"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil getTrackId(Integer orderId, Integer orderType, Integer trackId, HttpServletRequest request){
        try {
            Integer uid = driverService.getUserIdFormRedis(request);
            if(null == uid){
                return ResultUtil.tokenErr();
            }
            // 设置订单轨迹id
            if(Objects.isNull(trackId)){
                return ResultUtil.error("创建轨迹失败!");
            }
            orderService.getTrackId(orderId, orderType, trackId);
            return ResultUtil.success();
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
    /**