From 2b3d7ce83a43334a4d0a6438e8654f85a2bc5d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 8 Jan 2020 15:35:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index aee98a6c2..435f5e65a 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -662,18 +662,28 @@ func buildErrMsg(task tasksch.ITask) (err error) { failedList := task.GetErrMsg() for _, v := range failedList { for _, vv := range v.([]*partner.StoreSkuInfoWithErr) { - result := &SyncErrResult{ - SkuID: vv.StoreSkuInfo.SkuID, - StoreID: vv.StoreID, - CategoryName: vv.CategoryName, - VendorID: vv.VendoreID, - VendorSkuID: vv.StoreSkuInfo.VendorSkuID, - NameID: vv.StoreSkuInfo.NameID, - VendorPrice: vv.StoreSkuInfo.VendorPrice, - SyncType: vv.SyncType, - ErrMsg: vv.ErrMsg, + if vv.StoreSkuInfo != nil { + result := &SyncErrResult{ + SkuID: vv.StoreSkuInfo.SkuID, + StoreID: vv.StoreID, + VendorID: vv.VendoreID, + VendorSkuID: vv.StoreSkuInfo.VendorSkuID, + NameID: vv.StoreSkuInfo.NameID, + VendorPrice: vv.StoreSkuInfo.VendorPrice, + SyncType: vv.SyncType, + ErrMsg: vv.ErrMsg, + } + resultL = append(resultL, result) + } else { + result := &SyncErrResult{ + StoreID: vv.StoreID, + CategoryName: vv.CategoryName, + VendorID: vv.VendoreID, + SyncType: vv.SyncType, + ErrMsg: vv.ErrMsg, + } + resultL = append(resultL, result) } - resultL = append(resultL, result) } } err = fmt.Errorf(utils.Format4Output(resultL, true))