1
This commit is contained in:
@@ -59,6 +59,7 @@ func QueryExpressPrice(param *bida.GetExpressPriceReq) (map[string]*bida.GetExpr
|
||||
// CreateWayOrder 创建快递订单
|
||||
func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, userId string) error {
|
||||
// 检查价格
|
||||
reallyCannelleFee := param.ChannelFee
|
||||
if err := checkWayFeeIsTrue(param); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -86,9 +87,10 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user
|
||||
PackageNum: param.PackageNum,
|
||||
ReceiveAddressID: param.ReceiveAddressId,
|
||||
Remark: param.Remark,
|
||||
SenderAddressID: param.SenderAddressID,
|
||||
SenderAddressID: param.SenderAddressId,
|
||||
ThirdPlatform: param.ThirdPlatform,
|
||||
Type: param.Type,
|
||||
ReallyChannelFee: reallyCannelleFee,
|
||||
ChannelFee: param.ChannelFee,
|
||||
ServiceCharge: param.ServiceCharge,
|
||||
GuarantFee: param.GuarantFee,
|
||||
@@ -97,8 +99,41 @@ func CreateWayOrder(ctx *jxcontext.Context, param *model.MakeOrderParamReq, user
|
||||
Increment: param.Increment,
|
||||
ChannelType: param.ChannelType,
|
||||
OrderStatus: model.YES, // 创建
|
||||
Img: param.Img,
|
||||
Img: param.Images,
|
||||
IsForward: model.YES,
|
||||
}
|
||||
dao.WrapAddIDCULEntity(vendorOrder, ctx.GetUserName())
|
||||
return vendorOrder.CreateVendorOrder()
|
||||
return dao.CreateEntity(dao.GetDB(), vendorOrder)
|
||||
}
|
||||
|
||||
// CancelWayOrder 取消运单 todo
|
||||
func CancelWayOrder(param *bida.CancelOrderReq) error {
|
||||
if err := api.QBiDaAPI.CancelOrder(param); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 发起退款
|
||||
// 修改本地订单状态
|
||||
return nil
|
||||
}
|
||||
|
||||
// QueryOrderDetail 获取订单详细信息
|
||||
func QueryOrderDetail(typeCode int, orderNo string) (*bida.OrderDetail, error) {
|
||||
detail, err := api.QBiDaAPI.GetOrderDetail(&bida.GetOrderDetailReq{
|
||||
Type: typeCode,
|
||||
OrderNo: orderNo,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 本地查询获取真是支付快递费用
|
||||
sql := `SELECT * FROM user_vendor_order a WHERE a.other_way_bill = ? and a.type = ? `
|
||||
data := &model.UserVendorOrder{}
|
||||
param := []interface{}{orderNo, typeCode}
|
||||
if err := dao.GetRow(dao.GetDB(), data, sql, param); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
detail.ExpressFee = data.ChannelFee
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user