seatonwan9
2025-08-28 e5d17ab1bc9e0779b325c53bf23d61ae4a15432e
src/main/java/com/webmanage/controller/OrderController.java
@@ -157,6 +157,17 @@
        }
    }
    @PostMapping("/approval/page/with-product-conditions")
    @ApiOperation("分页查询待审批订单列表(支持产品条件)")
    public Result<Object> getPendingApprovalOrderPageWithProductConditions(@Valid @RequestBody OrderQueryDTO queryDTO) {
        try {
            return Result.success(orderInfoService.getPendingApprovalOrderPageWithProductConditions(queryDTO));
        } catch (Exception e) {
            log.error("查询待审批订单列表失败", e);
            return Result.error("查询待审批订单列表失败:" + e.getMessage());
        }
    }
    @GetMapping("/detail/{orderId}")
    @ApiOperation("获取订单详情")
    public Result<OrderDetailVO> getOrderDetail(
@@ -349,4 +360,17 @@
            return Result.error("取消订单失败:" + e.getMessage());
        }
    }
    @GetMapping("/product/{productId}/has-completed-orders")
    @ApiOperation("根据产品ID判断是否存在审核中的关联订单")
    public Result<Boolean> hasCompletedOrdersByProductId(
            @ApiParam("产品ID") @PathVariable @NotBlank String productId) {
        try {
            boolean exists = orderInfoService.existsCompletedNotCancelledOrderByProductId(productId);
            return Result.success(exists);
        } catch (Exception e) {
            log.error("查询产品关联订单存在性失败,产品ID: {}", productId, e);
            return Result.error("查询失败:" + e.getMessage());
        }
    }
}