Esempio n. 1
0
        /// <summary>
        /// 加盟缴费分页
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseAdminAttach> GetJoinPayPage(PageParamList <RequestAdminAttach> pageParam)
        {
            IQueryable <SystemAdminAttach> AdminAttach = Kily.Set <SystemAdminAttach>();
            IQueryable <SystemAdmin>       Admin       = Kily.Set <SystemAdmin>();

            if (!string.IsNullOrEmpty(pageParam.QueryParam.Account))
            {
                Admin = Admin.Where(t => t.Account.Equals(pageParam.QueryParam.Account));
            }
            var data = Admin.OrderBy(t => t.CreateTime).GroupJoin(AdminAttach, t => t.Id, x => x.AdminId, (t, x) => new ResponseAdminAttach()
            {
                AdminId         = t.Id,
                CompanyName     = t.CompanyName,
                TrueName        = t.TrueName,
                AccountType     = t.AccountType,
                AccountTypeName = AttrExtension.GetSingleDescription <AccountEnum, DescriptionAttribute>(t.AccountType),
                IdCard          = t.IdCard,
                Phone           = t.Phone,
                Email           = t.Email,
                StartTime       = x.FirstOrDefault().StartTime,
                EndTime         = x.FirstOrDefault().EndTime,
                IsPay           = x.FirstOrDefault().IsPay,
                Money           = x.FirstOrDefault().Money,
                PayUser         = x.FirstOrDefault().PayUser,
                IsDelete        = t.IsDelete
            }).AsNoTracking().ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 2
0
        /// <summary>
        /// 物码缴费
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseEnterpriseApply> GetTagAuditPage(PageParamList <RequestEnterpriseApply> pageParam)
        {
            IQueryable <EnterpriseTagApply> queryable  = Kily.Set <EnterpriseTagApply>().Where(t => t.IsDelete == false);
            IQueryable <EnterpriseInfo>     queryables = Kily.Set <EnterpriseInfo>();

            if (!string.IsNullOrEmpty(pageParam.QueryParam.AreaTree))
            {
                queryables = queryables.Where(t => t.TypePath.Contains(pageParam.QueryParam.AreaTree));
            }
            if (!string.IsNullOrEmpty(pageParam.QueryParam.BatchNo))
            {
                queryable = queryable.Where(t => t.BatchNo.Contains(pageParam.QueryParam.BatchNo));
            }
            var data = queryable.Join(queryables, t => t.CompanyId, y => y.Id, (t, y) => new ResponseEnterpriseApply()
            {
                Id            = t.Id,
                BatchNo       = t.BatchNo,
                TagTypeName   = AttrExtension.GetSingleDescription <TagEnum, DescriptionAttribute>(t.TagType),
                ApplyNum      = t.ApplyNum,
                ApplyMoney    = t.ApplyMoney,
                Payment       = t.Payment,
                IsPay         = t.IsPay,
                PaytTicket    = t.PaytTicket,
                AuditTypeName = AttrExtension.GetSingleDescription <AuditEnum, DescriptionAttribute>(t.AuditType),
                TableName     = t.GetType().Name
            }).ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 3
0
        /// <summary>
        /// 企业认证
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseEnterpriseIdent> IdentEnterprisePay(PageParamList <RequestEnterpriseIdent> pageParam)
        {
            IQueryable <EnterpriseIdent> queryable = Kily.Set <EnterpriseIdent>().Where(t => t.IsDelete == false);

            queryable = queryable.Where(t => t.AuditType >= AuditEnum.AuditSuccess);
            if (!string.IsNullOrEmpty(pageParam.QueryParam.CompanyName))
            {
                queryable = queryable.Where(t => t.CompanyName.Contains(pageParam.QueryParam.CompanyName));
            }
            var data = queryable.OrderByDescending(t => t.CreateTime)
                       .Select(x => new ResponseEnterpriseIdent()
            {
                Id             = x.Id,
                IdentNo        = x.IdentNo,
                CompanyName    = x.CompanyName,
                IdentStarName  = AttrExtension.GetSingleDescription <IdentEnum, DescriptionAttribute>(x.IdentStar),
                LinkPhone      = x.LinkPhone,
                AuditTypeName  = AttrExtension.GetSingleDescription <AuditEnum, DescriptionAttribute>(x.AuditType),
                TableName      = x.GetType().Name,
                IdentStartTime = x.IdentStartTime,
                IdentEndTime   = x.IdentEndTime
            }).AsNoTracking().ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 4
0
        /// <summary>
        /// 厨师信息
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseCookInfo> GetCookInfoPage(PageParamList <RequestCookInfo> pageParam)
        {
            IQueryable <CookInfo> queryable = Kily.Set <CookInfo>().OrderByDescending(t => t.CreateTime);

            if (!string.IsNullOrEmpty(pageParam.QueryParam.AreaTree))
            {
                queryable = queryable.Where(t => t.TypePath.Contains(pageParam.QueryParam.AreaTree));
            }
            if (UserInfo().AccountType == AccountEnum.Province)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Province));
            }
            if (UserInfo().AccountType == AccountEnum.City)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().City));
            }
            if (UserInfo().AccountType == AccountEnum.Area)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Area));
            }
            if (UserInfo().AccountType == AccountEnum.Village)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Town));
            }
            var data = queryable.Select(t => new ResponseCookInfo()
            {
                Id            = t.Id,
                TrueName      = t.TrueName,
                IdCardNo      = t.IdCardNo,
                AuditTypeName = AttrExtension.GetSingleDescription <DescriptionAttribute>(t.AuditType),
                TableName     = t.GetType().Name
            }).ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 5
