From 1ded6199f4d2655763983bf50bef9551dd83e05c 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, 15 Jan 2020 14:41:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=94=99=E8=AF=AF=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E7=AE=A1=E7=90=86=E8=BF=94=E5=9B=9E=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sync.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/business/jxstore/cms/sync.go b/business/jxstore/cms/sync.go index d401bf3cc..6c11bb624 100644 --- a/business/jxstore/cms/sync.go +++ b/business/jxstore/cms/sync.go @@ -6,6 +6,8 @@ import ( "sync" "time" + "git.rosy.net.cn/jx-callback/business/partner/putils" + "git.rosy.net.cn/baseapi" "git.rosy.net.cn/baseapi/platformapi/dingdingapi" "git.rosy.net.cn/baseapi/utils" @@ -230,6 +232,7 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs isManageIt := len(storeIDs) == 0 || len(storeIDs) > 5 _, hint, err = v.LoopStoresMap2(ctx, nil, db, fmt.Sprintf("同步门店信息:%v", storeIDs), isAsync, isManageIt, vendorIDs, storeIDs, mustDirty, func(t *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (resultList interface{}, err error) { loopMapInfo := batchItemList[0].(*LoopStoreMapInfo) + var failedList []*partner.StoreSkuInfoWithErr handler := v.GetStoreHandler(loopMapInfo.VendorID) if handler != nil { if len(loopMapInfo.StoreMapList) > 1 { @@ -245,6 +248,8 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs storeMap.SyncStatus = 0 _, err = dao.UpdateEntity(db2, storeMap, model.FieldSyncStatus) resultList = append(resultList, 1) + } else { + failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, storeMap.VendorID, "同步门店") } return resultList, err }, loopMapInfo.StoreMapList) @@ -255,6 +260,8 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs if err = handler.UpdateStore(db, storeMap.StoreID, userName); err == nil { storeMap.SyncStatus = 0 _, err = dao.UpdateEntity(db, storeMap, model.FieldSyncStatus) + } else { + failedList = putils.GetErrMsg2FailedSingleList(nil, err, storeMap.StoreID, storeMap.VendorID, "同步门店") } if err == nil { resultList = []interface{}{1} @@ -262,6 +269,9 @@ func (v *VendorSync) SyncStore2(ctx *jxcontext.Context, db *dao.DaoDB, vendorIDs } err = partner.AddVendorInfo2Err(err, loopMapInfo.VendorID) } + if len(failedList) > 0 { + t.AddFailedList(failedList) + } return resultList, err }, true) return hint, makeSyncError(err)