diff --git a/constants/invoice_html.go b/constants/invoice_html.go index 8259d5d4..46f96ab8 100644 --- a/constants/invoice_html.go +++ b/constants/invoice_html.go @@ -236,7 +236,7 @@ const INVOICE_TEMPLATE_0301 = ` %v %v - %v Units + %v %v %v ` diff --git a/model/gmodel/fs_order_logic.go b/model/gmodel/fs_order_logic.go index ebd8b52a..b878324d 100644 --- a/model/gmodel/fs_order_logic.go +++ b/model/gmodel/fs_order_logic.go @@ -107,6 +107,7 @@ type OrderProduct struct { PurchaseQuantity PurchaseQuantity `json:"purchase_quantity"` // 购买数量 ProductId int64 `json:"product_id"` // 商品ID ProductSn string `json:"product_sn"` // 商品编码 + ProductWebsiteUnit string `json:"product_website_unit"` //产品前台网站单位 ProductName string `json:"product_name"` // 商品名称 ProductCover string `json:"product_cover"` // 商品封面 ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面 @@ -156,6 +157,7 @@ type OrderProductInter struct { ProductCover string `json:"product_cover"` // 商品封面 ProductCoverMetadata map[string]interface{} `json:"product_cover_metadata"` // 商品封面 ProductSn string `json:"product_sn"` // 商品编码 + ProductWebsiteUnit string `json:"product_website_unit"` //产品前台网站单位 DiyInformation *UserDiyInformation `json:"diy_information"` SizeInfo *OrderProductSizeInfo `json:"size_info"` FittingInfo *OrderProductFittingInfo `json:"fitting_info"` diff --git a/service/repositories/order.go b/service/repositories/order.go index 0bcd23b4..32472a4a 100644 --- a/service/repositories/order.go +++ b/service/repositories/order.go @@ -411,7 +411,7 @@ func (d *defaultOrder) Invoice(ctx context.Context, in *InvoiceReq) (res *Invoic productNum := orderProduct.PurchaseQuantity.Current.(string) var productNumStr = productNum - var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, productNumStr, priceTotal) + var productsInfo = fmt.Sprintf(model00301, orderProduct.ProductName, price, productNumStr, orderProduct.ProductWebsiteUnit, priceTotal) products = products + productsInfo } model003 = fmt.Sprintf(constants.INVOICE_TEMPLATE_03, products) @@ -1527,9 +1527,10 @@ func (d *defaultOrder) Create(ctx context.Context, in *CreateReq) (res *CreateRe ProductId: *shoppingCart.ProductId, ProductCover: *shoppingCart.ShoppingCartProduct.Cover, ProductCoverMetadata: productCoverMetadata, - ProductName: *shoppingCart.ShoppingCartProduct.Title, + ProductName: shoppingCartSnapshot.ProductInfo.ProductName, + ProductSn: shoppingCartSnapshot.ProductInfo.ProductSn, + ProductWebsiteUnit: shoppingCartSnapshot.ProductInfo.ProductWebsiteUnit, - ProductSn: *shoppingCart.ShoppingCartProduct.Sn, DiyInformation: &shoppingCartSnapshot.UserDiyInformation, FittingInfo: &gmodel.OrderProductFittingInfo{ FittingID: *shoppingCart.FittingId, @@ -1817,9 +1818,11 @@ func (d *defaultOrder) OrderDetailHandler(ctx context.Context, orderInfo *gmodel ProductId: productValue.ProductId, ProductSn: productValue.ProductSn, + ProductWebsiteUnit: productValue.ProductWebsiteUnit, ProductName: productValue.ProductName, ProductCover: productValue.ProductCover, ProductCoverMetadata: productValue.ProductCoverMetadata, + ShoppingCartSnapshot: &shoppingCartSnapshotData, ExpectedDeliveryTime: &expectedDeliveryTime, PurchaseQuantity: order.GetPurchaseQuantity(productValue.PurchaseQuantity, true),