Пример #1
0
        /// <summary>
        /// 获取当前用户对应组织名称,然后用组织名称查询字典中对应的ssjd的ID.(仅用于街道)
        /// </summary>
        /// <returns></returns>
        public Guid?GetCurrentSSJD()
        {
            var relation   = new RoadFlow.Platform.OrganizeBLL().GetByID(RoadFlow.Platform.UsersBLL.CurrentFirstRelationID);
            var dictionary = new DictionaryBLL().GetByName(relation.Name.Replace("街道", ""));

            return(dictionary == null?Guid.NewGuid() : dictionary.ID);
        }
Пример #2
0
        /// <summary>
        /// 按楼盘统计(因为默认有时间段筛选,所以没做时间段相关的排序)
        /// </summary>
        /// <returns></returns>
        public List <RoadFlow.Data.Model.BuildingMonthModifyCountModel> GetPagerDataHouse(out string pager, int size, int pageIndex, Dictionary <KeyValuePair <string, RoadFlow.Data.Model.SQLFilterType>, object> where)
        {
            List <RoadFlow.Data.Model.BuildingMonthModifyCountModel> result = new List <Data.Model.BuildingMonthModifyCountModel>();
            var all = GetAll(where).ToList <RoadFlow.Data.Model.BuildingMonthModifyCountModel>().OrderBy(p => p.HouseID).OrderBy(p => p.TimeArea);


            //循环计算楼盘企业和每月更新数量
            Dictionary <Guid, string> houseCount = new Dictionary <Guid, string>();
            int  count           = 0;
            int  enterpriseCount = 0;
            int  timeArea        = 0;
            Guid houseID         = Guid.NewGuid();
            Guid first           = houseID;

            foreach (var item in all)
            {
                if (houseID != item.HouseID)
                {
                    if (houseID != first)
                    {
                        houseCount.Add(houseID, count + "," + enterpriseCount + "," + item.TimeArea);
                        count           = 0;
                        enterpriseCount = 0;
                    }
                    houseID = item.HouseID.Value;
                }
                count           += item.Count.Value;
                enterpriseCount += item.EnterpriseModifyCount.Value;
                timeArea         = item.TimeArea.Value;
            }
            if (first != houseID)
            {
                houseCount.Add(houseID, count + "," + enterpriseCount + "," + timeArea);//添加最后一项
            }


            var houseBLL = new RoadFlow.Platform.DictionaryBLL();

            foreach (var item in houseCount)
            {
                var model = new RoadFlow.Data.Model.BuildingMonthModifyCountModel();
                model.BuildingName          = houseBLL.GetByID(item.Key).Title;//这里显示的其实是楼盘名字
                model.Count                 = int.Parse(item.Value.Split(',')[0]);
                model.EnterpriseModifyCount = int.Parse(item.Value.Split(',')[1]);
                model.TimeArea              = int.Parse(item.Value.Split(',')[2]);
                model.Timeliness            = 40;
                model.Accuracy              = 20;
                model.Quality               = RoadFlow.Platform.BLLCommon.GetQuality(model.Count.Value + model.EnterpriseModifyCount.Value);
                model.Score                 = model.Manual == null? model.Timeliness + model.Accuracy + model.Quality:model.Manual;
                result.Add(model);
            }

            //分页
            int allCount = result.Count;

            pager = RoadFlow.Utility.New.Tools.GetPagerHtml(allCount, size, pageIndex);  //生成HTML的分页

            return(result.OrderByDescending(p => p.Count + p.EnterpriseModifyCount).Skip((pageIndex - 1) * size).Take(size).ToList());
        }