1
This commit is contained in:
@@ -589,7 +589,7 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
||||
storeIDs2 = append(storeIDs2, k)
|
||||
}
|
||||
} else {
|
||||
//storeIDs2 = append(storeIDs2, -1)
|
||||
//storeIDs2 = append(storeIDs2, -1)l
|
||||
// 商家小程序用户切换门店,如果角色storeIDsMap没有数据则查询传入数据
|
||||
storeIDs2 = append(storeIDs2, int(utils.Interface2Int64WithDefault(params["storeID"], 0)))
|
||||
}
|
||||
|
||||
@@ -155,6 +155,8 @@ func (d DeliveryHandler) CreateWaybill(order *model.GoodsOrder, maxDeliveryFee i
|
||||
delivery.OnWaybillCreated(bill)
|
||||
//todo 模拟新运单回调
|
||||
if _, err = partner.CurOrderManager.LoadWaybill(sfOrderID, model.VendorIDSFPS); fmt.Sprintf("%s", err) == "找不到相应运单" {
|
||||
//忽略找不到运单错误
|
||||
err = nil
|
||||
resp := OnWaybillMsg(sfps2.UrlIndexRiderStatus, sfps2.RiderStatus{
|
||||
ShopId: utils.Str2Float64(sfps2.SFShopStoreID),
|
||||
SFOrderID: sfOrderID,
|
||||
@@ -254,7 +256,9 @@ func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeison
|
||||
sfOrder, err := api.SfPsAPI.GetOrderStatus(order[0].VendorWaybillID)
|
||||
//获取顺丰骑手实时位置
|
||||
sfRider, err := api.SfPsAPI.GetRiderLatestPosition(sfOrder.OrderID)
|
||||
|
||||
if sfRider == nil {
|
||||
return nil, errors.New("顺丰派送暂无骑手信息")
|
||||
}
|
||||
result := &mtpsapi.RiderInfo{
|
||||
OrderId: orderId,
|
||||
ThirdCarrierOrderId: sfOrder.OrderID,
|
||||
@@ -299,6 +303,15 @@ func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, v
|
||||
return api.SfPsAPI.QueryTipFee(vendorWaybillID)
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (lng, lat float64, err error) {
|
||||
if rider, err := api.SfPsAPI.GetRiderLatestPosition(vendorWaybillID); err == nil && len(rider.RiderLng) > 0 && len(rider.RiderLat) > 0 {
|
||||
lng = utils.Str2Float64(rider.RiderLng)
|
||||
lat = utils.Str2Float64(rider.RiderLat)
|
||||
return lng, lat, nil
|
||||
}
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error) {
|
||||
return api.SfPsAPI.AddTipFee(vendorWaybillID, tipFee)
|
||||
}
|
||||
@@ -396,7 +409,7 @@ func OnWaybillMsg(urlIndex string, msg interface{}) (resp *sfps2.CallbackRespons
|
||||
case sfps2.OrderStatusFinished:
|
||||
result.LogisticsStatus = model.WaybillStatusDelivered
|
||||
result.LogisticsContext = model.RiderGetOrderDelivered
|
||||
case sfps2.OrderStatusOrderCancel:
|
||||
case sfps2.OrderStatusOrderCancel, sfps2.OrderStatusRiderCancel:
|
||||
result.LogisticsStatus = model.WaybillStatusCanceled
|
||||
result.LogisticsContext = model.RiderGetOrderCanceled
|
||||
case sfps2.OrderStatusError:
|
||||
|
||||
@@ -259,6 +259,18 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
||||
return api.UuAPI.GetOrderLiquidatedDamages(deliverId, orderId)
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (lng, lat float64, err error) {
|
||||
if rider, err := api.UuAPI.GetOrderDetail(vendorWaybillID); err == nil && len(rider.DriverLastloc) > 0 {
|
||||
te := strings.Split(rider.DriverLastloc, ",")
|
||||
if len(te) > 0 {
|
||||
lng = utils.Str2Float64(te[0])
|
||||
lat = utils.Str2Float64(te[1])
|
||||
}
|
||||
return lng, lat, nil
|
||||
}
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
//辅助函数
|
||||
func getOrderPrice(order *model.GoodsOrder) (orderPrice *uuptapi.GetOrderPriceResp, err error) {
|
||||
store, err := dao.GetStoreDetail(dao.GetDB(), getReallyStoreID(order.StoreID, order.JxStoreID), 0, "")
|
||||
|
||||
@@ -92,6 +92,7 @@ func PingTimer() {
|
||||
}
|
||||
globals.SugarLogger.Debugf("PingTimer jx clientID ")
|
||||
} else {
|
||||
fmt.Printf("PingTimer mt心跳,conn%s,%s", conn.ClientId, conn.ClientType)
|
||||
if err := conn.Socket.WriteMessage(websocket.TextMessage, []byte(HeartCheckMsg)); err != nil {
|
||||
fmt.Printf("PingTimer mtHeartBeat err:%v", err)
|
||||
//对美团重新建立连接
|
||||
|
||||
@@ -24,15 +24,13 @@ func (c *SFPSController) SfOrder() {
|
||||
c.ServeJSON()
|
||||
return
|
||||
}
|
||||
|
||||
// 订单回调
|
||||
for k, v := range msg {
|
||||
callbackResponse = sfps.OnWaybillMsg(k, v)
|
||||
c.Data["data"] = callbackResponse
|
||||
fmt.Printf("SfOrder callbackResponse=%s", utils.Format4Output(callbackResponse, false))
|
||||
err := c.ServeJSON()
|
||||
if err != nil {
|
||||
fmt.Printf("serveJSON err=%v", err)
|
||||
}
|
||||
c.ServeJSON()
|
||||
}
|
||||
} else {
|
||||
c.Abort("404")
|
||||
|
||||
Reference in New Issue
Block a user