1
This commit is contained in:
@@ -3,7 +3,6 @@ package dada
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
||||
@@ -130,7 +129,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *dadaapi.CallbackMsg) (retVal *dadaap
|
||||
|
||||
// 抖音订单状态回传
|
||||
func tiktokStatusPush(order *model.Waybill, status int) {
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: order.CourierName,
|
||||
@@ -507,18 +506,18 @@ func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCod
|
||||
}
|
||||
|
||||
// 获取骑手信息(订单详情)
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||
order, err := api.DadaAPI.QueryOrderInfo(orderId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: orderId,
|
||||
ThirdCarrierOrderId: mtPeisongId,
|
||||
CourierName: order.TransporterName,
|
||||
CourierPhone: order.TransporterPhone,
|
||||
LogisticsProviderCode: mtpsapi.DaDaCode,
|
||||
LogisticsProviderCode: utils.DaDaCode,
|
||||
LogisticsStatus: order.StatusCode,
|
||||
LogisticsContext: "",
|
||||
Latitude: order.TransporterLat,
|
||||
|
||||
@@ -2,7 +2,6 @@ package fn
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
tao "git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||
@@ -323,7 +322,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify, resultParam *fnpsapi.ShortSta
|
||||
|
||||
// 抖音订单状态回传
|
||||
func tiktokStatusPush(order *model.Waybill, orderStatus int64) {
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: order.CourierName,
|
||||
@@ -393,7 +392,7 @@ func GetDesiredFee(vendorOrderID string) (desiredFee, acuteFee int64) {
|
||||
}
|
||||
|
||||
// 获取骑手信息
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||
// 获取订单状态
|
||||
order, err := api.FnAPI.QueryOrder(orderId)
|
||||
if err != nil {
|
||||
@@ -406,12 +405,12 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: orderId,
|
||||
ThirdCarrierOrderId: utils.Int64ToStr(order.TrackingId),
|
||||
CourierName: knightInfo.CarrierDriverName,
|
||||
CourierPhone: knightInfo.CarrierDriverPhone,
|
||||
LogisticsProviderCode: mtpsapi.FnPsCode,
|
||||
LogisticsProviderCode: utils.FnPsCode,
|
||||
LogisticsStatus: order.OrderStatus, // 默认正在配送中
|
||||
Latitude: knightInfo.CarrierDriverLatitude,
|
||||
Longitude: knightInfo.CarrierDriverLongitude,
|
||||
|
||||
@@ -2,7 +2,6 @@ package jdeclp
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/jdeclpapi"
|
||||
@@ -104,7 +103,7 @@ func (c *DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, reson
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||
return nil, nil
|
||||
}
|
||||
func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId string) (money int64, err error) {
|
||||
|
||||
@@ -153,7 +153,7 @@ func (c *DeliveryHandler) onWaybillMsg(msg *mtpsapi.CallbackOrderMsg) (retVal *m
|
||||
}
|
||||
|
||||
func pushMTPSToTiktok(msgStatus int, order *model.Waybill) {
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: order.CourierName,
|
||||
@@ -471,7 +471,7 @@ func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCod
|
||||
}
|
||||
|
||||
// 获取骑手信息 美团配送 deliveryId,mtPeisongId这两参数美团专属
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
||||
func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||
// 获取订单状态
|
||||
order, err := api.MtpsAPI.QueryOrderStatus(deliveryId, mtPeisongId)
|
||||
if err != nil {
|
||||
@@ -483,12 +483,12 @@ func (c *DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeiso
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: orderId,
|
||||
ThirdCarrierOrderId: utils.Interface2String(order["mt_peisong_id"]),
|
||||
CourierName: utils.Interface2String(order["courier_name"]),
|
||||
CourierPhone: utils.Interface2String(order["courier_phone"]),
|
||||
LogisticsProviderCode: mtpsapi.MTPsCode,
|
||||
LogisticsProviderCode: utils.MTPsCode,
|
||||
LogisticsStatus: int(utils.MustInterface2Int64(order["status"])), // 默认正在配送中
|
||||
Latitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lat)),
|
||||
Longitude: utils.Float64ToStr(jxutils.IntCoordinate2Standard(lng)),
|
||||
|
||||
@@ -3,7 +3,11 @@ package delivery
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/dingdingapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxstore/cms"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/ddmsg"
|
||||
"math/big"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/tao_vegetable"
|
||||
@@ -16,7 +20,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/tasksch"
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/mtwm"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tiktok_shop/tiktok_api"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -96,10 +99,6 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
continue
|
||||
}
|
||||
|
||||
//if (v.WaybillVendorID == model.YES || v.WaybillVendorID == -1) && v.VendorID == model.VendorIDMTWM {
|
||||
// continue
|
||||
//}
|
||||
|
||||
if orderId == "" { // 订单id为空是,是定时轮询操作,不做此状态
|
||||
waybillList, _ := dao.GetWaybills(dao.GetDB(), v.VendorOrderID, nil)
|
||||
if len(waybillList) > 0 && waybillList[0].Status > model.WaybillStatusEndBegin {
|
||||
@@ -108,7 +107,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
}
|
||||
}
|
||||
|
||||
riderInfo := &mtpsapi.RiderInfo{}
|
||||
riderInfo := &utils.RiderInfo{}
|
||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(v.WaybillVendorID); handlerInfo != nil {
|
||||
if v.WaybillVendorID == model.VendorIDDada || v.WaybillVendorID == model.VendorIDFengNiao || v.WaybillVendorID == model.VendorIDUUPT || v.WaybillVendorID == model.VendorIDSFPS {
|
||||
riderInfo, err = handlerInfo.Handler.GetRiderInfo(v.VendorOrderID, 0, v.VendorWaybillID)
|
||||
@@ -250,7 +249,7 @@ func GetOrderRiderInfoToPlatform(orderId string, wayBillStatus int) {
|
||||
return
|
||||
}
|
||||
|
||||
func PullTiktokRiderInfo(riderInfo *mtpsapi.RiderInfo) {
|
||||
func PullTiktokRiderInfo(riderInfo *utils.RiderInfo) {
|
||||
switch riderInfo.LogisticsStatus {
|
||||
case 5: // 呼叫骑手
|
||||
riderInfo.LogisticsStatus = 0
|
||||
@@ -311,7 +310,7 @@ func UpdateOrder2Complete() {
|
||||
return
|
||||
}
|
||||
|
||||
func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *utils.RiderInfo) {
|
||||
order, _ := partner.CurOrderManager.LoadOrder(fakeWayBill.VendorOrderID, fakeWayBill.OrderVendorID)
|
||||
storeId := 0
|
||||
if order.StoreID != 0 {
|
||||
@@ -320,6 +319,13 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
storeId = order.JxStoreID
|
||||
}
|
||||
storeDetail, _ := dao.GetStoreDetail(dao.GetDB(), storeId, order.VendorID, order.VendorOrgCode)
|
||||
|
||||
waybill2, err := cms.GetSToURidingDistance2(jxutils.IntCoordinate2Standard(storeDetail.Lng), jxutils.IntCoordinate2Standard(storeDetail.Lat), jxutils.IntCoordinate2Standard(order.ConsigneeLng), jxutils.IntCoordinate2Standard(order.ConsigneeLat), fakeWayBill.VendorOrderID)
|
||||
if err != nil {
|
||||
ddmsg.SendUserMessage(dingdingapi.MsgTyeText, "2452A93EEB9111EC9B06525400E86DC0", "高德地图骑行方案获取错误:", utils.Format4Output(err.Error(), false))
|
||||
return
|
||||
}
|
||||
courierCoordinate := strings.Split(waybill2.CourierCoordinate, ",")
|
||||
switch fakeWayBill.Status {
|
||||
case 5: // 呼叫骑手
|
||||
riderInfo.LogisticsContext = "呼叫骑手,新建运单"
|
||||
@@ -334,11 +340,12 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
fakeWayBill.Status = model.WaybillStatusCourierAssigned
|
||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierAssigned)
|
||||
case 12: // 骑手接单
|
||||
|
||||
riderInfo.LogisticsContext = model.RiderWaitGetGoods
|
||||
riderInfo.LogisticsStatus = 10
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsORDERRECEIVED
|
||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
||||
riderInfo.Latitude = courierCoordinate[1]
|
||||
riderInfo.Longitude = courierCoordinate[0]
|
||||
// 下一状态以及推送时间
|
||||
fakeWayBill.Status = model.WaybillStatusCourierArrived
|
||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusCourierArrived)
|
||||
@@ -346,8 +353,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
riderInfo.LogisticsContext = model.RiderToStore
|
||||
riderInfo.LogisticsStatus = 15
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERARRIVED
|
||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
||||
riderInfo.Latitude = courierCoordinate[1]
|
||||
riderInfo.Longitude = courierCoordinate[0]
|
||||
// 下一状态以及推送时间
|
||||
fakeWayBill.Status = model.WaybillStatusDelivering
|
||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivering)
|
||||
@@ -355,8 +362,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
riderInfo.LogisticsContext = model.RiderGetOrderDelivering
|
||||
riderInfo.LogisticsStatus = 20
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsRIDERPICKUP
|
||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lat))
|
||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(storeDetail.Lng))
|
||||
riderInfo.Latitude = courierCoordinate[1]
|
||||
riderInfo.Longitude = courierCoordinate[0]
|
||||
// 下一状态以及推送时间
|
||||
fakeWayBill.Status = model.WaybillStatusDelivered
|
||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusDelivered)
|
||||
@@ -364,8 +371,8 @@ func makeRiderInfo(fakeWayBill *model.Waybill, riderInfo *mtpsapi.RiderInfo) {
|
||||
riderInfo.LogisticsContext = model.RiderGetOrderDelivered
|
||||
riderInfo.LogisticsStatus = 40
|
||||
riderInfo.OpCode = tiktok_api.TiktokLogisticsDELIVERED
|
||||
riderInfo.Latitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLat))
|
||||
riderInfo.Longitude = utils.Float64ToStr(jxutils.IntCoordinate2Standard(order.ConsigneeLng))
|
||||
riderInfo.Latitude = courierCoordinate[1]
|
||||
riderInfo.Longitude = courierCoordinate[0]
|
||||
// 下一状态以及推送时间
|
||||
fakeWayBill.Status = model.WaybillStatusFailed
|
||||
fakeWayBill.VendorStatus = utils.Int64ToStr(model.WaybillStatusFailed)
|
||||
@@ -398,7 +405,7 @@ func UpdateFakeWayBillToTiktok() {
|
||||
continue
|
||||
}
|
||||
|
||||
riderInfo := &mtpsapi.RiderInfo{
|
||||
riderInfo := &utils.RiderInfo{
|
||||
OrderId: fakeWayBill[i].VendorOrderID,
|
||||
ThirdCarrierOrderId: fakeWayBill[i].VendorOrderID,
|
||||
CourierName: fakeWayBill[i].CourierName,
|
||||
@@ -438,7 +445,7 @@ func UpdateFakeWayBillToTiktok() {
|
||||
}
|
||||
// 推送完成时加多加十分钟,相当于是配送中状态多存货十分钟
|
||||
if fakeWayBill[i].Status == model.WaybillStatusDelivered {
|
||||
randTime += 1200
|
||||
randTime += 600
|
||||
}
|
||||
fakeWayBill[i].StatusTime = time.Now().Add(time.Duration(randTime) * time.Second).Local()
|
||||
fakeWayBill[i].WaybillFinishedAt = time.Now()
|
||||
@@ -552,8 +559,8 @@ func LoadingStoreOrderSettleAmount(startTime, endTime int64, jxStoreId []int) er
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetVendorRiderInfo(wayBillVendorId, vendorId int, vendorOrderId, vendorWaybillId string) (riderInfo *mtpsapi.RiderInfo, err error) {
|
||||
riderInfo = &mtpsapi.RiderInfo{}
|
||||
func GetVendorRiderInfo(wayBillVendorId, vendorId int, vendorOrderId, vendorWaybillId string) (riderInfo *utils.RiderInfo, err error) {
|
||||
riderInfo = &utils.RiderInfo{}
|
||||
if handlerInfo := partner.GetDeliveryPlatformFromVendorID(wayBillVendorId); handlerInfo != nil {
|
||||
if wayBillVendorId == model.VendorIDDada || wayBillVendorId == model.VendorIDFengNiao || wayBillVendorId == model.VendorIDUUPT {
|
||||
riderInfo, err = handlerInfo.Handler.GetRiderInfo(vendorOrderId, 0, vendorWaybillId)
|
||||
|
||||
@@ -15,7 +15,6 @@ import (
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/globals/api"
|
||||
|
||||
@@ -299,7 +298,7 @@ func (d DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId s
|
||||
return money, nil
|
||||
}
|
||||
|
||||
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
||||
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||
order, err := dao.GetWaybills(dao.GetDB(), orderId, []int64{model.VendorIDSFPS})
|
||||
if len(order) == 0 || err != nil {
|
||||
return nil, errors.New("顺丰 订单id无效,请检查")
|
||||
@@ -311,12 +310,12 @@ func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeison
|
||||
if sfRider == nil {
|
||||
return nil, errors.New("顺丰派送暂无骑手信息")
|
||||
}
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: orderId,
|
||||
ThirdCarrierOrderId: sfOrder.OrderID,
|
||||
CourierName: sfOrder.RiderName,
|
||||
CourierPhone: sfOrder.RiderPhone,
|
||||
LogisticsProviderCode: mtpsapi.SFPSCode,
|
||||
LogisticsProviderCode: utils.SFPSCode,
|
||||
LogisticsStatus: utils.Float64TwoInt(sfOrder.OrderStatus), // 默认正在配送中
|
||||
Latitude: sfRider.RiderLat,
|
||||
Longitude: sfRider.RiderLng,
|
||||
@@ -452,7 +451,7 @@ func OnWaybillMsg(urlIndex string, msg interface{}) (resp *sfps2.CallbackRespons
|
||||
}
|
||||
|
||||
func tiktokStatusPush(order *model.Waybill, orderStatus int64) {
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: order.CourierName,
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/partner/purchase/tao_vegetable"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/baidunavi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/baseapi/platformapi/uuptapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
@@ -219,17 +218,17 @@ func (d DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, resonC
|
||||
return fmt.Errorf("UU跑腿暂不支持此操作")
|
||||
}
|
||||
|
||||
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error) {
|
||||
func (d DeliveryHandler) GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error) {
|
||||
waybill, err := api.UuAPI.GetOrderDetail(orderId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
param := &mtpsapi.RiderInfo{
|
||||
param := &utils.RiderInfo{
|
||||
OrderId: orderId,
|
||||
ThirdCarrierOrderId: waybill.OrderCode,
|
||||
CourierName: waybill.DriverName,
|
||||
CourierPhone: waybill.DriverMobile,
|
||||
LogisticsProviderCode: mtpsapi.UUPTCode,
|
||||
LogisticsProviderCode: utils.UUPTCode,
|
||||
LogisticsStatus: utils.Str2Int(waybill.State),
|
||||
}
|
||||
if len(waybill.DriverLastloc) == 0 {
|
||||
@@ -407,7 +406,7 @@ func OnWaybillMsg(req *uuptapi.WaybillCallbackParam) (resp *uuptapi.CallbackResp
|
||||
}
|
||||
|
||||
func tiktokStatusPush(param *model.Waybill, orderStatus string) {
|
||||
result := &mtpsapi.RiderInfo{
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: param.VendorOrderID,
|
||||
ThirdCarrierOrderId: param.VendorOrderID,
|
||||
CourierName: param.CourierName,
|
||||
|
||||
@@ -2,7 +2,7 @@ package partner
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/model/dao"
|
||||
@@ -41,7 +41,7 @@ type IDeliveryPlatformHandler interface {
|
||||
//投诉骑手
|
||||
ComplaintRider(bill *model.Waybill, resonID int, resonContent string) (err error)
|
||||
// GetRiderInfo 获取骑手信息
|
||||
GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *mtpsapi.RiderInfo, err error)
|
||||
GetRiderInfo(orderId string, deliveryId int64, mtPeisongId string) (rider *utils.RiderInfo, err error)
|
||||
// 三方配送时,呼叫骑手在取消.可能存在违约赔付!获取每单的违约金额!
|
||||
// 蜂鸟:骑手接单后-取餐之前,每单扣除2元,超过20分钟不扣款
|
||||
// 达达:骑手接单后-到店之前,接单1-15分钟内,扣款2元,超过不扣款
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package partner
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
)
|
||||
@@ -48,25 +49,21 @@ type IPurchasePlatformOrderHandler interface {
|
||||
CanSwitch2SelfDeliver(order *model.GoodsOrder) (isCan bool, err error)
|
||||
// 将订单从购物平台配送转为自送
|
||||
Swtich2SelfDeliver(order *model.GoodsOrder, userName string) (err error)
|
||||
|
||||
// 将订单从购物平台配送转为自送后又送达
|
||||
Swtich2SelfDelivered(order *model.GoodsOrder, userName string) (err error)
|
||||
|
||||
// 完全自送的门店表示开始配送
|
||||
SelfDeliverDelivering(order *model.GoodsOrder, userName string) (err error)
|
||||
|
||||
// 转自配送时取消非专送混合送门店取消理由
|
||||
GetCancelDeliveryReason(order *model.GoodsOrder) (string, error)
|
||||
// 取消美团外卖理由转使用三方配送
|
||||
CancelLogisticsByWmOrderId(order *model.GoodsOrder, reasonCode, detailContent, appPoiCode, orderId string) error
|
||||
OrderLogisticsStatus(orderId int64) (int64, error)
|
||||
// 获取运单状态
|
||||
OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error)
|
||||
// 完全自送的门店表示配送完成
|
||||
SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error)
|
||||
|
||||
GetOrderRealMobile(ctx *jxcontext.Context, order *model.GoodsOrder) (mobile string, err error)
|
||||
|
||||
ReplyOrderComment(ctx *jxcontext.Context, vendorOrgCode string, orderComment *model.OrderComment, replyComment string) (err error)
|
||||
|
||||
AgreeOrRefuseCancel(ctx *jxcontext.Context, order *model.GoodsOrder, isAgree bool, reason string) (err error)
|
||||
CancelOrder(ctx *jxcontext.Context, order *model.GoodsOrder, reason string) (err error)
|
||||
// order.Skus要包含原始订单中的Sku信息,removedSkuList中是要移除的Sku信息
|
||||
|
||||
@@ -823,8 +823,20 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
status, err := api.EbaiAPI.OrderDeliveryGet(orderId)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
data := &utils.RiderInfo{}
|
||||
data.LogisticsStatus = int(utils.MustInterface2Int64(status["status"]))
|
||||
data.CourierName = utils.Interface2String(status["name"])
|
||||
data.CourierPhone = utils.Interface2String(status["phone"])
|
||||
data.OrderId = utils.Interface2String(status["order_id"])
|
||||
data.Latitude = utils.Float64ToStr(utils.MustInterface2Float64(status["latitude"]))
|
||||
data.Longitude = utils.Float64ToStr(utils.MustInterface2Float64(status["longitude"]))
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
@@ -341,8 +341,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
@@ -661,8 +661,9 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
@@ -325,8 +325,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package jx
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
@@ -152,8 +153,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
@@ -3,7 +3,6 @@ package mtwm
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
"math"
|
||||
"net/url"
|
||||
"regexp"
|
||||
@@ -609,7 +608,7 @@ func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName
|
||||
|
||||
err = api.OrderArrived(utils.Str2Int64(order.VendorOrderID))
|
||||
if err == nil {
|
||||
riderInfo := &mtpsapi.RiderInfo{
|
||||
riderInfo := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: "",
|
||||
@@ -915,15 +914,15 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), utils.Int64ToStr(orderId))
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), orderId)
|
||||
if err != nil {
|
||||
return 0, errors.New("获取本地门店账号信息失败,请重试")
|
||||
return nil, errors.New("获取本地门店账号信息失败,请重试")
|
||||
}
|
||||
|
||||
status, err := getAPI(orderInfo.VendorOrgCode, 0, "").OrderLogisticsStatus(orderId)
|
||||
status, err := getAPI(orderInfo.VendorOrgCode, 0, "").OrderLogisticsStatus(utils.Str2Int64(orderId))
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return status, nil
|
||||
|
||||
@@ -847,8 +847,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息(t+1)当前订单获取不到结算
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||
order_getSettleBillDetailV3_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_getSettleBillDetailV3/request"
|
||||
order_logisticsAdd_request "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_logisticsAdd/request"
|
||||
order_orderDetail_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/order_orderDetail/response"
|
||||
@@ -634,7 +633,7 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
|
||||
return err
|
||||
}
|
||||
|
||||
riderInfo := &mtpsapi.RiderInfo{
|
||||
riderInfo := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: "",
|
||||
@@ -652,7 +651,7 @@ func (c *PurchaseHandler) SelfDeliverDelivering(order *model.GoodsOrder, userNam
|
||||
|
||||
// SelfDeliverDelivered 自配搜完成(暂无)
|
||||
func (c *PurchaseHandler) SelfDeliverDelivered(order *model.GoodsOrder, userName string) (err error) {
|
||||
riderInfo := &mtpsapi.RiderInfo{
|
||||
riderInfo := &utils.RiderInfo{
|
||||
OrderId: order.VendorOrderID,
|
||||
ThirdCarrierOrderId: order.VendorOrderID,
|
||||
CourierName: "",
|
||||
@@ -985,18 +984,27 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// OrderLogisticsStatus 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), utils.Int64ToStr(orderId))
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
orderInfo, err := dao.GetSimpleOrder(dao.GetDB(), orderId)
|
||||
if err != nil {
|
||||
return 0, errors.New("获取本地门店账号信息失败,请重试")
|
||||
return nil, errors.New("获取本地门店账号信息失败,请重试")
|
||||
}
|
||||
|
||||
waybill, err := getAPI(orderInfo.VendorOrgCode, 0, "").GetShipmentInfo(utils.Str2Int64(orderInfo.VendorOrderID), 0, tiktokShop.ShipmentTypeInvoice)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return waybill.ShipmentStatus, nil
|
||||
result := &utils.RiderInfo{
|
||||
OrderId: utils.Int64ToStr(waybill.ShopOrderID),
|
||||
ThirdCarrierOrderId: waybill.TrackNo,
|
||||
CourierName: waybill.RiderName,
|
||||
CourierPhone: waybill.RiderPhone,
|
||||
LogisticsStatus: int(waybill.ShipmentStatus),
|
||||
Latitude: waybill.RiderLatitude,
|
||||
Longitude: waybill.RiderLongitude,
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// GetOrderTotalShopMoney 获取门店结算信息
|
||||
|
||||
@@ -309,8 +309,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package yb
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"git.rosy.net.cn/jx-callback/business/partner"
|
||||
@@ -103,8 +104,8 @@ func (c *PurchaseHandler) CancelLogisticsByWmOrderId(order *model.GoodsOrder, re
|
||||
}
|
||||
|
||||
// 获取订单配送状态
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId int64) (int64, error) {
|
||||
return 0, nil
|
||||
func (c *PurchaseHandler) OrderLogisticsStatus(orderId string) (*utils.RiderInfo, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// GetOrderSettleAccounts 获取订单结算信息
|
||||
|
||||
Reference in New Issue
Block a user