Exemplo n.º 1
0
        public object GetWxUserInfoBatch(Dictionary <string, object> dicParas)
        {
            string errMsg     = string.Empty;
            string nextOpenId = dicParas.ContainsKey("nextOpenId") ? dicParas["nextOpenId"].ToString() : string.Empty;

            UserInfoCollection <UserInfoDetailModel> userInfoCollection = null;

            if (!getWxFans <UserInfoDetailModel>("员工组", nextOpenId, out userInfoCollection, out errMsg))
            {
                return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg));
            }

            if (userInfoCollection != null && userInfoCollection.UserInfoList != null)
            {
                var subscribeusers = userInfoCollection.UserInfoList.Exists(p => p.Subscribe.Equals(1)) ?
                                     userInfoCollection.UserInfoList.Where(w => w.Subscribe.Equals(1)).ToList <UserInfoDetailModel>() : default(List <UserInfoDetailModel>);

                //绑定UserID
                UserInfoCacheModel userInfoCacheModel = null;
                foreach (var su in subscribeusers)
                {
                    if (UserBusiness.IsEffectiveXcUser(su.OpenID, out userInfoCacheModel))
                    {
                        su.UserID = userInfoCacheModel.UserID;
                    }
                }

                return(ResponseModelFactory.CreateSuccessModel(isSignKeyReturn, subscribeusers));
            }

            return(ResponseModelFactory.CreateSuccessModel(isSignKeyReturn));
        }
Exemplo n.º 2
0
        public static bool IsEffectiveXcUser(string openId, out UserInfoCacheModel userInfoCacheModel)
        {
            userInfoCacheModel = null;
            if (XcUserInfoList.Any <UserInfoCacheModel>(p => p.OpenID.Equals(openId, StringComparison.OrdinalIgnoreCase)))
            {
                userInfoCacheModel = XcUserInfoList.Where(p => p.OpenID.Equals(openId, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
                return(true);
            }

            return(false);
        }