From 4147fefc98984f499cf92dfae3c03b661856f16e 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, 28 Apr 2020 08:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=B6=E8=B1=B9=E5=90=8C=E6=AD=A5=E4=BA=AC?= =?UTF-8?q?=E8=A5=BF=EF=BC=8C=E9=9D=9E=E6=A0=87=E5=93=81=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BD=86=E6=98=AF=E5=8F=AF=E4=BB=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index 02e4ffaa9..c5f173bbd 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -936,22 +936,20 @@ func syncStoreSkusFromYb(ctx *jxcontext.Context, storeID, vendorID int, vendorSt return "", err } for _, v := range remoteSkuList { - if len(v.YbBarCode) > 7 { - if localSkuMap[v.SkuList[0].VendorSkuID] == nil { + if localSkuMap[v.SkuList[0].VendorSkuID] == nil { + if len(v.YbBarCode) > 7 { addList = append(addList, v) - } else { - updateList = append(updateList, v) } - vendorSkuMap[v.SkuList[0].VendorSkuID] = v + } else { + updateList = append(updateList, v) } + vendorSkuMap[v.SkuList[0].VendorSkuID] = v } for _, v := range localSkuList { if vendorSkuMap[v.VendorSkuID] == nil { deleteList = append(deleteList, v) } } - fmt.Println("localSkuList", utils.Format4Output(localSkuList, false)) - fmt.Println("remoteSkuList", utils.Format4Output(remoteSkuList, false)) fmt.Println("addList", utils.Format4Output(addList, false)) // fmt.Println("updateList", utils.Format4Output(updateList, false)) fmt.Println("deleteList", utils.Format4Output(deleteList, false))