- refactor
- load pending orders, fixed bug.
This commit is contained in:
@@ -79,7 +79,7 @@ func (c *OrderController) getOrderInfo(msg *jdapi.CallbackOrderMsg) (order *mode
|
||||
ExpectedDeliveredTime: utils.Str2TimeWithDefault(utils.Interface2String(result["orderPreEndDeliveryTime"]), utils.DefaultTimeValue),
|
||||
VendorStatus: msg.StatusID,
|
||||
OrderSeq: int(utils.MustInterface2Int64(result["orderNum"])),
|
||||
OrderCreatedAt: utils.Str2Time(result["orderStartTime"].(string)),
|
||||
StatusTime: utils.Str2Time(result["orderStartTime"].(string)),
|
||||
OriginalData: utils.FilterMb4(string(utils.MustMarshal(result))),
|
||||
ActualPayPrice: utils.MustInterface2Int64(result["orderBuyerPayableMoney"]),
|
||||
Skus: []*model.OrderSku{},
|
||||
@@ -103,16 +103,15 @@ func (c *OrderController) getOrderInfo(msg *jdapi.CallbackOrderMsg) (order *mode
|
||||
for _, product2 := range result["product"].([]interface{}) {
|
||||
product := product2.(map[string]interface{})
|
||||
sku := &model.OrderSku{
|
||||
VendorOrderID: msg.BillID,
|
||||
VendorID: model.VendorIDJD,
|
||||
Count: int(utils.MustInterface2Int64(product["skuCount"])),
|
||||
SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["skuIdIsv"]), 0)),
|
||||
VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])),
|
||||
SkuName: product["skuName"].(string),
|
||||
Weight: int(utils.MustInterface2Float64(product["skuWeight"]) * 1000),
|
||||
SalePrice: utils.MustInterface2Int64(product["skuJdPrice"]),
|
||||
PromotionType: int(utils.MustInterface2Int64(product["promotionType"])),
|
||||
OrderCreatedAt: order.OrderCreatedAt,
|
||||
VendorOrderID: msg.BillID,
|
||||
VendorID: model.VendorIDJD,
|
||||
Count: int(utils.MustInterface2Int64(product["skuCount"])),
|
||||
SkuID: int(utils.Str2Int64WithDefault(utils.Interface2String(product["skuIdIsv"]), 0)),
|
||||
VendorSkuID: utils.Int64ToStr(utils.MustInterface2Int64(product["skuId"])),
|
||||
SkuName: product["skuName"].(string),
|
||||
Weight: int(utils.MustInterface2Float64(product["skuWeight"]) * 1000),
|
||||
SalePrice: utils.MustInterface2Int64(product["skuJdPrice"]),
|
||||
PromotionType: int(utils.MustInterface2Int64(product["promotionType"])),
|
||||
}
|
||||
if product["isGift"].(bool) {
|
||||
sku.SkuType = 1
|
||||
|
||||
@@ -18,7 +18,7 @@ func (c *OrderController) legacyWriteJdOrder(order *model.GoodsOrder, delOldFirs
|
||||
Code: "0",
|
||||
Jdorderid: utils.Str2Int64(order.VendorOrderID),
|
||||
Orderstatus: int(utils.Str2Int64(order.VendorStatus)),
|
||||
Orderstatustime: utils.Time2Str(order.OrderCreatedAt),
|
||||
Orderstatustime: utils.Time2Str(order.StatusTime),
|
||||
Success: 1,
|
||||
Cityname: "all",
|
||||
}
|
||||
|
||||
@@ -49,14 +49,14 @@ func (c *WaybillController) onWaybillMsg(msg *jdapi.CallbackDeliveryStatusMsg) (
|
||||
|
||||
func (c *WaybillController) callbackMsg2Waybill(msg *jdapi.CallbackDeliveryStatusMsg) (retVal *model.Waybill) {
|
||||
retVal = &model.Waybill{
|
||||
VendorOrderID: msg.OrderID,
|
||||
OrderVendorID: model.VendorIDJD,
|
||||
VendorWaybillID: msg.OrderID,
|
||||
WaybillVendorID: model.VendorIDJD,
|
||||
CourierName: msg.DeliveryManName,
|
||||
CourierMobile: msg.DeliveryManPhone,
|
||||
VendorStatus: msg.DeliveryStatus,
|
||||
WaybillCreatedAt: utils.Str2Time(msg.DeliveryStatusTime),
|
||||
VendorOrderID: msg.OrderID,
|
||||
OrderVendorID: model.VendorIDJD,
|
||||
VendorWaybillID: msg.OrderID,
|
||||
WaybillVendorID: model.VendorIDJD,
|
||||
CourierName: msg.DeliveryManName,
|
||||
CourierMobile: msg.DeliveryManPhone,
|
||||
VendorStatus: msg.DeliveryStatus,
|
||||
StatusTime: utils.Str2Time(msg.DeliveryStatusTime),
|
||||
}
|
||||
return retVal
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user