/// <summary>
        /// 显示柱状图
        /// </summary>
        /// <param name="itemName"></param>
        /// <param name="chartObject"></param>
        /// <param name="chartDept"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        public static ResultContrast IndexPeriodsContrastObjsChart(QueryContrastPeriods query, string areaName, string[] chartObject, string chartDept, Dictionary<string, List<decimal>> dir)
        {
            //表格数据定义
            List<EnergyContrst> enerList = new List<EnergyContrst>();

            ResultContrast contrast = new ResultContrast();
            ExecuteProcess execu = new ExecuteProcess();
            if (chartObject.Length == 0)
            {
                execu.Success = false;
                execu.ExceptionMsg = "暂无数据信息";
                execu.ActionName = "";
                execu.ActionUser = "";
                execu.ActionTime = System.DateTime.Now;
            }
            else
            {
                execu.Success = true;
                execu.ExceptionMsg = "";
            }

            string sql = " and ItemCodeNumber = '" + query.ItemCode + "'";
            List<NTS.WEB.Model.Itemcode> itemList = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                 .GetItemCodeList(sql, "");

            contrast.ActionInfo = execu;

            #region 数据series
            LineJson lineJson = new LineJson();
            List<EneryCompare> compareList = new List<EneryCompare>();

            #endregion

            int Index = 0;
            StringBuilder chartNew = new StringBuilder();
            {
                foreach (var d in dir)
                {
                    EnergyContrst ener = new EnergyContrst();

                    EneryCompare compareItem = new EneryCompare();

                    if (itemList.Count == 0)
                    {
                        ener.EneType = "总能耗";
                    }
                    else
                    {
                        ener.EneType = itemList[0].ItemCodeName;
                    }

                    ener.Obj = areaName;

                    ener.Tm = GetTimeTitleByStartTimeAndEndTime(query.PeriodLst[Index].StartTime, query.PeriodLst[Index].EndTime);
                    ener.Val = Math.Round(d.Value.Sum(), 2);

                    // 取小数点后2位
                    List<decimal> dirValue = new List<decimal>();
                    foreach (var item in d.Value)
                    {
                        dirValue.Add(Math.Round(item, 2));
                    }
                    compareItem.name = ener.Tm;
                    compareItem.data = dirValue;

                    compareList.Add(compareItem);

                    enerList.Add(ener);
                    Index++;
                }

                lineJson.Unit = chartDept;
                contrast.Unit = chartDept;

                lineJson.CompareType = "periods";
                contrast.ContrastLst = enerList; // 表格数据。

                lineJson.series = compareList;
                contrast.lineJson = lineJson;

                //lineJson.series =
                return contrast;
            }
        }
        public static ResultContrast ShowEnergyAnalyseLineChart(QueryAnalyse queryAnalyse, string[] chartObject, string[] chartDept, Dictionary<string, List<decimal>> dir)
        {
            //表格数据定义
            List<EnergyContrst> enerList = new List<EnergyContrst>();

            ResultContrast contrast = new ResultContrast();
            ExecuteProcess execu = new ExecuteProcess();
            if (chartObject.Length == 0)
            {
                execu.Success = false;
                execu.ExceptionMsg = "暂无数据信息";
                execu.ActionName = "";
                execu.ActionUser = "";
                execu.ActionTime = System.DateTime.Now;
            }
            else
            {
                execu.Success = true;
                execu.ExceptionMsg = "";
            }

            string sql = " and ItemCodeNumber = '" + queryAnalyse.ItemCode + "'";
            List<NTS.WEB.Model.Itemcode> itemList = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                 .GetItemCodeList(sql, "");

            contrast.ActionInfo = execu;

            #region 数据series
            LineJson lineJson = new LineJson();
            List<EneryCompare> compareList = new List<EneryCompare>();
            #endregion

            int Index = 0;
            StringBuilder chartNew = new StringBuilder();
            {
                foreach (var d in dir)
                {

                    EnergyContrst ener = new EnergyContrst();

                    EneryCompare compareItem = new EneryCompare();

                    if (itemList.Count == 0)
                    {
                        ener.EneType = "总能耗";
                    }
                    else
                    {
                        ener.EneType = itemList[0].ItemCodeName;
                    }

                    ener.Obj = d.Key;
                    ener.Tm = queryAnalyse.StartTime.ToString();
                    ener.Val = Math.Round(d.Value.Sum(), 2);

                    compareItem.name = d.Key;
                    compareItem.data = d.Value;
                    compareList.Add(compareItem);

                    enerList.Add(ener);
                    Index++;
                }
                if (chartDept.Length > 0)
                {
                    lineJson.Unit = chartDept[0];
                    contrast.Unit = chartDept[0];
                }
                lineJson.CompareType = "object";

                contrast.ContrastLst = enerList; // 表格数据。

                lineJson.series = compareList;
                contrast.lineJson = lineJson;

                //lineJson.series =
                return contrast;
            }
        }
        public ResultContrast IndexContrastObjsChart()
        {
            try
            {
                var inputValue = _ntsPage.Request["inputs"]; ;
                var oderObject = Newtonsoft.Json.JsonConvert.DeserializeObject<QueryOrderObjects>(inputValue);

                QueryCompare query = new QueryCompare();
                query.StartTime = oderObject.StartTime;
                query.EndTime = oderObject.EndTime;
                query.ObjectNum = oderObject.AreaIdLst;
                query.ItemCode = oderObject.ItemCode;
                query.ObjType = oderObject.ObjType;
                query.Unit = oderObject.Particle;

                if (oderObject.AreaIdLst.Count <= 1)
                {
                    throw new Exception("请选择多个对象进行比较!");
                }

                EnergyAnalyseQueryType typeItemCode = oderObject.QueryType;
                var result = new ResultCompare();
                switch (oderObject.QueryType)
                {
                    case EnergyAnalyseQueryType.Default:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                      .GetCompareChart(oderObject);
                        break;

                    case EnergyAnalyseQueryType.UnitArea:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                      .GetAreaCompareChart(oderObject);
                        break;

                    case EnergyAnalyseQueryType.UnitPerson:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                     .GetPersonNumCompareChart(oderObject); ;
                        break;
                    default:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                     .GetCompareChart(oderObject);
                        break;
                }
                string strDepName = "";
                if (result.Dept.Count > 0)
                {
                    strDepName = result.Dept[0].ToString();
                }
                else
                {
                    throw new Exception("没有数据信息");
                }

                switch (oderObject.QueryType)
                {
                    case EnergyAnalyseQueryType.Convert2Co2:
                        strDepName = "T";
                        break;
                    case EnergyAnalyseQueryType.Convert2Coal:
                        strDepName = "T";
                        break;
                    case EnergyAnalyseQueryType.Convert2Money:
                        strDepName = "元";
                        break;
                }

                return JsonForHightChartsNew.IndexContrastObjsChart(query, "对比柱状图", result.ObjectName.ToArray(), strDepName,
                  result.Enery);
            }
            catch (Exception ex)
            {
                ResultContrast con = new ResultContrast();
                ExecuteProcess process = new ExecuteProcess();
                process.ExceptionMsg = ex.Message;
                process.Success = false;
                con.ActionInfo = process;
                return con;
            }
        }
        public ResultContrast IndexContrastPeriodsChart()
        {
            try
            {
                var inputValue = _ntsPage.Request["inputs"]; ;
                var query = Newtonsoft.Json.JsonConvert.DeserializeObject<QueryContrastPeriods>(inputValue);

                var result = new ResultCompare();
                switch (query.QueryType)
                {
                    case QueryOrderType.Default:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                      .GetPeriodsCompareChart(query);
                        break;
                    case QueryOrderType.UnitArea:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                      .GetAreaPeriodsCompareChart(query);
                        break;

                    case QueryOrderType.UnitPerson:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                     .GetPersonNumPeriodsCompareChart(query); ;
                        break;
                    default:
                        result = Framework.Common.BaseWcf.CreateChannel<ServiceInterface.IEnergyContrastService>("EnergyContrastService")
                                      .GetPeriodsCompareChart(query);
                        break;

                }

                string strAreaName = "";
                var listObject = dal.GetBaseLayerObjectList(" and layerobjectid = " + query.AreaId, "");
                if (listObject.Count > 0)
                {
                    strAreaName = listObject[0].LayerObjectName;
                }
                string strDepName = "";
                if (result.Dept.Count > 0)
                {
                    strDepName = result.Dept[0].ToString();
                }
                else
                {
                    throw new Exception("没有数据信息");
                }

                switch (query.QueryType)
                {
                    case QueryOrderType.CarbanOut:
                        strDepName = "T";
                        break;
                    case QueryOrderType.ConvCoal:
                        strDepName = "T";
                        break;
                    case QueryOrderType.Renminbi:
                        strDepName = "元";
                        break;
                }
                return JsonForHightChartsNew.IndexPeriodsContrastObjsChart(query, strAreaName, result.ObjectName.ToArray(), strDepName,
                  result.Enery);
            }
            catch (Exception ex)
            {
                ResultContrast con = new ResultContrast();
                ExecuteProcess process = new ExecuteProcess();
                process.ExceptionMsg = ex.Message;
                process.Success = false;
                con.ActionInfo = process;
                return con;
            }
        }
        public ResultContrast IndexContrastChart()
        {
            ResultContrast refResutl = new ResultContrast();
            try
            {
                int inputValue = int.Parse(_ntsPage.Request["cType"]);
                switch (inputValue)
                {
                    case 1:
                        refResutl = IndexContrastObjsChart();
                        break;
                    case 2:
                        refResutl = IndexContrastPeriodsChart();
                        break;
                    default:
                        break;
                }
            }
            catch (Exception ex)
            {
                ResultContrast con = new ResultContrast();
                ExecuteProcess process = new ExecuteProcess();
                process.ExceptionMsg = ex.Message;
                process.Success = false;
                con.ActionInfo = process;
                return con;

            }
            return refResutl;
        }