Exemplo n.º 1
0
        /// <summary>
        /// 开始同步市120本地数据到市全局库中
        /// </summary>
        public void StartSyncLocalData()
        {
            while (true)
            {
                //上传单位信息
                try
                {
                    List <UnitInfoData> UnitInfo = LocalData.GetUnitInfoData();
                    if (UnitInfo.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.UnitInfoDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_UnitInfoDataRespExchange);
                        Data.InsertUnitInfoData(UnitInfo, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                //上传车辆信息
                try
                {
                    List <VehicleData> VehicleInfo = LocalData.GetVehicleData();
                    if (VehicleInfo.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.VehicleDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_VehicleDataRespExchange);
                        Data.InsertVehicleData(VehicleInfo, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                //上传系统人员信息
                try
                {
                    List <SysUserData> SysUserInfo = LocalData.GetSysUserData();
                    if (SysUserInfo.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.SysUserDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_SysUserDataRespExchange);
                        Data.InsertSysUserData(SysUserInfo, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                // 上传呼叫记录信息
                try
                {
                    List <CallRcordData> CallRcordDataInfo = LocalData.GetCallRcordData();
                    if (CallRcordDataInfo.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.CallRcordDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_CallRcordDataRespExchange);
                        Data.InsertCallRcordData(CallRcordDataInfo, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                //上传受理记录信息
                try
                {
                    List <DealData> DealDataInfo = LocalData.GetDealData();
                    if (DealDataInfo.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.DealDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_DealDataRespExchange);
                        Data.InsertDealData(DealDataInfo, LocalXZBM);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                //上传出车信息
                try
                {
                    List <DispatchVehicleData> DispatchVehicleInfo = LocalData.GetDispatchVehicleData();
                    if (DispatchVehicleInfo.Count > 0)
                    {
                        foreach (DispatchVehicleData item in DispatchVehicleInfo)
                        {
                            IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                            Data.DispatchVehicleDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_DispatchVehicleDataRespExchange);
                            Data.InsertDispatchVehicleData(DispatchVehicleInfo, LocalXZBM);
                            Thread.Sleep(Interval);
                        }
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                //上传调度分站记录信息
                try
                {
                    List <DispatchStationInfoData> DispatchStationInfo = LocalData.GetDispatchStationInfoData();
                    if (DispatchStationInfo.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.DispatchStationInfoDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_DispatchStationInfoDataRespExchange);
                        Data.InsertDispatchStationInfoData(DispatchStationInfo, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                //上传病历填写项目数据
                try
                {
                    List <Web_MedicalProject> list = LocalData.GetWeb_MedicalProjectData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.Web_MedicalProjectRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_Web_MedicalProjectRespExchange);
                        Data.InsertWeb_MedicalProject(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                //上传病历填写项目值数据
                try
                {
                    List <Web_MedicalProjectValue> list = LocalData.GetWeb_MedicalProjectValueData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.Web_MedicalProjectValueRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_Web_MedicalProjectValueRespExchange);
                        Data.InsertWeb_MedicalProjectValue(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                //上传病历记录数据
                try
                {
                    List <Web_MedicalRecords> list = LocalData.GetWeb_MedicalRecordsData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.Web_MedicalRecordsRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_Web_MedicalRecordsRespExchange);
                        Data.InsertWeb_MedicalRecords(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                //上传病历填写项目与值对应数据
                try
                {
                    List <Web_MedicalStatistics> list = LocalData.GetWeb_MedicalStatisticsData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.Web_MedicalStatisticsRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_Web_MedicalStatisticsRespExchange);
                        Data.InsertWeb_MedicalStatistics(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                // 病历基础信息表数据
                try
                {
                    List <BLJCXXB> list = LocalData.GetBLJCXXBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.BLJCXXBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_BLJCXXBRespExchange);
                        Data.InsertBLJCXXB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                // 呼救区域表数据
                try
                {
                    List <HJQYB> list = LocalData.GetHJQYBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.HJQYBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_HJQYBRespExchange);
                        Data.InsertHJQYB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                /// 来电类型表数据
                try
                {
                    List <LDLXB> list = LocalData.GetLDLXBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LDLXBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LDLXBRespExchange);
                        Data.InsertLDLXB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }
                // 值班员信息表数据
                try
                {
                    List <ZBYXXB> list = LocalData.GetZBYXXBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.ZBYXXBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_ZBYXXBRespExchange);
                        Data.InsertZBYXXB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                // 症状表数据
                try
                {
                    List <ZZB> list = LocalData.GetZZBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.ZZBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_ZZBRespExchange);
                        Data.InsertZZB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex) { LogHelper.WriteLog(ex.Message, ex); }

                //20160105修改人:朱星汉 修改内容:添加病历记录删除表的上传
                // 病历删除记录表数据
                try
                {
                    List <LWBLTBDELB> list = LocalData.GetLWBLTBDELBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LWBLTBDELBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LWBLTBDELBRespExchange);
                        Data.DeleteWeb_MedicalRecords(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }
                //20151216修改人:朱星汉 修改内容:添加病历关系记录删除表的上传
                // 病历关系删除记录表数据
                try
                {
                    List <LWBLGXTBDELB> list = LocalData.GetLWBLGXTBDELBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LWBLGXTBDELBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LWBLGXTBDELBRespExchange);
                        Data.DeleteWeb_MedicalStatistics(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }

                // 大型事故表数据
                try
                {
                    List <DXSGB> list = LocalData.GetDXSGBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.DXSGBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_DXSGBRespExchange);
                        Data.InsertDXSGB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }

                //  联网调度关联表数据
                try
                {
                    List <LWDDGLB> list = LocalData.GetLWDDGLBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LWDDGLBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LWDDGLBRespExchange);
                        Data.InsertLWDDGLB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }

                // 联网车辆同步对应表数据
                try
                {
                    List <LWCLTBDYB> list = LocalData.GetLWCLTBDYBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LWCLTBDYBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LWCLTBDYBRespExchange);
                        Data.InsertLWCLTBDYB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }

                // 联网病历同步对应表数据
                try
                {
                    List <LWBLTBDYB> list = LocalData.GetLWBLTBDYBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LWBLTBDYBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LWBLTBDYBRespExchange);
                        Data.InsertLWBLTBDYB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }

                // 联网病历关系同步对应表数据
                try
                {
                    List <LWBLGXTBDYB> list = LocalData.GetLWBLGXTBDYBData();
                    if (list.Count > 0)
                    {
                        IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess();
                        Data.LWBLGXTBDYBRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_LWBLGXTBDYBRespExchange);
                        Data.InsertLWBLGXTBDYB(list, LocalXZBM);
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog(ex.Message, ex);
                }

                finally { Thread.Sleep(10000); }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 先传单位 车辆信息 先受理信息
        /// </summary>
        /// <param name="c"></param>
        public void ScanOnTime()
        {
            IGetData Data = ExchangeDataAccess.GetDataAccess();
            //20160712 修改人:朱星汉 修改内容:添加定时重发机制
            IUpdateMidState MidState = ExchangeDataAccess.UpdateMidStateAccess();

            while (true)
            {
                Thread.Sleep(2000);
                //20160712 修改人:朱星汉 修改内容:添加定时重发机制

                //同步单位信息数据
                try
                {
                    List <UnitInfoData> list = Data.GetUnitInfoData();
                    foreach (UnitInfoData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateUnitInfoData(item.UnitCode);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                ////同步车辆信息数据
                try
                {
                    List <VehicleData> list = Data.GetVehicleData();
                    foreach (VehicleData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateVehicleData(item.VehicleCode);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                // //同步系统人员信息数据
                try
                {
                    List <SysUserData> list = Data.GetSysUserData();
                    foreach (SysUserData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateSysUserData(item.UserName);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                ////同步呼叫记录信息
                try
                {
                    List <CallRcordData> list = Data.GetCallRcordData();
                    foreach (CallRcordData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateCallRcordData(item.CallID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                ////同步受理信息

                try
                {
                    List <DealData> list = Data.GetDealData();
                    foreach (DealData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateDealData(item.DealRecordID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                ////同步调度分站信息
                try
                {
                    List <DispatchStationInfoData> list = Data.GetDispatchStationInfoData();
                    foreach (DispatchStationInfoData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateDispatchStationInfoData(item.ID, item.DispatchVehicleUnit);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                //同步派车信息
                try
                {
                    List <DispatchVehicleData> list = Data.GetDispatchVehicleData();
                    foreach (DispatchVehicleData item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateDispatchVehicle(item.DealRecordID, item.Times, item.VehicleCode);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }


                //同步病历填写项目信息
                try
                {
                    List <Web_MedicalProject> list = Data.GetWeb_MedicalProjectData();
                    foreach (Web_MedicalProject item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateWeb_MedicalProjectData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                //同步病历填写项目值信息
                try
                {
                    List <Web_MedicalProjectValue> list = Data.GetWeb_MedicalProjectValueData();
                    foreach (Web_MedicalProjectValue item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateWeb_MedicalProjectValueData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }
                //20160105修改人:朱星汉 修改内容:添加病历记录删除表的上传
                // 病历记录删除记录表数据
                try
                {
                    List <LWBLTBDELB> list = Data.GetLWBLTBDELBData();
                    foreach (LWBLTBDELB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateLWBLTBDELData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }
                //同步病历记录信息
                try
                {
                    List <Web_MedicalRecords> list = Data.GetWeb_MedicalRecordsData();
                    foreach (Web_MedicalRecords item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateWeb_MedicalRecordsData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                //20151216修改人:朱星汉 修改内容:添加病历关系记录删除表的上传
                // 症状关系删除记录表数据
                try
                {
                    List <LWBLGXTBDELB> list = Data.GetLWBLGXTBDELBData();
                    foreach (LWBLGXTBDELB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateLWBLGXTBDELData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                //同步病历填写项目与值对应信息
                try
                {
                    List <Web_MedicalStatistics> list = Data.GetWeb_MedicalStatisticsData();
                    foreach (Web_MedicalStatistics item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateWeb_MedicalStatisticsData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                // 病历基础信息表数据
                try
                {
                    List <BLJCXXB> list = Data.GetBLJCXXBData();
                    foreach (BLJCXXB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateBLJCXXBData(item.LX, item.MC);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                // 呼救区域表数据
                try
                {
                    List <HJQYB> list = Data.GetHJQYBData();
                    foreach (HJQYB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateHJQYBData(item.XH);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }
                /// 来电类型表数据
                try
                {
                    List <LDLXB> list = Data.GetLDLXBData();
                    foreach (LDLXB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateLDLXBData(item.XH);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }
                // 值班员信息表数据
                try
                {
                    List <ZBYXXB> list = Data.GetZBYXXBData();
                    foreach (ZBYXXB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateZBYXXBData(item.ID);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }


                // 症状表数据
                try
                {
                    List <ZZB> list = Data.GetZZBData();
                    foreach (ZZB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateZZBData(item.XH);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }

                // 大型事故数据
                try
                {
                    List <DXSGB> list = Data.GetDXSGBData();
                    foreach (DXSGB item in list)
                    {
                        string sendMessageStr = XmlUtil.Serializer(item.GetType(), item);
                        Controller.GetInstance().us.SendMessage(sendMessageStr);
                        //20160712 修改人:朱星汉 修改内容:添加定时重发机制
                        string strReSendSql = MidState.UpdateDXSGBData(item.LSH);
                        if (ExistSQL(strReSendSql))
                        {
                            UploadServer.reSendQueue.Enqueue(new ReSendMsg(DateTime.Now, strReSendSql));
                        }
                        Thread.Sleep(Interval);
                    }
                }
                catch (System.Exception ex)
                {
                    LogHelper.WriteLog("", ex);
                }


                //定时扫描
                int TimeSpan = Controller.GetInstance().Args.args.DataGatherInterval;
                Thread.Sleep(TimeSpan);
            }
        }