- GoodsOrder.WaybillTipMoney的含义改为京西主动加的小费

- partner.IUpdateWaybillTip改为IAddWaybillTip
This commit is contained in:
gazebo
2019-08-01 18:09:23 +08:00
parent 45948e4b09
commit 1d0aa132f9
6 changed files with 42 additions and 15 deletions

View File

@@ -521,6 +521,7 @@ func (c *OrderManager) ExportOrders(ctx *jxcontext.Context, fromDateStr, toDateS
"waybillFinishedAt",
"status2",
"skuInfo",
"waybillTipMoney",
},
}
excelBin = excel.Obj2Excel([]*excel.Obj2ExcelSheetConfig{excelConf})

View File

@@ -1032,14 +1032,25 @@ func (s *DefScheduler) handleWaybillTip(savedOrderInfo *WatchOrderInfo) {
if !utils.IsTimeZero(savedOrderInfo.pmWaybillCreatedAt) &&
!savedOrderInfo.isAddWaybillTipDisabled {
if tipFee := s.getWaybillTip(savedOrderInfo); tipFee > 0 {
if handler, ok := partner.GetPurchasePlatformFromVendorID(order.VendorID).(partner.IUpdateWaybillTip); ok && handler != nil {
err := handler.UpdateWaybillTip(jxcontext.AdminCtx, order, tipFee)
vendorStatus := fmt.Sprintf("添加小费:%s", jxutils.IntPrice2StandardCurrencyString(tipFee))
remark := ""
if err == nil {
vendorStatus += "成功"
order.WaybillTipMoney = tipFee
partner.CurOrderManager.UpdateOrderFields(order, []string{"WaybillTipMoney"})
if handler, ok := partner.GetPurchasePlatformFromVendorID(order.VendorID).(partner.IAddWaybillTip); ok && handler != nil {
var remark string
vendorStatus := fmt.Sprintf("设置小费:%s", jxutils.IntPrice2StandardCurrencyString(tipFee))
if curTipFee, err := handler.GetWaybillTip(jxcontext.AdminCtx, order); err == nil {
tipFee2Add := tipFee - curTipFee
vendorStatus += fmt.Sprintf(", 本次添加:%s", jxutils.IntPrice2StandardCurrencyString(tipFee2Add))
if tipFee2Add > 0 {
err := handler.AddWaybillTip(jxcontext.AdminCtx, order, tipFee2Add)
if err == nil {
vendorStatus += "成功"
order.WaybillTipMoney += tipFee2Add
partner.CurOrderManager.UpdateOrderFields(order, []string{"WaybillTipMoney"})
} else {
vendorStatus += "失败"
remark = fmt.Sprint(err)
}
} else {
vendorStatus += "空操作"
}
} else {
vendorStatus += "失败"
remark = fmt.Sprint(err)