diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index fdd0b23cc..72c83c416 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1827,10 +1827,10 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // }) // } var ( - db = dao.GetDB() - vendorThingIDs []int64 - // thingIDs []int + db = dao.GetDB() + // vendorThingIDs []int64 ) + var lists []*jdapi.SkuIdEntity storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, []int{667281}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406") // for _, v := range storeMaps { // storesSkus, _ := dao.GetStoresSkusInfo(db, []int{v.StoreID}, nil) @@ -1841,51 +1841,52 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } // } things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, nil, []string{"320406"}) - thingIDmap := make(map[int64]string) + // thingIDmap := make(map[int64]string) for _, v := range things { if v.VendorThingID != "" { - vendorThingIDs = append(vendorThingIDs, utils.Str2Int64(v.VendorThingID)) - thingIDmap[utils.Str2Int64(v.VendorThingID)] = utils.Int64ToStr(v.ThingID) + lists = append(lists, &jdapi.SkuIdEntity{ + OutSkuId: utils.Int64ToStr(v.ThingID), + }) + // vendorThingIDs = append(vendorThingIDs, utils.Str2Int64(v.VendorThingID)) + // thingIDmap[utils.Str2Int64(v.VendorThingID)] = utils.Int64ToStr(v.ThingID) } } 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) - resultList, _ := FreeBatchInfo("uuuuu", func(task tasksch.ITask, batchedStoreSkuList []int64) (result interface{}, successCount int, err error) { - priceInfo, _ := api.JdAPI.GetStationInfoList(storeMap.VendorStoreID, batchedStoreSkuList) - for _, vv := range priceInfo { - // if vv.VipPrice != 0 { - // err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), []*jdapi.SkuIdEntity{ - // &jdapi.SkuIdEntity{ - // OutSkuId: thingIDmap[vv.SkuID], - // }, - // }) - result = []int64{vv.SkuID} - // } - } - return result, 0, err - }, ctx, task, vendorThingIDs, 40, true) - var lists []*jdapi.SkuIdEntity - for _, v := range resultList { - // var thingmaps []*model.ThingMap - // sql := ` - // SELECT * FROM thing_map WHERE vendor_thing_id = ? AND vendor_org_code = ? AND deleted_at = ? - // ` - // sqlParams := []interface{}{v, 320406, utils.DefaultTimeValue} - // err = dao.GetRows(db, &thingmaps, sql, sqlParams) - // for _, vv := range thingmaps { - lists = append(lists, &jdapi.SkuIdEntity{ - OutSkuId: thingIDmap[v.(int64)], - }) - // } - } - fmt.Println("uuuuu2", utils.Format4Output(lists, false)) + // resultList, _ := FreeBatchInfo("uuuuu", func(task tasksch.ITask, batchedStoreSkuList []int64) (result interface{}, successCount int, err error) { + // priceInfo, _ := api.JdAPI.GetStationInfoList(storeMap.VendorStoreID, batchedStoreSkuList) + // for _, vv := range priceInfo { + // // if vv.VipPrice != 0 { + // // err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), []*jdapi.SkuIdEntity{ + // // &jdapi.SkuIdEntity{ + // // OutSkuId: thingIDmap[vv.SkuID], + // // }, + // // }) + // result = []int64{vv.SkuID} + // // } + // } + // return result, 0, err + // }, ctx, task, vendorThingIDs, 40, true) + // for _, v := range resultList { + // var thingmaps []*model.ThingMap + // sql := ` + // SELECT * FROM thing_map WHERE vendor_thing_id = ? AND vendor_org_code = ? AND deleted_at = ? + // ` + // sqlParams := []interface{}{v, 320406, utils.DefaultTimeValue} + // err = dao.GetRows(db, &thingmaps, sql, sqlParams) + // for _, vv := range thingmaps { + // lists = append(lists, &jdapi.SkuIdEntity{ + // OutSkuId: thingIDmap[v.(int64)], + // }) + // } + // } FreeBatchInfo2("uuuuu2", func(task tasksch.ITask, batchedStoreSkuList []*jdapi.SkuIdEntity) (result interface{}, successCount int, err error) { err = api.JdAPI.DelVipPrice(utils.Int2Str(storeMap.StoreID), batchedStoreSkuList) return result, 0, err - }, ctx, task, lists, 40, true) + }, ctx, task, lists, 50, true) return retVal, err }, storeMaps) tasksch.HandleTask(task, nil, true).Run()