提交 d29b6a17 authored 作者: hzh's avatar hzh

用车接口功能实现

上级 bd94a9c0
...@@ -45,7 +45,7 @@ public interface IVehiclesService { ...@@ -45,7 +45,7 @@ public interface IVehiclesService {
* @param model 订单列表查询参数 * @param model 订单列表查询参数
* @return 订单列表 * @return 订单列表
*/ */
PageInfo<org.dromara.common.ys.model.res.vehicles.OrderListModel> list(String userId, OrderListModel model); PageInfo<org.dromara.common.ys.model.res.vehicles.OrderListModel> orderList(String userId, OrderListModel model);
/** /**
......
...@@ -73,7 +73,7 @@ public class VehiclesServiceImpl implements IVehiclesService { ...@@ -73,7 +73,7 @@ public class VehiclesServiceImpl implements IVehiclesService {
} }
@Override @Override
public PageInfo<OrderListModel> list(String userId, org.dromara.common.ys.model.req.vehicles.OrderListModel model) { public PageInfo<OrderListModel> orderList(String userId, org.dromara.common.ys.model.req.vehicles.OrderListModel model) {
ApiHttpResponse res = Api.v1( ApiHttpResponse res = Api.v1(
com.wenhe.base.base.RequestMethodEnum.POST, com.wenhe.base.base.RequestMethodEnum.POST,
DomainEnum.TEST.getDomain(), DomainEnum.TEST.getDomain(),
......
...@@ -4,13 +4,17 @@ package org.dromara.server.controller.vehicle; ...@@ -4,13 +4,17 @@ package org.dromara.server.controller.vehicle;
import io.seata.spring.annotation.GlobalTransactional; import io.seata.spring.annotation.GlobalTransactional;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.ys.common.PageInfo;
import org.dromara.common.ys.constant.TripType; import org.dromara.common.ys.constant.TripType;
import org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel; import org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel;
import org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel; import org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel;
import org.dromara.common.ys.model.req.vehicles.OrderDetailModel;
import org.dromara.common.ys.model.res.vehicles.*;
import org.dromara.common.ys.service.IVehiclesService; import org.dromara.common.ys.service.IVehiclesService;
import org.dromara.server.base.BaseController; import org.dromara.server.base.BaseController;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
* 用车相关 * 用车相关
...@@ -44,5 +48,82 @@ public class VehiclesController extends BaseController { ...@@ -44,5 +48,82 @@ public class VehiclesController extends BaseController {
return R.ok(vehiclesService.estimateYyycPrice(getUserId(), model)); return R.ok(vehiclesService.estimateYyycPrice(getUserId(), model));
} }
/**
* 订单详情
*/
@GlobalTransactional(timeoutMills = 600000)
@RequestMapping("/order/detail")
public R<org.dromara.common.ys.model.res.vehicles.OrderDetailModel> orderDetail(OrderDetailModel model) {
return R.ok(vehiclesService.detail(getUserId(), model));
}
/**
* 订单列表
*/
@GlobalTransactional(timeoutMills = 600000)
@GetMapping("/order/list")
public R<PageInfo<OrderListModel>> orderList(org.dromara.common.ys.model.req.vehicles.OrderListModel model) {
model.setBookNo(getUserId());
return R.ok(vehiclesService.orderList(getUserId(), model));
}
/**
* 下单接口(即时用车)
*/
@GlobalTransactional(timeoutMills = 600000, rollbackFor = Exception.class)
@PostMapping("/order/bookJsyc")
public R<OrderBookJsycModel> bookOrderJsyc(@RequestBody org.dromara.common.ys.model.req.vehicles.OrderBookJsycModel model) {
model.setTripType(Integer.parseInt(TripType.PUBLIC.getCode()));
OrderBookJsycModel order = vehiclesService.bookJsyc(getUserId(), model);
return R.ok(order);
}
/**
* 下单接口(预约用车)
*/
@GlobalTransactional(timeoutMills = 600000, rollbackFor = Exception.class)
@PostMapping("/order/bookYyyc")
public R<OrderBookYyycModel> bookOrderYyyc(@RequestBody org.dromara.common.ys.model.req.vehicles.OrderBookYyycModel model) {
model.setTripType(Integer.parseInt(TripType.PUBLIC.getCode()));
OrderBookYyycModel order = vehiclesService.bookYyyc(getUserId(), model);
return R.ok(order);
}
/**
* 获取司机位置
*/
@GlobalTransactional(timeoutMills = 600000, rollbackFor = Exception.class)
@PostMapping("/order/getDriverLocation")
public R<DriverLocationModel> getDriverLocation(@RequestBody org.dromara.common.ys.model.req.vehicles.DriverLocationModel model) {
return R.ok(vehiclesService.getDriverLocation(getUserId(), model));
}
/**
* 获取罚金金额
*/
@GlobalTransactional(timeoutMills = 600000, rollbackFor = Exception.class)
@PostMapping("/order/getCancelFee")
public R<CancelFeeModel> getCancelFee(@RequestBody org.dromara.common.ys.model.req.vehicles.CancelFeeModel model) {
return R.ok(vehiclesService.getCancelFee(getUserId(), model));
}
/**
* 取消订单
*/
@GlobalTransactional(timeoutMills = 600000, rollbackFor = Exception.class)
@PostMapping("/order/cancel")
public R<OrderCancelModel> orderCancel(@RequestBody org.dromara.common.ys.model.req.vehicles.OrderCancelModel model) {
return R.ok(vehiclesService.cancel(getUserId(), model));
}
/**
* 获取取消原因集合
*/
@GlobalTransactional(timeoutMills = 600000, rollbackFor = Exception.class)
@PostMapping("/getCancelReasonList")
public R<List<OrderGetQxyyModel>> getCancelReason() {
return R.ok(vehiclesService.getCancelReasonList(getUserId()));
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论