订单简单查询测试

This commit is contained in:
苏尹岚
2020-05-19 10:57:21 +08:00
parent 4b5191fa62
commit 15fa328726
3 changed files with 47 additions and 0 deletions

View File

@@ -962,3 +962,27 @@ func RefreshOrdersPriceInfo(ctx *jxcontext.Context, fromTime, toTime time.Time,
} }
return hint, err return hint, err
} }
type GetOrderSimpleInfoResult struct {
VendorOrderID string `orm:"column(vendor_order_id)" json:"vendorOrderID"`
Status int `json:"status"`
WaybillVendorID int `orm:"column(waybill_vendor_id)" json:"waybillVendorID"`
CourierName string `json:"courierName"`
CourierMobile string `json:"courierMobile"`
Tel1 string `json:"tel1"`
MarketManPhone string `json:"marketManPhone"`
}
func GetOrderSimpleInfo(ctx *jxcontext.Context, vendorOrderID string) (getOrderSimpleInfoResult *GetOrderSimpleInfoResult, err error) {
db := dao.GetDB()
sql := `
SELECT a.vendor_order_id, a.status, b.waybill_vendor_id, b.courier_name, b.courier_mobile, b.tel1, b.market_man_phone
FROM goods_order a
JOIN store b ON IF(a.store_id <> '', a.store_id, a.jx_store_id) = b.id
LEFT JOIN waybill c ON c.vendor_order_id = a.vendor_order_id
WHERE a.vendor_order_id = ?
`
sqlParams := []interface{}{vendorOrderID}
err = dao.GetRow(db, &getOrderSimpleInfoResult, sql, sqlParams)
return getOrderSimpleInfoResult, err
}

View File

@@ -1031,3 +1031,17 @@ func (c *OrderController) RefreshJdShopOrdersEarningPrice() {
return retVal, "", err return retVal, "", err
}) })
} }
// @Title 根据订单号查询一些信息
// @Description 根据订单号查询一些信息
// @Param token header string false "认证token"
// @Param vendorOrderID query string true "订单号"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /GetOrderSimpleInfo [get]
func (c *OrderController) GetOrderSimpleInfo() {
c.callGetOrderSimpleInfo(func(params *tOrderGetOrderSimpleInfoParams) (retVal interface{}, errCode string, err error) {
retVal, err = orderman.GetOrderSimpleInfo(params.Ctx, params.VendorOrderID)
return retVal, "", err
})
}

View File

@@ -1017,6 +1017,15 @@ func init() {
Filters: nil, Filters: nil,
Params: 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: "GetOrderSimpleInfo",
Router: `/GetOrderSimpleInfo`,
AllowHTTPMethods: []string{"get"},
MethodParams: param.Make(),
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.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:OrderController"],
beego.ControllerComments{ beego.ControllerComments{
Method: "GetOrderSkuInfo", Method: "GetOrderSkuInfo",