Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop

This commit is contained in:
laodaming 2023-11-02 15:00:48 +08:00
commit 8d49d4f164

View File

@ -1769,42 +1769,45 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
StatusLink: order.GetOrderStatusLinkUser(*orderInfo.DeliveryMethod, statusLink),
Metadata: orderMetadata,
}
// 购物车对应商品
var shoppingCartSnapshotDataMap = make(map[int64]gmodel.FsShoppingCartData, len(shoppingCartSnapshot))
for _, shoppingCartSnapshotValue := range shoppingCartSnapshot {
var shoppingCartSnapshotData gmodel.FsShoppingCartData
snapshot, err := d.OrderShoppingCartSnapshotHandler(ctx, shoppingCartSnapshotValue.Snapshot)
if err != nil {
logc.Errorf(ctx, "OrderDetailHandler OrderShoppingCartSnapshotHandler failed, err: %v", err)
return nil, err
}
shoppingCartSnapshotData.Id = shoppingCartSnapshotValue.Id
shoppingCartSnapshotData.UserId = shoppingCartSnapshotValue.UserId
shoppingCartSnapshotData.ProductId = shoppingCartSnapshotValue.ProductId
shoppingCartSnapshotData.TemplateId = shoppingCartSnapshotValue.TemplateId
shoppingCartSnapshotData.ModelId = shoppingCartSnapshotValue.ModelId
shoppingCartSnapshotData.SizeId = shoppingCartSnapshotValue.SizeId
shoppingCartSnapshotData.LightId = shoppingCartSnapshotValue.LightId
shoppingCartSnapshotData.FittingId = shoppingCartSnapshotValue.FittingId
shoppingCartSnapshotData.PurchaseQuantity = shoppingCartSnapshotValue.PurchaseQuantity
shoppingCartSnapshotData.IsSelected = shoppingCartSnapshotValue.IsSelected
shoppingCartSnapshotData.IsSelected = shoppingCartSnapshotValue.IsSelected
shoppingCartSnapshotData.IsHighlyCustomized = shoppingCartSnapshotValue.IsHighlyCustomized
shoppingCartSnapshotData.Ctime = shoppingCartSnapshotValue.Ctime
shoppingCartSnapshotData.Utime = shoppingCartSnapshotValue.Utime
shoppingCartSnapshotData.Snapshot = &snapshot
shoppingCartSnapshotDataMap[shoppingCartSnapshotValue.Id] = shoppingCartSnapshotData
}
var orderProductList []gmodel.OrderProduct
for _, productValue := range orderProduct {
var selectColorIndex int64
var shoppingCartSnapshotData gmodel.FsShoppingCartData
for _, shoppingCartSnapshotValue := range shoppingCartSnapshot {
if productValue.CartId == shoppingCartSnapshotValue.Id {
snapshot, err := d.OrderShoppingCartSnapshotHandler(ctx, shoppingCartSnapshotValue.Snapshot)
if err != nil {
logc.Errorf(ctx, "OrderDetailHandler OrderShoppingCartSnapshotHandler failed, err: %v", err)
return nil, err
}
shoppingCartSnapshotData.Id = shoppingCartSnapshotValue.Id
shoppingCartSnapshotData.UserId = shoppingCartSnapshotValue.UserId
shoppingCartSnapshotData.ProductId = shoppingCartSnapshotValue.ProductId
shoppingCartSnapshotData.TemplateId = shoppingCartSnapshotValue.TemplateId
shoppingCartSnapshotData.ModelId = shoppingCartSnapshotValue.ModelId
shoppingCartSnapshotData.SizeId = shoppingCartSnapshotValue.SizeId
shoppingCartSnapshotData.LightId = shoppingCartSnapshotValue.LightId
shoppingCartSnapshotData.FittingId = shoppingCartSnapshotValue.FittingId
shoppingCartSnapshotData.PurchaseQuantity = shoppingCartSnapshotValue.PurchaseQuantity
shoppingCartSnapshotData.IsSelected = shoppingCartSnapshotValue.IsSelected
shoppingCartSnapshotData.IsSelected = shoppingCartSnapshotValue.IsSelected
shoppingCartSnapshotData.IsHighlyCustomized = shoppingCartSnapshotValue.IsHighlyCustomized
shoppingCartSnapshotData.Ctime = shoppingCartSnapshotValue.Ctime
shoppingCartSnapshotData.Utime = shoppingCartSnapshotValue.Utime
shoppingCartSnapshotData.Snapshot = &snapshot
selectColorIndexV, selectColorIndexE := snapshot["select_color_index"]
if selectColorIndexE {
selectColorIndex = selectColorIndexV.(int64)
}
var shoppingCartSnapshotData = shoppingCartSnapshotDataMap[productValue.CartId]
var snapshotInfo = shoppingCartSnapshotData.Snapshot
if snapshotInfo != nil {
var snapshotInfoMap = *snapshotInfo
selectColorIndexV, selectColorIndexE := snapshotInfoMap["select_color_index"]
if selectColorIndexE {
selectColorIndex = selectColorIndexV.(int64)
}
}
var expectedDeliveryTime time.Time
if productValue.ExpectedDeliveryTime == nil {
expectedDeliveryTime = expectedTime