From ff169f9a0417b73f0afac554cf2f9d048ac56c80 Mon Sep 17 00:00:00 2001 From: 无关风月 <443237572@qq.com> Date: 星期一, 19 八月 2024 20:57:08 +0800 Subject: [PATCH] Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mx_charging_pile --- ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java | 70 +++++++++++++++++++++++++++++++++- 1 files changed, 67 insertions(+), 3 deletions(-) diff --git a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java index 186eaed..e853464 100644 --- a/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java +++ b/ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/TShoppingOrderController.java @@ -1,9 +1,17 @@ package com.ruoyi.order.controller; +import com.ruoyi.common.core.web.domain.AjaxResult; +import com.ruoyi.order.api.model.TExchangeOrder; +import com.ruoyi.order.api.model.TShoppingOrder; +import com.ruoyi.order.dto.*; +import com.ruoyi.order.service.TShoppingOrderService; import io.swagger.annotations.Api; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; /** * <p> @@ -17,6 +25,62 @@ @RestController @RequestMapping("/t-shopping-order") public class TShoppingOrderController { - + + @Resource + private TShoppingOrderService shoppingOrderService; + + + @GetMapping("/getMyShoppingOrderList") + @ApiOperation(value = "获取购买订单列表", tags = {"小程序-商城购买订单"}) + public AjaxResult<List<MyShoppingOrderList>> getMyShoppingOrderList(GetMyShoppingOrderList query){ + List<MyShoppingOrderList> list = shoppingOrderService.getMyShoppingOrderList(query); + return AjaxResult.success(list); + } + + + + @GetMapping("/getMyShoppingOrderInfo/{id}") + @ApiOperation(value = "获取购买订单详情", tags = {"小程序-商城购买订单"}) + public AjaxResult<MyShoppingOrderInfo> getMyShoppingOrderInfo(@PathVariable String id){ + MyShoppingOrderInfo info = shoppingOrderService.getMyShoppingOrderInfo(id); + return AjaxResult.success(info); + } + + + + @PutMapping("/confirmReceipt/{id}") + @ApiOperation(value = "确认收货操作", tags = {"小程序-商城购买订单"}) + public AjaxResult confirmReceipt(@PathVariable String id){ + TShoppingOrder shoppingOrder = shoppingOrderService.getById(id); + if(shoppingOrder.getStatus() == 3){ + return AjaxResult.error("不能重复确认收货"); + } + if(shoppingOrder.getStatus() == 1){ + return AjaxResult.error("订单还未发货呢"); + } + if(shoppingOrder.getStatus() == 4){ + return AjaxResult.error("订单已取消,不允许操作。"); + } + shoppingOrder.setStatus(3); + shoppingOrderService.updateById(shoppingOrder); + return AjaxResult.success(); + } + + + @PutMapping("/cancelOrder/{id}") + @ApiOperation(value = "取消订单操作", tags = {"小程序-商城购买订单"}) + public AjaxResult cancelOrder(@PathVariable String id){ + return shoppingOrderService.cancelOrder(id); + } + + + + @ResponseBody + @GetMapping(value = "/getNoInvoicedOrder") + @ApiOperation(value = "获取未开票的订单数据", tags = {"小程序-充电发票"}) + public AjaxResult<List<MyShoppingOrderList>> getNoInvoicedOrder(GetNoInvoicedOrder query){ + List<MyShoppingOrderList> list = shoppingOrderService.getNoInvoicedOrder(query); + return AjaxResult.success(list); + } } -- Gitblit v1.7.1