예제 #1
0
        public string GetBannerList(QueryCommon <BannerIndexQuery> query)
        {
            Result_List_Pager <Result_BannersIndex> res        = new Result_List_Pager <Result_BannersIndex>();
            Result_List_Pager <BannersIndex>        resService = bannerIndexService.GetBannerList(query);

            if (resService.Msg.IsSuccess)
            {
                var listHash = hashSet.Get_DictionariesList();
                res.List = resService.List.Select(x => new Result_BannersIndex()
                {
                    Id           = x.Id,
                    BannerDes    = x.BannerDes,
                    BannerTitle  = x.BannerTitle,
                    LanguageType = x.LanguageType == 1 ? listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().DKey : listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().Remarks,
                    ManagerId    = x.ManagerId,
                    ShopId       = x.ShopId,
                    TargetName   = x.TargetName,
                    Url          = x.Url
                }).ToList();
                res.Msg      = resService.Msg;
                res.PageInfo = resService.PageInfo;
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #2
0
        public string GetLawInfoList_Web(QueryCommon <LawInfoQuery_Web> query)
        {
            ILawInfoService jobsService                = ServiceHelper.Create <ILawInfoService>();
            Result_List_Pager <Result_LawInfo> res     = jobsService.GetLawInfoList_Web(query);
            List <Result_AttachmentInfo>       resItem = new List <Result_AttachmentInfo>();

            foreach (var item in res.List)
            {
                resItem = GetObjectList_ById_Web(item.Id).List.Where(x => x.AttachmentName != null && x.AttachmentName != "" && x.AttachmentName.LastIndexOf('.') > 0).ToList();
                if (resItem != null && resItem.Count > 0)
                {
                    Result_AttachmentInfo imgItem = resItem.Where(x => HashSet_Common.ImageTypeArr.Contains(x.AttachmentName.Substring(x.AttachmentName.LastIndexOf('.'), x.AttachmentName.Length - x.AttachmentName.LastIndexOf('.')))).FirstOrDefault();
                    if (imgItem != null)
                    {
                        item.AttachmentName = imgItem.AttachmentName;
                    }
                    else
                    {
                        item.AttachmentName = "";
                    }
                }
                else
                {
                    item.AttachmentName = "";
                }
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #3
0
        /// <summary>
        /// 会议列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Result_List_Pager <Result_MeetingInfo> GetMeetingsList_Web(QueryCommon <MeetingInfoQuery_Web> query)
        {
            Result_List_Pager <Result_MeetingInfo> res = new Result_List_Pager <Result_MeetingInfo>()
            {
                List     = new List <Result_MeetingInfo>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                var linqList = from listMeet in context.MeetingInfo select listMeet;
                if (query.ParamInfo.LanguageType != 0)
                {
                    //语言类型(0:所有 ;1:中文;2:英文;)
                    linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType);
                }
                if (query.ParamInfo.Type == 1)//最新
                {
                    linqList = linqList.Where(x => x.MeetingTime >= query.ParamInfo.EndTime);
                }
                if (query.ParamInfo.Type == 2)//历史
                {
                    linqList = linqList.Where(x => x.MeetingTime < query.ParamInfo.EndTime);
                }
                if (query.ParamInfo.Type == 0)
                {
                    linqList = linqList.Where(x => x.MeetingTime >= query.ParamInfo.StartTime && x.MeetingTime < query.ParamInfo.EndTime);
                }
                int total = linqList.Count();

                List <MeetingInfo> list = linqList.OrderBy(p => p.MeetingTime).OrderByDescending(p => p.Id).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();

                res.List = list.Select(x => new Result_MeetingInfo()
                {
                    Id             = x.Id,
                    Title          = x.Title,
                    CreatDate      = x.CreatDate,
                    MeetingContent = x.MeetingContent,
                    MeetingPlace   = x.MeetingPlace,
                    MeetingTime    = x.MeetingTime.ToString("yyyy-MM-dd HH:mm"),
                    ContinueTime   = x.ContinueTime,
                    UserId         = x.UserId
                }).ToList();

                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
예제 #4
0
        /// <summary>
        /// 会议列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Result_List_Pager <Result_LawInfo> GetLawInfoList_Web(QueryCommon <LawInfoQuery_Web> query)
        {
            Result_List_Pager <Result_LawInfo> res = new Result_List_Pager <Result_LawInfo>()
            {
                List     = new List <Result_LawInfo>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                var linqList = from listMeet in context.LawInfo select listMeet;
                if (query.ParamInfo.LanguageType != 0)
                {
                    //语言类型(0:所有 ;1:中文;2:英文;)
                    linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType);
                }
                if (query.ParamInfo.Title != null && query.ParamInfo.Title != string.Empty)
                {
                    linqList = linqList.Where(x => x.Title.IndexOf(query.ParamInfo.Title) != -1);
                }
                if (query.ParamInfo.StartTime != null && query.ParamInfo.EndTime != null)
                {
                    linqList = linqList.Where(x => x.CreateTime >= query.ParamInfo.StartTime && x.CreateTime <= query.ParamInfo.EndTime);
                }
                if (!string.IsNullOrWhiteSpace(query.ParamInfo.LawsInfo))
                {
                    linqList = linqList.Where(x => x.LawsInfo.Contains(query.ParamInfo.LawsInfo));
                }
                int            total = linqList.Count();
                List <LawInfo> list  = linqList.OrderBy(p => p.CreateTime).OrderByDescending(p => p.Id).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();

                res.List = list.Select(x => new Result_LawInfo()
                {
                    Id         = x.Id,
                    Title      = x.Title,
                    CreateTime = x.CreateTime,
                    Author     = x.Author,
                    LawsInfo   = x.LawsInfo,
                    UserId     = x.UserId
                }).ToList();

                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
예제 #5
0
        public string JobsList1(QueryCommon <JobsQuery> query)
        {
            Result_List_Pager <Result_Jobs> res = new Result_List_Pager <Result_Jobs>();

            query.ParamInfo.UserId   = base.CurrentUser.Id;
            query.ParamInfo.UserType = base.CurrentUser.UserType;

            IJobsService             jobsService = ServiceHelper.Create <IJobsService>();
            Result_List_Pager <Jobs> resList     = jobsService.GetJobsList_Member(query);

            if (resList.Msg.IsSuccess)
            {
                try
                {
                    var listHash = hashSet.Get_DictionariesList();
                    res.PageInfo = resList.PageInfo;
                    res.Msg      = resList.Msg;
                    res.List     = resList.List.Select(x => new Result_Jobs()
                    {
                        Id             = x.Id,
                        JobTitle       = x.JobTitle,
                        UserType       = listHash.Where(y => y.DictionaryTypeId == 15 && y.DKey == x.UserType.ToString()).FirstOrDefault().DValue,
                        JobContent     = x.JobContent,
                        UserId         = x.UserId.ToString(),
                        CreateDate     = x.CreateDate.ToString("yyyy-MM-dd"),
                        UpdateDate     = x.UpdateDate.ToString("yyyy-MM-dd"),
                        StartDate      = x.StartDate.ToString("yyyy-MM-dd"),
                        EndDate        = x.EndDate.ToString("yyyy-MM-dd"),
                        ApprovalStatus = listHash.Where(y => y.DictionaryTypeId == 14 && y.DKey == x.ApprovalStatus.ToString()).FirstOrDefault().DValue,
                        Reviewer       = x.Reviewer,

                        Payrol_LowHigh = (x.PayrolLow.ToString() + '-' + x.PayrolHigh.ToString()),
                        PayrollType    = listHash.Where(y => y.DictionaryTypeId == 18 && y.DKey == x.PayrollType.ToString()).FirstOrDefault().DValue,
                        TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks,
                        WorkType       = listHash.Where(y => y.DictionaryTypeId == 17 && y.DKey == x.WorkType.ToString()).FirstOrDefault().DValue,
                        CompanyTel     = x.CompanyTel,
                        CompanyEmail   = x.CompanyEmail,
                        WorkPlace      = x.WorkPlace,
                        LanguageType   = x.LanguageType == 1 ? listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().DKey : listHash.Where(y => y.DictionaryTypeId == 10 && y.DValue == x.LanguageType.ToString()).FirstOrDefault().Remarks
                    }).ToList();
                }
                catch (Exception ex)
                {
                    res.Msg = new Result_Msg()
                    {
                        IsSuccess = false, Message = ex.Message
                    };
                }
            }
            else
            {
                res.Msg = resList.Msg;
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #6
0
        public string IWantToBuyList_Web(QueryCommon <IWantToBuyQuery> query)
        {
            query.ParamInfo = new IWantToBuyQuery();
            if (base.CurrentUser != null)
            {
                query.ParamInfo.PurchaseID = base.CurrentUser.Id;
            }
            Result_List_Pager <Result_IWantToBuy> res     = new Result_List_Pager <Result_IWantToBuy>();
            Result_List_Pager <IWantToBuy>        resList = iWantToBuyService.Get_IWantToBuyList_Web_Buy(query);

            if (resList.Msg.IsSuccess)
            {
                var listHash = hashSet.Get_DictionariesList();

                res.PageInfo = resList.PageInfo;
                res.Msg      = resList.Msg;
                res.List     = resList.List.Select(x => new Result_IWantToBuy()
                {
                    Id          = x.Id,
                    PurchaseID  = x.PurchaseID,
                    ProductName = x.ProductName,
                    PurchaseNum = x.PurchaseNum,
                    Quantity    = x.Quantity,
                    Remarks     = x.Remarks,
                    TotalPrice  = x.TotalPrice,
                    Unit        = x.Unit,
                    UnitPrice   = x.UnitPrice,
                    Address     = x.Address,
                    Status      = x.Status,
                    StatusStr   = listHash.Where(y => y.DictionaryTypeId == 107 && y.DKey == x.Status.ToString()).FirstOrDefault().DValue,
                    //SupplyModel = GetObjectById_Web_Supply(x.Id, base.CurrentUser.Id),
                    SupplyList = Get_SupplyList_ByIWantToBuyId(x.Id).List,

                    DeliveryDate = x.DeliveryDate.ToString("yyyy-MM-dd hh:mm"),
                    CreateDate   = x.CreateDate.ToString("yyyy-MM-dd hh:mm"),
                    StartDate    = x.StartDate.ToString("yyyy-MM-dd hh:mm"),
                    EndDate      = x.EndDate.ToString("yyyy-MM-dd hh:mm"),
                    UpdateDate   = x.UpdateDate.ToString("yyyy-MM-dd hh:mm"),

                    TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks
                }).ToList();
            }
            else
            {
                res.Msg = resList.Msg;
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #7
0
        /// <summary>
        /// 获取招聘信息列表——Admin
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Result_List_Pager <Jobs> GetJobsList_Admin(QueryCommon <JobsQuery> query)
        {
            Result_List_Pager <Jobs> res = new Result_List_Pager <Jobs>()
            {
                List     = new List <Jobs>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                var linqList = from job in context.Jobs select job;
                if (query.ParamInfo.UserType != 0)
                {
                    linqList = linqList.Where(x => x.UserType == query.ParamInfo.UserType);
                }
                if (query.ParamInfo.LanguageType != 0)
                {
                    //语言类型(0:所有 ;1:中文;2:英文;)
                    linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType);
                }
                if (query.ParamInfo.ApprovalStatus != 0)
                {
                    linqList = linqList.Where(x => x.ApprovalStatus == query.ParamInfo.ApprovalStatus);
                }
                if (query.ParamInfo.JobTitle != null && query.ParamInfo.JobTitle != string.Empty)
                {
                    linqList = linqList.Where(x => x.JobTitle.IndexOf(query.ParamInfo.JobTitle) != -1);
                }

                int total = linqList.Count();
                res.List = linqList.OrderByDescending(p => p.CreateDate).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();

                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
        public string IWantToSupply_List(QueryCommon <IWantToBuyQuery> query)
        {
            Result_List_Pager <Result_IWantToSupply> res = new Result_List_Pager <Result_IWantToSupply>()
            {
                Msg = new Result_Msg()
                {
                    IsSuccess = true
                },
                List     = new List <Result_IWantToSupply>(),
                PageInfo = new PageInfo()
            };
            Result_List_Pager <IWantToSupply> list = iWantToBuyService.GetObjectById_Web_SupplyList_Pager(query);

            if (list.Msg.IsSuccess)
            {
                var listHash = hashSet.Get_DictionariesList();
                res.PageInfo = list.PageInfo;

                res.List = list.List.Select(x => new Result_IWantToSupply()
                {
                    Id             = x.Id,
                    PurchaseNum    = x.PurchaseNum.ToString(),
                    IWantToBuyID   = x.IWantToBuyID,
                    UnitPrice      = x.UnitPrice,
                    Quantity       = x.Quantity,
                    Unit           = x.Unit,
                    TotalPrice     = x.TotalPrice,
                    SupplierID     = x.SupplierID,
                    TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks,
                    ShopName       = iWantToBuyService.GetCompanyInfo_ByUserIdAndUserType(x.SupplierID).Model.CompanyName,
                    ShopId         = iWantToBuyService.GetCompanyInfo_ByUserIdAndUserType(x.SupplierID).Model.Id,

                    CreateDate         = x.CreateDate.ToString("yyyy-MM-dd hh:mm"),
                    BidDate            = x.BidDate.ToString("yyyy-MM-dd hh:mm"),
                    LatestDeliveryTime = x.LatestDeliveryTime.ToString("yyyy-MM-dd hh:mm"),
                    UpdateDate         = x.UpdateDate.ToString("yyyy-MM-dd hh:mm"),
                    Status             = x.Status,
                    StatusStr          = listHash.Where(y => y.DictionaryTypeId == 108 && y.DKey == x.Status.ToString()).FirstOrDefault().DValue
                }).ToList();
            }
            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #9
0
        public Result_List_Pager <BannersIndex> GetBannerList(QueryCommon <BannerIndexQuery> query)
        {
            Result_List_Pager <BannersIndex> res = new Result_List_Pager <BannersIndex>()
            {
                List     = new List <BannersIndex>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                var linqList = from banner in context.BannersIndex select banner;
                if (query.ParamInfo.LanguageType != 0)
                {
                    //语言类型(0:所有 ;1:中文;2:英文;)
                    linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType);
                }
                if (query.ParamInfo.BannerTitle != null && query.ParamInfo.BannerTitle != string.Empty)
                {
                    linqList = linqList.Where(x => x.BannerTitle.IndexOf(query.ParamInfo.BannerTitle) != -1);
                }
                int total = linqList.Count();
                res.List = linqList.OrderByDescending(p => p.Id).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();

                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
예제 #10
0
        public string GetWhatBusyList(QueryCommon <WhatBusyQuery> query)
        {
            IJobsService jobsService = ServiceHelper.Create <IJobsService>();

            Result_List_Pager <Result_WhatBusy> res = new Result_List_Pager <Result_WhatBusy>()
            {
                List     = new List <Result_WhatBusy>(),
                Msg      = new Result_Msg(),
                PageInfo = new PageInfo()
            };
            Result_List_Pager <WhatBusy> resDal = whatBuys.GetWhatBusyList(query);

            if (resDal != null && resDal.Msg.IsSuccess)
            {
                res.Msg      = resDal.Msg;
                res.PageInfo = resDal.PageInfo;
                res.List     = resDal.List.Select(x => new Result_WhatBusy()
                {
                    Id           = x.Id,
                    BusyCotent   = hashSet.Get_DictionariesList_ByTypeID(19).Where(y => y.DKey == x.BusyType.ToString()).FirstOrDefault().Remarks.Replace("#BusyContent#", x.BusyCotent.Length > 10 ? x.BusyCotent.Substring(0, 10) + "**" : x.BusyCotent),
                    BusyType     = x.BusyType,
                    UserName     = jobsService.GetCompanyInfo_ByUserIdAndUserType(x.UserId),
                    BusyTypeName = hashSet.Get_DictionariesList_ByTypeID(19).Where(y => y.DKey == x.BusyType.ToString()).FirstOrDefault().DValue,
                    IsShow       = x.IsShow,
                    UserId       = x.UserId,
                    TargetUrl    = x.TargetUrl,
                    CreateDate   = x.CreateDate.ToString("yyyy-MM-dd HH:mm")
                }).ToList();
            }
            else
            {
                res.Msg = new Result_Msg()
                {
                    IsSuccess = false, Message = "数据库数据读取失败"
                };
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #11
0
        public string MeetingsList_Web(QueryCommon <TechnicalInfoQuery_Web> query)
        {
            if (query.ParamInfo.Type > 0)
            {
                query.ParamInfo.EndTime = DateTime.Now.Date;
            }
            //else
            //{
            //    query.ParamInfo.StartTime = query.ParamInfo.StartTime.Date;
            //    query.ParamInfo.EndTime = query.ParamInfo.EndTime.Date.AddDays(1);
            //}

            ITechnicalInfoService jobsService                = ServiceHelper.Create <ITechnicalInfoService>();
            Result_List_Pager <Result_TechnicalInfo> res     = jobsService.GetMeetingsList_Web(query);
            List <Result_AttachmentInfo>             resItem = new List <Result_AttachmentInfo>();

            foreach (var item in res.List)
            {
                resItem = GetObjectList_ById_Web(item.Id).List.Where(x => x.AttachmentName != null && x.AttachmentName != "" && x.AttachmentName.LastIndexOf('.') > 0).ToList();
                if (resItem != null && resItem.Count > 0)
                {
                    Result_AttachmentInfo imgItem = resItem.Where(x => HashSet_Common.ImageTypeArr.Contains(x.AttachmentName.Substring(x.AttachmentName.LastIndexOf('.'), x.AttachmentName.Length - x.AttachmentName.LastIndexOf('.')))).FirstOrDefault();
                    if (imgItem != null)
                    {
                        item.AttachmentName = imgItem.AttachmentName;
                    }
                    else
                    {
                        item.AttachmentName = "";
                    }
                }
                else
                {
                    item.AttachmentName = "";
                }
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #12
0
        /// <summary>
        /// 根据查询条件获取数据列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public Result_List_Pager <WhatBusy> GetWhatBusyList(QueryCommon <WhatBusyQuery> query)
        {
            Result_List_Pager <WhatBusy> res = new Result_List_Pager <WhatBusy>()
            {
                List     = new List <WhatBusy>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                int total = 0;
                if (query.ParamInfo.BusyType == 0)
                {
                    total    = (from p in context.WhatBusy select p).Count();
                    res.List = (from p in context.WhatBusy select p).OrderByDescending(p => p.CreateDate).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();
                }
                else
                {
                    total    = (from p in context.WhatBusy where p.BusyType == query.ParamInfo.BusyType select p).Count();
                    res.List = (from p in context.WhatBusy where p.BusyType == query.ParamInfo.BusyType select p).OrderByDescending(p => p.CreateDate).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();
                }
                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
                res.Msg.IsSuccess        = true;
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
예제 #13
0
        public string SupplyList(QueryCommon <IWantToBuyQuery> query)
        {
            query.ParamInfo.PurchaseID = base.CurrentUser.Id;

            Result_List_Pager <Result_IWantToBuy> res = new Result_List_Pager <Result_IWantToBuy>();

            IIWantToBuyService             jobsService = ServiceHelper.Create <IIWantToBuyService>();
            Result_List_Pager <IWantToBuy> resList     = jobsService.GetIWantToBuyList_SupplyUser_Pager(query);
            var listHash = hashSet.Get_DictionariesList();

            if (resList.Msg.IsSuccess)
            {
                res.PageInfo = resList.PageInfo;
                res.Msg      = resList.Msg;
                res.List     = resList.List.Select(x => new Result_IWantToBuy()
                {
                    Id          = x.Id,
                    SupplyModel = Get_SupplyModel_ByIWantToBuyID(x.Id),
                    //SupplierID = Get_SupplierID_ByIWantToBuyID(x.Id),

                    //IsMine = Get_SupplierID_ByIWantToBuyID(x.Id) > 0 ? 1 : 0,
                    //ShopName = jobsService.GetCompanyInfo_ByUserIdAndUserType(Get_SupplierID_ByIWantToBuyID(x.Id)).Model.ShopName,

                    PurchaseID  = x.PurchaseID,
                    ProductName = x.ProductName,
                    PurchaseNum = x.PurchaseNum,
                    Quantity    = x.Quantity,
                    Remarks     = x.Remarks,
                    TotalPrice  = x.TotalPrice,
                    Unit        = x.Unit,
                    UnitPrice   = x.UnitPrice,
                    Address     = x.Address,
                    Status      = x.Status,
                    StatusStr   = listHash.Where(y => y.DictionaryTypeId == 107 && y.DKey == x.Status.ToString()).FirstOrDefault().DValue,

                    DeliveryDate = x.DeliveryDate.ToString("yyyy-MM-dd hh:mm"),
                    CreateDate   = x.CreateDate.ToString("yyyy-MM-dd hh:mm"),
                    StartDate    = x.StartDate.ToString("yyyy-MM-dd hh:mm"),
                    EndDate      = x.EndDate.ToString("yyyy-MM-dd hh:mm"),
                    UpdateDate   = x.UpdateDate.ToString("yyyy-MM-dd hh:mm"),

                    TypeOfCurrency = listHash.Where(y => y.DictionaryTypeId == 1 && y.DValue == x.TypeOfCurrency.ToString()).FirstOrDefault().Remarks
                }).ToList();

                foreach (var item in res.List)
                {
                    if (item.SupplyModel.Msg.IsSuccess)
                    {
                        item.SupplierID = item.SupplyModel.Model.SupplierID;
                        if (item.SupplyModel.Model.SupplierID == base.CurrentUser.Id)
                        {
                            item.IsMine = 1;//0:竞价中;1:我已中标;2:他人中标

                            Result_Model <ShopInfo> res1 = jobsService.GetCompanyInfo_ByUserIdAndUserType(item.SupplyModel.Model.SupplierID);
                            item.ShopName = res1.Model.CompanyName;
                        }
                        else
                        {
                            item.IsMine = 2;//0:竞价中;1:我已中标;2:他人中标

                            Result_Model <ShopInfo> res1 = jobsService.GetCompanyInfo_ByUserIdAndUserType(item.SupplyModel.Model.SupplierID);
                            item.ShopName = res1.Model.CompanyName;
                        }
                    }
                    else if (item.SupplierID == 0)
                    {
                        item.IsMine = 0;//0:竞价中;1:我已中标;2:他人中标
                    }
                    var suppy = Get_SupplyModel_ByUserIdAndIWantToBuyId(Convert.ToInt64(item.Id), base.CurrentUser.Id);
                    if (suppy.Msg.IsSuccess)
                    {
                        item.WhetherParticipation = 1;
                    }
                    else
                    {
                        item.WhetherParticipation = 0;
                    }
                }
            }
            else
            {
                res.Msg = resList.Msg;
            }

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #14
0
        /// <summary>
        /// 根据查询条件获取数据列表
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public Result_List_Pager <Result_TransactionRecord> GetTransactionRecordList(TransactionRecordQuery query)
        {
            Result_List_Pager <Result_TransactionRecord> res = new Result_List_Pager <Result_TransactionRecord>()
            {
                List     = new List <Result_TransactionRecord>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                if (query.StartDate > query.EndDate)
                {
                    res.Msg.IsSuccess = false;
                    res.Msg.Message   = "开始时间不能大于结束时间";
                }
                else
                {
                    //开始月份与结束月份相同或开始月份小于结束月份时,查询开始月份第一天至结束月份最后一天内的数据

                    query.StartDate = query.StartDate.Date;
                    query.EndDate   = query.EndDate.Date.AddMonths(1);
                    int total = 0;
                    List <TransactionRecord> list;
                    if (query.CurveType == 0)
                    {
                        total = (from p in context.TransactionRecord where p.YearMonth >= query.StartDate && p.YearMonth < query.EndDate select p).Count();
                        list  = (from p in context.TransactionRecord where p.YearMonth >= query.StartDate && p.YearMonth < query.EndDate select p).OrderBy(p => p.YearMonth).Skip((query.PageNo - 1) * query.PageSize).Take(query.PageSize).ToList();
                    }
                    else
                    {
                        total = (from p in context.TransactionRecord where p.YearMonth >= query.StartDate && p.YearMonth < query.EndDate && p.CurveType == query.CurveType select p).Count();
                        list  = (from p in context.TransactionRecord where p.YearMonth >= query.StartDate && p.YearMonth < query.EndDate && p.CurveType == query.CurveType select p).OrderBy(p => p.YearMonth).Skip((query.PageNo - 1) * query.PageSize).Take(query.PageSize).ToList();
                    }
                    res.List = list.Select(x => new Result_TransactionRecord()
                    {
                        Id               = x.Id,
                        XName_CN         = x.XName_CN,
                        XName_Eng        = x.XName_Eng,
                        Y_CompleteAmount = x.Y_CompleteAmount,
                        Y_CompleteNumber = x.Y_CompleteNumber,
                        Y_OrderAmount    = x.Y_OrderAmount,
                        Y_OrderQuantity  = x.Y_OrderQuantity,
                        CurveType        = HashSet_Common.hashCurveType.Where(y => y.Key == x.CurveType).FirstOrDefault().Value,
                        YearMonth        = x.YearMonth.Year.ToString() + "-" + x.YearMonth.Month.ToString(),
                        IsTrue           = x.IsTrue
                    }).ToList();

                    res.PageInfo.CurrentPage = query.PageNo;
                    res.PageInfo.PageSize    = query.PageSize;
                    res.PageInfo.Total       = total;
                    res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageSize));


                    res.Msg.IsSuccess = true;
                }
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
예제 #15
0
        /// <summary>
        /// 获取招聘信息列表——Web
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Result_List_Pager <Jobs> GetJobsList_Web(QueryCommon <JobsQuery> query)
        {
            Result_List_Pager <Jobs> res = new Result_List_Pager <Jobs>()
            {
                List     = new List <Jobs>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                var linqList = from job in context.Jobs where job.ApprovalStatus == 3 select job;

                #region 拼接 Linq 查询条件
                if (query.ParamInfo.UserType != 0)
                {
                    //发布者类型(1:平台管理员?;2:供应商;3:采购商;)
                    linqList = linqList.Where(x => x.UserType == query.ParamInfo.UserType);
                }
                if (query.ParamInfo.LanguageType != 0)
                {
                    //语言类型(0:所有 ;1:中文;2:英文;)
                    linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType);
                }
                if (query.ParamInfo.PayrolLow == null && query.ParamInfo.PayrolHigh == null)
                {
                    //linqList = linqList.Where(x => x.PayrolLow == query.PayrolLow);
                }
                else if (query.ParamInfo.PayrolLow == null && query.ParamInfo.PayrolHigh >= 0)
                {
                    linqList = linqList.Where(x => x.PayrolHigh <= query.ParamInfo.PayrolHigh);
                }
                else if (query.ParamInfo.PayrolLow >= 0 && query.ParamInfo.PayrolHigh == null)
                {
                    linqList = linqList.Where(x => x.PayrolLow >= query.ParamInfo.PayrolLow);
                }
                else if (query.ParamInfo.PayrolLow <= query.ParamInfo.PayrolHigh)
                {
                    linqList = linqList.Where(x => x.PayrolLow >= query.ParamInfo.PayrolLow && x.PayrolHigh <= query.ParamInfo.PayrolHigh);
                }

                if (query.ParamInfo.WorkType != 3)
                {
                    //工作类型(0:全职;1:兼职;2:外包)
                    linqList = linqList.Where(x => x.WorkType == query.ParamInfo.WorkType);
                }
                if (query.ParamInfo.JobTitle != null && query.ParamInfo.JobTitle != string.Empty)
                {
                    linqList = linqList.Where(x => x.JobTitle.IndexOf(query.ParamInfo.JobTitle) != -1);
                }
                #endregion

                int total = linqList.Count();
                res.List = linqList.OrderByDescending(p => p.CreateDate).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();

                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }
예제 #16
0
        public string GetTransactionRecordList(TransactionRecordQuery query)
        {
            Result_List_Pager <Result_TransactionRecord> res = bannerIndexService.GetTransactionRecordList(query);

            return(Newtonsoft.Json.JsonConvert.SerializeObject(res));
        }
예제 #17
0
        /// <summary>
        /// 会议列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Result_List_Pager <Result_TechnicalInfo> GetMeetingsList_Web(QueryCommon <TechnicalInfoQuery_Web> query)
        {
            Result_List_Pager <Result_TechnicalInfo> res = new Result_List_Pager <Result_TechnicalInfo>()
            {
                List     = new List <Result_TechnicalInfo>(),
                PageInfo = new PageInfo(),
                Msg      = new Result_Msg()
                {
                    IsSuccess = true
                }
            };

            try
            {
                var    linqList = from listMeet in context.TechnicalInfo where listMeet.Status == 2 select listMeet;
                string name     = (from a in context.SiteSettingsInfo where a.Key == "techName" select a).FirstOrDefault().Value;
                string tel      = (from a in context.SiteSettingsInfo where a.Key == "techTel" select a).FirstOrDefault().Value;
                string Email    = (from a in context.SiteSettingsInfo where a.Key == "techEmail" select a).FirstOrDefault().Value;
                if (query.ParamInfo.LanguageType != 0)
                {
                    //语言类型(0:所有 ;1:中文;2:英文;)
                    linqList = linqList.Where(x => x.LanguageType == query.ParamInfo.LanguageType);
                }
                if (query.ParamInfo.Type == 1)//最新
                {
                    linqList = linqList.Where(x => x.PublishTime >= query.ParamInfo.EndTime);
                }
                if (query.ParamInfo.Type == 2)//历史
                {
                    linqList = linqList.Where(x => x.PublishTime < query.ParamInfo.EndTime);
                }
                if (query.ParamInfo.Type == 0)
                {
                    linqList = linqList.Where(x => x.PublishTime >= query.ParamInfo.StartTime && x.PublishTime < query.ParamInfo.EndTime);
                }

                int total = linqList.Count();
                List <TechnicalInfo> list = linqList.OrderBy(p => p.PublishTime).OrderByDescending(p => p.Id).Skip((query.PageInfo.CurrentPage - 1) * query.PageInfo.PageSize).Take(query.PageInfo.PageSize).ToList();

                res.List = list.Select(x => new Result_TechnicalInfo()
                {
                    Id          = x.Id,
                    Title       = x.Title,
                    PublishTime = x.PublishTime,
                    Author      = x.Author,
                    TechContent = x.TechContent,
                    Tel         = x.Tel,
                    Email       = x.Email,
                    UserId      = x.PublisherId,
                    techName    = name,
                    techTel     = tel,
                    techEmail   = Email
                }).ToList();
                res.PageInfo.CurrentPage = query.PageInfo.CurrentPage;
                res.PageInfo.PageSize    = query.PageInfo.PageSize;
                res.PageInfo.Total       = total;
                res.PageInfo.PageCount   = Convert.ToInt32(Math.Ceiling((double)total / (double)query.PageInfo.PageSize));
            }
            catch (Exception ex)
            {
                res.Msg.IsSuccess = false;
                res.Msg.Message   = "查询失败,失败原因:" + ex.Message;
            }
            return(res);
        }