京东商城订单修改
This commit is contained in:
@@ -1019,10 +1019,10 @@ func SaveJdsOrders(ctx *jxcontext.Context, orderCreatedStart, orderCreatedEnd ti
|
|||||||
}
|
}
|
||||||
orders, err := result2Orders(ctx, orderResult)
|
orders, err := result2Orders(ctx, orderResult)
|
||||||
for _, order := range orders {
|
for _, order := range orders {
|
||||||
// order.StoreID = 102919
|
order.StoreID = 102919
|
||||||
// order.JxStoreID = 102919
|
order.JxStoreID = 102919
|
||||||
// order.StoreName = "商城模板(成都发货)"
|
order.StoreName = "商城模板(成都发货)"
|
||||||
// order.VendorStoreID = model.JdShopMainVendorStoreID
|
order.VendorStoreID = model.JdShopMainVendorStoreID
|
||||||
partner.CurOrderManager.OnOrderNew(order, model.Order2Status(order))
|
partner.CurOrderManager.OnOrderNew(order, model.Order2Status(order))
|
||||||
globals.SugarLogger.Debugf("SaveJdsOrders, order: [%v]", utils.Format4Output(order, false))
|
globals.SugarLogger.Debugf("SaveJdsOrders, order: [%v]", utils.Format4Output(order, false))
|
||||||
noticeMsg := fmt.Sprintf("京东商城新订单,订单号:[%v] ,将要发到的门店id:[%v] , 门店名:[%v]", order.VendorOrderID, order.StoreID, order.StoreName)
|
noticeMsg := fmt.Sprintf("京东商城新订单,订单号:[%v] ,将要发到的门店id:[%v] , 门店名:[%v]", order.VendorOrderID, order.StoreID, order.StoreName)
|
||||||
@@ -1084,13 +1084,7 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
|
|||||||
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
|
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
|
||||||
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
|
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
|
||||||
}
|
}
|
||||||
// if order.StoreName != "" {
|
|
||||||
// storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJDShop}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", order.StoreName)
|
|
||||||
// if len(storeMaps) > 0 {
|
|
||||||
// order.StoreID = storeMaps[0].StoreID
|
|
||||||
// order.VendorStoreID = storeMaps[0].VendorStoreID
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
storeList, err := common.GetStoreListByLocation(ctx, jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), 5000, false, true)
|
storeList, err := common.GetStoreListByLocation(ctx, jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), 5000, false, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
globals.SugarLogger.Debugf("jds GetStoreListByLocation error: %v", err.Error())
|
globals.SugarLogger.Debugf("jds GetStoreListByLocation error: %v", err.Error())
|
||||||
@@ -1098,6 +1092,10 @@ func result2Orders(ctx *jxcontext.Context, result *jdshopapi.AllOrdersResult) (o
|
|||||||
}
|
}
|
||||||
order.StoreID = storeList[0].ID
|
order.StoreID = storeList[0].ID
|
||||||
order.StoreName = storeList[0].Name
|
order.StoreName = storeList[0].Name
|
||||||
|
storeMaps, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDJDShop}, []int{order.StoreID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
|
||||||
|
if len(storeMaps) > 0 {
|
||||||
|
order.VendorStoreID = storeMaps[0].VendorStoreID
|
||||||
|
}
|
||||||
// }
|
// }
|
||||||
//如果是暂停,表示是预订单
|
//如果是暂停,表示是预订单
|
||||||
if jdsOrder.OrderStatus == jdshopapi.JdsOrderStatusPause {
|
if jdsOrder.OrderStatus == jdshopapi.JdsOrderStatusPause {
|
||||||
@@ -1183,6 +1181,7 @@ func TransferJdsOrder(ctx *jxcontext.Context, vendorOrderID string, storeID int)
|
|||||||
if len(storeMaps) > 0 {
|
if len(storeMaps) > 0 {
|
||||||
order.StoreID = storeID
|
order.StoreID = storeID
|
||||||
order.StoreName = storeMaps[0].StoreName
|
order.StoreName = storeMaps[0].StoreName
|
||||||
|
order.VendorStoreID = storeMaps[0].VendorStoreID
|
||||||
} else {
|
} else {
|
||||||
return "", fmt.Errorf("未查询到该门店对应的平台信息!门店:[%v]", order.StoreID)
|
return "", fmt.Errorf("未查询到该门店对应的平台信息!门店:[%v]", order.StoreID)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user