1
This commit is contained in:
@@ -148,7 +148,7 @@ func (c *DeliveryHandler) UpdateStore(ctx *jxcontext.Context, storeDetail *dao.S
|
|||||||
|
|
||||||
// 蜂鸟门店状态改变
|
// 蜂鸟门店状态改变
|
||||||
func OnStoreStatus(msg *fnpsapi.ChainstoreStatusNotify) (retVal *fnpsapi.CallbackResponse) {
|
func OnStoreStatus(msg *fnpsapi.ChainstoreStatusNotify) (retVal *fnpsapi.CallbackResponse) {
|
||||||
return curDeliveryHandler.OnStoreStatus(msg)
|
return CurDeliveryHandler.OnStoreStatus(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改本地门店审核状态
|
// 修改本地门店审核状态
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
"git.rosy.net.cn/baseapi/platformapi/mtpsapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
"git.rosy.net.cn/jx-callback/business/jxcallback/orderman"
|
||||||
|
"git.rosy.net.cn/jx-callback/business/jxutils/jxcontext"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -35,7 +36,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
curDeliveryHandler *DeliveryHandler
|
CurDeliveryHandler *DeliveryHandler
|
||||||
complaintReson2FnResonMap = map[int]int{
|
complaintReson2FnResonMap = map[int]int{
|
||||||
model.ComplaintReasons1: ComplaintReasonsFn160,
|
model.ComplaintReasons1: ComplaintReasonsFn160,
|
||||||
model.ComplaintReasons2: ComplaintReasonsFn130,
|
model.ComplaintReasons2: ComplaintReasonsFn130,
|
||||||
@@ -53,10 +54,8 @@ type DeliveryHandler struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if api.FnAPI != nil {
|
CurDeliveryHandler = new(DeliveryHandler)
|
||||||
curDeliveryHandler = new(DeliveryHandler)
|
partner.RegisterDeliveryPlatform(CurDeliveryHandler, true)
|
||||||
partner.RegisterDeliveryPlatform(curDeliveryHandler, true)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *DeliveryHandler) GetVendorID() int {
|
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) {
|
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) {
|
func (c *DeliveryHandler) OnWaybillExcept(msg *fnpsapi.AbnormalReportNotify) (retVal *fnpsapi.CallbackResponse) {
|
||||||
@@ -487,3 +486,31 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
|||||||
}
|
}
|
||||||
return vendorPrice, nil
|
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
|
||||||
|
}
|
||||||
|
|||||||
@@ -548,3 +548,13 @@ func (c *DeliveryHandler) GetDeliverLiquidatedDamages(orderId string, deliverId
|
|||||||
}
|
}
|
||||||
return 0, err
|
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
|
||||||
|
}
|
||||||
|
|||||||
@@ -95,7 +95,9 @@ type IPurchasePlatformOrderHandler interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type IAddWaybillTip interface {
|
type IAddWaybillTip interface {
|
||||||
|
// GetWaybillTip 获取添加小费
|
||||||
GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error)
|
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)
|
UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user