From 8b8bde1c84068aae454809005d61df8b401a6c23 Mon Sep 17 00:00:00 2001 From: Pu Zhibing <393733352@qq.com> Date: 星期三, 18 十二月 2024 15:39:01 +0800 Subject: [PATCH] 修改表格返回结果对象 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java | 54 ++++++++++++++++++++++++++++++++---------------------- 1 files changed, 32 insertions(+), 22 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java index e0d987d..a019584 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java @@ -8,6 +8,7 @@ import com.ruoyi.account.api.model.UserAddress; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.controller.BaseController; +import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.order.enums.OrderStatus; @@ -22,7 +23,6 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; -import java.math.BigInteger; import java.time.LocalDateTime; import java.util.List; @@ -75,7 +75,7 @@ /** * 订单详情 */ - @ApiOperation(value = "订单详情", tags = {"小程序-订单详情"}) + @ApiOperation(value = "订单详情", tags = {"小程序-个人中心-我的订单-订单详情"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), }) @@ -87,7 +87,7 @@ /** * 扫码校验 */ - @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理-扫码核销校验"}) + @ApiOperation(value = "扫码校验", tags = {"小程序-个人中心-门店管理"}) @ApiImplicitParams({ @ApiImplicitParam(value = "分享id", name = "shareId", required = true, dataType = "int", paramType="query"), }) @@ -102,7 +102,7 @@ /** * 订单核销 */ - @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理-扫码核销"}) + @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单号", name = "code", required = true, dataType = "String"), }) @@ -115,7 +115,7 @@ /** * 取消订单 */ - @ApiOperation(value = "取消订单", tags = {"小程序-个人中心-我的订单-取消订单"}) + @ApiOperation(value = "取消订单", tags = {"小程序-个人中心-我的订单"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), }) @@ -130,7 +130,7 @@ /** * 确认收货 */ - @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单-确认收货"}) + @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), }) @@ -161,7 +161,7 @@ /** * 更换收货地址 */ - @ApiOperation(value = "更换收货地址", tags = {"小程序-个人中心-我的订单-更换收货地址"}) + @ApiOperation(value = "更换收货地址", tags = {"小程序-个人中心-我的订单"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), }) @@ -182,7 +182,7 @@ /** * 更新订单状态 */ - @ApiOperation(value = "更新订单状态", tags = {"后台-订单管理-更新订单状态"}) + @ApiOperation(value = "更新订单状态", tags = {"后台-订单管理"}) @ApiImplicitParams({ @ApiImplicitParam(value = "订单对象", name = "order", required = true, dataType = "Order"), }) @@ -205,19 +205,28 @@ orderService.updateById(order); return R.ok(); } - - - @ResponseBody - @GetMapping("/getOrderPageList") - @ApiOperation(value = "获取订单列表", tags = {"管理后台-订单管理", "门店后台-订单管理"}) - public TableDataInfo<OrderPageListVo> getOrderPageList(OrderPageList orderPageList){ - startPage(); - List<OrderPageListVo> list = orderService.getOrderPageList(orderPageList); - return getDataTable(list); + + @PostMapping("/getLastOrder") + public R<Order> getLastOrder(@RequestParam("appUserId") Long appUserId){ + Order one = orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).orderByDesc(Order::getCreateTime).last("limit 1").one(); + return R.ok(one); } + + + @PostMapping("/byUserId") + public R<List<Order>> byUserId(@RequestParam("appUserId") Long appUserId){ + return R.ok(orderService.lambdaQuery().eq(Order::getAppUserId, appUserId).list()); + } + @PostMapping("/byShopId") + public R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId){ + return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).groupBy(Order::getAppUserId).list()); + } + - @ResponseBody + + + @PutMapping("/confirmDelivery/{orderId}") @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"}) public R confirmDelivery(@PathVariable("orderId") String orderId, String code){ @@ -225,14 +234,12 @@ } - @ResponseBody @PutMapping("/cancelOrder/{orderId}") @ApiOperation(value = "取消订单操作", tags = {"管理后台-订单管理"}) public R cancelOrder(@PathVariable("orderId") Long orderId){ return orderService.cancelOrder(orderId); } - @ResponseBody @PutMapping("/receivingOperation/{orderId}") @ApiOperation(value = "收货操作", tags = {"管理后台-订单管理"}) public R receivingOperation(@PathVariable("orderId") Long orderId){ @@ -240,7 +247,6 @@ } - @ResponseBody @GetMapping("/getOrderInfo/{orderId}") @ApiOperation(value = "查询订单详情", tags = {"管理后台-订单管理"}) public R<OrderInfoVo> getOrderInfo(@PathVariable("orderId") Long orderId){ @@ -249,6 +255,10 @@ } - + @GetMapping("/getOrderPageList") +// @ApiOperation(value = "获取订单列表", tags = {"管理后台-订单管理", "门店后台-订单管理"}) + public R<PageInfo<OrderPageListVo>> getOrderPageList(OrderPageList orderPageList){ + return R.ok(orderService.getOrderPageList(orderPageList)); + } } -- Gitblit v1.7.1