添加快递
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type UserVendorOrder struct {
|
||||
ModelIDCUL
|
||||
UserId string `orm:"size(128);column(user_id);index" json:"userID"` // 用户ID
|
||||
@@ -79,3 +81,20 @@ type MakeOrderParamReq struct {
|
||||
OriginalFee float64 `json:"original_fee"` // 原价
|
||||
Increment float64 `json:"increment"` // 物流
|
||||
}
|
||||
|
||||
// UserOrderList 用户订单列表
|
||||
type UserOrderList struct {
|
||||
UserId string `orm:"size(128);column(user_id);index" json:"userID"` // 用户ID
|
||||
LocalWayBill string `orm:"size(128);column(local_way_bill);index" json:"localWayBill"` // 本地订单ID
|
||||
OtherWayBill string `orm:"size(128);column(other_way_bill);index" json:"otherWayBill"` // 第三方运单ID
|
||||
Type int `orm:"size(8);column(type)" json:"type"` // 快递公司
|
||||
ReceiveAddressID int64 `orm:"size(128);column(receive_address_id)" json:"receiveAddressID"` // 收件人地址ID
|
||||
SenderAddressID int64 `orm:"size(128);column(sender_address_id)" json:"senderAddressID"` // 寄件人地址ID
|
||||
CreatedAt time.Time `orm:"auto_now_add;type(datetime)" json:"createdAt"` // 创建时间
|
||||
OrderStatus int `orm:"size(8);column(order_status)" json:"orderType"` // 订单状态(1-待支付,2-支付失败,3-支付成功,4-取件,5-配送,6-,4-取消)
|
||||
ChannelFee float64 `orm:"column(channel_fee)" json:"channelFee"` // 渠道价
|
||||
SendUserName string `orm:"column(send_user_name)" json:"sendUserName"` // 发货人
|
||||
ReceiveUserName string `orm:"column(receive_user_name)" json:"receiveUserName"` // 收货人
|
||||
SenderAddress string `orm:"column(sender_address)" json:"senderAddress"` // 发货城市
|
||||
ReceiveAddress string `orm:"column(receive_address)" json:"receiveAddress"` // 收货城市
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ func QueryOrderDetail(typeCode int, orderNo string) (*bida.OrderDetail, error) {
|
||||
}
|
||||
|
||||
// QueryUserOrderList 查询用户订单列表
|
||||
func QueryUserOrderList(userId string, expressType, orderStatus int, pageNum, pageSize int) {
|
||||
func QueryUserOrderList(userId string, expressType, orderStatus int, pageNum, pageSize int) ([]*model.UserOrderList, error) {
|
||||
sql := `
|
||||
SELECT
|
||||
a.type,a.other_way_bill,a.local_way_bill,a.user_id,a.receive_address_id,a.sender_address_id,
|
||||
@@ -168,4 +168,10 @@ func QueryUserOrderList(userId string, expressType, orderStatus int, pageNum, pa
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
param = append(param, pageSize, (pageNum-1)*pageSize)
|
||||
|
||||
// 获取数据
|
||||
result := make([]*model.UserOrderList, 0, 0)
|
||||
if err := dao.GetRows(dao.GetDB(), result, sql, param...); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -151,3 +151,43 @@ func (c *QBiDaExpressController) CancelWayVendorOrder() {
|
||||
return nil, "", nil
|
||||
})
|
||||
}
|
||||
|
||||
// QueryUserOrderList 获取用户订单列表QueryUserOrderList
|
||||
// @Title Q必达
|
||||
// @Description 获取用户订单列表
|
||||
// @Param token header string true "管理员token"
|
||||
// @Param expressType formData int false "就是type快递公司"
|
||||
// @Param orderStatus formData int false "订单状态"
|
||||
// @Param pageNum formData int true "页码"
|
||||
// @Param pageSize formData int true "页数"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /QueryUserOrderList [post]
|
||||
func (c *QBiDaExpressController) QueryUserOrderList() {
|
||||
c.callQueryUserOrderList(func(params *tExpressQueryUserOrderListParams) (interface{}, string, error) {
|
||||
result, err := bidaServer.QueryUserOrderList(params.Ctx.GetUserID(), params.ExpressType, params.OrderStatus, params.PageNum, params.PageSize)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
return result, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// GetOrderDetail 查询订单详情
|
||||
// @Title Q必达
|
||||
// @Description 获取订单详情
|
||||
// @Param token header string true "管理员token"
|
||||
// @Param expressType formData int true "就是type快递公司"
|
||||
// @Param orderNo formData string true "订单Id,三方Id"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetOrderDetail [post]
|
||||
func (c *QBiDaExpressController) GetOrderDetail() {
|
||||
c.callGetOrderDetail(func(params *tExpressGetOrderDetailParams) (interface{}, string, error) {
|
||||
result, err := bidaServer.QueryOrderDetail(params.ExpressType, params.OrderNo)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
return result, "", nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1033,4 +1033,31 @@ func init() {
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 取消物流运单
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"],
|
||||
beego.ControllerComments{
|
||||
Method: "CancelWayVendorOrder",
|
||||
Router: "/CancelWayVendorOrder",
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 获取用户订单列表
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"],
|
||||
beego.ControllerComments{
|
||||
Method: "QueryUserOrderList",
|
||||
Router: "/QueryUserOrderList",
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
// 获取用户订单详情
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:QBiDaExpressController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetOrderDetail",
|
||||
Router: "/GetOrderDetail",
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user