1
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/scheduler/defsch"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/jd"
|
||||
"math/big"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -239,16 +240,25 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if err := ebai.OrderStatussync(utils.Struct2Map(riderInfo, "", true)); err != nil {
|
||||
if err := ebai.OrderDeliveryCoordinate(utils.Struct2Map(riderInfo, "", true)); err != nil {
|
||||
globals.SugarLogger.Debugf("Error pushing ebai OrderStatussync information :%s--%s--%v", v.VendorOrderID, utils.Format4Output(riderInfo, false), err)
|
||||
}
|
||||
}
|
||||
case model.VendorIDJD: // 京东发单
|
||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.VendorID); handler != nil {
|
||||
if err := handler.GetOrderRider(v.VendorOrgCode, v.VendorStoreID, utils.Struct2Map(riderInfo, "", true)); err != nil {
|
||||
globals.SugarLogger.Debugf("Error pushing meituan rider information :%s--%s--%v", v.VendorOrderID, utils.Format4Output(riderInfo, false), err)
|
||||
if orderId == "" {
|
||||
// 定时同步骑手坐标
|
||||
if err = jd.OrderDeliveryCoordinate(v.VendorOrderID, utils.Struct2Map(riderInfo, "", true)); err != nil {
|
||||
globals.SugarLogger.Debugf("Error pushing jd OrderStatussync information :%s--%s--%v", v.VendorOrderID, utils.Format4Output(riderInfo, false), err)
|
||||
}
|
||||
} else {
|
||||
// 同步订单骑手状态
|
||||
if handler := partner.GetPurchaseOrderHandlerFromVendorID(v.VendorID); handler != nil {
|
||||
if err := handler.GetOrderRider(v.VendorOrgCode, v.VendorStoreID, utils.Struct2Map(riderInfo, "", true)); err != nil {
|
||||
globals.SugarLogger.Debugf("Error pushing meituan rider information :%s--%s--%v", v.VendorOrderID, utils.Format4Output(riderInfo, false), err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case model.VendorIDJDShop: // 京东商城
|
||||
continue
|
||||
case model.VendorIDDD: // 抖店小时达
|
||||
@@ -499,7 +509,7 @@ func UpdateFakeWayBillToTiktok() {
|
||||
|
||||
}
|
||||
if order.VendorID == model.VendorIDEBAI {
|
||||
ebai.OrderStatussync(utils.Struct2Map(riderInfo, "", true))
|
||||
ebai.OrderDeliveryCoordinate(utils.Struct2Map(riderInfo, "", true))
|
||||
}
|
||||
//
|
||||
//allTime := order.ExpectedDeliveredTime.Unix() - order.OrderCreatedAt.Unix()
|
||||
@@ -534,7 +544,7 @@ func UpdateFakeWayBillToTiktok() {
|
||||
continue
|
||||
}
|
||||
// 饿百订单推送订单送达
|
||||
if fakeWayBill[i].OrderVendorID == model.VendorIDEBAI || fakeWayBill[i].OrderVendorID == model.VendorIDTaoVegetable || fakeWayBill[i].OrderVendorID == model.VendorIDMTWM {
|
||||
if fakeWayBill[i].OrderVendorID == model.VendorIDEBAI || fakeWayBill[i].OrderVendorID == model.VendorIDJD || fakeWayBill[i].OrderVendorID == model.VendorIDTaoVegetable || fakeWayBill[i].OrderVendorID == model.VendorIDMTWM {
|
||||
if err := handler.Swtich2SelfDelivered(order, "JingXiAdmin"); err != nil {
|
||||
partner.CurOrderManager.OnOrderMsg(order, tao_vegetable.OrderStatusDeliveryOver, fmt.Sprintf("%v", err))
|
||||
} else {
|
||||
|
||||
@@ -171,7 +171,7 @@ func (p *PurchaseHandler) GetOrderRider(vendorOrgCode, vendorStoreID string, par
|
||||
return api.EbaiAPI.SelfDeliveryLocationSync(riderInfo)
|
||||
}
|
||||
|
||||
func OrderStatussync(param map[string]interface{}) error {
|
||||
func OrderDeliveryCoordinate(param map[string]interface{}) error {
|
||||
selfStatus := 0
|
||||
switch param["logistics_status"].(int) {
|
||||
case 0, 5:
|
||||
|
||||
@@ -3,9 +3,8 @@ package jd
|
||||
import (
|
||||
"encoding/json"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"net/url"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
"net/url"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
|
||||
@@ -215,6 +214,7 @@ func (p *PurchaseHandler) GetOrderRider(vendorOrgCode, vendorStoreID string, par
|
||||
deliverInfo.DeliveryManPhone = param["courier_phone"].(string)
|
||||
case 40:
|
||||
// 完成和取消状态不通过此接口发送通知消息
|
||||
getAPI(vendorOrgCode).DeliveryEndOrder(param["order_id"].(string), param["courier_name"].(string))
|
||||
return nil
|
||||
case 100:
|
||||
// 完成和取消状态不通过此接口发送通知消息
|
||||
@@ -229,3 +229,11 @@ func (p *PurchaseHandler) GetOrderRider(vendorOrgCode, vendorStoreID string, par
|
||||
getAPI(vendorOrgCode).ReceiveLogisticInfoForOpenApiPlatform(logisticInfo)
|
||||
return nil
|
||||
}
|
||||
|
||||
func OrderDeliveryCoordinate(vendorOrgCode string, param map[string]interface{}) error {
|
||||
operateUser := param["courier_name"].(string)
|
||||
if operateUser == "" {
|
||||
operateUser = "system_user"
|
||||
}
|
||||
return getAPI(vendorOrgCode).SelfDeliveryUploadCoordinate(utils.Str2Int64(param["order_id"].(string)), param["latitude"].(string), param["longitude"].(string), operateUser)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user