From 595572ef145caeca37ec88e9def331546a95a975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Fri, 29 Nov 2019 14:33:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BA=AC=E4=B8=9C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/tempop/tempop.go | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 6a3fd16b5..8f8dd250c 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -11,6 +11,7 @@ import ( "mime/multipart" "net/http" "regexp" + "sort" "strings" "sync" "time" @@ -49,6 +50,7 @@ var ( titleList = []string{ "用户名", "关联门店", + "状态", } ) @@ -60,6 +62,7 @@ type GetJdUsersStruct struct { type JdUserStruct struct { UserName string `json:"用户名"` StoreIDs string `json:"关联门店"` + Status string `json:"状态"` } func init() { @@ -1473,20 +1476,19 @@ func GetJdUsers(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint pageNoList []int storeUserList []interface{} ) - //获取京东有效的店 db := dao.GetDB() + //获取京东商城所有用户 + _, _, toatlPage, _ := api.JdAPI.PrivilegeSearchUser(1) + for i := 1; i <= toatlPage; i++ { + pageNoList = append(pageNoList, i) + } storeMapList, err := dao.GetStoreMapsListWithoutDisabled(db, []int{model.VendorIDJD}, model.StoreStatusDisabled) for _, v := range storeMapList { - jxVendorIDsMap[v.VendorStoreID] = v.VendorStoreID + jxVendorIDsMap[v.VendorStoreID] = utils.Int64ToStr(int64(v.StoreID)) } taskSeqFunc := func(task *tasksch.SeqTask, step int, params ...interface{}) (result interface{}, err error) { switch step { case 0: - //获取京东商城所有用户 - _, _, toatlPage, _ := api.JdAPI.PrivilegeSearchUser(1) - for i := 1; i <= toatlPage; i++ { - pageNoList = append(pageNoList, i) - } taskFunc1 := func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) { pageNo := batchItemList[0].(int) storeUserLists, _, _, err := api.JdAPI.PrivilegeSearchUser(pageNo) @@ -1506,16 +1508,17 @@ func GetJdUsers(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint if jxVendorIDsMap[v] == "" { continue } - vendorStoreIDsMap[v] = v + vendorStoreIDsMap[v] = jxVendorIDsMap[v] } if len(vendorStoreIDsMap) == 0 { - jdStruct := JdUserStruct{vv.LoginName, ""} + jdStruct := JdUserStruct{vv.LoginName, "", vv.LockStatus} jdUsersStruct.AppendData(jdStruct) } else { for _, m := range vendorStoreIDsMap { vendorStoreIDsResult = append(vendorStoreIDsResult, m) } - jdStruct := JdUserStruct{vv.LoginName, strings.Join(vendorStoreIDsResult, ",")} + sort.Strings(vendorStoreIDsResult[:]) + jdStruct := JdUserStruct{vv.LoginName, strings.Join(vendorStoreIDsResult, ","), vv.LockStatus} jdUsersStruct.AppendData(jdStruct) } return retVal, err