Beispiel #1
0
        public ResultEnery GetObjectEnery()
        {
            var inputValue = _ntsPage.Request.Form["Inputs"];
            var query      = Newtonsoft.Json.JsonConvert.DeserializeObject <QueryEnery>(inputValue);
            var objectId   = 0;

            objectId = query.IsArea == 1 ? query.ObjectId : query.DeviceId;
            var model = new BaseQueryModel
            {
                IsDevice   = 1 - query.IsArea,
                ObjectList = new List <int> {
                    objectId
                },
                ItemCode  = query.ItemCode,
                Unit      = ConvertUnit(query.DateUnit),
                Starttime = query.Starttime,
                Endtime   = query.Starttime
            };
            var list = query.IsAreaTree == 1 ? _dalReportBase.GetBaseEneryDataList(model, true) : _dalReportBase.GetBaseEneryDataList(model);

            return(list.BaseLayerObjectResults.Count > 0
                ? new ResultEnery
            {
                Total = list.BaseLayerObjectResults[objectId.ToString(CultureInfo.InvariantCulture)].Total
            }
                : new ResultEnery {
                Total = 0
            });
        }
Beispiel #2
0
        public async Task <ActionResult <BaseQueryResult <Address> > > GetAddresses()
        {
            var query = new BaseQueryModel {
                PageSize = -1
            };
            var addresses = await this.addressRepository.GetAllAsync(query, true);

            return(Ok(addresses));
        }
Beispiel #3
0
        public BaseResult GetDeviceQuerySingleItemCodeEneryTotal(NTS.WEB.DataContact.BasicQuery query)
        {
            var            ObjectList  = new BLL.BaseLayerObject().GetDeviceObjectList(string.Format(" and deviceid={0}", query.ObjectNum), " order by deviceid");
            var            ItemList    = new BLL.Itemcode().GetItemcodeList(" and ParentID=0", " order by ItemcodeID");
            List <string>  ItemCodeStr = (from item in ItemList select item.ItemCodeNumber).ToList <string>();
            BaseQueryModel model       = new BaseQueryModel();

            model.IsDevice   = 1;
            model.ObjectList = (from p in ObjectList select p.DeviceID).ToList <int>();
            model.ItemCode   = query.ItemCode;
            model.Unit       = BaseTool.GetChartUnit(query.Unit);
            model.Starttime  = query.StartTime;
            model.Endtime    = query.EndTime;
            var ResList = reportBll.GetBaseEneryDataList(model);

            return(ResList);
        }
Beispiel #4
0
        public static IQueryable <T> ApplyPaging <T>(this IQueryable <T> query, BaseQueryModel queryModel)
        {
            // No Paging
            if (queryModel.PageSize == -1)
            {
                return(query);
            }

            if (queryModel.Page <= 0)
            {
                queryModel.Page = 1;
            }

            if (queryModel.PageSize <= 0)
            {
                queryModel.PageSize = 10;
            }

            return(query.Skip((queryModel.Page - 1) * queryModel.PageSize).Take(queryModel.PageSize));
        }
Beispiel #5
0
        private void GenerateEnergyValue(BaseQueryModel model, Dictionary <string, EnergyValueCost> tempConvert, decimal price)
        {
            BaseResult resList = _reportBll.GetBaseEneryDataList(model, model.areaType == AreaType.Liquid ? true : false);

            foreach (var r in resList.BaseLayerObjectResults)
            {
                foreach (var rr in r.Value.Datas)
                {
                    if (tempConvert.ContainsKey(rr.DatePick))
                    {
                        if (model.ItemCode == "00000")
                        {
                            tempConvert[rr.DatePick].EnergyValue += rr.CoalDataValue;
                            tempConvert[rr.DatePick].EnergyCost  += rr.CoalDataValue * price;
                        }
                        else
                        {
                            tempConvert[rr.DatePick].EnergyValue += rr.DataValue;
                            tempConvert[rr.DatePick].EnergyCost  += rr.DataValue * price;
                        }
                    }
                }
            }
        }
Beispiel #6
0
        public Dictionary <string, decimal> GetSingleItemCodeByObject(BasicQuery query, string itemcode)
        {
            // var result = new ResultIndexLineChart { DatePick = new List<string>(), DatePickEnery = new List<decimal>() };
            var eneryDataList = new Dictionary <string, decimal>();
            var model         = new BaseQueryModel();

            List <Model.BaseLayerObject> objectList = new List <Model.BaseLayerObject>();

            if (query.AreaType == AreaType.Area)
            {
                objectList = new NTS.WEB.BLL.BaseLayerObject().GetBaseLayerObjectList(string.Format(" and layerobjectid={0}", query.ObjectNum), " order by LayerObjectID");
            }
            else
            {
                objectList = new NTS.WEB.BLL.BaseLayerObject().GetBaseFuncLayerObjectList(string.Format(" and layerobjectid={0}", query.ObjectNum), " order by LayerObjectID");
            }


            model.IsDevice   = 0;
            model.ObjectList = (from p in objectList select p.LayerObjectID).ToList <int>();
            model.ItemCode   = itemcode;
            model.Unit       = BaseTool.GetChartUnit(query.Unit);
            model.Starttime  = query.StartTime;
            model.Endtime    = query.EndTime;
            model.areaType   = query.AreaType;

            var resList = _energCon.GetBaseEneryDataListNew(model);

            foreach (var d in objectList.SelectMany(o => resList.BaseLayerObjectResults[o.LayerObjectID.ToString(CultureInfo.InvariantCulture)].Datas))
            {
                if (!eneryDataList.ContainsKey(d.DatePick))
                {
                    switch (query.QueryType)
                    {
                    case EnergyAnalyseQueryType.Convert2Co2:
                        eneryDataList.Add(d.DatePick, d.Co2DataValue);
                        break;

                    case EnergyAnalyseQueryType.Convert2Coal:
                        eneryDataList.Add(d.DatePick, d.CoalDataValue);
                        break;

                    case EnergyAnalyseQueryType.Convert2Money:
                        eneryDataList.Add(d.DatePick, d.MoneyDataValue);
                        break;

                    default:
                        eneryDataList.Add(d.DatePick, d.DataValue);
                        break;
                    }
                }
                else
                {
                    switch (query.QueryType)
                    {
                    case EnergyAnalyseQueryType.Convert2Co2:
                        eneryDataList[d.DatePick] += d.Co2DataValue;
                        break;

                    case EnergyAnalyseQueryType.Convert2Coal:
                        eneryDataList[d.DatePick] += d.CoalDataValue;
                        break;

                    case EnergyAnalyseQueryType.Convert2Money:
                        eneryDataList[d.DatePick] += d.MoneyDataValue;
                        break;

                    default:
                        eneryDataList[d.DatePick] += d.DataValue;
                        break;
                    }
                }
            }

            //foreach (var e in eneryDataList)
            //{
            //    result.DatePick.Add(e.Key);
            //    result.DatePickEnery.Add(e.Value);
            //}
            return(eneryDataList);
        }
