diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index 342ed4e32..457774151 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -840,19 +840,25 @@ func GetJdUsers(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint vendorStoreIDs, err := api.JdAPI.GetJdUserBindStoreIDs(vv.ID) var vendorStoreIDsMap = make(map[string]string, len(vendorStoreIDs)) var vendorStoreIDsResult []string + var roleNameStr string for _, v := range vendorStoreIDs { if jxVendorIDsMap[v] == "" { continue } vendorStoreIDsMap[v] = jxVendorIDsMap[v] } + if vv.RoleNameStr != "" { + roleNameStr = strings.ReplaceAll(vv.RoleNameStr, " ", "") + if roleNameStr != jdapi.JdUserRoleJHYName && roleNameStr != jdapi.JdUserRolesName && roleNameStr != jdapi.JdUserNoRole { + api.JdAPI.UpdateJdUserRoles(int64(vv.ID), []string{jdapi.JdUserRoleJHYId}) + } + } if len(vendorStoreIDsMap) == 0 { - if vv.LoginName == "jd_jxcs1223" || vv.LoginName == "jd_jxgy" { - jdStruct := JdUserStruct{vv.LoginName, "管理员", vv.RoleNameStr, vv.LockStatus} + isManager, _ := api.JdAPI.IsJdManagerUser(int64(vv.ID)) + if isManager { + jdStruct := JdUserStruct{vv.LoginName, "商家管理员", vv.RoleNameStr, vv.LockStatus} jdUsersStruct.AppendData(jdStruct) } else { - // jdStruct := JdUserStruct{vv.LoginName, "", vv.RoleNameStr, vv.LockStatus} - // jdUsersStruct.AppendData(jdStruct) retVal = []int64{int64(vv.ID)} } } else { @@ -878,7 +884,6 @@ func GetJdUsers(ctx *jxcontext.Context, isAsync, isContinueWhenError bool) (hint tasksch.HandleTask(taskParallel2, task, true).Run() _, err = taskParallel2.GetResult(0) case 3: - //写excel WriteToExcelJd(task, jdUsersStruct.userMap) } return result, err