调整加订单配送小费逻辑,添加美团外卖平台支持
This commit is contained in:
@@ -392,7 +392,7 @@ func (c *DeliveryHandler) ComplaintRider(bill *model.Waybill, resonID int, reson
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
|
||||
func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2 string) (tipFee int64, err error) {
|
||||
order, err := api.DadaAPI.QueryOrderInfo2(vendorOrderID)
|
||||
if err == nil {
|
||||
tipFee = jxutils.StandardPrice2Int(order.Tips)
|
||||
@@ -400,13 +400,9 @@ func (c *DeliveryHandler) GetWaybillTip(ctx *jxcontext.Context, vendorOrgCode, v
|
||||
return tipFee, err
|
||||
}
|
||||
|
||||
func (c *DeliveryHandler) AddWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee2Add int64) (err error) {
|
||||
curTip, err := c.GetWaybillTip(ctx, vendorOrgCode, vendorOrderID, vendorWaybillID, vendorWaybillID2)
|
||||
if err == nil {
|
||||
totalTip := curTip + tipFee2Add
|
||||
if globals.EnableStoreWrite {
|
||||
err = api.DadaAPI.AddTip(vendorOrderID, jxutils.IntPrice2Standard(totalTip), cityCode, "")
|
||||
}
|
||||
func (c *DeliveryHandler) UpdateWaybillTip(ctx *jxcontext.Context, vendorOrgCode, vendorStoreID, vendorOrderID, vendorWaybillID, vendorWaybillID2, cityCode string, tipFee int64) (err error) {
|
||||
if globals.EnableStoreWrite {
|
||||
err = api.DadaAPI.AddTip(vendorOrderID, jxutils.IntPrice2Standard(tipFee), cityCode, "")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user