地址
This commit is contained in:
@@ -28,10 +28,11 @@ const (
|
||||
)
|
||||
|
||||
const (
|
||||
OrderTypeNormal = 0 //普通订单
|
||||
OrderTypeMatter = 1 //物料订单
|
||||
OrderTypeSupplyGoods = 2 //进货订单
|
||||
OrderTypeDefendPrice = 3 //守价订单
|
||||
OrderTypeAddressErr = -1 //地址异常订单
|
||||
OrderTypeNormal = 0 //普通订单
|
||||
OrderTypeMatter = 1 //物料订单
|
||||
OrderTypeSupplyGoods = 2 //进货订单
|
||||
OrderTypeDefendPrice = 3 //守价订单
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -70,13 +70,11 @@ func SaveJdsOrders(msg *jdshopapi.CallBackResult) (err error) {
|
||||
if err != nil || order == nil {
|
||||
return err
|
||||
}
|
||||
// order.StoreID = 102919
|
||||
// order.JxStoreID = 102919
|
||||
// order.StoreName = "商城模板(成都发货)"
|
||||
// order.VendorStoreID = model.JdShopMainVendorStoreID
|
||||
// order.DeliveryFlag = model.OrderDeliveryFlagMaskScheduleDisabled
|
||||
partner.CurOrderManager.OnOrderNew(order, model.Order2Status(order))
|
||||
noticeMsg := fmt.Sprintf("京东商城新订单,订单号:[%v] ,将要发到的门店id:[%v] , 门店名:[%v]", order.VendorOrderID, order.StoreID, order.StoreName)
|
||||
if order.OrderType == model.OrderTypeAddressErr {
|
||||
noticeMsg += " 此订单地址有问题,需要矫正坐标!"
|
||||
}
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "DDC5657B43EE11E9A9FF525400E86DC0", "京东商城来新订单了!", noticeMsg)
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "1439B3E07D3911EA881A525400E86DC0", "京东商城来新订单了!", noticeMsg)
|
||||
return err
|
||||
@@ -118,11 +116,15 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
||||
if err = err2; err != nil {
|
||||
globals.SugarLogger.Infof("高德page err: %v", err)
|
||||
}
|
||||
lng2, lat2, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "")
|
||||
distance := jxutils.EarthDistance(lng, lat, lng2, lat2)
|
||||
if distance > 1 {
|
||||
order.OrderType = model.OrderTypeAddressErr
|
||||
}
|
||||
if err == nil && lng != 0 && lat != 0 {
|
||||
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng)
|
||||
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat)
|
||||
} else {
|
||||
lng2, lat2, _ := api.AutonaviAPI.GetCoordinateFromAddress(order.ConsigneeAddress, "")
|
||||
order.ConsigneeLng = jxutils.StandardCoordinate2Int(lng2)
|
||||
order.ConsigneeLat = jxutils.StandardCoordinate2Int(lat2)
|
||||
}
|
||||
@@ -231,6 +233,9 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err
|
||||
}
|
||||
}
|
||||
setJdsOrderSeq(order)
|
||||
if order.OrderType == model.OrderTypeAddressErr {
|
||||
buildOrderTo102919(order)
|
||||
}
|
||||
return order, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user