From 4f8c757d0a98d8c36c0f7f0bbfdbc053bb2d3c55 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 16 Nov 2022 15:15:01 +0800 Subject: [PATCH 1/6] mt price --- business/jxstore/cms/store_sku.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 6a618d2eb..00798d4fa 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -6643,6 +6643,7 @@ func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmap var params []*mtwmapi.SpuData for k, v := range preData { //获取京西平台storeID + globals.SugarLogger.Debugf("k==============%s", k) if storeID, vendorOrgCode, err := dao.GetCodeAndIDByMeiTuan(k); err != nil { return errors.New(fmt.Sprintf("获取京西本地门店ID失败:%v 请重试", err)) } else { From 7419670ad9d249a07665af2d1bba8ce49f4fe814 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 16 Nov 2022 15:29:07 +0800 Subject: [PATCH 2/6] mt price --- business/jxstore/cms/store_sku.go | 4 ++-- business/model/dao/store.go | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 00798d4fa..99b453a2d 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -6644,10 +6644,10 @@ func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmap for k, v := range preData { //获取京西平台storeID globals.SugarLogger.Debugf("k==============%s", k) - if storeID, vendorOrgCode, err := dao.GetCodeAndIDByMeiTuan(k); err != nil { + if storeID, err := dao.GetCodeAndIDByMeiTuan(k); err != nil { return errors.New(fmt.Sprintf("获取京西本地门店ID失败:%v 请重试", err)) } else { - globals.SugarLogger.Debugf("检查数据storeID=%d vendorOrgCode=%s", storeID, vendorOrgCode) + globals.SugarLogger.Debugf("检查数据storeID===============%d", storeID) for _, i := range v { param := &mtwmapi.SpuData{ AppSpuCode: i.AppSpuCode, diff --git a/business/model/dao/store.go b/business/model/dao/store.go index ca1811f8f..1f4e01368 100644 --- a/business/model/dao/store.go +++ b/business/model/dao/store.go @@ -3,6 +3,7 @@ package dao import ( "errors" "fmt" + "git.rosy.net.cn/jx-callback/globals" "sort" "strings" "time" @@ -1632,7 +1633,8 @@ func InsertIntoFreightTemplate(storeID int, vendorStoreID string, templateID, wa } //只获取美团平台的京西storeID -func GetCodeAndIDByMeiTuan(vendorStoreID string) (storeID int, vendorOrgCode string, err error) { - err = GetRow(GetDB(), &storeID, "SELECT s.store_id,s.vendor_org_code FROM store_map s WHERE s.vendor_store_id = ? AND s.vendor_id = ? ", vendorStoreID, model.VendorIDMTWM) - return storeID, vendorStoreID, err +func GetCodeAndIDByMeiTuan(vendorStoreID string) (storeID int, err error) { + err = GetRow(GetDB(), &storeID, "SELECT s.store_id FROM store_map s WHERE s.vendor_store_id = ? AND s.vendor_id = ? ", vendorStoreID, model.VendorIDMTWM) + globals.SugarLogger.Debugf("GetCodeAndIDByMeiTuan storeID===========%d", storeID) + return storeID, err } From 806ced4032afc3c4beeb76b4e37ac3f75665201a Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 16 Nov 2022 16:54:29 +0800 Subject: [PATCH 3/6] mt price --- business/partner/purchase/mtwm/store_sku2.go | 1 + 1 file changed, 1 insertion(+) diff --git a/business/partner/purchase/mtwm/store_sku2.go b/business/partner/purchase/mtwm/store_sku2.go index f846cb18f..a91730ab6 100644 --- a/business/partner/purchase/mtwm/store_sku2.go +++ b/business/partner/purchase/mtwm/store_sku2.go @@ -197,6 +197,7 @@ func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, storeID in //批量更新商品进货价 func BatchSetRestockingPrice(ctx *jxcontext.Context, storeID int, vendorStoreID string, param []*mtwmapi.SpuData) error { + globals.SugarLogger.Debugf("打印getStoreVendorOrgCode(storeID)==============%s", getStoreVendorOrgCode(storeID)) if err := getAPI(getStoreVendorOrgCode(storeID), storeID, "").BatchSetRestockingPrice(ctx.GetTrackInfo(), vendorStoreID, param); err != nil { return err } From 4e3455d6aaff50ade2158321e89cd4e2ad75019c Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 16 Nov 2022 17:03:29 +0800 Subject: [PATCH 4/6] mt price --- business/jxstore/cms/store_sku.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 99b453a2d..6f6ba53c9 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -6657,7 +6657,9 @@ func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmap params = append(params, param) } if len(params) > 0 { - globals.SugarLogger.Debugf("params=========%s %s %s", params[0].AppSpuCode, params[0].PurchasePrice, params[0].SkuID) + for _, v := range params { + globals.SugarLogger.Debugf("params=========%s %s %s", v.AppSpuCode, v.PurchasePrice, v.SkuID) + } } if err := mtwm.BatchSetRestockingPrice(ctx, storeID, k, params); err != nil { return err From afa455dbe2e2b6eaf51203878d26de6c908237e4 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Thu, 17 Nov 2022 09:05:36 +0800 Subject: [PATCH 5/6] mt price --- business/jxstore/cms/store_sku.go | 8 -------- business/partner/purchase/mtwm/store_sku2.go | 1 - 2 files changed, 9 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 6f6ba53c9..25b1d9da9 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -6642,12 +6642,9 @@ func SyncTiktokMainIdToLocal(ctx *jxcontext.Context, param *tiktok_store.MainSku func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmapi.SpuData) error { var params []*mtwmapi.SpuData for k, v := range preData { - //获取京西平台storeID - globals.SugarLogger.Debugf("k==============%s", k) if storeID, err := dao.GetCodeAndIDByMeiTuan(k); err != nil { return errors.New(fmt.Sprintf("获取京西本地门店ID失败:%v 请重试", err)) } else { - globals.SugarLogger.Debugf("检查数据storeID===============%d", storeID) for _, i := range v { param := &mtwmapi.SpuData{ AppSpuCode: i.AppSpuCode, @@ -6656,11 +6653,6 @@ func BatchSetRestockingPrice(ctx *jxcontext.Context, preData map[string][]mtwmap } params = append(params, param) } - if len(params) > 0 { - for _, v := range params { - globals.SugarLogger.Debugf("params=========%s %s %s", v.AppSpuCode, v.PurchasePrice, v.SkuID) - } - } if err := mtwm.BatchSetRestockingPrice(ctx, storeID, k, params); err != nil { return err } diff --git a/business/partner/purchase/mtwm/store_sku2.go b/business/partner/purchase/mtwm/store_sku2.go index a91730ab6..f846cb18f 100644 --- a/business/partner/purchase/mtwm/store_sku2.go +++ b/business/partner/purchase/mtwm/store_sku2.go @@ -197,7 +197,6 @@ func (p *PurchaseHandler) DeleteStoreCategory(ctx *jxcontext.Context, storeID in //批量更新商品进货价 func BatchSetRestockingPrice(ctx *jxcontext.Context, storeID int, vendorStoreID string, param []*mtwmapi.SpuData) error { - globals.SugarLogger.Debugf("打印getStoreVendorOrgCode(storeID)==============%s", getStoreVendorOrgCode(storeID)) if err := getAPI(getStoreVendorOrgCode(storeID), storeID, "").BatchSetRestockingPrice(ctx.GetTrackInfo(), vendorStoreID, param); err != nil { return err } From e820bd4bdea8ff3076d75511e48d2bf56da5bad8 Mon Sep 17 00:00:00 2001 From: richboo111 Date: Thu, 17 Nov 2022 09:12:23 +0800 Subject: [PATCH 6/6] mt price --- controllers/cms_sku.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/controllers/cms_sku.go b/controllers/cms_sku.go index 19edd7618..fe268d521 100644 --- a/controllers/cms_sku.go +++ b/controllers/cms_sku.go @@ -9,7 +9,6 @@ import ( "git.rosy.net.cn/jx-callback/business/model" "git.rosy.net.cn/jx-callback/business/model/dao" "git.rosy.net.cn/jx-callback/business/partner/purchase/tiktok_store" - "git.rosy.net.cn/jx-callback/globals" "github.com/astaxie/beego/server/web" ) @@ -824,17 +823,8 @@ func (c *SkuController) SyncTiktokMainSkuToLocalSku() { func (c *SkuController) BatchSetRestockingPrice() { c.callBatchSetRestockingPrice(func(params *tSkuBatchSetRestockingPriceParams) (interface{}, string, error) { payload := make(map[string][]mtwmapi.SpuData) - payload2 := make(map[string]interface{}) if err := utils.UnmarshalUseNumber([]byte(params.Payload), &payload); err == nil { - globals.SugarLogger.Debugf("payload============%v", payload) err = cms.BatchSetRestockingPrice(params.Ctx, payload) - } else { - if err := utils.UnmarshalUseNumber([]byte(params.Payload), &payload2); err != nil { - return nil, "", err - } else { - globals.SugarLogger.Debugf("payload2============%v", payload2) - } - //return nil, "", err } return nil, "", nil })