From 7417095e107f311eba51a6572e13ea034c4ddde6 Mon Sep 17 00:00:00 2001 From: momo <1012651275@qq.com> Date: Wed, 1 Nov 2023 18:13:01 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=AE=A2=E5=8D=95=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=95=86=E5=93=81=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constants/invoice_html.go | 2 +- model/gmodel/fs_order_logic.go | 2 ++ service/repositories/order.go | 9 ++++++--- 3 files changed, 9 insertions(+), 4 deletions(-) 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),