0
        /// <summary>
        /// 商家认证分页列表
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseRepastIdent> GetDiningIdentPage(PageParamList <RequestRepastIdent> pageParam)
        {
            IQueryable <RepastIdent> queryable  = Kily.Set <RepastIdent>().Where(t => t.IsDelete == false);
            IQueryable <RepastInfo>  queryables = Kily.Set <RepastInfo>().Where(t => t.IsDelete == false);

            if (pageParam.QueryParam.DiningType.HasValue)
            {
                queryable = queryable.Where(t => t.DiningType == pageParam.QueryParam.DiningType);
            }
            if (!string.IsNullOrEmpty(pageParam.QueryParam.MerchantName))
            {
                queryable = queryable.Where(t => t.MerchantName.Contains(pageParam.QueryParam.MerchantName));
            }
            if (!string.IsNullOrEmpty(pageParam.QueryParam.AreaTree))
            {
                queryables = queryables.Where(t => t.TypePath.Contains(pageParam.QueryParam.AreaTree));
            }
            if (UserInfo().AccountType == AccountEnum.Province)
            {
                queryables = queryables.Where(t => t.TypePath.Contains(UserInfo().Province));
            }
            if (UserInfo().AccountType == AccountEnum.City)
            {
                queryables = queryables.Where(t => t.TypePath.Contains(UserInfo().City));
            }
            if (UserInfo().AccountType == AccountEnum.Area)
            {
                queryables = queryables.Where(t => t.TypePath.Contains(UserInfo().Area));
            }
            if (UserInfo().AccountType == AccountEnum.Village)
            {
                queryables = queryables.Where(t => t.TypePath.Contains(UserInfo().Town));
            }
            var data = queryables.Join(queryable, a => a.Id, t => t.InfoId, (a, t) => new ResponseRepastIdent()
            {
                Id             = t.Id,
                MerchantName   = t.MerchantName,
                IdentStarName  = AttrExtension.GetSingleDescription <IdentEnum, DescriptionAttribute>(t.IdentStar),
                AuditTypeName  = AttrExtension.GetSingleDescription <AuditEnum, DescriptionAttribute>(t.AuditType),
                DiningTypeName = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                IdentYear      = t.IdentYear,
                TableName      = t.GetType().Name,
                AuditType      = t.AuditType,
                AuditInfo      = Kily.Set <SystemAudit>()
                                 .Where(x => x.IsDelete == false)
                                 .Where(x => x.TableId == t.Id).ToList().MapToList <SystemAudit, ResponseAudit>()
            }).ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 6
0
        /// <summary>
        /// 商家分页列表
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseMerchant> GetMerchantPage(PageParamList <RequestMerchant> pageParam)
        {
            IQueryable <RepastInfo> queryable = Kily.Set <RepastInfo>().Where(t => t.IsDelete == false);

            if (!string.IsNullOrEmpty(pageParam.QueryParam.MerchantName))
            {
                queryable = queryable.Where(t => t.MerchantName.Contains(pageParam.QueryParam.MerchantName));
            }
            if (!string.IsNullOrEmpty(pageParam.QueryParam.AreaTree))
            {
                queryable = queryable.Where(t => t.TypePath.Contains(pageParam.QueryParam.AreaTree));
            }
            if (UserInfo().AccountType == AccountEnum.Province)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Province));
            }
            if (UserInfo().AccountType == AccountEnum.City)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().City));
            }
            if (UserInfo().AccountType == AccountEnum.Area)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Area));
            }
            if (UserInfo().AccountType == AccountEnum.Village)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Town));
            }
            if (pageParam.QueryParam.AuditType.HasValue)
            {
                queryable = queryable.Where(t => t.AuditType == pageParam.QueryParam.AuditType.Value);
            }
            var data = queryable.OrderByDescending(t => t.CreateTime).Select(t => new ResponseMerchant()
            {
                Id             = t.Id,
                CommunityCode  = t.CommunityCode,
                Account        = t.Account,
                PassWord       = t.PassWord,
                MerchantName   = t.MerchantName,
                DiningTypeName = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                DingRoleId     = t.DingRoleId,
                Phone          = t.Phone,
                Email          = t.Email,
                TypePath       = t.TypePath,
                InviteCode     = t.InviteCode ?? "-",
                TableName      = t.GetType().Name
            }).AsNoTracking().ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 7
0
        /// <summary>
        /// 角色权限列表分页
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseRepastRoleAuthor> GetMerchantAuthorPage(PageParamList <RequestRepastRoleAuthor> pageParam)
        {
            IQueryable <RepastRoleAuthor> queryable  = Kily.Set <RepastRoleAuthor>();
            IQueryable <RepastInfo>       queryables = Kily.Set <RepastInfo>().Where(t => t.IsDelete == false);

            if (!string.IsNullOrEmpty(pageParam.QueryParam.MerchantName))
            {
                queryables = queryables.Where(t => t.MerchantName.Contains(pageParam.QueryParam.MerchantName));
            }
            var data = queryables.OrderBy(t => t.CreateTime).GroupJoin(queryable, t => t.DingRoleId, x => x.Id, (t, x) => new ResponseRepastRoleAuthor()
            {
                Id               = t.Id,
                RepastRoleId     = x.FirstOrDefault().Id,
                MerchantName     = t.MerchantName,
                MerchantRoleName = x.FirstOrDefault().AuthorName,
                MerchantTypeName = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                AuthorMenuPath   = x.FirstOrDefault().AuthorMenuPath
            }).ToPagedResult(pageParam.pageNumber, pageParam.pageSize);

            return(data);
        }
Esempio n. 8
0
        /// <summary>
        /// 获取商家详情
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public ResponseMerchant GetMerchantDetail(Guid Id)
        {
            IQueryable <RepastInfo> queryable = Kily.Set <RepastInfo>().Where(t => t.Id == Id);
            var data = queryable.OrderByDescending(t => t.CreateTime).Select(t => new ResponseMerchant()
            {
                Id              = t.Id,
                CommunityCode   = t.CommunityCode,
                Account         = t.Account,
                PassWord        = t.PassWord,
                MerchantName    = t.MerchantName,
                MerchantImage   = t.MerchantImage,
                CardExpiredDate = t.CardExpiredDate,
                SafeOffer       = t.SafeOffer,
                OfferLv         = t.OfferLv,
                DiningTypeName  = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                DingRoleId      = t.DingRoleId,
                Phone           = t.Phone,
                Email           = t.Email,
                TypePath        = t.TypePath,
                Certification   = t.Certification,
                ImplUser        = t.ImplUser,
                AllowUnit       = t.AllowUnit,
                Honor           = t.HonorCertification,
                VersionTypeName = AttrExtension.GetSingleDescription <SystemVersionEnum, DescriptionAttribute>(t.VersionType),
                AuditInfo       = Kily.Set <SystemAudit>()
                                  .Where(x => x.IsDelete == false)
                                  .Where(x => x.TableId == t.Id).Select(x => new ResponseAudit
                {
                    Id              = x.Id,
                    TableId         = t.Id,
                    TabelName       = t.GetType().Name,
                    CreateTime      = x.CreateTime,
                    AuditSuggestion = x.AuditSuggestion,
                    AuditName       = x.AuditName,
                    CreateUser      = x.CreateUser
                }).ToList()
            }).FirstOrDefault();

            return(data);
        }
