修改抖音运单状态变化推送

This commit is contained in:
邹宗楠
2023-12-15 15:46:05 +08:00
parent 145775ca23
commit 53c22d4468
8 changed files with 14 additions and 13 deletions

View File

@@ -132,7 +132,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
func tiktokStatusPush(order *model.Waybill, status int, lng, lat, vendorOrgCode string) {
result := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorWaybillID,
CourierName: order.CourierName,
CourierPhone: order.CourierMobile,
LogisticsStatus: order.Status,

View File

@@ -325,7 +325,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify, resultParam *fnpsapi.ShortSta
func tiktokStatusPush(order *model.Waybill, orderStatus int64, lng, lat, vendorOrgCode string) {
result := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorWaybillID,
CourierName: order.CourierName,
CourierPhone: order.CourierMobile,
LogisticsStatus: order.Status,

View File

@@ -156,7 +156,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
func pushMTPSToTiktok(msgStatus int, order *model.Waybill, lng, lat, vendorOrgCode string) {
result := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorWaybillID,
CourierName: order.CourierName,
CourierPhone: order.CourierMobile,
LogisticsProviderCode: utils.MTPsCode,

View File

@@ -205,7 +205,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
}
if riderInfo.ThirdCarrierOrderId == "" {
riderInfo.ThirdCarrierOrderId = riderInfo.OrderId + "_fake"
riderInfo.ThirdCarrierOrderId = riderInfo.OrderId
}
// 目前只推送美团骑手信息
@@ -232,7 +232,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
continue
case model.VendorIDDD: // 抖店小时达
riderInfo.LogisticsProviderCode = tiktok_api.JxVendorId2TiktokCode(v.WaybillVendorID)
riderInfo.ThirdCarrierOrderId = v.VendorOrderID
riderInfo.ThirdCarrierOrderId = v.VendorWaybillID
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)
@@ -435,7 +435,7 @@ func UpdateFakeWayBillToTiktok() {
riderInfo := &utils.RiderInfo{
OrderId: fakeWayBill[i].VendorOrderID,
ThirdCarrierOrderId: fakeWayBill[i].VendorOrderID,
ThirdCarrierOrderId: fakeWayBill[i].VendorWaybillID,
CourierName: fakeWayBill[i].CourierName,
CourierPhone: fakeWayBill[i].CourierMobile,
LogisticsProviderCode: "10002",

View File

@@ -454,7 +454,7 @@ func OnWaybillMsg(urlIndex string, msg interface{}) (resp *sfps2.CallbackRespons
func tiktokStatusPush(order *model.Waybill, orderStatus int64, lng, lat, vendorOrgCode string) {
result := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorWaybillID,
CourierName: order.CourierName,
CourierPhone: order.CourierMobile,
LogisticsProviderCode: utils.SFPSCode,

View File

@@ -428,7 +428,7 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
func tiktokStatusPush(param *model.Waybill, orderStatus string, lng, lat, vendorOrgCode string) {
result := &utils.RiderInfo{
OrderId: param.VendorOrderID,
ThirdCarrierOrderId: param.VendorOrderID,
ThirdCarrierOrderId: param.VendorWaybillID,
CourierName: param.CourierName,
CourierPhone: param.CourierMobile,
LogisticsProviderCode: utils.UUPTCode,

View File

@@ -616,7 +616,7 @@ func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName
if err == nil {
riderInfo := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorWaybillID,
CourierName: "",
CourierPhone: "",
LogisticsProviderCode: "10015", // 商家自建配送

View File

@@ -247,7 +247,6 @@ func (p *PurchaseHandler) GetOrderRider(vendorOrgCode, vendorStoreID string, par
//appKey := `7152420904331429407` // 暂时定死
//appSecret := `cc7ba367-2394-4cbb-81c6-26f0e929d1c6` //暂时定死
//return tiktokShop.NewExpress(appKey, appSecret, "").OrderStatusAndPsInfoNew(param)
//api.AutonaviAPI.
if param["latitude"].(string) != "" && param["longitude"].(string) != "" {
if len(param["latitude"].(string)) > len("39.978573") && len(param["longitude"].(string)) > len("116.5031060") { // 是否为百度坐标
lng, lat, _ := api.AutonaviAPI.CoordinateConvert(utils.Str2Float64(param["latitude"].(string)), utils.Str2Float64(param["longitude"].(string)), autonavi.CoordSysBaidu)
@@ -256,7 +255,7 @@ func (p *PurchaseHandler) GetOrderRider(vendorOrgCode, vendorStoreID string, par
}
}
return getAPI(vendorOrgCode, 0, vendorStoreID).OrderStatusAndPsInfoNew(param)
return getAPI(vendorOrgCode, 0, vendorStoreID).OrderStatusAndPsInfoNew(param, vendorStoreID)
}
func (p *PurchaseHandler) GetOrder(vendorOrgCode, vendorOrderID, vendorStoreID string) (order *model.GoodsOrder, err error) {
@@ -643,6 +642,7 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
return err
}
// 自送的时候(运单id和订单id一致的) ThirdCarrierOrderId 可以不填写,为了保持统一处理,这里填写订单id
riderInfo := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
@@ -661,9 +661,10 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
// SelfDeliverDelivered 自配搜完成(暂无)
func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
// 自配送完成时(订单id和运单id一直) ThirdCarrierOrderId 可以不填写,为了保持统一
riderInfo := &utils.RiderInfo{
OrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID,
ThirdCarrierOrderId: order.VendorOrderID, // waybill.vendorWaybillId
CourierName: "",
CourierPhone: "",
LogisticsProviderCode: "",
@@ -1017,7 +1018,7 @@ func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (data *utils.Ride
result := &utils.RiderInfo{
OrderId: waybill.ShopOrderId,
ThirdCarrierOrderId: waybill.ShopOrderId,
ThirdCarrierOrderId: waybill.ShopOrderId, // 假的运单id
CourierName: waybill.RiderName,
CourierPhone: waybill.RiderPhone,
LogisticsStatus: int(waybill.Status),