1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user