Esempio n. 9
0
        /// <summary>
        /// 账号分页
        /// </summary>
        /// <param name="pageParam"></param>
        /// <returns></returns>
        public PagedResult <ResponseGovtInfo> GetInfoPage(PageParamList <RequestGovtInfo> pageParam)
        {
            IQueryable <GovtInfo> queryable = Kily.Set <GovtInfo>().Where(t => t.IsDelete == false);

            if (!string.IsNullOrEmpty(pageParam.QueryParam.DepartName))
            {
                queryable = queryable.Where(t => t.DepartName.Contains(pageParam.QueryParam.DepartName));
            }
            if (UserInfo().AccountType > AccountEnum.Country)
            {
                queryable = queryable.Where(t => t.TypePath.Contains(UserInfo().Province) ||
                                            t.TypePath.Contains(UserInfo().City) ||
                                            t.TypePath.Contains(UserInfo().Area));
            }
            var data = queryable.OrderByDescending(t => t.CreateTime).Select(t => new ResponseGovtInfo()
            {
                Id              = t.Id,
                DepartName      = t.DepartName,
                Account         = t.Account,
                AccountTypeName = AttrExtension.GetSingleDescription <GovtAccountEnum, DescriptionAttribute>(t.AccountType),
                TrueName        = t.TrueName,
                Phone           = t.Phone,
                Email           = t.Email,
                TypePath        = t.TypePath
            }).ToList();

            data.ForEach(t =>
            {
                t.TableName = Kily.Set <SystemProvince>()
                              .Where(x => x.Id.ToString() == t.Province)
                              .Select(x => x.Name).AsNoTracking().FirstOrDefault() + "," +
                              Kily.Set <SystemCity>()
                              .Where(x => x.Id.ToString() == t.City)
                              .Select(x => x.Name).AsNoTracking().FirstOrDefault() + "," +
                              Kily.Set <SystemArea>()
                              .Where(x => x.Id.ToString() == t.Area)
                              .Select(x => x.Name).AsNoTracking().FirstOrDefault();
            });
            return(data.ToPagedResult(pageParam.pageNumber, pageParam.pageSize));
        }
Esempio n. 10
0
        /// <summary>
        /// 获取认证详情
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public ResponseRepastIdent GetDiningIdentDetail(Guid Id)
        {
            IQueryable <RepastIdent>       queryable  = Kily.Set <RepastIdent>().Where(t => t.IsDelete == false);
            IQueryable <RepastIdentAttach> queryables = Kily.Set <RepastIdentAttach>().Where(t => t.IsDelete == false);
            var data = queryable.GroupJoin(queryables, x => x.Id, p => p.IdentId, (x, t) => new ResponseRepastIdent()
            {
                IdentNo            = x.IdentNo,
                MerchantName       = x.MerchantName,
                IdentStarName      = AttrExtension.GetSingleDescription <IdentEnum, DescriptionAttribute>(x.IdentStar),
                AuditTypeName      = AttrExtension.GetSingleDescription <AuditEnum, DescriptionAttribute>(x.AuditType),
                DiningTypeName     = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(x.DiningType),
                IdentYear          = x.IdentYear,
                CommunityCode      = x.CommunityCode,
                Representative     = x.Representative,
                RepresentativeCard = x.RepresentativeCard,
                SendPerson         = x.SendPerson,
                SendCard           = x.SendCard,
                LinkPhone          = x.LinkPhone,
                Remark             = x.Remark,
                IdentStartTime     = x.IdentStartTime,
                IdentEndTime       = x.IdentEndTime,
                ImgCard            = t.FirstOrDefault().ImgCard,
                ImgApply           = t.FirstOrDefault().ImgApply,
                ImgResearch        = t.FirstOrDefault().ImgResearch,
                ImgAgreement       = t.FirstOrDefault().ImgAgreement,
                ImgMaterialOrder   = t.FirstOrDefault().ImgMaterialOrder,
                ImgDisinfection    = t.FirstOrDefault().ImgDisinfection,
                ImgMaterialSave    = t.FirstOrDefault().ImgMaterialSave,
                ImgAbandoned       = t.FirstOrDefault().ImgAbandoned,
                ImgSample          = t.FirstOrDefault().ImgSample,
                ImgWorkingPerson   = t.FirstOrDefault().ImgWorkingPerson,
                ImgOther           = t.FirstOrDefault().ImgOther,
                AuditInfo          = Kily.Set <SystemAudit>()
                                     .Where(o => o.IsDelete == false)
                                     .Where(o => o.TableId == x.Id).ToList().MapToList <SystemAudit, ResponseAudit>()
            }).FirstOrDefault();

            return(data);
        }
