- 调整QueryOrderWaybillFeeInfo

This commit is contained in:
gazebo
2019-05-07 12:01:07 +08:00
parent 861c520c1e
commit ea75a0ad7b
7 changed files with 203 additions and 102 deletions

View File

@@ -98,6 +98,7 @@ func (c *OrderController) QueryOrderWaybillFeeInfo() {
// @Param token header string true "认证token"
// @Param vendorOrderID formData string true "订单ID"
// @Param vendorID formData int true "订单所属的厂商ID"
// @Param courierVendorIDs formData string false "运单厂商ID缺省全部"
// @Param forceCreate formData bool false "是否强制创建(忽略订单状态检查及其它参数)"
// @Param maxAddFee formData int false "最大加价单位为分为0时为缺省值"
// @Param maxDiffFee2Mtps formData int false "最大与美团配送差价单位为分maxAddFee不为0时才可能有效"
@@ -106,7 +107,10 @@ func (c *OrderController) QueryOrderWaybillFeeInfo() {
// @router /CreateWaybillOnProviders [post]
func (c *OrderController) CreateWaybillOnProviders() {
c.callCreateWaybillOnProviders(func(params *tOrderCreateWaybillOnProvidersParams) (retVal interface{}, errCode string, err error) {
retVal, err = defsch.FixedScheduler.CreateWaybillOnProvidersEx(params.Ctx, params.VendorOrderID, params.VendorID, params.ForceCreate, int64(params.MaxAddFee), int64(params.MaxDiffFee2Mtps))
var courierVendorIDs []int
if err = jxutils.Strings2Objs(params.CourierVendorIDs, &courierVendorIDs); err == nil {
retVal, err = defsch.FixedScheduler.CreateWaybillOnProvidersEx(params.Ctx, params.VendorOrderID, params.VendorID, courierVendorIDs, params.ForceCreate, int64(params.MaxAddFee), int64(params.MaxDiffFee2Mtps))
}
return retVal, "", err
})
}
@@ -127,6 +131,27 @@ func (c *OrderController) CancelAll3rdWaybills() {
})
}
// @Title 取消三方运单
// @Description 取消三方运单
// @Param token header string true "认证token"
// @Param vendorWaybillID formData string true "订单ID"
// @Param waybillVendorID formData int true "订单所属的厂商ID"
// @Param reasonID formData int false "原因ID"
// @Param reason formData string false "取消原因"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /CancelWaybill [post]
func (c *OrderController) CancelWaybill() {
c.callCancelWaybill(func(params *tOrderCancelWaybillParams) (retVal interface{}, errCode string, err error) {
reasonID := params.ReasonID
if reasonID == 0 {
reasonID = partner.CancelWaybillReasonOther
}
err = defsch.FixedScheduler.CancelWaybillByID(params.Ctx, params.VendorWaybillID, params.WaybillVendorID, reasonID, params.Reason)
return retVal, "", err
})
}
// @Title 得到门店订单信息
// @Description 得到门店订单信息
// @Param token header string true "认证token"
@@ -193,12 +218,13 @@ func (c *OrderController) GetOrderInfo() {
// @Param token header string true "认证token"
// @Param vendorOrderID query string true "订单ID"
// @Param vendorID query int true "订单所属的厂商ID"
// @Param isNotEnded query bool false "是否只是没有结束的运单"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetOrderWaybillInfo [get]
func (c *OrderController) GetOrderWaybillInfo() {
c.callGetOrderWaybillInfo(func(params *tOrderGetOrderWaybillInfoParams) (retVal interface{}, errCode string, err error) {
retVal, err = orderman.FixedOrderManager.GetOrderWaybillInfo(params.Ctx, params.VendorOrderID, params.VendorID)
retVal, err = orderman.FixedOrderManager.GetOrderWaybillInfo(params.Ctx, params.VendorOrderID, params.VendorID, params.IsNotEnded)
return retVal, "", err
})
}