京东商城订单数据修改

This commit is contained in:
苏尹岚
2020-06-19 08:27:40 +08:00
parent c68e371d2d
commit 4295e4f123
3 changed files with 17 additions and 8 deletions

View File

@@ -1109,7 +1109,6 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
}
storeList, err := common.GetStoreListByLocation(ctx, jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), 5000, false, true)
if err != nil {
globals.SugarLogger.Debugf("jds GetStoreListByLocation error: %v", err.Error())
@@ -1121,13 +1120,12 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
if len(storeMaps) > 0 {
order.VendorStoreID = storeMaps[0].VendorStoreID
}
// }
//如果是暂停,表示是预订单
if jdsOrder.OrderStatus == jdshopapi.JdsOrderStatusPause {
order.BusinessType = model.BusinessTypeDingshida
order.ExpectedDeliveredTime = utils.Str2Time(orderDetail.ExpectedDeliveredTime)
} else if jdsOrder.OrderStatus == jdshopapi.JdsOrderStatusWaittingExport {
order.ExpectedDeliveredTime = order.CreatedAt.Add(time.Hour)
order.ExpectedDeliveredTime = order.OrderCreatedAt.Add(time.Hour)
order.BusinessType = model.BusinessTypeImmediate
} else {
globals.SugarLogger.Errorf("未知的京东商城订单状态status : %v", jdsOrder.OrderStatus)
@@ -1191,11 +1189,12 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
waybill = v
}
}
fmt.Println("test1111", utils.Format4Output(partner.DeliveryPlatformHandlers, false))
handler := partner.DeliveryPlatformHandlers[waybill.WaybillVendorID]
err = handler.Handler.CancelWaybill(waybill, 0, "订单转移被取消")
if err != nil {
return "", err
if waybill.WaybillVendorID != model.VendorIDJDWL {
handler := partner.DeliveryPlatformHandlers[waybill.WaybillVendorID]
err = handler.Handler.CancelWaybill(waybill, 0, "订单转移被取消")
if err != nil {
return "", err
}
}
}
err = jdshop.ChangeOrderStatus(vendorOrderID, model.OrderStatusCanceled, "订单转移被取消")

View File

@@ -94,3 +94,7 @@ func (c *DeliveryHandler) GetWaybillFee(order *model.GoodsOrder) (deliveryFeeInf
func (c *DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, resonContent string) (err error) {
return err
}
func (c *DeliveryHandler) OnWaybillMsg() {
}

View File

@@ -1 +1,7 @@
package jdeclp
import "git.rosy.net.cn/jx-callback/globals/testinit"
func init() {
testinit.Init()
}