| | |
| | | catch (Exception e) { log.error("查询买家订单列表失败", e); return Result.error("查询买家订单列表失败:" + e.getMessage()); } |
| | | } |
| | | |
| | | @PostMapping("/buyer/page/with-product-conditions") |
| | | @ApiOperation("分页查询买家订单列表(支持产品条件)") |
| | | public Result<Object> getBuyerOrderPageWithProductConditions(@Valid @RequestBody OrderQueryDTO queryDTO) { |
| | | try { return Result.success(orderInfoService.getBuyerOrderPageWithProductConditions(queryDTO)); } |
| | | catch (Exception e) { log.error("查询买家订单列表失败", e); return Result.error("查询买家订单列表失败:" + e.getMessage()); } |
| | | } |
| | | |
| | | @PostMapping("/create") |
| | | @ApiOperation("创建订单(包含订单详情),需在 Header 携带 Idempotency-Token 防重复提交") |
| | | public Result<OrderInfo> createOrder(@RequestHeader(value = "Idempotency-Token", required = false) String token, |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/seller/page/with-product-conditions") |
| | | @ApiOperation("分页查询卖家订单列表(支持产品条件)") |
| | | public Result<Object> getSellerOrderPageWithProductConditions(@Valid @RequestBody OrderQueryDTO queryDTO) { |
| | | try { |
| | | if (queryDTO.getProviderId() == null) { |
| | | return Result.error("提供者ID不能为空"); |
| | | } |
| | | return Result.success(orderInfoService.getSellerOrderPageWithProductConditions(queryDTO)); |
| | | } catch (Exception e) { |
| | | log.error("查询卖家订单列表失败", e); |
| | | return Result.error("查询卖家订单列表失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/approval/page") |
| | | @ApiOperation("分页查询待审批订单列表") |
| | | public Result<Object> getPendingApprovalOrderPage(@Valid @RequestBody OrderQueryDTO queryDTO) { |
| | | try { |
| | | return Result.success(orderInfoService.getPendingApprovalOrderPage(queryDTO)); |
| | | } catch (Exception e) { |
| | | log.error("查询待审批订单列表失败", e); |
| | | return Result.error("查询待审批订单列表失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @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()); |
| | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/workflow/update") |
| | | @ApiOperation("根据订单ID更新工作流ID(workflow_id)") |
| | | public Result<Boolean> updateWorkflowId( |
| | | @ApiParam("订单ID") @RequestParam @NotBlank String orderId, |
| | | @ApiParam("工作流ID") @RequestParam @NotBlank String workflowId) { |
| | | try { |
| | | boolean result = orderInfoService.updateWorkflowId(orderId, workflowId); |
| | | return result ? Result.success(true) : Result.error("更新工作流ID失败"); |
| | | } catch (Exception e) { |
| | | log.error("更新工作流ID失败,订单ID: {}", orderId, e); |
| | | return Result.error("更新工作流ID失败:" + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/agreement/check/{orderId}") |
| | | @ApiOperation("检查订单是否包含协议类型的子订单") |
| | | public Result<Boolean> checkAgreementPriceType( |
| | |
| | | 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()); |
| | | } |
| | | } |
| | | } |