修改订单配送费

This commit is contained in:
苏尹岚
2020-08-11 09:17:13 +08:00
parent 68cf04d034
commit d2ff7cde17
4 changed files with 46 additions and 0 deletions

View File

@@ -1490,3 +1490,23 @@ func AdjustJdsOrderSimple(ctx *jxcontext.Context, vendorOrderID string, skuID in
}
return err
}
func UpdateWaybillDesiredFee(ctx *jxcontext.Context, vendorOrderID string, desiredFee int) (err error) {
var (
db = dao.GetDB()
)
order, _ := dao.GetSimpleOrder(db, vendorOrderID)
if order == nil {
return fmt.Errorf("未找到该订单orderID: %v", vendorOrderID)
}
bill, err := partner.CurOrderManager.LoadWaybill(order.VendorWaybillID, order.WaybillVendorID)
if err != nil {
return err
}
if bill == nil {
return fmt.Errorf("未找到此订单对应的运单orderID: %v", vendorOrderID)
}
bill.DesiredFee = int64(desiredFee)
_, err = dao.UpdateEntity(db, bill, "DesiredFee")
return err
}

View File

@@ -1119,3 +1119,18 @@ func (c *OrderController) AdjustJdsOrderSimple() {
return retVal, "", err
})
}
// @Title 修改订单运费
// @Description 修改订单运费
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单号"
// @Param desiredFee formData int true "运费"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /UpdateWaybillDesiredFee [put]
func (c *OrderController) UpdateWaybillDesiredFee() {
c.callUpdateWaybillDesiredFee(func(params *tOrderUpdateWaybillDesiredFeeParams) (retVal interface{}, errCode string, err error) {
err = orderman.UpdateWaybillDesiredFee(params.Ctx, params.VendorOrderID, params.DesiredFee)
return retVal, "", err
})
}

View File

@@ -222,3 +222,5 @@ func (c *JxOrderController) SendFailedMatterOrder() {
return retVal, "", err
})
}

View File

@@ -1314,6 +1314,15 @@ func init() {
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
beego.ControllerComments{
Method: "UpdateWaybillDesiredFee",
Router: `/UpdateWaybillDesiredFee`,
AllowHTTPMethods: []string{"put"},
MethodParams: param.Make(),
Filters: nil,
Params: nil})
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ReportController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:ReportController"],
beego.ControllerComments{
Method: "AutoFocusStoreSkus",