This commit is contained in:
苏尹岚
2021-03-29 09:51:17 +08:00
parent fcc482a36a
commit 213c1b902f
2 changed files with 17 additions and 16 deletions

View File

@@ -4093,8 +4093,8 @@ func RefreshStoreBind(ctx *jxcontext.Context) (err error) {
var ( var (
db = dao.GetDB() db = dao.GetDB()
) )
stores, err := dao.GetStoreList(db, nil, nil, []int{model.StoreStatusClosed, model.StoreStatusHaveRest, model.StoreStatusOpened}, nil, nil, "") stores, err := dao.GetStoreList(db, []int{668074}, nil, []int{model.StoreStatusClosed, model.StoreStatusHaveRest, model.StoreStatusOpened}, nil, nil, "")
task := tasksch.NewParallelTask("RefreshStoreBind", tasksch.NewParallelConfig().SetParallelCount(5).SetIsContinueWhenError(true), ctx, task := tasksch.NewParallelTask("RefreshStoreBind", 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) {
store := batchItemList[0].(*model.Store) store := batchItemList[0].(*model.Store)
var userIDs []string var userIDs []string

View File

@@ -1879,20 +1879,21 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
// 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()
) // )
if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil { // if configs, err := dao.QueryConfigs(dao.GetDB(), "jdConfigCookie", model.ConfigTypeCookie, ""); err == nil {
api.JdAPI.SetCookieWithStr(configs[0].Value) // api.JdAPI.SetCookieWithStr(configs[0].Value)
result, _ := api.JdAPI.GetJdAppInfo() // result, _ := api.JdAPI.GetJdAppInfo()
if result != nil { // if result != nil {
if vocs, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, result.OrgCode, model.VendorOrgTypePlatform); len(vocs) > 0 { // if vocs, _ := dao.GetVendorOrgCode(db, model.VendorIDJD, result.OrgCode, model.VendorOrgTypePlatform); len(vocs) > 0 {
vocs[0].AppKey = result.AppKey // vocs[0].AppKey = result.AppKey
vocs[0].AppSecret = result.AppSecret // vocs[0].AppSecret = result.AppSecret
dao.UpdateEntity(db, vocs[0], "AppKey", "AppSecret") // dao.UpdateEntity(db, vocs[0], "AppKey", "AppSecret")
} // }
} // }
} // }
cms.RefreshStoreBind(ctx)
return err return err
} }