| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/v1/mini-program/navigation/route-and-fare") |
| | | @ApiOperation(value = "导航-获取路线和费用",tags = {"小程序-获取路线和费用"},response = RouteAndFareVo.class) |
| | | @ApiOperation(value = "导航-获取路线和费用", tags = {"小程序-获取路线和费用"}, response = RouteAndFareVo.class) |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<RouteAndFareVo> getRouteAndFare(@RequestBody @Valid RouteAndFareDto routeAndFareDto, HttpServletRequest request) { |
| | | // uid已通过拦截器otp校验,可以直接使用 |
| | | String uid = request.getHeader("XP-Uid"); |
| | | return R.ok(xpPricingService.getRouteAndFare(routeAndFareDto,uid)); |
| | | return R.ok(xpPricingService.getRouteAndFare(routeAndFareDto, uid)); |
| | | } |
| | | |
| | | // 根据开通城市 获取定价 |
| | | @GetMapping("/getPricingByCityId/{cityId}") |
| | | public R<XpPricing> getPricingByCityId(@PathVariable("cityId")Long cityId) { |
| | | public R<XpPricing> getPricingByCityId(@PathVariable("cityId") Long cityId) { |
| | | XpPricing pricing = xpPricingService.lambdaQuery().eq(XpPricing::getCityId, cityId).last("limit 1").one(); |
| | | return R.ok(pricing); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/base/v1/mini-program/pricing/rules/{openCityId}") |
| | | @ApiOperation(value = "获取费用规则",tags = {"小程序-根据开通城市获取费用规则"},response = String.class) |
| | | @ApiOperation(value = "获取费用规则", tags = {"小程序-根据开通城市获取费用规则"}, response = String.class) |
| | | public R<?> getPricingRules(@PathVariable Long openCityId) { |
| | | XpPricing xpPricing = xpPricingService.getOne(new LambdaQueryWrapper<XpPricing>().eq(XpPricing::getCityId, openCityId).eq(XpPricing::getPricingType, 1).last("limit 1")); |
| | | if(xpPricing!=null){ |
| | | if (xpPricing != null) { |
| | | return R.ok(xpPricing.getPriceRule()); |
| | | } |
| | | return R.ok(""); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/base/v1/mini-program/pricing/getWaitTime") |
| | | @ApiOperation(value = "获取等待时间",tags = {"小程序-获取等待时间"},response = Integer.class) |
| | | public R<Integer> getWaitTime(@RequestBody LonLatDto dto){ |
| | | return R.ok(xpPricingService.getWaitTime(dto.getLongitude(),dto.getLatitude())); |
| | | @ApiOperation(value = "获取等待时间", tags = {"小程序-获取等待时间"}, response = Integer.class) |
| | | public R<Integer> getWaitTime(@RequestBody LonLatDto dto) { |
| | | return R.ok(xpPricingService.getWaitTime(dto.getLongitude(), dto.getLatitude())); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存信息 |
| | | * @param xpGeoQueryEntity |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/inner/saveXpGeoQueryEntity") |
| | | public R<?> saveXpGeoQueryEntity(@RequestBody XpGeoQueryEntity xpGeoQueryEntity){ |
| | | xpGeoQueryEntityService.save(xpGeoQueryEntity); |
| | | @PostMapping("/inner/updateXpGeoQueryEntity") |
| | | public R<?> updateXpGeoQueryEntity(@RequestParam String orderId) { |
| | | xpGeoQueryEntityService.updateByOrderId(orderId); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | * 播单 |
| | | */ |
| | | @PostMapping("/base/v1/mini-program/order/save") |
| | | @ApiOperation(value = "保存订单",tags = {"小程序-保存订单"}) |
| | | @ApiOperation(value = "保存订单", tags = {"小程序-保存订单"}) |
| | | @XpClientCheck(checkToken = false, checkOtpToken = true) |
| | | public R<SaveOrderVo> saveOrder(@RequestBody @Validated XpOrderDto dto, HttpServletRequest request) { |
| | | String uid = request.getHeader("XP-Uid"); |
| | |
| | | saveOrderVo.setOrderId(l); |
| | | return R.ok(saveOrderVo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |