Пример #1
0
        public ActionResult GetEmployeeInfo(int storeId)
        {
            var storeIds = _storeContract.QueryManageStoreId(AuthorityHelper.OperatorId.Value);

            if (storeIds == null || storeIds.Count <= 0 || !storeIds.Contains(storeId))
            {
                return(Json(OperationResult.Error("权限不足")));
            }
            var key        = storeId.ToString();
            var storeEntry = RedisCacheHelper.GetValueFromHash <StoreCacheEntry>(RedisCacheHelper.KEY_ALL_STORE, key);

            if (storeEntry == null)
            {
                return(Json(OperationResult.Error("店铺信息未找到")));
            }
            var data = _adminContract.Administrators.Where(x => x.IsDeleted == false && x.IsEnabled == true)
                       .Where(x => x.DepartmentId.Value == storeEntry.DepartmentId.Value)
                       .Select(a => new
            {
                a.JobPosition.JobPositionName,
                a.Member.MobilePhone,
                a.Member.UserPhoto,
                a.Member.RealName
            }).ToList()
                       .Select(a => new
            {
                a.JobPositionName,
                a.MobilePhone,
                UserPhoto = string.IsNullOrEmpty(a.UserPhoto) ? string.Empty : WebUrl + a.UserPhoto,
                a.RealName
            }).ToList();

            return(Json(new OperationResult(OperationResultType.Success, string.Empty, data)));
        }