This commit is contained in:
邹宗楠
2023-10-24 10:19:58 +08:00
parent 08c39f4961
commit 0dce9e560d
11 changed files with 60 additions and 63 deletions

View File

@@ -3,8 +3,8 @@ package tiktok_store
import (
"errors"
"fmt"
instantShopping_getDeliveryListByOrderId_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/instantShopping_getDeliveryListByOrderId/response"
superm_getShipmentInfo_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_getShipmentInfo/response"
superm_getStoreAutoCallRiderInfo_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_getStoreAutoCallRiderInfo/response"
superm_setStoreAutoCallRider_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/superm_setStoreAutoCallRider/request"
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
@@ -55,22 +55,21 @@ func (c *PurchaseHandler) onWaybillMsg(tag, orderId string, data interface{}) *t
func (c *PurchaseHandler) callbackMsg2Waybill(tag, orderId string, data interface{}) (retVal *model.Waybill) {
req := data.(tiktok_api.ShipmentInfoData)
tempRemark := ""
if req.ShipmentStatus == tiktok_api.ShipmentStatusReceived {
if req.Status == tiktok_api.ShipmentStatusReceived {
tempRemark = req.RiderName + "," + req.RiderPhone
}
return &model.Waybill{
VendorOrderID: utils.Int64ToStr(req.ShopOrderID),
OrderVendorID: model.VendorIDDD,
VendorWaybillID: req.TrackNo,
VendorWaybillID: utils.Int64ToStr(req.ShopOrderID),
WaybillVendorID: model.VendorIDDD,
CourierName: req.RiderName,
CourierMobile: req.RiderPhone,
VendorStatus: utils.Int64ToStr(req.ShipmentStatus),
Status: c.GetWaybillStatusFromVendorStatus(utils.Int64ToStr(req.ShipmentStatus)),
StatusTime: utils.Str2Time(req.OccurredTime),
//StatusTime: getTimeFromTimestamp(utils.Str2Int64(req.OccurredTime)),
Remark: tempRemark,
VendorOrgCode: utils.Int64ToStr(req.ShopID), //为抖音账号ID
VendorStatus: utils.Int64ToStr(req.Status),
Status: c.GetWaybillStatusFromVendorStatus(utils.Int64ToStr(req.Status)),
StatusTime: utils.Str2Time(req.OperateTime),
Remark: tempRemark,
VendorOrgCode: utils.Int64ToStr(req.ShopID), //为抖音账号ID
}
}
@@ -138,7 +137,7 @@ func (c *PurchaseHandler) CancelWaybill(bill *model.Waybill, cancelReasonID int,
}
//查询运力状态
func (c *PurchaseHandler) GetDYPSRiderInfo(orderId string) (*superm_getShipmentInfo_response.ShipmentInfo, error) {
func (c *PurchaseHandler) GetDYPSRiderInfo(orderId string) (*instantShopping_getDeliveryListByOrderId_response.InstantShoppingGetDeliveryListByOrderIdData, error) {
params := map[string]interface{}{
"vendorOrderID": orderId,
}
@@ -146,9 +145,11 @@ func (c *PurchaseHandler) GetDYPSRiderInfo(orderId string) (*superm_getShipmentI
if err != nil {
return nil, errors.New("获取本地门店账号信息失败,请重试")
}
if waybill, err := getAPI(orderInfo[0].VendorOrgCode, 0, "").GetShipmentInfo(utils.Str2Int64(orderId), 0, tiktok_api.ShipmentTypeInvoice); err != nil {
waybill, err := getAPI(orderInfo[0].VendorOrgCode, 0, "").GetShipmentInfo(utils.Str2Int64(orderId), 0, tiktok_api.ShipmentTypeInvoice)
if err != nil {
return nil, err
} else {
return waybill, nil
}
return waybill, nil
}