From 98d29a456ff0bc9db86e5cc4696fde2a8524b4f8 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期一, 13 一月 2025 22:34:18 +0800 Subject: [PATCH] 12.18 --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java | 31 +++++++++++++++++++++++++++++-- 1 files changed, 29 insertions(+), 2 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 752d42e..9bd0e61 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 @@ -205,6 +205,7 @@ public R<Void> updateOrderStatus(@RequestBody Order order){ Order order1 = orderService.getById(order.getId()); order1.setOrderStatus(order.getOrderStatus()); + order1.setOldOrderStatus(order.getOldOrderStatus()); orderService.updateById(order1); return R.ok(); } @@ -286,8 +287,10 @@ Long userid = tokenService.getLoginUser().getUserid(); SysUser sysUser = sysUserClient.getSysUser(userid).getData(); - List<Order> orderList = orderService.list(new LambdaQueryWrapper<Order>().eq(sysUser.getRoleType() == 2, Order::getShopId, sysUser.getObjectId()) - .between(Order::getCreateTime, LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))); + List<Order> orderList = orderService.list(new LambdaQueryWrapper<Order>() + .eq(sysUser.getRoleType() == 2, Order::getShopId, sysUser.getObjectId()) + .between(Order::getCreateTime, LocalDateTime.parse(startTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), LocalDateTime.parse(endTime, DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))) + .orderByAsc(Order::getCreateTime)); Map<String, List<Order>> map = orderList.stream().collect(Collectors.groupingBy(item -> item.getCreateTime() @@ -450,5 +453,29 @@ } return R.ok(); } + + + /** + * 根据id获取订单详情 + * @param id + * @return + */ + @PostMapping("/getOrderById") + public R<Order> getOrderById(@RequestParam("id") Long id){ + Order order = orderService.getById(id); + return R.ok(order); + } + + + /** + * 修改订单 + * @param order + * @return + */ + @PostMapping("/editOrder") + public R editOrder(@RequestBody Order order){ + orderService.updateById(order); + return R.ok(); + } } -- Gitblit v1.7.1