From 15891983e2377461413c40d23a0d7c96065f0d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 28 Sep 2023 15:21:29 +0800 Subject: [PATCH 1/3] 1 --- business/partner/purchase/mtwm/store.go | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index 72a6b06b6..fa42f6b3c 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -227,6 +227,7 @@ func (p *PurchaseHandler) DeleteStore(db *dao.DaoDB, storeID int, userName strin } func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName string) (err error) { + globals.SugarLogger.Debugf("=========params := %s", utils.Format4Output(storeID, false)) var name string if db == nil { db = dao.GetDB() @@ -255,14 +256,8 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin } store := fmt.Sprintf("门店id:%d,门店名称:%s,第三方门店状态:%d,本地修改前门店状态%d,本地门店修改后状态:%d,第三方平台Id(美团):%s", storeID, remoteStoreInfo.Name, remoteStoreInfo.IsOnline, storeDetail.Status, mergedStoreStatus, storeDetail.VendorOrgCode) event.AddOperateEvent(jxcontext.AdminCtx, jxcontext.AdminCtx.GetTrackInfo(), store, "", "", 10, "UpdateStore") - // openLevel, isOnline := bizStatusJX2Mtwm(mergedStoreStatus) //TODO 美团暂时不用那个电话 phone := storeDetail.Tel1 - // if storeDetail.MarketManPhone != "" { - // phone = storeDetail.MarketManPhone - // } else { - // phone = model.VendorStoreTel - // } params := map[string]interface{}{ "name": name, //jxutils.ComposeStoreName(storeDetail.Store.Name, model.VendorIDMTWM), "address": storeDetail.Address, // 美团好像地址也不能改的? @@ -277,19 +272,9 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin "promotion_info": storeDetail.PromoteInfo, } if globals.EnableMtwmStoreWrite { + globals.SugarLogger.Debugf("=========params := %s", utils.Format4Output(params, false)) errList.AddErr(mtapi.PoiSave(storeDetail.VendorStoreID, params)) } - // PoiSave有时会报错:商家已接入美团配送,不可修改门店配送相关信息,这里放弃信息修改 - // if err != nil { - // if utils.IsErrMatch(err, utils.Int2Str(mtwmapi.ErrCodeCanNotModifyStoreDeliveryInfo), nil) { - // if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 { - // err = p.UpdateStoreStatus(jxcontext.AdminCtx, storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID, mergedStoreStatus) - // } else { - // err = nil - // } - // } - // errList.AddErr(err) - // } if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 { errList.AddErr(p.UpdateStoreStatus(jxcontext.AdminCtx, storeDetail.VendorOrgCode, storeID, storeDetail.VendorStoreID, mergedStoreStatus)) } From 1c303844817307182e224192a032c473f6f57398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 28 Sep 2023 15:29:51 +0800 Subject: [PATCH 2/3] 1 --- business/jxstore/cms/store.go | 1 + business/jxstore/cms/sync.go | 1 + 2 files changed, 2 insertions(+) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 4fa2d39f7..b183422cb 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1914,6 +1914,7 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor valid["address"] = address } + globals.SugarLogger.Debugf("=============== %s", utils.Format4Output(isUpdateStoreNeedSync(valid), false)) if isUpdateStoreNeedSync(valid) { // 同步修改门店已经配送门店 _, err = CurVendorSync.SyncStore(ctx, db, vendorID, storeID, false, userName) updateCourierStores(ctx, storeID) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 4b080d6d7..198f99a99 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -248,6 +248,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs if len(loopMapInfo.StoreMapList) > 1 { db2 = dao.GetDB() } + globals.SugarLogger.Debugf("=========storeMap := %s", utils.Format4Output(storeMap, false)) if model.IsSyncStatusNew(storeMap.SyncStatus) { storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID, storeMap.VendorOrgCode) if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, storeDetail); err == nil { From fb7d26063be192d8eb96e057524de1942584b85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 28 Sep 2023 16:09:05 +0800 Subject: [PATCH 3/3] 1 --- business/jxstore/cms/store.go | 1 - business/jxstore/cms/sync.go | 1 - business/jxstore/cms/sync_store_sku.go | 4 +++- business/partner/purchase/mtwm/store.go | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index b183422cb..4fa2d39f7 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -1914,7 +1914,6 @@ func UpdateStoreVendorMap(ctx *jxcontext.Context, db *dao.DaoDB, storeID, vendor valid["address"] = address } - globals.SugarLogger.Debugf("=============== %s", utils.Format4Output(isUpdateStoreNeedSync(valid), false)) if isUpdateStoreNeedSync(valid) { // 同步修改门店已经配送门店 _, err = CurVendorSync.SyncStore(ctx, db, vendorID, storeID, false, userName) updateCourierStores(ctx, storeID) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 198f99a99..4b080d6d7 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -248,7 +248,6 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs if len(loopMapInfo.StoreMapList) > 1 { db2 = dao.GetDB() } - globals.SugarLogger.Debugf("=========storeMap := %s", utils.Format4Output(storeMap, false)) if model.IsSyncStatusNew(storeMap.SyncStatus) { storeDetail, _ := dao.GetStoreDetail(db, storeMap.StoreID, storeMap.VendorID, storeMap.VendorOrgCode) if vendorStoreID, err = handler.CreateStore2(db2, storeMap.StoreID, userName, nil, storeDetail); err == nil { diff --git a/business/jxstore/cms/sync_store_sku.go b/business/jxstore/cms/sync_store_sku.go index 9103b48b2..49d40f60b 100644 --- a/business/jxstore/cms/sync_store_sku.go +++ b/business/jxstore/cms/sync_store_sku.go @@ -238,7 +238,9 @@ func FullSyncStoreSkuNew(ctx *jxcontext.Context, parentTask tasksch.ITask, vendo case 1: if singleStoreHandler != nil { // 同步分类在同步商品 - _, err = SyncStoreSkuNew(ctx, task, 0, vendorID, storeID, vendorStoreID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError) + if !isAdd { + _, err = SyncStoreSkuNew(ctx, task, 0, vendorID, storeID, vendorStoreID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError) + } } else { // 直接同步商品 err = syncStoreSkuNew(ctx, task, 0, true, vendorID, storeID, "", nil, nil, excludeSkuIDs, false, isContinueWhenError) diff --git a/business/partner/purchase/mtwm/store.go b/business/partner/purchase/mtwm/store.go index fa42f6b3c..c5a303bdf 100644 --- a/business/partner/purchase/mtwm/store.go +++ b/business/partner/purchase/mtwm/store.go @@ -227,7 +227,6 @@ func (p *PurchaseHandler) DeleteStore(db *dao.DaoDB, storeID int, userName strin } func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName string) (err error) { - globals.SugarLogger.Debugf("=========params := %s", utils.Format4Output(storeID, false)) var name string if db == nil { db = dao.GetDB() @@ -272,7 +271,6 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin "promotion_info": storeDetail.PromoteInfo, } if globals.EnableMtwmStoreWrite { - globals.SugarLogger.Debugf("=========params := %s", utils.Format4Output(params, false)) errList.AddErr(mtapi.PoiSave(storeDetail.VendorStoreID, params)) } if storeDetail.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreStatus) != 0 {