Beispiel #7
0
 public BaseResult GetLoadForecastChart(BaseQueryModel loadCast)
 {
     return(EnergyContrastCommon.GetBaseEneryDataListNew(loadCast));
 }
Beispiel #8
0
        public MResultModel GetMenuInfoByLoginUser(BaseQueryModel model)
        {
            PermissionsGroupModel resM = _bll.GetMenuPermissionsInfoByUserID(model.LoginUserID);

            return(MResultModel <PermissionsGroupModel> .GetSuccessResultM(resM, "查询成功"));
        }
Beispiel #9
0
 public BaseResult GetBaseEneryDataList(BaseQueryModel model, bool IsLiquid)
 {
     return(BigDataComm.GetBaseEneryDataList(model, IsLiquid));
 }
Beispiel #10
0
        /// <summary>
        /// 能耗集合
        /// </summary>
        /// <param name="model">查询的对象封装</param>
        /// <returns></returns>
        public static BaseResult GetBaseEneryDataListNew(BaseQueryModel model)
        {
            BaseResult Res = new BaseResult();

            Res.BaseLayerObjectResults = new Dictionary <string, BaseData>();
            //Res.DeviceResults = new Dictionary<Model.Device, BaseData>();
            bool IsDevice = model.IsDevice == 0 ? false : true;
            var  datas    = new DataTable();

            if (model != null && model.ObjectList.Count > 0)
            {
                foreach (var objects in model.ObjectList)
                {
                    double        tempCount = 0;
                    BaseDataModel bmodel    = new BaseDataModel();
                    bmodel.Starttime = model.Starttime;
                    if (model.Unit == ChartUnit.unit_hour)
                    {
                        bmodel.Endtime = (model.Starttime == model.Endtime)
                                             ? model.Starttime.AddDays(1).AddHours(-1)
                                             : model.Endtime;
                    }
                    else
                    {
                        bmodel.Endtime = model.Endtime;
                    }
                    bmodel.IsDevice = model.IsDevice;
                    bmodel.ItemCode = model.ItemCode;
                    bmodel.ObjectId = objects;
                    bmodel.Unit     = model.Unit;
                    datas           = GetBaseData(bmodel);
                    BaseData bsDatas = new BaseData();
                    bsDatas.itemCode = new Model.Itemcode();
                    var ItemCodeList = new DAL.Itemcode().GetItemcodeList(string.Format(" and ItemCodeNumber='{0}'", model.ItemCode), string.Format(" order by ItemcodeID"));
                    bsDatas.itemCode = ItemCodeList.Count > 0 ? ItemCodeList[0] : null;
                    Model.BaseLayerObject ObjectInfo = new Model.BaseLayerObject();

                    Model.Device DeviceObjectInfo = new Model.Device();
                    if (!IsDevice)
                    {
                        List <Model.BaseLayerObject> infoList = new List <Model.BaseLayerObject>();
                        if (model.areaType == WEB.DataContact.AreaType.Area)
                        {
                            infoList = new DAL.BaseLayerObject().GetBaseLayerObjectList(string.Format(" and LayerObjectID={0}", objects), string.Format(" order by LayerObjectID"));
                        }
                        else
                        {
                            infoList = new DAL.BaseLayerObject().GetBaseFuncLayerObjectList(string.Format(" and LayerObjectID={0}", objects), string.Format(" order by LayerObjectID"));
                        }

                        ObjectInfo    = infoList.Count > 0 ? infoList[0] : null;
                        bsDatas.Datas = new List <DataItems>();
                        foreach (DataRow item in datas.Rows)
                        {
                            tempCount += double.Parse(item["CountValue"].ToString());
                            bsDatas.Datas.Add(new DataItems()
                            {
                                DatePick         = item["Starttime"].ToString(),
                                DataValue        = decimal.Parse(item["CountValue"].ToString()),
                                CoalDataValue    = Convert.ToDecimal(double.Parse(item["CountValue"].ToString()) * bsDatas.itemCode.ItemCoal),
                                Co2DataValue     = Convert.ToDecimal(double.Parse(item["CountValue"].ToString()) * bsDatas.itemCode.ItemCO2),
                                MoneyDataValue   = Convert.ToDecimal(double.Parse(item["CountValue"].ToString()) * bsDatas.itemCode.ItemMoney),
                                DataValueAndDept = item["CountValue"].ToString() + bsDatas.itemCode.Unit
                            });
                        }
                        bsDatas.baseLayerObject = ObjectInfo;
                    }
                    else
                    {
                        var infoList = new DAL.Device().GetDeviceList(string.Format(" and deviceid={0}", objects), string.Format(" order by DeviceID"));
                        DeviceObjectInfo = infoList.Count > 0 ? infoList[0] : null;
                        bsDatas.Datas    = new List <DataItems>();
                        foreach (DataRow item in datas.Rows)
                        {
                            tempCount += double.Parse(item["CountValue"].ToString());
                            bsDatas.Datas.Add(new DataItems()
                            {
                                DatePick         = item["Starttime"].ToString(),
                                DataValue        = Convert.ToDecimal(item["CountValue"].ToString()),
                                CoalDataValue    = Convert.ToDecimal(double.Parse(item["CountValue"].ToString()) * bsDatas.itemCode.ItemCoal),
                                Co2DataValue     = Convert.ToDecimal(double.Parse(item["CountValue"].ToString()) * bsDatas.itemCode.ItemCO2),
                                MoneyDataValue   = Convert.ToDecimal(double.Parse(item["CountValue"].ToString()) * bsDatas.itemCode.ItemMoney),
                                DataValueAndDept = item["CountValue"].ToString() + bsDatas.itemCode.Unit
                            });
                        }
                        bsDatas.device = DeviceObjectInfo;
                    }
                    bsDatas.Total = Convert.ToDecimal(tempCount);
                    bsDatas.ConvertDataValueList = new System.Collections.Hashtable();
                    bsDatas.ConvertDataValueList.Add("ITEMCOAL", Math.Round((tempCount * bsDatas.itemCode.ItemCoal), 4).ToString());
                    bsDatas.ConvertDataValueList.Add("ITEMCO2", Math.Round((tempCount * bsDatas.itemCode.ItemCO2), 4).ToString());
                    bsDatas.ConvertDataValueList.Add("ITEMMONEY", Math.Round((tempCount * bsDatas.itemCode.ItemCO2), 4).ToString());
                    Res.BaseLayerObjectResults.Add(
                        !IsDevice ? ObjectInfo.LayerObjectID.ToString() : DeviceObjectInfo.DeviceID.ToString(), bsDatas);
                }
                return(Res);
            }
            return(null);
        }
