From 0609d24e0d31f7df10cfbf5804d71534923a1d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 3 Jul 2023 11:14:51 +0800 Subject: [PATCH] 1 --- business/partner/purchase/tao_vegetable/order.go | 1 + business/partner/purchase/tao_vegetable/store_sku2.go | 7 +++++++ business/partner/purchase/tao_vegetable/tao.go | 10 +++++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/business/partner/purchase/tao_vegetable/order.go b/business/partner/purchase/tao_vegetable/order.go index 7f28a761b..bbcfcdc66 100644 --- a/business/partner/purchase/tao_vegetable/order.go +++ b/business/partner/purchase/tao_vegetable/order.go @@ -55,6 +55,7 @@ func (p *PurchaseHandler) getOrder(vendorOrgCode string, vendorOrderID int64, ve StoreId: utils.String2Pointer(vendorStoreID), BizOrderId: utils.Int64ToPointer(vendorOrderID), }} + orderDetail, err := getAPI(vendorOrgCode, 0, vendorStoreID).QueryOrderDetail(requestParam) globals.SugarLogger.Debugf("orderDetail := %s", utils.Format4Output(orderDetail, false)) if err != nil { diff --git a/business/partner/purchase/tao_vegetable/store_sku2.go b/business/partner/purchase/tao_vegetable/store_sku2.go index e5f652c7a..40b744074 100644 --- a/business/partner/purchase/tao_vegetable/store_sku2.go +++ b/business/partner/purchase/tao_vegetable/store_sku2.go @@ -65,6 +65,13 @@ func getStoreVendorOrgCode(storeID int) (vendorOrgCode string) { return vendorOrgCode } +func getStoreVendorOrgCodeByVendorStoreID(vendorStoreID string) (vendorOrgCode string) { + if storeMap, _ := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDTaoVegetable, vendorStoreID, ""); storeMap != nil { + return storeMap.VendorOrgCode + } + return vendorOrgCode +} + // 门店分类 func (p *PurchaseHandler) GetStoreAllCategories(ctx *jxcontext.Context, storeID int, vendorStoreID string) (cats []*partner.BareCategoryInfo, err error) { remoteCats, err := getAPI(getStoreVendorOrgCode(storeID), storeID, vendorStoreID).GetStoreAllCategory() diff --git a/business/partner/purchase/tao_vegetable/tao.go b/business/partner/purchase/tao_vegetable/tao.go index 4252ad6b5..77a5278f8 100644 --- a/business/partner/purchase/tao_vegetable/tao.go +++ b/business/partner/purchase/tao_vegetable/tao.go @@ -213,6 +213,14 @@ func getAPI(appOrgCode string, storeID int, vendorStoreID string) (apiObj *tao_v if appOrgCode == "" { globals.SugarLogger.Debugf("getAPI appOrgCode is empty") } - apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*tao_vegetable.API) + if appOrgCode != "" { + apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, appOrgCode).(*tao_vegetable.API) + } else if appOrgCode == "" && vendorStoreID != "" { + apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, getStoreVendorOrgCodeByVendorStoreID(vendorStoreID)).(*tao_vegetable.API) + } else if appOrgCode == "" && storeID != 0 { + apiObj = partner.CurAPIManager.GetAPI(model.VendorIDTaoVegetable, getStoreVendorOrgCode(storeID)).(*tao_vegetable.API) + } else { + apiObj = nil + } return apiObj }