This commit is contained in:
邹宗楠
2023-06-05 17:25:40 +08:00
parent 3293103285
commit d81bad8f1c
4 changed files with 46 additions and 7 deletions

View File

@@ -148,7 +148,7 @@ func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.S
// 蜂鸟门店状态改变
func OnStoreStatus(msg *fnpsapi.ChainstoreStatusNotify) (retVal *fnpsapi.CallbackResponse) {
return curDeliveryHandler.OnStoreStatus(msg)
return CurDeliveryHandler.OnStoreStatus(msg)
}
// 修改本地门店审核状态

View File

@@ -5,6 +5,7 @@ import (
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
"strings"
"time"
@@ -35,7 +36,7 @@ const (
)
var (
curDeliveryHandler *DeliveryHandler
CurDeliveryHandler *DeliveryHandler
complaintReson2FnResonMap = map[int]int{
model.ComplaintReasons1: ComplaintReasonsFn160,
model.ComplaintReasons2: ComplaintReasonsFn130,
@@ -53,10 +54,8 @@ type DeliveryHandler struct {
}
func init() {
if api.FnAPI != nil {
curDeliveryHandler = new(DeliveryHandler)
partner.RegisterDeliveryPlatform(curDeliveryHandler, true)
}
CurDeliveryHandler = new(DeliveryHandler)
partner.RegisterDeliveryPlatform(CurDeliveryHandler, true)
}
func (c *DeliveryHandler) GetVendorID() int {
@@ -323,7 +322,7 @@ func OnWaybillMsg(msg *fnpsapi.OrderStatusNottify, resultParam *fnpsapi.ShortSta
// 异常报备
func OnWaybillExceptFn(msg *fnpsapi.AbnormalReportNotify) (retVal *fnpsapi.CallbackResponse) {
return curDeliveryHandler.OnWaybillExcept(msg)
return CurDeliveryHandler.OnWaybillExcept(msg)
}
func (c *DeliveryHandler) OnWaybillExcept(msg *fnpsapi.AbnormalReportNotify) (retVal *fnpsapi.CallbackResponse) {
@@ -487,3 +486,31 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
}
return vendorPrice, nil
}
func (c *DeliveryHandler) GetRidderPosition(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (lng, lat float64, err error) {
order, err := api.FnAPI.GetKnightInfo(&fnpsapi.GetOrderDetailReq{
PartnerOrderCode: vendorOrderID,
})
if err == nil {
lng = utils.Str2Float64WithDefault(order.CarrierDriverLongitude, 0)
lat = utils.Str2Float64WithDefault(order.CarrierDriverLatitude, 0)
}
return lng, lat, err
}
func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error) {
return api.FnAPI.AddTip(&fnpsapi.AddTipRes{
OrderId: "",
PartnerOrderCode: vendorOrderID,
AddTipAmountCent: tipFee,
ThirdIndexId: time.Now().Unix(),
})
}
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
order, err := api.FnAPI.QueryOrder(vendorOrderID)
if err == nil {
tipFee = order.OrderTipAmountCent
}
return tipFee, err
}

View File

@@ -548,3 +548,13 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
}
return 0, err
}
func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error) {
// 无法获取已经添加的小费金额
return fmt.Errorf("美团暂不支持添加小费")
//return api.MtpsAPI.AddTip(vendorOrderID, vendorWaybillID, tipFee)
}
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
return tipFee, err
}

View File

@@ -95,7 +95,9 @@ type IPurchasePlatformOrderHandler interface {
}
type IAddWaybillTip interface {
// GetWaybillTip 获取添加小费
GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error)
// UpdateWaybillTip 添加小费
UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error)
}