feat:订单模块新增商品单位

This commit is contained in:
momo 2023-11-01 18:13:01 +08:00
parent b868ef19ae
commit 7417095e10
3 changed files with 9 additions and 4 deletions

View File

@ -236,7 +236,7 @@ const INVOICE_TEMPLATE_0301 = `
<tr>
<td class="bill_td info" align="left">%v</td>
<td class="bill_td info" align="right">%v</td>
<td class="bill_td info" align="right">%v Units</td>
<td class="bill_td info" align="right">%v %v</td>
<td class="bill_td info" align="right">%v</td>
</tr>
`

View File

@ -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"`

View File

@ -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),