From 15fa328726028cbb7cea4042b9432dcf2f85d770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 19 May 2020 10:57:21 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=AE=80=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxcallback/orderman/order.go | 24 ++++++++++++++++++++++++ controllers/jx_order.go | 14 ++++++++++++++ routers/commentsRouter_controllers.go | 9 +++++++++ 3 files changed, 47 insertions(+) diff --git a/business/jxcallback/orderman/order.go b/business/jxcallback/orderman/order.go index 6848b520c..f951763b6 100644 --- a/business/jxcallback/orderman/order.go +++ b/business/jxcallback/orderman/order.go @@ -962,3 +962,27 @@ func RefreshOrdersPriceInfo(ctx *jxcontext.Context, fromTime, toTime time.Time, } 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 +} diff --git a/controllers/jx_order.go b/controllers/jx_order.go index bb01fc5cd..7cdef0c65 100644 --- a/controllers/jx_order.go +++ b/controllers/jx_order.go @@ -1031,3 +1031,17 @@ func (c *OrderController) RefreshJdShopOrdersEarningPrice() { 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 + }) +} diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 69e4aa67d..1250ecf20 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -1017,6 +1017,15 @@ func init() { 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.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.ControllerComments{ Method: "GetOrderSkuInfo",