Beispiel #1
0
        private string CombinationalLogicCode(string AreaCode, string number)
        {
            string builder = "";

            number = GetNuberToString(number);
            // 63301080000000314010401
            string level              = "6";
            string ResourceType       = "0314";
            string ResourceTypeNumber = "01";


            // 子类型
            string Subtype   = "04";
            string logicCode = level + AreaCode + ResourceType + ResourceTypeNumber + Subtype + number;

            if (logicCode.Length != 23 && LogicalData.LogicalCode.Length == 23)
            {
                logicCode = LogicalData.LogicalCode;
            }
            logicCode = GetLogicalCodel(logicCode);

            if (logicCode.Length == 23)
            {
                if (!UpdateLogicalCode(LogicalData.srvID, logicCode))
                {
                    HttpServerFrom.SetManager("更改逻辑编码失败", System.Drawing.Color.Red);
                }
                return(logicCode);
            }
            return(null);
        }
Beispiel #2
0
        /// <summary>
        /// 组合逻辑码
        /// </summary>

        public string GetLogicalAndAddDataBase()
        {
            string logicalCode = GetGBCode();

            int number = GetGBCodeCount(LogicalData.srvAreaID, null);

            if (number > 99)
            {
                HttpServerFrom.SetManager("资源已满,查看是否要进行变更", System.Drawing.Color.Red);
            }
            return(CombinationalLogicCode(logicalCode, number.ToString()));
        }
        public string AddPostQueue(string address, string FileName)
        {
            if (!string.IsNullOrEmpty(address) && !string.IsNullOrEmpty(FileName))
            {
                PostModel postInfo = new PostModel();
                postInfo.Address  = address;
                postInfo.FileName = FileName;
                Queueinterface <PostModel> .SendQueue.Enqueue(postInfo);

                HttpServerFrom.SetManager("队列添加成功:" + postInfo.FileName, Color.Green);
                return("1");
            }
            else
            {
                HttpServerFrom.SetManager("队列添加失败:" + FileName, Color.Red);
                return("2");
            }
        }
 private void PostSend(PostModel postModel)
 {
     try
     {
         string result = HttpSendFile.UploadFilesByPost(postModel.Address, postModel.FileName);
         if (result != "0")
         {
             HttpServerFrom.SetManager("发送成功:" + postModel.FileName, Color.Green);
         }
         else
         {
             HttpServerFrom.SetManager("发送失败" + postModel.FileName, Color.Red);
         }
     }
     catch (Exception ex)
     {
         HttpServerFrom.SetManager("发送失败" + postModel.FileName + "失败原因:" + ex.Message, Color.Red);
         Log.Instance.LogWrite("发送队列异常:" + ex.ToString());
     }
 }
