| | |
| | | import com.xzx.gc.common.request.BaseController; |
| | | import com.xzx.gc.model.JsonResult; |
| | | import com.xzx.gc.order.dto.AddJhyOrderDto; |
| | | import com.xzx.gc.order.dto.JhyOrderConfirmDto; |
| | | import com.xzx.gc.order.dto.JhyOrderListDto; |
| | | import com.xzx.gc.order.service.JhyOrderService; |
| | | import com.xzx.gc.order.vo.JhyOrderDetailsVo; |
| | | import com.xzx.gc.order.vo.JhyOrderListVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | return JsonResult.success(result); |
| | | } |
| | | |
| | | @ApiOperation("订单明细信息") |
| | | @ApiResponses( |
| | | @ApiResponse(code = 200, message = "success", response = JhyOrderDetailsVo.class) |
| | | ) |
| | | @PostMapping(value = "/jhy/order/details/{orderId}") |
| | | public JsonResult<Object> orderDetail(@PathVariable("orderId") Long orderId, HttpServletRequest request) { |
| | | return JsonResult.success(jhyOrderService.orderDetails(orderId, getUserId(request))); |
| | | } |
| | | |
| | | @ApiOperation("抢单") |
| | | @PostMapping(value = "/jhy/order/grab/{orderId}") |
| | | public Result<String> grabOrder(@PathVariable("orderId") Long orderId, HttpServletRequest request) { |
| | | jhyOrderService.grabOrder(orderId, getUserId(request)); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("取消订单") |
| | | @PostMapping(value = "/jhy/order/cancel/{orderId}") |
| | | public Result<String> cancelOrder(@PathVariable("orderId") Long orderId, HttpServletRequest request) { |
| | | jhyOrderService.cancelOrder(orderId, getUserId(request)); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("确认订单-支付") |
| | | @PostMapping(value = "/jhy/order/confirm") |
| | | public Result<String> confirmOrder(@RequestBody JhyOrderConfirmDto confirmDto, HttpServletRequest request) { |
| | | confirmDto.setUserId(getUserId(request)); |
| | | jhyOrderService.confirmOrder(confirmDto); |
| | | return Result.success(); |
| | | } |
| | | |
| | | @ApiOperation("订单状态数量") |
| | | @PostMapping(value = "/jhy/order/orderStatusCnt/{type}") |
| | | public JsonResult<Map<Integer, Integer>> orderStatusCnt(@PathVariable("type") Integer type, HttpServletRequest request) { |
| | | return JsonResult.success(jhyOrderService.orderStatusCount(type, getUserId(request))); |
| | | } |
| | | |
| | | } |