Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into develop
This commit is contained in:
commit
407ba29319
@ -95,22 +95,23 @@ type OrderStatus struct {
|
|||||||
|
|
||||||
// 订单商品
|
// 订单商品
|
||||||
type OrderProduct struct {
|
type OrderProduct struct {
|
||||||
TotalPrice AmountInfo `json:"amount"` // 商品总价
|
TotalPrice AmountInfo `json:"amount"` // 商品总价
|
||||||
ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间
|
ExpectedDeliveryTime *time.Time `json:"expected_delivery_time"` // 预计到货时间
|
||||||
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量
|
||||||
ProductID int64 `json:"product_id"` // 商品ID
|
ProductID int64 `json:"product_id"` // 商品ID
|
||||||
ProductName string `json:"product_name"` // 商品名称
|
ProductName string `json:"product_name"` // 商品名称
|
||||||
ItemPrice AmountInfo `json:"product_price"` // 商品单价
|
ItemPrice AmountInfo `json:"product_price"` // 商品单价
|
||||||
ProductSnapshot interface{} `json:"product_snapshot"` // 商品快照
|
ProductSnapshot interface{} `json:"product_snapshot"` // 商品快照
|
||||||
ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照
|
ShoppingCartSnapshot *FsShoppingCart `json:"shopping_cart_snapshot"` // 购物车快照
|
||||||
ProductCover string `json:"product_cover"` // 商品封面
|
ShoppingCartSnapshotInfo map[string]interface{} `json:"shopping_cart_snapshot_info"` // 商品封面
|
||||||
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
ProductCover string `json:"product_cover"` // 商品封面
|
||||||
ProductSn string `json:"product_sn"` // 商品编码
|
ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面
|
||||||
DiyInformation *UserDiyInformation `json:"diy_information"`
|
ProductSn string `json:"product_sn"` // 商品编码
|
||||||
SizeInfo *OrderProductSizeInfo `json:"size_info"`
|
DiyInformation *UserDiyInformation `json:"diy_information"`
|
||||||
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
|
SizeInfo *OrderProductSizeInfo `json:"size_info"`
|
||||||
StepNum []int `json:"step_num"` // 阶梯数量
|
FittingInfo *OrderProductFittingInfo `json:"fitting_info"`
|
||||||
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
StepNum []int `json:"step_num"` // 阶梯数量
|
||||||
|
IsHighlyCustomized int64 `json:"is_highly_customized"`
|
||||||
}
|
}
|
||||||
type PurchaseQuantity struct {
|
type PurchaseQuantity struct {
|
||||||
Current interface{} `json:"current"`
|
Current interface{} `json:"current"`
|
||||||
|
@ -84,7 +84,7 @@ func (l *CalculateProductPriceLogic) CalculateProductPrice(req *types.CalculateP
|
|||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to calculate product price ")
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to calculate product price ")
|
||||||
}
|
}
|
||||||
return resp.SetStatus(basic.CodeOK, "success", types.CalculateProductPriceRsp{
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", types.CalculateProductPriceRsp{
|
||||||
ItemPrice: format.CentitoDollar(itemPrice, 3),
|
ItemPrice: format.CentitoDollar(itemPrice, 3),
|
||||||
TotalPrice: format.CentitoDollarWithNoHalfAdjust(totalPrice, 2),
|
TotalPrice: format.CentitoDollarWithNoHalfAdjust(totalPrice, 2),
|
||||||
PurchaseQuantity: req.PurchaseQuantity,
|
PurchaseQuantity: req.PurchaseQuantity,
|
||||||
|
@ -1076,6 +1076,43 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel
|
|||||||
orderDetail.OrderProduct[orderProductKey].TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
orderDetail.OrderProduct[orderProductKey].TotalPrice = order.GetAmountInfoFormat(&orderProduct.TotalPrice)
|
||||||
orderDetail.OrderProduct[orderProductKey].PurchaseQuantity = order.GetPurchaseQuantity(&orderProduct.PurchaseQuantity)
|
orderDetail.OrderProduct[orderProductKey].PurchaseQuantity = order.GetPurchaseQuantity(&orderProduct.PurchaseQuantity)
|
||||||
orderDetail.OrderProduct[orderProductKey].ProductSnapshot = nil
|
orderDetail.OrderProduct[orderProductKey].ProductSnapshot = nil
|
||||||
|
var snapshot map[string]interface{}
|
||||||
|
if orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot.Snapshot != nil {
|
||||||
|
json.Unmarshal([]byte(*orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot.Snapshot), &snapshot)
|
||||||
|
}
|
||||||
|
snapshotfittingInfoData, snapshotfittingInfoEx := snapshot["fitting_info"]
|
||||||
|
var snapshotfittingInfoJson map[string]interface{}
|
||||||
|
if snapshotfittingInfoEx {
|
||||||
|
snapshotfittingInfo := snapshotfittingInfoData.(map[string]interface{})
|
||||||
|
snapshotfittingInfoJsonData, snapshotfittingInfoJsonEx := snapshotfittingInfo["fitting_json"]
|
||||||
|
if snapshotfittingInfoJsonEx {
|
||||||
|
var snapshotfittingInfoJson map[string]interface{}
|
||||||
|
json.Unmarshal([]byte(snapshotfittingInfoJsonData.(string)), &snapshotfittingInfoJson)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
snapshot["fitting_info"] = snapshotfittingInfoJson
|
||||||
|
snapshotModelInfoData, snapshotModelInfoEx := snapshot["model_info"]
|
||||||
|
var snapshotModelInfoJson map[string]interface{}
|
||||||
|
if snapshotModelInfoEx {
|
||||||
|
snapshotModelInfo := snapshotModelInfoData.(map[string]interface{})
|
||||||
|
snapshotModelInfoJsonData, snapshotModelInfoJsonEx := snapshotModelInfo["model_json"]
|
||||||
|
if snapshotModelInfoJsonEx {
|
||||||
|
json.Unmarshal([]byte(snapshotModelInfoJsonData.(string)), &snapshotModelInfoJson)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
snapshot["model_info"] = snapshotModelInfoJson
|
||||||
|
snapshotTemplateInfoData, snapshotTemplateInfoEx := snapshot["template_info"]
|
||||||
|
var snapshotTemplateInfoJson map[string]interface{}
|
||||||
|
if snapshotTemplateInfoEx {
|
||||||
|
snapshotTemplateInfo := snapshotTemplateInfoData.(map[string]interface{})
|
||||||
|
snapshotTemplateInfoJsonData, snapshotTemplateInfoJsonEx := snapshotTemplateInfo["template_json"]
|
||||||
|
if snapshotTemplateInfoJsonEx {
|
||||||
|
json.Unmarshal([]byte(snapshotTemplateInfoJsonData.(string)), &snapshotTemplateInfoJson)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
snapshot["template_info"] = snapshotTemplateInfoJson
|
||||||
|
orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshot.Snapshot = nil
|
||||||
|
orderDetail.OrderProduct[orderProductKey].ShoppingCartSnapshotInfo = snapshot
|
||||||
}
|
}
|
||||||
orderDetail.OrderInfo.StatusLink = order.GetOrderStatusLinkUser(orderDetail.OrderInfo.DeliveryMethod, orderDetail.OrderInfo.StatusLink)
|
orderDetail.OrderInfo.StatusLink = order.GetOrderStatusLinkUser(orderDetail.OrderInfo.DeliveryMethod, orderDetail.OrderInfo.StatusLink)
|
||||||
orderDetail.OrderAmount.Deposit.PayAmount = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Deposit.PayAmount)
|
orderDetail.OrderAmount.Deposit.PayAmount = order.GetAmountInfoFormat(&orderDetail.OrderAmount.Deposit.PayAmount)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user