Beispiel #5
0
        private bool UpdateState(string TimingTerminalState)
        {
            bool        flag        = false;
            XmlDocument xmlHeartDoc = new XmlDocument();
            responseXML rHeart      = new responseXML();

            rHeart.SourceAreaCode = HttpServerFrom.strSourceAreaCode;
            rHeart.SourceType     = HttpServerFrom.strSourceType;
            rHeart.SourceName     = HttpServerFrom.strSourceName;
            rHeart.SourceID       = HttpServerFrom.strSourceID;
            rHeart.sHBRONO        = HttpServerFrom.strHBRONO;
            string MediaSql    = "";
            string strSRV_ID   = "";
            string strSRV_CODE = "";

            HttpServerFrom.DeleteFolder(HttpServerFrom.sHeartSourceFilePath);//删除原有XML发送文件的文件夹下的XML
            string        frdStateName = "";
            List <Device> lDev         = new List <Device>();

            try
            {
                //  MediaSql = "select  SRV.SRV_ID,SRV.SRV_CODE,SRV_GOOGLE, SRV_PHYSICAL_CODE,srv_detail  FROM SRV  left join Srvtype on   SRV.DeviceTypeId= Srvtype .srv_id where  Srvtype.srv_id=1";
                MediaSql = "select  SRV.SRV_ID,SRV.SRV_CODE,SRV_GOOGLE, SRV_PHYSICAL_CODE,srv_detail,SRV_LOGICAL_CODE_GB,SRV_MFT_DATE,updateDate,SRV_RMT_STATUS  FROM SRV  left join Srvtype on   SRV.DeviceTypeId= Srvtype .srv_id where  Srvtype.srv_id=1";
                DataTable dtMedia = mainForm.dba.getQueryInfoBySQL(MediaSql);
                if (dtMedia != null && dtMedia.Rows.Count > 0)
                {
                    if (dtMedia.Rows.Count > 100)
                    {
                        int mod = dtMedia.Rows.Count / 100 + 1;
                        for (int i = 0; i < mod; i++)
                        {
                            for (int idtM = 0; idtM < dtMedia.Rows.Count; idtM++)
                            {
                                Device DV = new Device();
                                DV.SRV_ID   = dtMedia.Rows[idtM][0].ToString();
                                strSRV_CODE = dtMedia.Rows[idtM][1].ToString();
                                DV.DeviceID = dtMedia.Rows[idtM]["SRV_LOGICAL_CODE_GB"].ToString();//修改于20180819 把资源码换成23位

                                DV.DeviceName = dtMedia.Rows[idtM][4].ToString();

                                DV.Latitude     = dtMedia.Rows[idtM][2].ToString().Split(',')[0];
                                DV.Longitude    = dtMedia.Rows[idtM][2].ToString().Split(',')[1];
                                DV.Srv_Mft_Date = dtMedia.Rows[idtM]["SRV_MFT_DATE"].ToString();
                                DV.UpdateDate   = dtMedia.Rows[idtM]["updateDate"].ToString();



                                DV.DeviceState = TimingTerminalState;

                                lDev.Add(DV);
                            }
                            Random rdState = new Random();
                            frdStateName = "10" + rHeart.sHBRONO + GetSequenceCodes();
                            string xmlEBMStateFileName = "\\EBDB_" + frdStateName + ".xml";

                            xmlHeartDoc = rHeart.DeviceStateResponse(lDev, frdStateName);
                            TarXml.AudioResponseXml.CreateXML(xmlHeartDoc, HttpServerFrom.sHeartSourceFilePath + xmlEBMStateFileName);
                            HttpServerFrom.mainFrm.GenerateSignatureFile(HttpServerFrom.sHeartSourceFilePath, frdStateName);
                            HttpServerFrom.tar.CreatTar(HttpServerFrom.sHeartSourceFilePath, HttpServerFrom.sSendTarPath, frdStateName);//使用新TAR
                            string sHeartBeatTarName = HttpServerFrom.sSendTarPath + "\\" + "EBDT_" + frdStateName + ".tar";
                            string result            = SendTar.SendTarOrder.sendHelper.AddPostQueue(HttpServerFrom.sZJPostUrlAddress, sHeartBeatTarName);
                            if (result == "1")
                            {
                                flag = true;
                            }
                        }
                    }
                    else
                    {
                        for (int idtM = 0; idtM < dtMedia.Rows.Count; idtM++)
                        {
                            Device DV = new Device();
                            DV.SRV_ID   = dtMedia.Rows[idtM][0].ToString();
                            strSRV_CODE = dtMedia.Rows[idtM][1].ToString();
                            DV.DeviceID = dtMedia.Rows[idtM]["SRV_LOGICAL_CODE_GB"].ToString();

                            DV.DeviceName = dtMedia.Rows[idtM][4].ToString();

                            DV.Latitude     = dtMedia.Rows[idtM][2].ToString().Split(',')[0];
                            DV.Longitude    = dtMedia.Rows[idtM][2].ToString().Split(',')[1];
                            DV.Srv_Mft_Date = dtMedia.Rows[idtM]["SRV_MFT_DATE"].ToString();
                            DV.UpdateDate   = dtMedia.Rows[idtM]["updateDate"].ToString();
                            DV.DeviceState  = TimingTerminalState;
                            lDev.Add(DV);
                        }
                        Random rdState = new Random();
                        frdStateName = "10" + rHeart.sHBRONO + GetSequenceCodes();
                        string xmlEBMStateFileName = "\\EBDB_" + frdStateName + ".xml";

                        xmlHeartDoc = rHeart.DeviceStateResponse(lDev, frdStateName);
                        TarXml.AudioResponseXml.CreateXML(xmlHeartDoc, HttpServerFrom.sHeartSourceFilePath + xmlEBMStateFileName);
                        HttpServerFrom.mainFrm.GenerateSignatureFile(HttpServerFrom.sHeartSourceFilePath, frdStateName);
                        HttpServerFrom.tar.CreatTar(HttpServerFrom.sHeartSourceFilePath, HttpServerFrom.sSendTarPath, frdStateName);//使用新TAR
                        string sHeartBeatTarName = HttpServerFrom.sSendTarPath + "\\" + "EBDT_" + frdStateName + ".tar";
                        string result            = SendTar.SendTarOrder.sendHelper.AddPostQueue(HttpServerFrom.sZJPostUrlAddress, sHeartBeatTarName);
                        if (result == "1")
                        {
                            flag = true;
                        }
                    }
                }
                else
                {
                    Random rdState = new Random();
                    frdStateName = "10" + rHeart.sHBRONO + GetSequenceCodes();
                    string xmlEBMStateFileName = "\\EBDB_" + frdStateName + ".xml";

                    xmlHeartDoc = rHeart.DeviceStateResponse(lDev, frdStateName);
                    TarXml.AudioResponseXml.CreateXML(xmlHeartDoc, HttpServerFrom.sHeartSourceFilePath + xmlEBMStateFileName);
                    HttpServerFrom.mainFrm.GenerateSignatureFile(HttpServerFrom.sHeartSourceFilePath, frdStateName);
                    HttpServerFrom.tar.CreatTar(HttpServerFrom.sHeartSourceFilePath, HttpServerFrom.sSendTarPath, frdStateName);//使用新TAR
                    string sHeartBeatTarName = HttpServerFrom.sSendTarPath + "\\" + "EBDT_" + frdStateName + ".tar";
                    string result            = SendTar.SendTarOrder.sendHelper.AddPostQueue(HttpServerFrom.sZJPostUrlAddress, sHeartBeatTarName);
                    if (result == "1")
                    {
                        flag = true;
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception("终端状态变更:" + ex.Message);
            }
            return(flag);
        }
        /// <summary>
        /// 播放
        /// </summary>
        /// <returns></returns>
        public bool AudioPlay(int type, string ParamValue, string TsCmd_ID, string TsCmd_ValueID)
        {
            try
            {
                HttpServerFrom.SetManager("EBM开始时间: " + AudioModel.PlayingTime + "===>EBM结束时间: " + AudioModel.PlayEndTime, Color.Green);
                HttpServerFrom.SetManager("播放开始时间: " + AudioModel.PlayingTime + "===>播放结束时间: " + AudioModel.PlayEndTime, Color.Green);
                HttpServerFrom.SetManager("等待播放" + AudioModel.PlayingContent, Color.Green);
                EBD ebd = GetEBD(AudioModel.XmlFilaPath);

                string AreaString = CombinationArea();

                ///未播放
                AudioPlayState = AudioMessage.AudioPlayState.NotPlay;
                lock (HttpServerFrom.PlayBackObject)
                {
                    HttpServerFrom.PlayBack = HttpServerFrom.PlaybackStateType.NotBroadcast;
                }
                #region 未播放
                PlayStateInterface.NotPlay(TsCmd_ID, AudioModel.XmlFilaPath, "未播放", "1");
                #endregion 未播放代码
                //播放中
                #region 播放中

                while (true)
                {
                    DateTime current = DateTime.Now;
                    Thread.Sleep(500);
                    if (DateTime.Compare(current, AudioModel.PlayingTime) > 0)
                    {
                        HttpServerFrom.SetManager("播放开始", Color.Green);
                        lock (HttpServerFrom.PlayBackObject)
                        {
                            HttpServerFrom.PlayBack = HttpServerFrom.PlaybackStateType.Playback;
                        }
                        AudioPlayState = AudioMessage.AudioPlayState.Playing;
                        bool result = SendMQ.MqSendOrder.sendOrder.SendMq(ebd, type, ParamValue, TsCmd_ID, TsCmd_ValueID);
                        PlayStateInterface.Playing(TsCmd_ID, AudioModel.XmlFilaPath, "播放中", "2", "播发中");
                        break;
                    }
                }
                #endregion 播放中代码
                //播放完成
                #region 播放完
                while (true)
                {
                    Thread.Sleep(500);
                    if (DateTime.Compare(DateTime.Now, AudioModel.PlayEndTime) < 0)//结束时间大于当前时间
                    {
                        string    MediaSql = "select TsCmd_ID,TsCmd_ExCute from  TsCmdStore where TsCmd_ID='" + TsCmd_ID + "'";
                        DataTable dtMedia  = mainForm.dba.getQueryInfoBySQL(MediaSql);
                        if (dtMedia.Rows[0]["TsCmd_ExCute"].ToString().Contains("播放完毕"))
                        {
                            HttpServerFrom.SetManager("播放结束", Color.Green);
                            lock (HttpServerFrom.PlayBackObject)
                            {
                                HttpServerFrom.PlayBack = HttpServerFrom.PlaybackStateType.PlayOut;
                            }
                            AudioPlayState = AudioMessage.AudioPlayState.PlayingOver;
                            PlayStateInterface.PlayOver(TsCmd_ID, AudioModel.XmlFilaPath, "播放完成", "3", "开机/运行中");
                            SingletonInfo.GetInstance().DicTsCmd_ID.Remove(AreaString);
                            break;
                        }
                    }
                    else
                    {
                        lock (HttpServerFrom.PlayBackObject)
                        {
                            HttpServerFrom.PlayBack = HttpServerFrom.PlaybackStateType.PlayOut;
                        }
                        HttpServerFrom.SetManager("播放结束", Color.Green);
                        //没播放完 但是文件时间到了
                        string strSql = "";
                        if (type == 1)
                        {
                            strSql = string.Format("update PLAYRECORD set PR_REC_STATUS = '{0}' where PR_SourceID='{1}'", "删除", TsCmd_ID);
                            mainForm.dba.UpdateDbBySQL(strSql);
                            string strSqlTsCmdStore = string.Format("update TsCmdStore set TsCmd_ExCute = '{0}' where TsCmd_ID='{1}'", "播放完毕", TsCmd_ID);
                            mainForm.dba.UpdateDbBySQL(strSqlTsCmdStore);
                        }
                        else if (type == 2)
                        {
                            strSql = string.Format("update PLAYRECORD set PR_REC_STATUS = '{0}' ", "删除");
                            mainForm.dba.UpdateDbBySQL(strSql);
                        }
                        SingletonInfo.GetInstance().DicTsCmd_ID.Remove(AreaString);
                        break;
                    }
                }
                #endregion 播放完代码
                GC.Collect();

                return(true);
            }
            catch (Exception ex)
            {
                AudioPlayState = AudioMessage.AudioPlayState.error;
                Log.Instance.LogWrite(ex.Message);
            }
            return(false);
        }
        public void TimingTerminalInfo(int type)
        {
            DateTime    INow        = DateTime.Now;
            XmlDocument xmlHeartDoc = new XmlDocument();
            responseXML rHeart      = new responseXML();

            rHeart.SourceAreaCode = ServerForm.strSourceAreaCode;
            rHeart.SourceType     = ServerForm.strSourceType;
            rHeart.SourceName     = ServerForm.strSourceName;
            rHeart.SourceID       = ServerForm.strSourceID;
            rHeart.sHBRONO        = ServerForm.strHBRONO;
            string MediaSql    = "";
            string strSRV_ID   = "";
            string strSRV_CODE = "";

            ServerForm.DeleteFolder(ServerForm.sHeartSourceFilePath);//删除原有XML发送文件的文件夹下的XML
            string        frdStateName = "";
            DataTable     dtMedia      = null;
            DataTable     dtSrvMedia   = null;
            List <Device> lDev         = new List <Device>();

            try
            {
                MediaSql = "select SRV_ID, SRV_CODE, SRV_GOOGLE, SRV_PHYSICAL_CODE, srv_detail, SRV_LOGICAL_CODE, SRV_RMT_STATUS, SRV_MFT_DATE,  srv_updateDate,Terminal_SRV_MFT_DATE,terminal_updateDate from terminalMaintenanceView where deviceTypeId = '" + type + "' ";
                dtMedia  = mainForm.dba.getQueryInfoBySQL(MediaSql);

                if (dtMedia.Rows.Count == 0)
                {
                    MediaSql   = "select  SRV.SRV_ID,SRV.SRV_CODE,SRV_GOOGLE, SRV_PHYSICAL_CODE,srv_detail,SRV_LOGICAL_CODE,SRV_MFT_DATE,updateDate,SRV_RMT_STATUS  FROM SRV  left join Srvtype on   SRV.DeviceTypeId= Srvtype .srv_id where  Srvtype.srv_id= " + type;
                    dtSrvMedia = mainForm.dba.getQueryInfoBySQL(MediaSql);
                    for (int idtM = 0; idtM < dtSrvMedia.Rows.Count; idtM++)
                    {
                        int    srvId         = Convert.ToInt32(dtSrvMedia.Rows[idtM]["SRV_ID"].ToString());
                        string TerminalState = dtSrvMedia.Rows[0]["SRV_RMT_STATUS"].ToString();


                        Device DV = new Device();
                        DV.SRV_ID   = dtSrvMedia.Rows[idtM][0].ToString();
                        strSRV_CODE = dtSrvMedia.Rows[idtM][1].ToString();
                        #region 自动添加逻辑编码 2018-01-10
                        string SRV_LOGICAL_CODE    = dtMedia.Rows[idtM]["SRV_LOGICAL_CODE"].ToString();
                        string areaId              = dtMedia.Rows[idtM]["areaId"].ToString();
                        string SRV_LOGICAL_CODE_GB = dtMedia.Rows[idtM]["SRV_LOGICAL_CODE_GB"].ToString();
                        int    number              = GetGBCodeCount(areaId, SRV_LOGICAL_CODE_GB);

                        LogicalData logicaldata = new LogicalData();
                        logicaldata.srvID       = dtMedia.Rows[idtM]["SRV_ID"].ToString();
                        logicaldata.srvAreaID   = areaId;
                        logicaldata.LogicalCode = SRV_LOGICAL_CODE;
                        LogicalCoding.LogicalHelper logical = new LogicalCoding.LogicalHelper(logicaldata);

                        if (number > 1)
                        {
                            SRV_LOGICAL_CODE_GB = logical.GetLogicalCodel(SRV_LOGICAL_CODE_GB);

                            logical.UpdateLogicalCode(logicaldata.srvID, SRV_LOGICAL_CODE_GB);
                        }

                        if (string.IsNullOrEmpty(SRV_LOGICAL_CODE_GB) || SRV_LOGICAL_CODE_GB.Length != 23)
                        {
                            SRV_LOGICAL_CODE_GB = logical.GetLogicalAndAddDataBase();
                            if (string.IsNullOrEmpty(SRV_LOGICAL_CODE_GB))
                            {
                                HttpServerFrom.SetManager("区域码有误请认真核对区域码", Color.Red);
                                continue;
                            }
                        }
                        if (!string.IsNullOrEmpty(SRV_LOGICAL_CODE_GB))
                        {
                            if (!(SRV_LOGICAL_CODE_GB.Length == 23 && logical.GetCombAreaCode(SRV_LOGICAL_CODE_GB, areaId)))
                            {
                                SRV_LOGICAL_CODE_GB = logical.GetLogicalAndAddDataBase();
                            }
                        }
                        DV.DeviceID = SRV_LOGICAL_CODE_GB;
                        #endregion

                        DV.DeviceName = dtSrvMedia.Rows[idtM][4].ToString();

                        DV.Latitude     = dtSrvMedia.Rows[idtM][2].ToString().Split(',')[0].Substring(0, 6);
                        DV.Longitude    = dtSrvMedia.Rows[idtM][2].ToString().Split(',')[1].Substring(0, 6);;
                        DV.Srv_Mft_Date = dtSrvMedia.Rows[idtM]["SRV_MFT_DATE"].ToString();
                        DV.UpdateDate   = dtSrvMedia.Rows[idtM]["updateDate"].ToString();
                        if (string.IsNullOrEmpty(DV.UpdateDate))
                        {
                            DV.UpdateDate = "null";
                        }

                        rHeart.AddTerminalMaintenance(DV);
                        lDev.Add(DV);
                    }
                }
                else
                {
                    // MediaSql = "select top(99) SRV_ID,SRV_CODE,SRV_GOOGLE from SRV";

                    if (dtMedia != null && dtMedia.Rows.Count > 0)
                    {
                        for (int idtM = 0; idtM < dtMedia.Rows.Count; idtM++)
                        {
                            int    srvId         = Convert.ToInt32(dtMedia.Rows[idtM]["SRV_ID"].ToString());
                            string TerminalState = dtMedia.Rows[idtM]["SRV_RMT_STATUS"].ToString();


                            Device DV = new Device();
                            DV.SRV_ID   = dtMedia.Rows[idtM][0].ToString();
                            strSRV_CODE = dtMedia.Rows[idtM][1].ToString();
                            #region 自动添加逻辑编码 2018-01-10
                            string SRV_LOGICAL_CODE    = dtMedia.Rows[idtM]["SRV_LOGICAL_CODE"].ToString();
                            string areaId              = dtMedia.Rows[idtM]["areaId"].ToString();
                            string SRV_LOGICAL_CODE_GB = dtMedia.Rows[idtM]["SRV_LOGICAL_CODE_GB"].ToString();
                            int    number              = GetGBCodeCount(areaId, SRV_LOGICAL_CODE_GB);

                            LogicalData logicaldata = new LogicalData();
                            logicaldata.srvID       = dtMedia.Rows[idtM]["SRV_ID"].ToString();
                            logicaldata.srvAreaID   = areaId;
                            logicaldata.LogicalCode = SRV_LOGICAL_CODE;
                            LogicalCoding.LogicalHelper logical = new LogicalCoding.LogicalHelper(logicaldata);

                            if (number > 1)
                            {
                                SRV_LOGICAL_CODE_GB = logical.GetLogicalCodel(SRV_LOGICAL_CODE_GB);

                                logical.UpdateLogicalCode(logicaldata.srvID, SRV_LOGICAL_CODE_GB);
                            }

                            if (string.IsNullOrEmpty(SRV_LOGICAL_CODE_GB) || SRV_LOGICAL_CODE_GB.Length != 23)
                            {
                                SRV_LOGICAL_CODE_GB = logical.GetLogicalAndAddDataBase();
                                if (string.IsNullOrEmpty(SRV_LOGICAL_CODE_GB))
                                {
                                    HttpServerFrom.SetManager("区域码有误请认真核对区域码", Color.Red);
                                    continue;
                                }
                            }
                            if (!string.IsNullOrEmpty(SRV_LOGICAL_CODE_GB))
                            {
                                if (!(SRV_LOGICAL_CODE_GB.Length == 23 && logical.GetCombAreaCode(SRV_LOGICAL_CODE_GB, areaId)))
                                {
                                    SRV_LOGICAL_CODE_GB = logical.GetLogicalAndAddDataBase();
                                }
                            }
                            DV.DeviceID = SRV_LOGICAL_CODE_GB;
                            #endregion

                            DV.DeviceName = dtMedia.Rows[idtM][4].ToString();

                            DV.Latitude = dtMedia.Rows[idtM][2].ToString().Split(',')[0];
                            if (DV.Latitude.Split('.')[1].Length > 6)
                            {
                                DV.Latitude = DV.Latitude.Split('.')[0] + "." + DV.Latitude.Split('.')[1].Substring(0, 6);
                            }
                            DV.Longitude = dtMedia.Rows[idtM][2].ToString().Split(',')[1];
                            if (DV.Longitude.Split('.')[1].Length > 6)
                            {
                                DV.Longitude = DV.Latitude.Split('.')[0] + "." + DV.Longitude.Split('.')[1].Substring(0, 6);
                            }
                            DV.Srv_Mft_Date = dtMedia.Rows[idtM]["SRV_MFT_DATE"].ToString();
                            DV.UpdateDate   = dtMedia.Rows[idtM]["srv_updateDate"].ToString();
                            /// Terminal_SRV_MFT_DATE,terminal_updateDate
                            DV.Old_Srv_Mft_Date = dtMedia.Rows[idtM]["Terminal_SRV_MFT_DATE"].ToString();
                            DV.Old_UpdateDate   = dtMedia.Rows[idtM]["terminal_updateDate"].ToString();
                            if (!(DV.Srv_Mft_Date.IndexOf(DV.Old_Srv_Mft_Date) > -1))
                            {
                                rHeart.UpdateTerminalMaintenance(DV);
                                lDev.Add(DV);
                            }
                            else if (!string.IsNullOrEmpty(DV.UpdateDate) && !string.IsNullOrEmpty(DV.Old_UpdateDate))
                            {
                                if (!(DV.UpdateDate.IndexOf(DV.Old_UpdateDate) > -1))
                                {
                                    rHeart.UpdateTerminalMaintenance(DV);
                                    lDev.Add(DV);
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }

                        //string TrLL = dtMedia.Rows[idtM][2].ToString();
                        //Device DV = new Device();
                        //if (idtM < 10)
                        //{
                        //    DV.DeviceID = "0" + idtM;
                        //}
                        //else { DV.DeviceID = idtM.ToString(); }
                        //strSRV_CODE = dtMedia.Rows[idtM][1].ToString();
                        //DV.DeviceID = strSRV_ID;
                        //DV.DeviceName = strSRV_ID;
                        //if (TrLL != "")
                        //{
                        //    string[] str = TrLL.Split(',');
                        //    if (str.Length >= 2)
                        //    {
                        //        DV.Longitude = str[1];
                        //        DV.Latitude = str[0];
                        //    }
                        //    else
                        //    {
                        //        DV.Longitude = "118.33";
                        //        DV.Latitude = "33.95";
                        //    }
                        //}
                        //else
                        //{
                        //    DV.Longitude = "118.33";
                        //    DV.Latitude = "33.95";
                        //}
                    }
                }
                if (lDev.Count > 0)
                {
                    Random rdState = new Random();
                    frdStateName = "10" + rHeart.sHBRONO + GetSequenceCodes();
                    string xmlEBMStateFileName = "\\EBDB_" + frdStateName + ".xml";
                    xmlHeartDoc = rHeart.DeviceInfoResponse(lDev, frdStateName);
                    CreateXML(xmlHeartDoc, ServerForm.sHeartSourceFilePath + xmlEBMStateFileName);
                    ServerForm.mainFrm.GenerateSignatureFile(ServerForm.sHeartSourceFilePath, frdStateName);
                    ServerForm.tar.CreatTar(ServerForm.sHeartSourceFilePath, ServerForm.sSendTarPath, frdStateName);//使用新TAR
                    string sHeartBeatTarName = ServerForm.sSendTarPath + "\\" + "EBDT_" + frdStateName + ".tar";
                    send.address      = ServerForm.sZJPostUrlAddress;
                    send.fileNamePath = sHeartBeatTarName;
                    SendTar.SendTarOrder.sendHelper.AddPostQueue(ServerForm.sZJPostUrlAddress, sHeartBeatTarName);
                }
            }

            catch
            {
            }
            Console.WriteLine((INow - DateTime.Now));
        }