p-honggang.li
2025-09-03 9cd82d70df40b547403389b54c6043592ab637e4
src/main/java/com/webmanage/controller/OrderController.java
@@ -360,4 +360,29 @@
            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());
        }
    }
    @PostMapping("/status/isEvaluate")
    @ApiOperation("更新评价状态")
    public Result<Object> updateOrderInfoIsEvaluate(@ApiParam("订单ID") @RequestParam @NotBlank String orderId){
        try {
            boolean success = orderInfoService.updateOrderIsEvaluate(orderId);
            return success ? Result.success("评价状态更新成功") : Result.error("评价状态更新失败");
        } catch (Exception e) {
            log.error("评价状态更新失败", e);
            return Result.error("评价状态更新失败:" + e.getMessage());
        }
    }
}