add fix id_car
This commit is contained in:
@@ -504,27 +504,7 @@ func (s *ComponentReportOrderService) CreatePaymentOrder(ctx context.Context, re
|
||||
zap.String("code_url", codeURL),
|
||||
)
|
||||
}
|
||||
|
||||
// 创建一个临时下载记录,用于跟踪支付状态,但不生成报告文件
|
||||
download := &productEntities.ComponentReportDownload{
|
||||
UserID: req.UserID,
|
||||
ProductID: req.ProductID,
|
||||
ProductCode: product.Code,
|
||||
ProductName: product.Name,
|
||||
OrderID: &createdPurchaseOrder.ID, // 关联购买订单ID
|
||||
OrderNumber: &outTradeNo, // 外部订单号
|
||||
ExpiresAt: calculateExpiryTime(), // 30天后过期
|
||||
// 注意:这里不设置FilePath,因为文件将在支付成功后生成
|
||||
}
|
||||
|
||||
err = s.componentReportRepo.Create(ctx, download)
|
||||
if err != nil {
|
||||
s.logger.Error("创建下载记录失败", zap.Error(err))
|
||||
// 不中断流程,即使创建下载记录失败也继续返回订单信息
|
||||
}
|
||||
|
||||
// 返回支付响应,包含支付URL
|
||||
// 使用购买订单ID而不是下载记录ID,以便前端可以正确检查支付状态
|
||||
response := &CreatePaymentOrderResponse{
|
||||
OrderID: createdPurchaseOrder.ID, // 修改为购买订单ID
|
||||
OrderNo: createdPurchaseOrder.OrderNo,
|
||||
@@ -535,7 +515,6 @@ func (s *ComponentReportOrderService) CreatePaymentOrder(ctx context.Context, re
|
||||
}
|
||||
|
||||
s.logger.Info("========== 支付订单创建完成 ==========",
|
||||
zap.String("download_id", download.ID),
|
||||
zap.String("purchase_order_id", createdPurchaseOrder.ID),
|
||||
zap.String("order_no", createdPurchaseOrder.OrderNo),
|
||||
zap.String("user_id", req.UserID),
|
||||
|
||||
Reference in New Issue
Block a user