Beispiel #1
0
        /// <summary>
        /// 有多少个小格存在于大格中
        /// </summary>
        /// <returns></returns>
        public DataTable htgetsmallExistBig(Hashtable ht, List <clsPoi> clsPoi)
        {
            try
            {
                DataTable dt1 = new DataTable();

                dt1.Columns.Add(new DataColumn("col"));
                dt1.Columns.Add(new DataColumn("row"));
                dt1.Columns.Add(new DataColumn("voice_call_num"));
                dt1.Columns.Add(new DataColumn("data_call_num"));
                dt1.Columns.Add(new DataColumn("voice_drop_num"));
                dt1.Columns.Add(new DataColumn("data_drop_num"));
                dt1.Columns.Add(new DataColumn("DODATA_CALL_NUM"));

                foreach (clsPoi t in clsPoi)
                {
                    //遍历查找功能函数。确定有多少格子在这个大格子中(callnum;dropnum)
                    clsResult cls = new clsResult();
                    cls.LsData = new List <clsData>();
                    clsPoi clsP = t as clsPoi;
                    if (ht.ContainsKey(clsP.longitudeandlatitude))
                    {
                        clsData newcls = ht[clsP.longitudeandlatitude] as clsData;
                        if (newcls == null)
                        {
                            continue;
                        }

                        DataRow dr = dt1.NewRow();
                        dr["col"] = clsP.Column;
                        dr["row"] = clsP.Row;

                        dr["voice_call_num"]  = newcls.Voice_call_num;
                        dr["data_call_num"]   = newcls.Data_call_num;
                        dr["voice_drop_num"]  = newcls.Voice_drop_num;
                        dr["data_drop_num"]   = newcls.Data_drop_num;
                        dr["DODATA_CALL_NUM"] = newcls.DODATA_CALL_NUM;
                        dt1.Rows.Add(dr);
                    }
                }
                return(dt1);
            }
            catch (Exception ex)
            {
                clsTool.WriteLog(ex.Message + ex.StackTrace, "getsmallExistBig大格子里有多少个小格子");
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        ///得到经纬度的DataTabel
        /// </summary>
        /// <param name="CITY_ID"></param>
        /// <param name="strTime"></param>
        /// <returns></returns>
        public Hashtable htdtDo(int CITY_ID, string strTime)
        {
            Hashtable ht = new Hashtable();

            try
            {
                DataTable dt = new DataTable();
                strSQL = string.Format(@"select key,
                                        sum(nvl(dodata_call_num,0)) as dodata_call_num
                                        from (select longitude * 100 || latitude * 100 key,
                                        dodata_call_num
                                        from (select trunc(to_number(substr(GRID_ID, length(GRID_ID) - 4, 5)) / 1000,
                                                     2.1) as latitude,
                                               trunc(to_number(substr(grid_id, 0, length(grid_id) - 5)) / 1000,
                                                     2.1) as longitude,
                                               t.dodata_call_num
                                          from mod_cdl_do_grid t
                                         where city_id={0} and {1}
                                         order by longitude))
                                        group by key", CITY_ID, strTime);
                dt     = NOAP.CommonDB.DBAcess.Instance().GetDataTable(strSQL);
                foreach (DataRow dr in dt.Rows)
                {
                    clsData cls = new clsData();
                    if (dr["dodata_call_num"] != null && dr["dodata_call_num"].ToString() != "")
                    {
                        cls.DODATA_CALL_NUM = Convert.ToSingle(dr["dodata_call_num"]);
                    }
                    else
                    {
                        cls.DODATA_CALL_NUM = 0;
                    }

                    string strkey = dr["key"].ToString().Trim();
                    if (!ht.ContainsKey(strkey))
                    {
                        ht.Add(strkey, cls);
                    }
                }
                return(ht);
            }

            catch (Exception ex)
            {
                return(ht);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 有多少个小格存在于大格中
        /// </summary>
        /// <returns></returns>
        public DataTable getNewsmallExistBig(DataTable dt, string[,] array, int XLength, int YLength, int city_id)
        {
            string    result    = string.Empty;
            float     longitude = 0f;
            float     latitude  = 0f;
            DataTable dt1       = new DataTable();

            for (int i = 0; i < XLength; i++)
            {
                for (int j = 0; j < YLength; j++)
                {
                    result = array[i, j];
                    string[] arr = result.Split('|');

                    longitude = Convert.ToSingle(arr[0]);
                    latitude  = Convert.ToSingle(arr[1]);

                    longitude = longitude * 1000;
                    latitude  = latitude * 1000;

                    //遍历查找功能函数。确定有多少格子在这个大格子中(callnum;dropnum)
                    clsResult cls = new clsResult();
                    foreach (DataRow dr in dt.Rows)
                    {
                        if (dr["longitude"] == null || dr["longitude"].ToString() == string.Empty)
                        {
                            continue;
                        }
                        float smalllongitude = Convert.ToSingle(dr["longitude"].ToString());  //取的经度
                        if (dr["latitude"] == null || dr["latitude"].ToString() == string.Empty)
                        {
                            continue;
                        }
                        float smalllatitude = Convert.ToSingle(dr["latitude"].ToString());   //取的纬度
                        if (dr["callnum"] == null || dr["callnum"].ToString() == string.Empty)
                        {
                            continue;
                        }
                        float callnum = Convert.ToSingle(dr["callnum"]);
                        if (dr["callnum"] == null || dr["callnum"].ToString() == string.Empty)
                        {
                            continue;
                        }
                        float dropnum = Convert.ToSingle(dr["dropnum"]);

                        //判数是否在有多少在大格子中
                        if (longitude >= smalllongitude && latitude >= smalllatitude)
                        {
                            clsData clsquota = new clsData();
                            clsquota.Data_drop_num = dropnum;         //掉话次数
                            clsquota.Data_call_num = callnum;         //呼叫总次数
                            cls.ArrGrid[i, j]      = array[i, j];     //单元格称
                            cls.LsData.Add(clsquota);

                            cls.Latitude  = dr["latitude"].ToString();
                            cls.Longitude = dr["longitude"].ToString();
                        }
                    }
                    arrayData.Add(cls); //得到个数据结构图
                }
            }
            //dt1 = getZhiBiao(arrayData, city_id);
            return(dt1);
        }
Beispiel #4
0
        /// <summary>
        /// 有多少个小格存在于大格中
        /// </summary>
        /// <returns></returns>
        public DataTable newgetsmallExistBig(DataTable dt, List <clsPoi> clsPoi,
                                             int XLength, int YLength, int city_id,
                                             DateTime date, string strTime, float minlongitude, float maxlongitude)
        {
            try
            {
                string    result = string.Empty;
                DataTable dt1    = new DataTable();

                dt1.Columns.Add(new DataColumn("col"));
                dt1.Columns.Add(new DataColumn("row"));
                dt1.Columns.Add(new DataColumn("voice_call_num"));
                dt1.Columns.Add(new DataColumn("voice_drop_num"));
                dt1.Columns.Add(new DataColumn("data_call_num"));
                dt1.Columns.Add(new DataColumn("data_drop_num"));
                dt1.Columns.Add(new DataColumn("DODATA_CALL_NUM"));

                //查找功能函数
                for (int kk = 0; kk < dt.Rows.Count; kk++)
                {
                    for (int i = 0; i < clsPoi.Count; i++)   //大格子是一个范围的值(即对角线的值结构)
                    {
                        //遍历查找功能函数。确定有多少格子在这个大格子中(callnum;dropnum)
                        clsResult cls = new clsResult();
                        cls.LsData = new List <clsData>();
                        clsPoi clsP = clsPoi[i] as clsPoi;

                        double longitude_lb = clsP.longitude_lb;     //左下角的坐标
                        double latitude_lb  = clsP.latitude_lb;      //左下角的坐标的结构对象

                        double longitude_rb     = clsP.longitude_rb; //右上角的坐标
                        double latitude_rb      = clsP.latitude_rb;  //右上角的坐标
                        string longtiuandlatiud = dt.Rows[kk]["key"].ToString();
                        if (clsP.longitudeandlatitude == dt.Rows[kk]["key"].ToString())
                        {
                            clsData clsquota = new clsData();
                            DataRow dr       = dt1.NewRow();
                            dr["col"] = clsP.Column;
                            dr["row"] = clsP.Row;
                            if (dt.Rows[kk]["voice_call_num"] != null && dt.Rows[kk]["voice_call_num"].ToString() != "")  //接入次数(1X语音业务)
                            {
                                clsquota.Voice_call_num = Convert.ToSingle(dt.Rows[kk]["voice_call_num"]);
                            }
                            else
                            {
                                clsquota.Voice_call_num = 0;
                            }
                            dr["voice_call_num"] = clsquota.Voice_call_num;
                            if (dt.Rows[kk]["voice_drop_num"] != null && dt.Rows[kk]["voice_drop_num"].ToString() != "")  //掉话次数(1X语音业务)
                            {
                                clsquota.Voice_drop_num = Convert.ToSingle(dt.Rows[kk]["Voice_drop_num"]);
                            }
                            else
                            {
                                clsquota.Voice_drop_num = 0;
                            }
                            dr["voice_drop_num"] = clsquota.Voice_drop_num;
                            if (dt.Rows[kk]["data_call_num"] != null && dt.Rows[kk]["data_call_num"].ToString() != "")   //接入次数(1X数据业务)
                            {
                                clsquota.Data_call_num = Convert.ToSingle(dt.Rows[kk]["data_call_num"]);
                            }
                            else
                            {
                                clsquota.Data_call_num = 0;
                            }
                            dr["data_call_num"] = clsquota.Data_call_num;

                            if (dt.Rows[kk]["data_drop_num"] != null && dt.Rows[kk]["data_drop_num"].ToString() != "")   //掉话次数(1X数据业务)
                            {
                                clsquota.Data_drop_num = Convert.ToSingle(dt.Rows[kk]["data_drop_num"]);
                            }
                            else
                            {
                                clsquota.Data_drop_num = 0;
                            }
                            dr["data_drop_num"] = clsquota.Data_drop_num;

                            if (dt.Rows[kk]["DODATA_CALL_NUM"] != null && dt.Rows[kk]["DODATA_CALL_NUM"].ToString() != "") //DO业务:接入次
                            {
                                clsquota.DODATA_CALL_NUM = Convert.ToSingle(dt.Rows[kk]["DODATA_CALL_NUM"]);
                            }
                            else
                            {
                                clsquota.DODATA_CALL_NUM = 0;
                            }
                            dr["DODATA_CALL_NUM"] = clsquota.DODATA_CALL_NUM;
                            dt1.Rows.Add(dr);
                        }
                    }
                }
                return(dt1);
            }
            catch (Exception ex)
            {
                clsTool.WriteLog(ex.Message + ex.StackTrace, "getsmallExistBig大格子里有多少个小格子");
                return(null);
            }
        }
Beispiel #5
0
        /// <summary>
        /// 有多少个小格存在于大格中
        /// </summary>
        /// <returns></returns>
        public DataTable getsmallExistBig(DataTable dt, List <clsPoi> clsPoi,
                                          int XLength, int YLength, int city_id,
                                          DateTime date, string strTime, float minlongitude, float maxlongitude)

        {
            try
            {
                string    result = string.Empty;
                DataTable dt1    = new DataTable();
                for (int i = 0; i < clsPoi.Count; i++)   //大格子是一个范围的值(即对角线的值结构)
                {
                    //遍历查找功能函数。确定有多少格子在这个大格子中(callnum;dropnum)
                    clsResult cls = new clsResult();
                    cls.LsData = new List <clsData>();
                    clsPoi clsP = clsPoi[i] as clsPoi;
                    //if (clsP.longitude_lb <= minlongitude) continue;  //
                    double longitude_lb = clsP.longitude_lb; //左下角的坐标
                    double latitude_lb  = clsP.latitude_lb;  //左下角的坐标的结构对象

                    double longitude_rb = clsP.longitude_rb; //右上角的坐标
                    double latitude_rb  = clsP.latitude_rb;  //右上角的坐标

                    string strWhere = string.Format(@"latitude>={0} and longitude>={1} and 
                                               latitude<={2} and longitude<={3}"
                                                    , latitude_lb, longitude_lb, latitude_rb, longitude_rb);

                    DataRow[] dr = dt.Select(strWhere, "longitude asc");
                    for (int kk = 0; kk < dr.Length; kk++)
                    {
                        clsData clsquota = new clsData();
                        #region 性能指标
                        if (dr[kk]["voice_call_num"] != null && dr[kk]["voice_call_num"].ToString() != "")  //接入次数(1X语音业务)
                        {
                            clsquota.Voice_call_num = Convert.ToSingle(dr[kk]["voice_call_num"]);
                        }
                        else
                        {
                            clsquota.Voice_call_num = 0;
                        }
                        if (dr[kk]["voice_drop_num"] != null && dr[kk]["voice_drop_num"].ToString() != "")  //掉话次数(1X语音业务)
                        {
                            clsquota.Voice_drop_num = Convert.ToSingle(dr[kk]["Voice_drop_num"]);
                        }
                        else
                        {
                            clsquota.Voice_drop_num = 0;
                        }
                        if (dr[kk]["data_call_num"] != null && dr[kk]["data_call_num"].ToString() != "")   //接入次数(1X数据业务)
                        {
                            clsquota.Data_call_num = Convert.ToSingle(dr[kk]["data_call_num"]);
                        }
                        else
                        {
                            clsquota.Data_call_num = 0;
                        }

                        if (dr[kk]["data_drop_num"] != null && dr[kk]["data_drop_num"].ToString() != "")   //掉话次数(1X数据业务)
                        {
                            clsquota.Data_drop_num = Convert.ToSingle(dr[kk]["data_drop_num"]);
                        }
                        else
                        {
                            clsquota.Data_drop_num = 0;
                        }

                        if (dr[kk]["DODATA_CALL_NUM"] != null && dr[kk]["DODATA_CALL_NUM"].ToString() != "") //DO业务:接入次数DODATA_CALL_NUM
                        {
                            clsquota.DODATA_CALL_NUM = Convert.ToSingle(dr[kk]["DODATA_CALL_NUM"]);
                        }
                        else
                        {
                            clsquota.DODATA_CALL_NUM = 0;
                        }
                        #endregion
                        //clsquota.Data_drop_num = Convert.ToSingle(dr[kk]["callnum"]);
                        //clsquota.Voice_call_num = Convert.ToSingle(dr[kk]["callnum"]);
                        cls.Latitude  = dt.Rows[kk]["latitude"].ToString();
                        cls.Longitude = dt.Rows[kk]["longitude"].ToString();
                        if (dr[kk]["GRID_ID"] != null && dr[kk]["GRID_ID"].ToString() != "")
                        {
                            clsquota.XYZUOBIAO = Convert.ToString(dr[kk]["GRID_ID"]);              //确定坐标点
                        }
                        clsquota.Row    = clsP.Row;                                                //得到行号
                        clsquota.Column = clsP.Column;                                             //得到列号
                        cls.LsData.Add(clsquota);
                    }
                    arrayData.Add(cls); //得到所有大格子的数据结构
                } //得到个数据结构图
                dt1 = getZhiBiao(arrayData, city_id, date, strTime);
                return(dt1);
            }
            catch (Exception ex)
            {
                clsTool.WriteLog(ex.Message + ex.StackTrace, "getsmallExistBig大格子里有多少个小格子");
                return(null);
            }
        }