From 10a24a9cd9ad9c4b6139e7137bc67bfcea1b364a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 3 Jul 2023 15:54:59 +0800 Subject: [PATCH] 1 --- business/model/order.go | 41 ++++++++++--------- .../partner/purchase/tao_vegetable/order.go | 39 +++++++++--------- .../purchase/tao_vegetable/order_utils.go | 2 +- 3 files changed, 42 insertions(+), 40 deletions(-) diff --git a/business/model/order.go b/business/model/order.go index c144a0699..8997a5041 100644 --- a/business/model/order.go +++ b/business/model/order.go @@ -192,26 +192,27 @@ func (o *GoodsOrderOriginal) TableUnique() [][]string { } type OrderSku struct { - ID int64 `orm:"column(id)" json:"id"` - VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"` - VendorID int `orm:"column(vendor_id)" json:"vendorID"` - StoreSubID int `orm:"column(store_sub_id)" json:"storeSubID"` // EarningActID,当前这个字段被当成结算活动ID用 - StoreSubName string `orm:"size(64)" json:"storeSubName"` // 当前这个字段被用作vendorActType - Count int `json:"count"` - VendorSkuID string `orm:"column(vendor_sku_id);size(48)" json:"vendorSkuID"` - SkuID int `orm:"column(sku_id)" json:"skuID"` // 外部系统里记录的 jxskuid - JxSkuID int `orm:"column(jx_sku_id)" json:"jxSkuID"` // 根据VendorSkuID在本地系统里查询出来的 jxskuid - SkuName string `orm:"size(255)" json:"skuName"` - ShopPrice int64 `json:"shopPrice"` // 京西价 - VendorPrice int64 `json:"vendorPrice"` // 平台价 - SalePrice int64 `json:"salePrice"` // 售卖价 - EarningPrice int64 `json:"earningPrice"` // 活动商品设置,结算给门店老板的钱,如果结算活动ID为0,是按结算比例算的,否则就是结算表中的值 - Weight int `json:"weight"` // 单位为克 - SkuType int `json:"skuType"` // 当前如果为gift就为1,否则缺省为0 - PromotionType int `json:"promotionType"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换 - OrderCreatedAt time.Time `orm:"type(datetime);index" json:"-"` // 分区考虑 - IsVendorAct int `json:"isVendorAct"` - Upc string `json:"upc"` //upc码 + ID int64 `orm:"column(id)" json:"id"` + VendorOrderID string `orm:"column(vendor_order_id);size(48)" json:"vendorOrderID"` + VendorSubOrderID string `orm:"column(vendor_sub_order_id);size(48)" json:"vendorSubOrderID"` // 子订单id + VendorID int `orm:"column(vendor_id)" json:"vendorID"` + StoreSubID int `orm:"column(store_sub_id)" json:"storeSubID"` // EarningActID,当前这个字段被当成结算活动ID用 + StoreSubName string `orm:"size(64)" json:"storeSubName"` // 当前这个字段被用作vendorActType + Count int `json:"count"` + VendorSkuID string `orm:"column(vendor_sku_id);size(48)" json:"vendorSkuID"` + SkuID int `orm:"column(sku_id)" json:"skuID"` // 外部系统里记录的 jxskuid + JxSkuID int `orm:"column(jx_sku_id)" json:"jxSkuID"` // 根据VendorSkuID在本地系统里查询出来的 jxskuid + SkuName string `orm:"size(255)" json:"skuName"` + ShopPrice int64 `json:"shopPrice"` // 京西价 + VendorPrice int64 `json:"vendorPrice"` // 平台价 + SalePrice int64 `json:"salePrice"` // 售卖价 + EarningPrice int64 `json:"earningPrice"` // 活动商品设置,结算给门店老板的钱,如果结算活动ID为0,是按结算比例算的,否则就是结算表中的值 + Weight int `json:"weight"` // 单位为克 + SkuType int `json:"skuType"` // 当前如果为gift就为1,否则缺省为0 + PromotionType int `json:"promotionType"` // todo 当前是用于记录京东的PromotionType(生成jxorder用),没有做转换 + OrderCreatedAt time.Time `orm:"type(datetime);index" json:"-"` // 分区考虑 + IsVendorAct int `json:"isVendorAct"` + Upc string `json:"upc"` //upc码 } // 同样商品在一个订单中可能重复出现(比如搞活动时,相同商品价格不一样,第一个有优惠) diff --git a/business/partner/purchase/tao_vegetable/order.go b/business/partner/purchase/tao_vegetable/order.go index 3fa06340a..590986c66 100644 --- a/business/partner/purchase/tao_vegetable/order.go +++ b/business/partner/purchase/tao_vegetable/order.go @@ -103,25 +103,26 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve if len(*orderDetail.SubOrderResponseList) > 0 { for _, extra := range *orderDetail.SubOrderResponseList { sku := &model.OrderSku{ - VendorOrderID: order.VendorOrderID, - VendorID: model.VendorIDTaoVegetable, - StoreSubID: 0, - StoreSubName: "", - Count: utils.Float64TwoInt(*extra.BuySaleQuantity), - VendorSkuID: *extra.SkuCode, - SkuID: utils.Str2Int(*extra.SkuCode), - JxSkuID: utils.Str2Int(*extra.SkuCode), - SkuName: *extra.SkuName, - ShopPrice: *extra.Price, - VendorPrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity), - SalePrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity), - EarningPrice: 0, - Weight: int(*extra.Weight / utils.Float64TwoInt64(*extra.BuySaleQuantity)), - SkuType: 0, - PromotionType: 0, - OrderCreatedAt: order.OrderCreatedAt, - IsVendorAct: 0, - Upc: *extra.Barcode, + VendorOrderID: order.VendorOrderID, + VendorID: model.VendorIDTaoVegetable, + StoreSubID: 0, + StoreSubName: "", + Count: utils.Float64TwoInt(*extra.BuySaleQuantity), + VendorSkuID: *extra.SkuCode, + SkuID: utils.Str2Int(*extra.SkuCode), + JxSkuID: utils.Str2Int(*extra.SkuCode), + SkuName: *extra.SkuName, + ShopPrice: *extra.Price, + VendorPrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity), + SalePrice: *extra.OriginalFee / utils.Float64TwoInt64(*extra.BuySaleQuantity), + EarningPrice: 0, + Weight: int(*extra.Weight / utils.Float64TwoInt64(*extra.BuySaleQuantity)), + SkuType: 0, + PromotionType: 0, + OrderCreatedAt: order.OrderCreatedAt, + IsVendorAct: 0, + Upc: *extra.Barcode, + VendorSubOrderID: utils.Int64ToStr(*extra.BizSubOrderId), } activityId := make([]int64, 0) diff --git a/business/partner/purchase/tao_vegetable/order_utils.go b/business/partner/purchase/tao_vegetable/order_utils.go index 27f3a60f0..ff9bdea39 100644 --- a/business/partner/purchase/tao_vegetable/order_utils.go +++ b/business/partner/purchase/tao_vegetable/order_utils.go @@ -33,7 +33,7 @@ func orderStatusChangeNotice(order *model.GoodsOrder, orderStatus string) (*requ } for _, v := range skuList { workCallbackSubOrderInfo := domain591.AlibabaAelophyOrderWorkCallbackWorkCallbackSubOrderInfo{ - BizSubOrderId: nil, + BizSubOrderId: utils.Int64ToPointer(utils.Str2Int64(v.VendorSubOrderID)), SkuCode: utils.String2Pointer(v.VendorSkuID), PickSaleQuantity: utils.String2Pointer(utils.Int2Str(v.Count)), PickStockQuantity: utils.String2Pointer(utils.Int2Str(v.Count)),