- model.WaybillStatusNeverSend

- try to set ebai sku weight
This commit is contained in:
gazebo
2018-11-27 10:27:32 +08:00
parent a3cddd891e
commit 4fbfcdb13e
6 changed files with 25 additions and 3 deletions

View File

@@ -99,17 +99,22 @@ func (p *PurchaseHandler) GetOrder(vendorOrderID string) (order *model.GoodsOrde
// discounts := result["discount"].(map[string]interface{})
for _, product2 := range products {
product := product2.(map[string]interface{})
skuName := product["product_name"].(string)
_, _, _, specUnit, _, specQuality := jxutils.SplitSkuName(skuName)
sku := &model.OrderSku{
VendorOrderID: order.VendorOrderID,
VendorID: model.VendorIDEBAI,
Count: int(utils.MustInterface2Int64(product["product_amount"])),
SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["custom_sku_id"]), 0)),
VendorSkuID: utils.Interface2String(product["baidu_product_id"]),
SkuName: product["product_name"].(string),
Weight: 0, // todo
SkuName: skuName,
Weight: jxutils.FormatSkuWeight(specQuality, specUnit), // 订单信息里没有重量,只有名字里尝试找
SalePrice: utils.MustInterface2Int64(product["product_price"]),
// PromotionType: int(utils.MustInterface2Int64(product["promotionType"])),
}
if sku.Weight == 0 {
sku.Weight = 222 // 如果名字里找不到缺省给半斤左右的一个特别值
}
// if product["isGift"].(bool) {
// sku.SkuType = 1
// }

View File

@@ -21,7 +21,7 @@ var (
ebaiapi.WaybillStatusExceptional: model.WaybillStatusUnknown,
ebaiapi.WaybillStatusSelfDelivery: model.WaybillStatusUnknown,
ebaiapi.WaybillStatusNotInDelivering: model.WaybillStatusUnknown,
ebaiapi.WaybillStatusDeliveryRejected: model.WaybillStatusAcceptCanceled, // ?
ebaiapi.WaybillStatusDeliveryRejected: model.WaybillStatusNeverSend,
}
)