From f118613de8df6cdcc709947be54b4e86f02a1ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Mon, 8 Feb 2021 13:56:12 +0800 Subject: [PATCH] aa --- business/jxstore/tempop/tempop.go | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index fd94e7880..7331484bc 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1827,24 +1827,30 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // }) // } var ( - db = dao.GetDB() - idList []*jdapi.SkuIdEntity + db = dao.GetDB() + idLists [][]*jdapi.SkuIdEntity + k = 1 ) storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{667281}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406") things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, nil, []string{"320406"}) - for _, v := range things { - if v.VendorThingID != "" { + for i := 0; i < len(things)/50+1; i += 50 { + var idList []*jdapi.SkuIdEntity + for j := i; j < 50*k; j++ { idList = append(idList, &jdapi.SkuIdEntity{ - OutSkuId: utils.Int64ToStr(v.ThingID), + OutSkuId: utils.Int64ToStr(things[j].ThingID), }) + idLists = append(idLists, idList) } + k++ } task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { storeMap := batchItemList[0].(*model.StoreMap) - err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), idList, "suyl") - if strings.Contains(err.Error(), "没有会员价") { - err = nil + for _, v := range idLists { + err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), v, "suyl") + if strings.Contains(err.Error(), "没有会员价") { + err = nil + } } return retVal, err }, storeMaps)