phpcjl
2024-12-18 3f8e43bb394301b7018a03d2d38e70e1232443d6
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;
@@ -19,9 +20,11 @@
import com.ruoyi.other.api.feignClient.BaseSettingClient;
import com.ruoyi.system.api.model.LoginUser;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;
import java.time.LocalDateTime;
import java.util.List;
@@ -54,7 +57,7 @@
     */
    @ApiOperation(value = "我的订单列表", tags = {"小程序-个人中心-我的订单"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int", paramType="query"),
            @ApiImplicitParam(value = "订单状态", name = "status", required = true, dataType = "int"),
    })
    @GetMapping("/getMyOrderList")
    public TableDataInfo<OrderVO> getMyOrderList(@ApiParam("订单状态") Integer status){
@@ -76,7 +79,7 @@
     */
    @ApiOperation(value = "订单详情", tags = {"小程序-个人中心-我的订单-订单详情"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int", paramType="query"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
    })
    @GetMapping("/detail/{orderId}")
    public R<OrderDetailVO> detail(@PathVariable("orderId") Long orderId){
@@ -103,7 +106,7 @@
     */
    @ApiOperation(value = "订单核销", tags = {"小程序-个人中心-门店管理"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单号", name = "code", required = true, dataType = "String", paramType="query"),
            @ApiImplicitParam(value = "订单号", name = "code", required = true, dataType = "String"),
    })
    @GetMapping("/writeOff/{code}/{shopId}")
    public R<Void> writeOff(@PathVariable("code") String code, @PathVariable("shopId") Integer shopId){
@@ -116,7 +119,7 @@
     */
    @ApiOperation(value = "取消订单", tags = {"小程序-个人中心-我的订单"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int", paramType="query"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
    })
    @GetMapping("/cancel/{orderId}")
    public R<Void> cancel(@PathVariable("orderId") Long orderId){
@@ -131,7 +134,7 @@
     */
    @ApiOperation(value = "确认收货", tags = {"小程序-个人中心-我的订单"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int", paramType="query"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
    })
    @GetMapping("/confirm/{orderId}")
    public R<Void> confirm(@PathVariable("orderId") Long orderId){
@@ -162,7 +165,7 @@
     */
    @ApiOperation(value = "更换收货地址", tags = {"小程序-个人中心-我的订单"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int", paramType="query"),
            @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"),
    })
    @GetMapping("/changeAddress")
    public R<Void> changeAddress(@RequestParam("orderId") Long orderId, @RequestParam("addressId") Long addressId){
@@ -182,6 +185,9 @@
     * 更新订单状态
     */
    @ApiOperation(value = "更新订单状态", tags = {"后台-订单管理"})
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单对象", name = "order", required = true, dataType = "Order"),
    })
    @PostMapping("/updateOrderStatus")
    public R<Void> updateOrderStatus(@RequestBody Order order){
        Order order1 = orderService.getById(order.getId());
@@ -195,7 +201,7 @@
     * 预约技师
     */
    @PostMapping("/subscribe")
    public R<Void> subscribe(@RequestParam("id") Long id ,@RequestParam("technicianId") Integer technicianId){
    public R<Void> subscribe(@RequestParam(value = "id", required = false) Long id ,@RequestParam(value = "technicianId", required = false) Integer technicianId){
        Order order = orderService.getById(id);
        order.setTechnicianId(technicianId);
        orderService.updateById(order);
@@ -220,17 +226,9 @@
    
    
    @ResponseBody
    @GetMapping("/getOrderPageList")
    @ApiOperation(value = "获取订单列表", tags = {"管理后台-订单管理", "门店后台-订单管理"})
    public TableDataInfo<OrderPageListVo> getOrderPageList(OrderPageList orderPageList){
        startPage();
        List<OrderPageListVo> list = orderService.getOrderPageList(orderPageList);
        return getDataTable(list);
    }
    
    
    @ResponseBody
    @PutMapping("/confirmDelivery/{orderId}")
    @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"})
    public R confirmDelivery(@PathVariable("orderId") String orderId, String code){
@@ -238,14 +236,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){
@@ -253,7 +249,6 @@
    }
    
    
    @ResponseBody
    @GetMapping("/getOrderInfo/{orderId}")
    @ApiOperation(value = "查询订单详情", tags = {"管理后台-订单管理"})
    public R<OrderInfoVo> getOrderInfo(@PathVariable("orderId") Long orderId){
@@ -262,6 +257,10 @@
    }
    
    
    @GetMapping("/getOrderPageList")
//    @ApiOperation(value = "获取订单列表", tags = {"管理后台-订单管理", "门店后台-订单管理"})
    public R<PageInfo<OrderPageListVo>> getOrderPageList(OrderPageList orderPageList){
        return R.ok(orderService.getOrderPageList(orderPageList));
    }
}