From 5a311c8e34b4df3fe2143770c84546ae6fe309eb Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Fri, 18 Jun 2021 10:26:20 +0800 Subject: [PATCH] aa --- business/jxstore/tempop/tempop.go | 103 +++++++++++++++--------------- 1 file changed, 52 insertions(+), 51 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 53127f2ba..13a5b7857 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1840,50 +1840,50 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // tasksch.HandleTask(task, nil, true).Run() // task.GetID() //删京东会员价 - var ( - db = dao.GetDB() - ) - //103065 - storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406") - things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, []int{23831, 23832, 25387, 27282}, []string{"320406"}) - thingIDmap := make(map[int64]string) - thingIDmap2 := make(map[string]int) - for _, v := range things { - if v.VendorThingID != "" { - thingIDmap[v.ThingID] = v.VendorThingID - thingIDmap2[v.VendorThingID] = int(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) - storeSkus, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{23831, 23832, 25387, 27282}) - result, _ := FreeBatchInfo("uuuuu2", func(task tasksch.ITask, batchedStoreSkuList []*model.StoreSkuBind) (result interface{}, successCount int, err error) { - api := jd.GetAPI("320406") - var ids []int64 - for _, v := range batchedStoreSkuList { - ids = append(ids, utils.Str2Int64(thingIDmap[int64(v.SkuID)])) - } - priceInfo, _ := api.GetStationInfoList(storeMap.VendorStoreID, ids) - //var list []*jdapi.SkuIdEntity - for _, vv := range priceInfo { - if vv.VipPrice != 0 { - //list = append(list, &jdapi.SkuIdEntity{ - // OutSkuId: utils.Int2Str(thingIDmap2[utils.Int64ToStr(vv.SkuID)]), - //}) - fmt.Println("fuck vip", vv.StationNo, vv.SkuID) - } - } - //if len(list) > 0 { - // err = api.DelVipPrice(utils.Int2Str(storeMap.StoreID), list) - //} - return result, 0, err - }, ctx, task, storeSkus, 50, true) - retVal = []interface{}{result} - return retVal, err - }, storeMaps) - tasksch.HandleTask(task, nil, true).Run() - _, err = task.GetResult(0) + //var ( + // db = dao.GetDB() + //) + ////103065 + //storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406") + //things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, []int{23831, 23832, 25387, 27282}, []string{"320406"}) + //thingIDmap := make(map[int64]string) + //thingIDmap2 := make(map[string]int) + //for _, v := range things { + // if v.VendorThingID != "" { + // thingIDmap[v.ThingID] = v.VendorThingID + // thingIDmap2[v.VendorThingID] = int(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) + // storeSkus, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{23831, 23832, 25387, 27282}) + // result, _ := FreeBatchInfo("uuuuu2", func(task tasksch.ITask, batchedStoreSkuList []*model.StoreSkuBind) (result interface{}, successCount int, err error) { + // api := jd.GetAPI("320406") + // var ids []int64 + // for _, v := range batchedStoreSkuList { + // ids = append(ids, utils.Str2Int64(thingIDmap[int64(v.SkuID)])) + // } + // priceInfo, _ := api.GetStationInfoList(storeMap.VendorStoreID, ids) + // //var list []*jdapi.SkuIdEntity + // for _, vv := range priceInfo { + // if vv.VipPrice != 0 { + // //list = append(list, &jdapi.SkuIdEntity{ + // // OutSkuId: utils.Int2Str(thingIDmap2[utils.Int64ToStr(vv.SkuID)]), + // //}) + // fmt.Println("fuck vip", vv.StationNo, vv.SkuID) + // } + // } + // //if len(list) > 0 { + // // err = api.DelVipPrice(utils.Int2Str(storeMap.StoreID), list) + // //} + // return result, 0, err + // }, ctx, task, storeSkus, 50, true) + // retVal = []interface{}{result} + // return retVal, err + // }, storeMaps) + //tasksch.HandleTask(task, nil, true).Run() + //_, err = task.GetResult(0) //京东账号更新 // var ( // db = dao.GetDB() @@ -1929,13 +1929,14 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } // } //} - //report.RefreshJDMembers(ctx) - //weixinmsg.SmartMessageTemplateSend("oYN_uskdlApt6sv5Y4m_t62iO0f4", weixinmsg.WX_AFS_ORDER_WAIT4APPROVE_TEMPLATE_ID, - // globals.WxBackstageHost+fmt.Sprintf("%s%d", weixinmsg.WX_TO_ORDER_PAGE_URL, 667092), - // weixinmsg.WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?data=%v", `{ - // "address": "甬旺农贸市场蔬菜摊","cityName":"苏州市","id":100002,"name":"斜塘顺达广场店","payeeName":"李川川","status":1,"tel1":"13812641804","tel2":"" - // }`), - // map[string]interface{}{"1123": 1}) + + //换美团菜市图片 + stores, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDMTWM}, []int{102498}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "589") + for _, v := range stores { + api.MtwmAPI.PoiSave(v.VendorStoreID, map[string]interface{}{ + "pic_url": "http://image.jxc4.com/image/ff8c9443c894bfb4822f7d2f742718df.jpg", + }) + } return err }