Beispiel #11
0
        public Dictionary <string, EnergyValueCost> GetSingleItemCodeValue(QueryCost query, List <Model.Itemcode> itemCodeList)
        {
            var model = new BaseQueryModel();

            model.IsDevice   = 0;
            model.areaType   = query.ObjType;
            model.ObjectList = new List <int>()
            {
                query.ObjectId
            };
            model.Unit = BaseTool.GetChartUnit((int)query.Particle - 1);

            if (model.Unit == ChartUnit.unit_month)
            {
                model.Starttime = Convert.ToDateTime(query.StartTime.ToString("yyyy-MM-1"));
                model.Endtime   = Convert.ToDateTime(query.EndTime.ToString("yyyy-MM-1"));
            }
            else
            {
                model.Starttime = query.StartTime;
                model.Endtime   = query.EndTime;
            }

            Dictionary <string, EnergyValueCost> tempConvert     = new Dictionary <string, EnergyValueCost>();
            Dictionary <string, EnergyValueCost> tempConvert4Day = new Dictionary <string, EnergyValueCost>();

            switch (model.Unit)
            {
            case ChartUnit.unit_month:
                for (DateTime i = model.Starttime; i <= model.Endtime.AddMonths(-1); i = i.AddMonths(1))
                {
                    tempConvert.Add(i.ToString("yyyy-MM-01"), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                for (DateTime i = DateTime.Parse(query.EndTime.ToString("yyyy-MM-01")); i <= query.EndTime; i = i.AddDays(1))
                {
                    tempConvert4Day.Add(i.ToString(("yyyy-MM-dd")), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                model.Endtime = query.EndTime.AddMonths(-1);
                break;

            case ChartUnit.unit_hour:
                for (DateTime i = model.Starttime; i < model.Endtime.AddDays(1); i = i.AddHours(1))
                {
                    tempConvert.Add(i.ToString("yyyy-MM-dd HH:00:00"), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                break;

            case ChartUnit.unit_day:
                for (DateTime i = model.Starttime; i <= model.Endtime; i = i.AddDays(1))
                {
                    tempConvert.Add(i.ToString(("yyyy-MM-dd")), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                break;
            }
            foreach (var item in itemCodeList)
            {
                decimal price = _accssCommon.GetFeePrice(item.ItemCodeNumber);
                model.ItemCode = item.ItemCodeNumber;
                GenerateEnergyValue(model, tempConvert, price);
                if (tempConvert4Day.Count > 0)
                {
                    model.Starttime = DateTime.Parse(query.EndTime.ToString("yyyy-MM-01"));
                    model.Endtime   = query.EndTime;
                    model.Unit      = ChartUnit.unit_day;
                    GenerateEnergyValue(model, tempConvert4Day, price);
                    EnergyValueCost temp = new EnergyValueCost()
                    {
                        EnergyCost  = tempConvert4Day.Sum(i => i.Value.EnergyCost),
                        EnergyValue = tempConvert4Day.Sum(i => i.Value.EnergyValue),
                    };

                    tempConvert.Add(query.EndTime.ToString("yyyy-MM-01"), temp);
                }
            }

            return(tempConvert);
        }
Beispiel #12
0
        public Dictionary <string, EnergyValueCost> GetSingleItemCodeValue_OLD(QueryCost query, List <Model.Itemcode> itemCodeList)
        {
            var model = new BaseQueryModel();

            model.IsDevice   = 0;
            model.ObjectList = new List <int>()
            {
                query.ObjectId
            };
            model.Unit = BaseTool.GetChartUnit((int)query.Particle - 1);

            if (model.Unit == ChartUnit.unit_month)
            {
                model.Starttime = Convert.ToDateTime(query.StartTime.ToString("yyyy-MM-1"));
                model.Endtime   = Convert.ToDateTime(query.EndTime.ToString("yyyy-MM-1"));
            }
            else
            {
                model.Starttime = query.StartTime;
                model.Endtime   = query.EndTime;
            }

            Dictionary <string, EnergyValueCost> tempConvert    = new Dictionary <string, EnergyValueCost>();
            Dictionary <string, EnergyValueCost> tempConvertDay = new Dictionary <string, EnergyValueCost>();

            switch (model.Unit)
            {
            case ChartUnit.unit_month:
                for (DateTime i = model.Starttime; i <= model.Endtime; i = i.AddMonths(1))
                {
                    tempConvert.Add(i.ToString("yyyy-MM-01"), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                break;

            case ChartUnit.unit_hour:
                for (DateTime i = model.Starttime; i < model.Endtime.AddDays(1); i = i.AddHours(1))
                {
                    tempConvert.Add(i.ToString("yyyy-MM-dd HH:00:00"), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                break;

            case ChartUnit.unit_day:
                for (DateTime i = model.Starttime; i <= model.Endtime; i = i.AddDays(1))
                {
                    tempConvert.Add(i.ToString(("yyyy-MM-dd")), new EnergyValueCost {
                        EnergyCost = 0, EnergyValue = 0
                    });
                }
                break;
            }
            foreach (var item in itemCodeList)
            {
                decimal price = _accssCommon.GetFeePrice(item.ItemCodeNumber);
                model.ItemCode = item.ItemCodeNumber;
                BaseResult resList = _reportBll.GetBaseEneryDataList(model, query.ObjType == AreaType.Liquid ? true : false);
                foreach (var r in resList.BaseLayerObjectResults)
                {
                    foreach (var rr in r.Value.Datas)
                    {
                        if (tempConvert.ContainsKey(rr.DatePick))
                        {
                            if (query.ItemCode == "00000")
                            {
                                tempConvert[rr.DatePick].EnergyValue += rr.CoalDataValue;
                                tempConvert[rr.DatePick].EnergyCost  += rr.CoalDataValue * price;
                            }
                            else
                            {
                                tempConvert[rr.DatePick].EnergyValue += rr.DataValue;
                                tempConvert[rr.DatePick].EnergyCost  += rr.DataValue * price;
                            }
                        }
                    }
                }
            }
            return(tempConvert);
        }
Beispiel #13
0
        public ResultOrder GetShopOrderNew(NTS.WEB.DataContact.QueryOrderObjects query)
        {
            try
            {
                string keyCatch = string.Empty;
                foreach (var q in query.AreaIdLst)
                {
                    keyCatch += q.ToString() + "_";
                }
                keyCatch += query.ItemCode + query.StartTime + query.EndTime + query.QueryType + query.ObjType;
                if (CacheHelper.GetCache(keyCatch) != null)
                {
                    return((ResultOrder)CacheHelper.GetCache(keyCatch));
                }

                VerifyPersonOrAreaExist(query);


                #region 返回对象定义
                ResultOrder resultOrder = new ResultOrder();
                resultOrder.lineHighChart = new LineHighChart()
                {
                    series =
                        new List <Series>()
                };
                resultOrder.lineHighChart.series.Add(new Series()
                {
                    data = new List <EneryHighChart>()
                });
                resultOrder.pieHighChart = new PieHighChart()
                {
                    series =
                        new List <Series>()
                };
                resultOrder.pieHighChart.series.Add(new Series()
                {
                    data = new List <EneryHighChart>()
                });

                resultOrder.OrderLst = new List <EnergyOrder>();
                #endregion

                List <Model.Itemcode> itemCodeList = new List <Model.Itemcode>();
                if (query.ItemCode == "00000")
                {                           //总能耗
                    itemCodeList     = new BLL.Itemcode().GetItemcodeList(" and ParentID=0 ", " order by ItemcodeID");
                    resultOrder.Unit = "T"; //标准煤单位
                }
                else
                {
                    itemCodeList = new BLL.Itemcode().GetItemcodeList(" and ItemCodeNumber='" + query.ItemCode + "'", " order by ItemcodeID");
                    if (itemCodeList.Count > 0)
                    {
                        resultOrder.Unit = itemCodeList[0].Unit;//单个分类分项单位
                    }
                }
                switch (query.QueryType)
                {
                case EnergyAnalyseQueryType.Convert2Co2:
                case EnergyAnalyseQueryType.Convert2Coal:
                    resultOrder.Unit = "T";     //标准煤单位
                    break;

                case EnergyAnalyseQueryType.Convert2Money:
                    resultOrder.Unit = "元";    //标准煤单位
                    break;
                }
                Dictionary <string, decimal> tempConvert       = new Dictionary <string, decimal>();
                Dictionary <string, int>     tempObjectConvert = new Dictionary <string, int>();
                var model = new BaseQueryModel();
                model.IsDevice   = 0;
                model.ObjectList = query.AreaIdLst;
                //model.Unit = GetUnit(query.StartTime, query.EndTime);
                model.Unit = BaseTool.GetChartUnit(query.Particle);

                if (model.Unit == ChartUnit.unit_month)
                {
                    model.Starttime = Convert.ToDateTime(query.StartTime.ToString("yyyy-MM-1"));
                    model.Endtime   = Convert.ToDateTime(query.EndTime.ToString("yyyy-MM-1"));
                }
                else
                {
                    model.Starttime = query.StartTime;
                    model.Endtime   = query.EndTime;
                }
                foreach (var item in itemCodeList)
                {
                    model.ItemCode = item.ItemCodeNumber;
                    BaseResult resList = reportBll.GetBaseEneryDataList(model, query.ObjType == AreaType.Liquid ? true : false);
                    if (resList == null)
                    {
                        continue;
                    }
                    foreach (var r in resList.BaseLayerObjectResults)
                    {
                        if (!tempConvert.ContainsKey(r.Value.baseLayerObject.LayerObjectName))
                        {
                            tempConvert.Add(r.Value.baseLayerObject.LayerObjectName, 0);
                        }
                        if (!tempObjectConvert.ContainsKey(r.Value.baseLayerObject.LayerObjectName))
                        {
                            tempObjectConvert.Add(r.Value.baseLayerObject.LayerObjectName, r.Value.baseLayerObject.LayerObjectID);
                        }
                        if (tempConvert.ContainsKey(r.Value.baseLayerObject.LayerObjectName))
                        {
                            if (query.ItemCode == "00000")
                            {//选择总能耗后把其他分类分项的能耗转化成标准煤
                                switch (query.QueryType)
                                {
                                case EnergyAnalyseQueryType.Default:                                        //默认总能耗
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString()); //
                                    break;

                                case EnergyAnalyseQueryType.UnitArea:    //单位面积能耗
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString()) /
                                        decimal.Parse(r.Value.baseLayerObject.AreaNum.ToString());
                                    break;

                                case EnergyAnalyseQueryType.UnitPerson:    //人均能耗
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString()) /
                                        decimal.Parse(r.Value.baseLayerObject.PersonNum.ToString());
                                    break;

                                case EnergyAnalyseQueryType.Convert2Coal:    //标准煤
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString());
                                    break;

                                case EnergyAnalyseQueryType.Convert2Co2:    //二氧化碳
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCO2"].ToString());
                                    break;

                                case EnergyAnalyseQueryType.Convert2Money:    //人民币
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMMONEY"].ToString());
                                    break;

                                default:
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString());//
                                    break;
                                }
                            }
                            else
                            {
                                switch (query.QueryType)
                                {
                                case EnergyAnalyseQueryType.Default:     //默认总能耗
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] += r.Value.Total;
                                    break;

                                case EnergyAnalyseQueryType.UnitArea:    //单位面积能耗
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        r.Value.Total /
                                        decimal.Parse(r.Value.baseLayerObject.AreaNum.ToString());
                                    break;

                                case EnergyAnalyseQueryType.UnitPerson:    //人均能耗
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        r.Value.Total /
                                        decimal.Parse(r.Value.baseLayerObject.PersonNum.ToString());
                                    break;

                                case EnergyAnalyseQueryType.Convert2Coal:    //标准煤
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString());
                                    break;

                                case EnergyAnalyseQueryType.Convert2Co2:    //二氧化碳
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMCO2"].ToString());
                                    break;

                                case EnergyAnalyseQueryType.Convert2Money:    //人民币
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                        decimal.Parse(r.Value.ConvertDataValueList["ITEMMONEY"].ToString());
                                    break;

                                default:
                                    tempConvert[r.Value.baseLayerObject.LayerObjectName] += r.Value.Total;
                                    break;
                                }
                            }
                        }
                    }
                }
                var tempAsc = from tt in tempConvert orderby tt.Value ascending select tt;//LineChart按照能耗值从低到高排序

                foreach (var tempConvertItem in tempAsc)
                {
                    resultOrder.lineHighChart.series[0].data.Add(new EneryHighChart()
                    {
                        name = tempConvertItem.Key,
                        id   = tempObjectConvert[tempConvertItem.Key].ToString(),
                        y    = decimal.Parse(tempConvertItem.Value.ToString("f2"))
                    });
                }

                var     tempDesc     = from tt in tempConvert orderby tt.Value descending select tt;//PieChart按照能耗值从高到低排序
                int     temppieindex = 1;
                decimal temppiecount = 0;
                foreach (var tempConvertItem in tempDesc)
                {
                    if (temppieindex < 6)
                    {
                        resultOrder.pieHighChart.series[0].data.Add(new EneryHighChart()
                        {
                            name = tempConvertItem.Key,
                            y    = decimal.Parse(tempConvertItem.Value.ToString("f2"))
                        });
                    }
                    else
                    {
                        temppiecount += decimal.Parse(tempConvertItem.Value.ToString("f2"));
                    }
                    temppieindex++;
                }
                if (temppieindex > 6)
                {
                    resultOrder.pieHighChart.series[0].data.Add(new EneryHighChart()
                    {
                        name = "其他",
                        y    = temppiecount
                    });
                }


                int order = 1;
                foreach (var tt in resultOrder.lineHighChart.series[0].data)
                {
                    resultOrder.OrderLst.Add(new EnergyOrder()
                    {
                        Order = order,
                        Tm    = model.Unit == ChartUnit.unit_hour ? query.StartTime.ToString("yyyy-MM-dd") : query.StartTime.ToString("yyyy-MM-dd") + "~" + query.EndTime.ToString("yyyy-MM-dd"),
                        Obj   = tt.name,
                        //ObjID=tempObjectConvert[tt.name],
                        Val     = tt.y,
                        EneType = itemCodeList.Count > 1 ? "总能耗" : itemCodeList[0].ItemCodeName
                    });
                    order++;
                }

                if (CacheHelper.GetCache(keyCatch) == null)
                {
                    CacheHelper.SetCache(keyCatch, resultOrder, 30);
                }
                return(resultOrder);
            }
            catch (Exception ee)
            {
                throw ee;
            }
        }
Beispiel #14
0
        public NTS.WEB.ResultView.ShopOrderResult GetShopOrder(NTS.WEB.DataContact.QueryOrder query)
        {
            string keyCatch = string.Empty;

            foreach (var q in query.ObjectNum)
            {
                keyCatch += q.ToString() + "_";
            }
            keyCatch += query.ItemCode + query.OrderWay + query.StartTime + query.EndTime + query.Particle;
            if (CacheHelper.GetCache(keyCatch) != null)
            {
                return(PaddingList((ShopOrderResult)CacheHelper.GetCache(keyCatch), query));
            }

            #region 定义区
            ShopOrderResult shopOrderResult = new ShopOrderResult();
            shopOrderResult.OrderList = new List <BaseOrder>();
            shopOrderResult.page      = new Padding();
            #endregion

            var ItemList  = new List <Model.Itemcode>();
            var shopOrder = new IndexShopOrder
            {
                TotalEneryOrderList = new List <EneryOrder>(),
                AreaEneryOrderList  = new List <EneryOrder>()
            };
            var shopOrderLast = new IndexShopOrder
            {
                TotalEneryOrderList = new List <EneryOrder>(),
                AreaEneryOrderList  = new List <EneryOrder>()
            };
            // var deepth = int.Parse(ConfigurationManager.AppSettings["ShopLevel"]);
            if (query.ItemCode == "00000")
            {
                ItemList = new BLL.Itemcode().GetItemcodeList(" and ParentID=0", " order by ItemcodeID");
            }
            else
            {
                ItemList = new BLL.Itemcode().GetItemcodeList(" and ItemCodeNumber='" + query.ItemCode + "'", " order by ItemcodeID");
            }
            List <string> ItemCodeStr = (from item in ItemList select item.ItemCodeNumber).ToList <string>();
            var           model       = new BaseQueryModel();
            model.IsDevice   = 0;
            model.ObjectList = query.ObjectNum;
            Dictionary <string, decimal> tempConvert     = new Dictionary <string, decimal>();
            Dictionary <string, decimal> tempAreaConvert = new Dictionary <string, decimal>();
            // decimal[] tempConvert = new decimal[objectList.Count];
            //  decimal[] tempAreaConvert = new decimal[objectList.Count];
            foreach (var item in ItemCodeStr)
            {
                model.ItemCode = item;
                model.Unit     = GetUnit(query.StartTime, query.EndTime);
                if (model.Unit == ChartUnit.unit_month)
                {
                    model.Starttime = Convert.ToDateTime(query.StartTime.ToString("yyyy-MM-1"));
                    model.Endtime   = Convert.ToDateTime(query.EndTime.ToString("yyyy-MM-1"));
                }
                else
                {
                    model.Starttime = query.StartTime;
                    model.Endtime   = query.EndTime;
                }
                var       resList = reportBll.GetBaseEneryDataList(model);
                const int order   = 1;
                foreach (var r in resList.BaseLayerObjectResults)
                {
                    if (tempConvert.ContainsKey(r.Value.baseLayerObject.LayerObjectName))
                    {
                        if (query.ItemCode == "00000")
                        {
                            tempConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString());
                            tempAreaConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString()) /
                                decimal.Parse(r.Value.baseLayerObject.AreaNum.ToString());
                        }
                        else
                        {
                            tempConvert[r.Value.baseLayerObject.LayerObjectName]     += r.Value.Total;
                            tempAreaConvert[r.Value.baseLayerObject.LayerObjectName] +=
                                r.Value.Total /
                                decimal.Parse(r.Value.baseLayerObject.AreaNum.ToString());
                        }
                    }
                    else
                    {
                        if (query.ItemCode == "00000")
                        {
                            tempConvert.Add(r.Value.baseLayerObject.LayerObjectName,
                                            decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString()));
                            tempAreaConvert.Add(r.Value.baseLayerObject.LayerObjectName,
                                                decimal.Parse(r.Value.ConvertDataValueList["ITEMCOAL"].ToString()) /
                                                decimal.Parse(r.Value.baseLayerObject.AreaNum.ToString()));
                        }
                        else
                        {
                            tempConvert.Add(r.Value.baseLayerObject.LayerObjectName,
                                            r.Value.Total);
                            tempAreaConvert.Add(r.Value.baseLayerObject.LayerObjectName,
                                                r.Value.Total /
                                                decimal.Parse(r.Value.baseLayerObject.AreaNum.ToString()));
                        }
                    }

                    shopOrder.TotalEneryOrderList.Add(new EneryOrder()
                    {
                        BuildingName = r.Value.baseLayerObject.LayerObjectName,
                        EneryValue   = double.Parse(tempConvert[r.Value.baseLayerObject.LayerObjectName].ToString("f2")),
                        OrderNum     = order
                    });


                    shopOrder.AreaEneryOrderList.Add(new EneryOrder()
                    {
                        BuildingName = r.Value.baseLayerObject.LayerObjectName,
                        EneryValue   = double.Parse(tempAreaConvert[r.Value.baseLayerObject.LayerObjectName].ToString("f2")),
                        OrderNum     = order
                    });
                }
            }

            var res1 = from p in shopOrder.TotalEneryOrderList group p by p.BuildingName into g select new { g.Key, BuildingName = g.Max(p => p.BuildingName), OrderNum = g.Max(p => p.OrderNum), EneryValue = g.Max(p => p.EneryValue) };
            var res2 = from p in shopOrder.AreaEneryOrderList group p by p.BuildingName into g select new { g.Key, BuildingName = g.Max(p => p.BuildingName), OrderNum = g.Max(p => p.OrderNum), EneryValue = g.Max(p => p.EneryValue) };

            foreach (var c in res1)
            {
                shopOrderLast.TotalEneryOrderList.Add(new EneryOrder {
                    BuildingName = c.BuildingName, EneryValue = c.EneryValue, OrderNum = c.OrderNum
                });
            }

            foreach (var c in res2)
            {
                shopOrderLast.AreaEneryOrderList.Add(new EneryOrder {
                    BuildingName = c.BuildingName, EneryValue = c.EneryValue, OrderNum = c.OrderNum
                });
            }
            int record = shopOrderLast.TotalEneryOrderList.Count;
            shopOrderResult.page = new Padding()
            {
                Current = query.PageCurrent,
                Total   = (record % query.PageSize == 0) ? record / query.PageSize : record / query.PageSize + 1
            };
            int orders = 1;
            if (query.Particle == "total")
            {
                foreach (var r in shopOrderLast.TotalEneryOrderList)
                {
                    shopOrderResult.OrderList.Add(new BaseOrder()
                    {
                        Energy = decimal.Parse(r.EneryValue.ToString("f2")),
                        Id     = orders,
                        Title  = r.BuildingName,
                        Units  = query.ItemCode == "00000" ? "T" : ItemList[0].Unit
                    });
                    orders++;
                }
            }
            else
            {
                foreach (var r in shopOrderLast.AreaEneryOrderList)
                {
                    shopOrderResult.OrderList.Add(new BaseOrder()
                    {
                        Energy = decimal.Parse(r.EneryValue.ToString("f2")),
                        Id     = r.OrderNum,
                        Title  = r.BuildingName,
                        Units  = query.ItemCode == "00000" ? "T" : ItemList[0].Unit
                    });
                }
            }

            if (CacheHelper.GetCache(keyCatch) == null)
            {
                CacheHelper.SetCache(keyCatch, shopOrderResult);
            }
            return(PaddingList(shopOrderResult, query));
        }
Beispiel #15
0
        /// <summary>
        /// 获得人均能耗值
        /// </summary>
        /// <param name="query"></param>
        /// <param name="itemcode"></param>
        /// <param name="time"></param>
        /// <param name="isCoal"></param>
        /// <returns></returns>
        public Dictionary <string, decimal> GetPersonNumSingleItemCodeByObject(QueryContrastPeriods query, string itemcode, TimePeriod time, int isCoal)
        {
            // var result = new ResultIndexLineChart { DatePick = new List<string>(), DatePickEnery = new List<decimal>() };
            var eneryDataList = new Dictionary <string, decimal>();
            var model         = new BaseQueryModel();

            List <Model.BaseLayerObject> objectList = new List <Model.BaseLayerObject>();

            if (query.ObjType == AreaType.Area)
            {
                objectList = new NTS.WEB.BLL.BaseLayerObject().GetBaseLayerObjectList(string.Format(" and layerobjectid={0}", query.AreaId), " order by LayerObjectID");
            }
            else
            {
                objectList = new NTS.WEB.BLL.BaseLayerObject().GetBaseFuncLayerObjectList(string.Format(" and layerobjectid={0}", query.AreaId), " order by LayerObjectID");
            }
            model.IsDevice   = 0;
            model.ObjectList = (from p in objectList select p.LayerObjectID).ToList <int>();
            model.ItemCode   = itemcode;
            model.Unit       = BaseTool.GetChartUnit(query.particle);
            model.Starttime  = time.StartTime;
            model.Endtime    = time.EndTime;
            model.areaType   = query.ObjType;

            var resList = _energCon.GetBaseEneryDataListNew(model);

            for (int iCount = 0; iCount < query.PeriodLst.Count; iCount++)
            {
                TimePeriod tpTime = query.PeriodLst[iCount];
            }
            foreach (var d in objectList.SelectMany(o => resList.BaseLayerObjectResults[o.LayerObjectID.ToString(CultureInfo.InvariantCulture)].Datas))
            {
                if (!eneryDataList.ContainsKey(d.DatePick))
                {
                    switch (query.QueryType)
                    {
                    case QueryOrderType.CarbanOut:
                        eneryDataList.Add(d.DatePick, d.Co2DataValue);
                        break;

                    case QueryOrderType.ConvCoal:
                        eneryDataList.Add(d.DatePick, d.CoalDataValue);
                        break;

                    case QueryOrderType.Renminbi:
                        eneryDataList.Add(d.DatePick, d.MoneyDataValue);
                        break;

                    default:
                        eneryDataList.Add(d.DatePick, d.DataValue);
                        break;
                    }
                }
                else
                {
                    eneryDataList[d.DatePick] += isCoal == 0 ? d.DataValue : d.CoalDataValue;
                    switch (query.QueryType)
                    {
                    case QueryOrderType.CarbanOut:
                        eneryDataList[d.DatePick] += d.Co2DataValue;
                        break;

                    case QueryOrderType.ConvCoal:
                        eneryDataList[d.DatePick] += d.CoalDataValue;
                        break;

                    case QueryOrderType.Renminbi:
                        eneryDataList[d.DatePick] += d.MoneyDataValue;
                        break;

                    default:
                        eneryDataList[d.DatePick] += d.DataValue;
                        break;
                    }
                }
            }

            //foreach (var e in eneryDataList)
            //{
            //    result.DatePick.Add(e.Key);
            //    result.DatePickEnery.Add(e.Value);
            //}
            return(eneryDataList);
        }
Beispiel #16
0
        //// static int AreaExtLevel = int.Parse(ConfigurationManager.AppSettings["AreaExtLevel"]);
        // public DataTable GetItemcodeData(ReportQueryModel model)
        // {
        //     int objectid;
        //     decimal total = 0;
        //     DataTable dt = TableViews.BaseTable.CreateBaseDataTable();
        //     if (!new CommDataTool().ObjectIsConfig(model,out objectid))
        //     {
        //         return null;
        //     }
        //     try
        //     {
        //         string objectname = Getobjectname(model.Objectid);
        //         string itemcodename = Getitemcodename(model.Itemcode);
        //         BaseDataModel DataModel = new BaseDataModel();
        //         DataModel.Starttime = model.Startime;
        //         DataModel.Endtime = model.Endtime;
        //         DataModel.ObjectId = objectid;
        //         DataModel.ReportClass = model.Unit;
        //         #region 处理加工

        //         //DataTable dtdata = DataComm.GetBaseData(DataModel);
        //         DataTable dtdata = BigDataComm.GetBaseData(DataModel);

        //         if (dtdata.Rows.Count > 0)
        //         {
        //             for (int i = 0; i < dtdata.Rows.Count; i++)
        //             {
        //                 DataRow dr = dt.NewRow();
        //                 dr[1] = CommDataTool.FormatDate(dtdata.Rows[i]["Starttime"].ToString(), model.Unit);
        //                 dr[2] = model.Objectid;
        //                 dr[3] = objectname;
        //                 dr[4] = dtdata.Rows[i]["Starttime"].ToString();
        //                 dr[5] = dtdata.Rows[i]["endtime"].ToString();
        //                 dr[6] = itemcodename;
        //                 dr[7] = decimal.Round(decimal.Parse(dtdata.Rows[i]["CountValue"].ToString()), 2);
        //                 total += decimal.Parse(dr[7].ToString());
        //                 dt.Rows.Add(dr);
        //             }
        //             DataRow totaldr = dt.NewRow();
        //             totaldr[1] = CommDataTool.FormatDate(dtdata.Rows[0]["Starttime"].ToString(), model.Unit) + "-" +
        //                          CommDataTool.FormatDate(dtdata.Rows[dtdata.Rows.Count - 1]["Starttime"].ToString(),
        //                                                  model.Unit);
        //             totaldr[2] = model.Objectid;
        //             totaldr[3] = objectname;
        //             totaldr[4] = "-";
        //             totaldr[5] = "-";
        //             totaldr[6] = itemcodename;
        //             totaldr[7] = decimal.Round(total, 2).ToString();
        //             dt.Rows.Add(totaldr);
        //         }

        //         #endregion

        //         return dt;
        //     }
        //     catch (Exception e)
        //     {
        //         return null;
        //     }
        // }


        // /// <summary>
        // /// 根据分类分项集合,对象集合,以及查询量获取所有的数据
        // /// </summary>
        // /// <param name="ItemcodeArr">分类分项集合</param>
        // /// <param name="ObjectArr">对象集合</param>
        // /// <param name="model">查询量实体类</param>
        // /// <returns></returns>
        // public DataTable GetManayObjectAndItemcodeData(string[] ItemcodeArr, string[] ObjectArr, ReportQueryModel model)
        // {
        //     StringBuilder countidArr = new StringBuilder();
        //     countidArr = new CommDataTool().GetTrueCountID(ItemcodeArr, ObjectArr, model);
        //     if (string.IsNullOrEmpty(countidArr.ToString()))
        //     {
        //         return null;
        //     }
        //     try
        //     {
        //         BaseMDataModel MDataModel = new BaseMDataModel();
        //         MDataModel.Starttime = model.Startime;
        //         MDataModel.Endtime = model.Endtime;
        //         MDataModel.ObjectId = countidArr.ToString().Substring(1);

        //         #region 处理加工

        //        // DataTable dtdata = DataComm.GetBOMBaseData(MDataModel);
        //         DataTable dtdata = BigDataComm.GetBomBaseData(MDataModel);
        //         return dtdata;

        //         #endregion
        //     }
        //     catch (Exception)
        //     {
        //         return null;
        //     }

        // }

        // /// <summary>
        // ///
        // /// </summary>
        // /// <param name="model"></param>
        // /// <returns></returns>

        // public DataTable GetItemcodeDataOnlyTotal(ReportQueryModel model)
        // {
        //     int objectid;
        //     decimal total = 0;
        //     DataTable dt = TableViews.BaseTable.CreateBaseDataTable();
        //     if (!new CommDataTool().ObjectIsConfig(model, out objectid))
        //     {
        //         return null;
        //     }
        //     try
        //     {
        //         string objectname = Getobjectname(model.Objectid);
        //         string itemcodename = Getitemcodename(model.Itemcode);
        //         BaseDataModel DataModel = new BaseDataModel();
        //         DataModel.Starttime = model.Startime;
        //         DataModel.Endtime = model.Endtime;
        //         DataModel.ObjectId = objectid;
        //         DataModel.ReportClass = model.Unit;
        //         #region 处理加工

        //         //DataTable dtdata = DataComm.GetBaseData(DataModel);
        //         DataTable dtdata = BigDataComm.GetBaseData(DataModel);

        //         if (dtdata.Rows.Count > 0)
        //         {
        //             DataRow totaldr = dt.NewRow();
        //             decimal _total = 0;
        //             foreach (DataRow dr in dtdata.Rows)
        //             {
        //                // _total += decimal.Parse(dr[0].ToString()); 大数据量时修改
        //                 _total += decimal.Parse(dr["CountValue"].ToString());
        //             }
        //             totaldr[7] = decimal.Round(_total,2).ToString();
        //             dt.Rows.Add(totaldr);
        //         }

        //         #endregion

        //         return dt;
        //     }
        //     catch (Exception e)
        //     {
        //         return null;
        //     }
        // }

        // /// <summary>
        // /// 获取子分项的能耗值
        // /// </summary>
        // /// <param name="model"></param>
        // /// <param name="recordCount"></param>
        // /// <returns></returns>
        // public DataTable GetSmallItemcodeData(ReportQueryModel model, out int recordCount)
        // {
        //     DataTable ChildTableAll = new DataTable();
        //     DataTable TempTable = new DataTable();
        //     recordCount = 0;
        //     DataTable itemdt =
        //         GetItemcodeList(model.Itemcode);
        //     if (itemdt.Rows.Count > 0)
        //     {
        //         DataTable dtnew = TableViews.BaseTable.CreateSmallItemCodeDataTable(itemdt);

        //         for (int i = 0; i < itemdt.Rows.Count; i++)
        //         {
        //             ReportQueryModel newmodel = new ReportQueryModel();
        //             newmodel.Endtime = model.Endtime;
        //             newmodel.Startime = model.Startime;
        //             newmodel.Objectid = model.Objectid;
        //             newmodel.Itemcode = int.Parse(itemdt.Rows[i]["itemcodeid"].ToString());
        //             newmodel.Unit = model.Unit;
        //             DataTable ChildTable = GetItemcodeData(newmodel);
        //             if (ChildTable == null) { return null; }
        //             if (i == 0)
        //             {
        //                 recordCount = ChildTable.Rows.Count;
        //                 ChildTableAll = ChildTable.Copy();
        //                 TempTable = ChildTable;
        //             }
        //             else
        //             {
        //                 // 获取总共的记录数
        //                 ChildTableAll = Common.DataTool.UniteDataTable(ChildTableAll, ChildTable);
        //             }
        //         }

        //         for (int j = 0; j < TempTable.Rows.Count; j++)
        //         {
        //             DataRow dr = dtnew.NewRow();
        //             dr[1] = TempTable.Rows[j][1].ToString();//Date
        //             dr[2] = TempTable.Rows[j][2].ToString();//ObjectID
        //             dr[3] = TempTable.Rows[j][3].ToString();//ObjectName
        //             dr[4] = TempTable.Rows[j][4].ToString();//Starttime
        //             dr[5] = TempTable.Rows[j][5].ToString();//Endtime
        //             for (int k = 0; k < itemdt.Rows.Count; k++)
        //             {
        //                 string date = TempTable.Rows[j][1].ToString();
        //                 string ItemCode = itemdt.Rows[k]["itemcodeid"].ToString();
        //                 DataRow[] drs = ChildTableAll.Select(string.Format(" Date='{0}' and ItemCode='{1}'", date, ItemCode));
        //                 dr[k + 6] = drs.Length > 0 ? drs[0]["EneryValue"].ToString() : "0.00";
        //             }

        //             dtnew.Rows.Add(dr);
        //         }
        //         return dtnew;

        //     }
        //     return null;
        // }


        // #region 基础方法
        // /// <summary>
        // /// 获取对象的名称
        // /// </summary>
        // /// <param name="oid"></param>
        // /// <returns></returns>
        // public string Getobjectname(string oid)
        // {
        //     SqlParameter[] parameter = {
        //                                     new SqlParameter("@layerobjectid", SqlDbType.Int)
        //                                 };
        //     parameter[0].Value = int.Parse(oid);

        //     DataTable Dtobject = new BaseLayerObject().GetList(" layerobjectid=@layerobjectid ", "layerobjectid", parameter);
        //     if (Dtobject.Rows.Count > 0)
        //     {
        //         return Dtobject.Rows[0]["layerobjectname"].ToString();
        //     }
        //     return string.Empty;
        // }

        // public string Getitemcodename(int oid)
        // {
        //     SqlParameter[] parameter = {
        //                                     new SqlParameter("@itemcodeid", SqlDbType.Int)
        //                                 };
        //     parameter[0].Value = oid;

        //     DataTable DtItemcode = new Itemcode().GetList(" itemcodeid=@itemcodeid ", "itemcodeid", parameter);
        //     if (DtItemcode.Rows.Count > 0)
        //     {
        //         return DtItemcode.Rows[0]["itemcodename"].ToString();
        //     }
        //     return string.Empty;
        // }

        // public DataTable GetItemcodeList(int parentid)
        // {
        //     SqlParameter[] parameter = {
        //                                     new SqlParameter("@parentid", SqlDbType.Int)
        //                                 };
        //     parameter[0].Value = parentid;

        //     DataTable DtItemcode = new Itemcode().GetList(" parentid=@parentid ", "itemcodeid", parameter);
        //     return DtItemcode;
        // }


        // /// <summary>
        // /// 计算对象属性的单位能耗值
        // /// </summary>
        // /// <param name="values">能耗值</param>
        // /// <param name="classid">属性类型id</param>
        // /// <param name="objectid">对象id</param>
        // /// <returns></returns>
        // private static string GetPerData(string values, int classid, string objectid)
        // {

        //     decimal attribute = new BaseLayerObject().GetBaseLayerObjectCommAttribute(objectid, classid);
        //     if (attribute > 0)
        //     {
        //         return decimal.Round(decimal.Parse(values) / attribute, 2).ToString();
        //     }
        //     return "0.00";

        // }
        // #endregion

        // /// <summary>
        // /// 返回区域属性需要的单位能耗数据集
        // /// </summary>
        // /// <param name="Report"></param>
        // /// <returns></returns>
        // public  DataTable GetPerDataJson(DataTable Report)
        // {
        //     DataTable DtPerReport = TableViews.BaseTable.CreatePerTable(AreaExtLevel);
        //     for (int i = 0; i < Report.Rows.Count; i++)
        //     {
        //         DataRow dr = DtPerReport.NewRow();
        //         for (int k = 1; k < 8;k++ )
        //         {
        //             dr[k] = Report.Rows[i][k].ToString();
        //         }

        //         for (int j = 0; j < AreaExtLevel; j++)
        //         {

        //             dr[8 + j] =
        //                 decimal.Round(
        //                     decimal.Parse(GetPerData(Report.Rows[i][7].ToString(), j + 1,
        //                                              Report.Rows[i][2].ToString())), 2).ToString();

        //         }
        //         DtPerReport.Rows.Add(dr);

        //     }
        //     return DtPerReport;
        // }

        public BaseResult GetBaseEneryDataList(BaseQueryModel model)
        {
            return(BigDataComm.GetBaseEneryDataList(model));
        }
Beispiel #17
0
 public BaseResult GetBaseEneryDataListNew(BaseQueryModel model)
 {
     return(EnergyContrastCommon.GetBaseEneryDataListNew(model));
 }