1
This commit is contained in:
@@ -2,6 +2,7 @@ package controllers
|
||||
|
||||
import (
|
||||
bida "git.rosy.net.cn/baseapi/platformapi/q_bida"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
bidaServer "git.rosy.net.cn/jx-callback/business/q_bida"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
@@ -11,16 +12,16 @@ type QBiDaExpressController struct {
|
||||
web.Controller
|
||||
}
|
||||
|
||||
// QueryExpressPrice 查询物业费
|
||||
// QueryExpressPrice 查询物流费
|
||||
// @Title Q必达
|
||||
// @Description 查询快递费
|
||||
// @Param token header string false "管理员token"
|
||||
// @Param promiseTimeType formData int true "快递时效产品"
|
||||
// @Param deliveryType formData int true "产品类型"
|
||||
// @Param goodsValue formData float64 true "保价金额"
|
||||
// @Param token header string true "管理员token"
|
||||
// @Param promiseTimeType formData int false "快递时效产品"
|
||||
// @Param deliveryType formData int false "产品类型"
|
||||
// @Param goodsValue formData float64 false "保价金额"
|
||||
// @Param receiveAddress formData string true "收件人地址"
|
||||
// @Param sendAddress formData string true "寄件人地址"
|
||||
// @Param type formData int true "快递公司"
|
||||
// @Param type formData int false "快递公司"
|
||||
// @Param weight formData int true "重量kg"
|
||||
// @Param length formData int true "所有包裹累计长"
|
||||
// @Param width formData int true "所有包裹累计宽"
|
||||
@@ -49,21 +50,19 @@ func (c *QBiDaExpressController) QueryExpressPrice() {
|
||||
})
|
||||
}
|
||||
|
||||
// 下单
|
||||
|
||||
// CreateWayOrder 下单
|
||||
// @Title Q必达
|
||||
// @Description 下单
|
||||
// @Param token header string false "管理员token"
|
||||
// @Param token header string true "管理员token"
|
||||
// @Param promiseTimeType formData int true "快递时效产品"
|
||||
// @Param deliveryType formData int true "产品类型"
|
||||
// @Param goods formData string true "商品名称"
|
||||
// @Param guaranteeValueAmount formData float64 true "保价金额"
|
||||
// @Param guaranteeValueAmount formData float64 false "保价金额"
|
||||
// @Param weight formData int true "重量kg"
|
||||
// @Param length formData int true "所有包裹累计长"
|
||||
// @Param width formData int true "所有包裹累计宽"
|
||||
// @Param height formData int true "所有包裹累计高"
|
||||
// @Param orderSendTime formData string true "预约时间"
|
||||
// @Param length formData int false "所有包裹累计长"
|
||||
// @Param width formData int false "所有包裹累计宽"
|
||||
// @Param height formData int false "所有包裹累计高"
|
||||
// @Param orderSendTime formData string false "预约时间"
|
||||
// @Param packageNum formData int true "包裹数量"
|
||||
// @Param receiveAddress formData string true "收件人地址"
|
||||
// @Param receiveName formData string true "收件人姓名"
|
||||
@@ -74,6 +73,16 @@ func (c *QBiDaExpressController) QueryExpressPrice() {
|
||||
// @Param senderPhone formData string true "寄件人手机号"
|
||||
// @Param thirdPlatform formData int true "第三方平台"
|
||||
// @Param type formData int true "快递公司"
|
||||
// @Param receiveAddressId formData int64 true "收件人地址Id"
|
||||
// @Param senderAddressId formData int64 true "寄件人地址Id"
|
||||
// @Param channelType formData int true "渠道类型(1-快递,2-物流,3-国际物流,4-整车)"
|
||||
// @Param images formData string false "物品图片多个用逗号隔开"
|
||||
// @Param channelFee formData float64 true "渠道价"
|
||||
// @Param bulk formData int false "泡比"
|
||||
// @Param serviceCharge formData float64 false "服务费"
|
||||
// @Param guarantFee formData float64 false "保价"
|
||||
// @Param originalFee formData float64 false "原价"
|
||||
// @Param increment formData float64 false "物流"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /CreateWayOrder [post]
|
||||
@@ -99,18 +108,46 @@ func (c *QBiDaExpressController) CreateWayOrder() {
|
||||
SenderPhone: params.SenderPhone,
|
||||
ThirdPlatform: params.ThirdPlatform,
|
||||
Type: params.Type,
|
||||
ReceiveAddressId: 0,
|
||||
SenderAddressID: 0,
|
||||
ChannelType: 0,
|
||||
Img: "",
|
||||
ChannelFee: 0,
|
||||
Bulk: 0,
|
||||
ServiceCharge: 0,
|
||||
GuarantFee: 0,
|
||||
OriginalFee: 0,
|
||||
Increment: 0,
|
||||
ReceiveAddressId: int64(params.ReceiveAddressId),
|
||||
SenderAddressId: int64(params.SenderAddressId),
|
||||
ChannelType: params.ChannelType,
|
||||
Images: params.Images,
|
||||
ChannelFee: params.ChannelFee,
|
||||
Bulk: utils.Int2Float64(params.Bulk),
|
||||
ServiceCharge: params.ServiceCharge,
|
||||
GuarantFee: params.GuarantFee,
|
||||
OriginalFee: params.OriginalFee,
|
||||
Increment: params.Increment,
|
||||
}
|
||||
|
||||
if err := bidaServer.CreateWayOrder(params.Ctx, param, params.Ctx.GetUserID()); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
return nil, "", nil
|
||||
})
|
||||
}
|
||||
|
||||
// CancelWayVendorOrder 取消运单
|
||||
// @Title Q必达
|
||||
// @Description 取消运单
|
||||
// @Param token header string true "管理员token"
|
||||
// @Param genre formData int true "1取消2关闭"
|
||||
// @Param orderNo formData string true "订单编号"
|
||||
// @Param type formData int true "快递公司"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /CancelWayVendorOrder [post]
|
||||
func (c *QBiDaExpressController) CancelWayVendorOrder() {
|
||||
c.callCancelWayVendorOrder(func(params *tExpressCancelWayVendorOrderParams) (interface{}, string, error) {
|
||||
cancel := &bida.CancelOrderReq{
|
||||
Genre: params.Genre,
|
||||
OrderNo: params.OrderNo,
|
||||
Type: params.Type,
|
||||
}
|
||||
|
||||
if err := bidaServer.CancelWayOrder(cancel); err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
bidaServer.CreateWayOrder(c.Ctx, params)
|
||||
return nil, "", nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user