Esempio n. 11
0
        /// <summary>
        /// 厨师详情
        /// </summary>
        /// <returns></returns>
        public ResponseCookInfo GetCookInfoDetail()
        {
            var data = Kily.Set <CookInfo>().Where(t => t.CookId == CookInfo().Id).Select(t => new ResponseCookInfo()
            {
                Id            = t.Id,
                CookId        = t.CookId,
                TrueName      = t.TrueName,
                Sexlab        = t.Sexlab,
                Nation        = t.Nation,
                Birthday      = t.Birthday,
                IdCardNo      = t.IdCardNo,
                TypePath      = t.TypePath,
                Address       = t.Address,
                CardOffice    = t.CardOffice,
                ExpiredDay    = t.ExpiredDay,
                IdCardPhoto   = t.IdCardPhoto,
                BookInCard    = t.BookInCard,
                HealthCard    = t.HealthCard,
                TrainCard     = t.TrainCard,
                AuditTypeName = AttrExtension.GetSingleDescription <DescriptionAttribute>(t.AuditType)
            }).AsNoTracking().FirstOrDefault();

            return(data);
        }
Esempio n. 12
0
        /// <summary>
        /// 餐饮商家登录
        /// </summary>
        /// <param name="LoginValidate"></param>
        /// <returns></returns>
        public Object MerchantLogin(RequestValidate LoginValidate)
        {
            #region 餐饮企业登录

            IQueryable <RepastInfo> queryable = Kily.Set <RepastInfo>()
                                                .Where(t => t.Account.Equals(LoginValidate.Account) || t.Phone.Equals(LoginValidate.Account))
                                                .Where(t => t.PassWord.Equals(LoginValidate.PassWord))
                                                .Where(t => t.IsDelete == false);
            ResponseMerchant Info = queryable.Select(t => new ResponseMerchant()
            {
                Id              = t.Id,
                Account         = t.Account,
                CommunityCode   = t.CommunityCode,
                MerchantName    = t.MerchantName,
                Phone           = t.Phone,
                DiningType      = t.DiningType,
                VersionType     = t.VersionType,
                VersionTypeName = AttrExtension.GetSingleDescription <SystemVersionEnum, DescriptionAttribute>(t.VersionType),
                DiningTypeName  = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                MerchantImage   = t.MerchantImage,
                AuditType       = t.AuditType,
                AuditTypeName   = AttrExtension.GetSingleDescription <AuditEnum, DescriptionAttribute>(t.AuditType),
                DingRoleId      = t.DingRoleId,
                TypePath        = t.TypePath,
                Address         = t.Address,
                Certification   = t.Certification,
                Email           = t.Email,
                ImplUser        = t.ImplUser,
                TableName       = typeof(ResponseMerchant).Name
            }).FirstOrDefault();

            #endregion 餐饮企业登录

            #region 非企业登录

            IQueryable <RepastInfoUser> queryables = Kily.Set <RepastInfoUser>()
                                                     .Where(t => t.Account.Equals(LoginValidate.Account) || t.Phone.Equals(LoginValidate.Account))
                                                     .Where(t => t.PassWord.Equals(LoginValidate.PassWord))
                                                     .Where(t => t.IsDelete == false);
            ResponseMerchantUser User = queryables.Select(t => new ResponseMerchantUser()
            {
                Id              = t.InfoId,
                InfoId          = t.Id,
                Account         = t.Account,
                TrueName        = t.TrueName,
                DiningType      = t.DiningType,
                VersionType     = t.VersionType,
                DingRoleId      = t.DingRoleId,
                TypePath        = t.TypePath,
                MerchantName    = t.MerchantName,
                Phone           = t.Phone,
                IdCard          = t.Phone,
                VersionTypeName = AttrExtension.GetSingleDescription <SystemVersionEnum, DescriptionAttribute>(t.VersionType),
                DiningTypeName  = AttrExtension.GetSingleDescription <MerchantEnum, DescriptionAttribute>(t.DiningType),
                TableName       = typeof(ResponseMerchantUser).Name
            }).FirstOrDefault();

            #endregion 非企业登录

            if (Info != null)
            {
                return(Info);
            }
            else if (User != null)
            {
                return(User);
            }
            else
            {
                return(null);
            }
        }