This commit is contained in:
suyl
2021-06-18 10:26:20 +08:00
parent 4579a52315
commit 5a311c8e34

View File

@@ -1840,50 +1840,50 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// tasksch.HandleTask(task, nil, true).Run() // tasksch.HandleTask(task, nil, true).Run()
// task.GetID() // task.GetID()
//删京东会员价 //删京东会员价
var ( //var (
db = dao.GetDB() // db = dao.GetDB()
) //)
//103065 ////103065
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJD}, nil, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "320406") //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"}) //things, _ := dao.GetThingMapList(db, model.ThingTypeSku, []int{model.VendorIDJD}, []int{23831, 23832, 25387, 27282}, []string{"320406"})
thingIDmap := make(map[int64]string) //thingIDmap := make(map[int64]string)
thingIDmap2 := make(map[string]int) //thingIDmap2 := make(map[string]int)
for _, v := range things { //for _, v := range things {
if v.VendorThingID != "" { // if v.VendorThingID != "" {
thingIDmap[v.ThingID] = v.VendorThingID // thingIDmap[v.ThingID] = v.VendorThingID
thingIDmap2[v.VendorThingID] = int(v.ThingID) // thingIDmap2[v.VendorThingID] = int(v.ThingID)
} // }
} //}
task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx, //task := tasksch.NewParallelTask("uuuuu", tasksch.NewParallelConfig().SetIsContinueWhenError(true), ctx,
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { // func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
storeMap := batchItemList[0].(*model.StoreMap) // storeMap := batchItemList[0].(*model.StoreMap)
storeSkus, _ := dao.GetStoresSkusInfo(db, []int{storeMap.StoreID}, []int{23831, 23832, 25387, 27282}) // 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) { // result, _ := FreeBatchInfo("uuuuu2", func(task tasksch.ITask, batchedStoreSkuList []*model.StoreSkuBind) (result interface{}, successCount int, err error) {
api := jd.GetAPI("320406") // api := jd.GetAPI("320406")
var ids []int64 // var ids []int64
for _, v := range batchedStoreSkuList { // for _, v := range batchedStoreSkuList {
ids = append(ids, utils.Str2Int64(thingIDmap[int64(v.SkuID)])) // ids = append(ids, utils.Str2Int64(thingIDmap[int64(v.SkuID)]))
} // }
priceInfo, _ := api.GetStationInfoList(storeMap.VendorStoreID, ids) // priceInfo, _ := api.GetStationInfoList(storeMap.VendorStoreID, ids)
//var list []*jdapi.SkuIdEntity // //var list []*jdapi.SkuIdEntity
for _, vv := range priceInfo { // for _, vv := range priceInfo {
if vv.VipPrice != 0 { // if vv.VipPrice != 0 {
//list = append(list, &jdapi.SkuIdEntity{ // //list = append(list, &jdapi.SkuIdEntity{
// OutSkuId: utils.Int2Str(thingIDmap2[utils.Int64ToStr(vv.SkuID)]), // // OutSkuId: utils.Int2Str(thingIDmap2[utils.Int64ToStr(vv.SkuID)]),
//}) // //})
fmt.Println("fuck vip", vv.StationNo, vv.SkuID) // fmt.Println("fuck vip", vv.StationNo, vv.SkuID)
} // }
} // }
//if len(list) > 0 { // //if len(list) > 0 {
// err = api.DelVipPrice(utils.Int2Str(storeMap.StoreID), list) // // err = api.DelVipPrice(utils.Int2Str(storeMap.StoreID), list)
//} // //}
return result, 0, err // return result, 0, err
}, ctx, task, storeSkus, 50, true) // }, ctx, task, storeSkus, 50, true)
retVal = []interface{}{result} // retVal = []interface{}{result}
return retVal, err // return retVal, err
}, storeMaps) // }, storeMaps)
tasksch.HandleTask(task, nil, true).Run() //tasksch.HandleTask(task, nil, true).Run()
_, err = task.GetResult(0) //_, err = task.GetResult(0)
//京东账号更新 //京东账号更新
// var ( // var (
// db = dao.GetDB() // 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), stores, _ := dao.GetStoresMapList(dao.GetDB(), []int{model.VendorIDMTWM}, []int{102498}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "589")
// weixinmsg.WX_MINI_TO_ORDER_PAGE_URL+fmt.Sprintf("?data=%v", `{ for _, v := range stores {
// "address": "甬旺农贸市场蔬菜摊","cityName":"苏州市","id":100002,"name":"斜塘顺达广场店","payeeName":"李川川","status":1,"tel1":"13812641804","tel2":"" api.MtwmAPI.PoiSave(v.VendorStoreID, map[string]interface{}{
// }`), "pic_url": "http://image.jxc4.com/image/ff8c9443c894bfb4822f7d2f742718df.jpg",
// map[string]interface{}{"1123": 1}) })
}
return err return err
} }