/// <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); } } }
/// <summary> /// 单位信息数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void HandleUnitInfoData(string message) { try { UnitInfoData UnitInfo = (UnitInfoData)XmlUtil.Deserialize(typeof(UnitInfoData), message); IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess(); Data.UnitInfoDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_UnitInfoDataRespExchange); // 单位类型(1: 政府机关; 2: 事业单位;3: 企业单位;4: 急救中心;5: 急救分站;6: 医院;7: 血站;8: CDC疾控中心;9: 卫生监督所;10: 学校;11: 指挥中心;12: 应急办;13: 联动单位) string UnitTypeID = UnitInfo.UnitTypeID; switch (UnitTypeID) { case "1": UnitInfo.UnitTypeID = "政府机关"; break; case "2": UnitInfo.UnitTypeID = "事业单位"; break; case "3": UnitInfo.UnitTypeID = "企业单位"; break; case "4": UnitInfo.UnitTypeID = "急救中心"; break; case "5": UnitInfo.UnitTypeID = "急救分站"; break; case "6": UnitInfo.UnitTypeID = "医院"; break; case "7": UnitInfo.UnitTypeID = "血站"; break; case "8": UnitInfo.UnitTypeID = "CDC疾控中心"; break; case "9": UnitInfo.UnitTypeID = "卫生监督所"; break; case "10": UnitInfo.UnitTypeID = "学校"; break; case "11": UnitInfo.UnitTypeID = "指挥中心"; break; case "12": UnitInfo.UnitTypeID = "应急办"; break; case "13": UnitInfo.UnitTypeID = "联动单位"; break; default: break; } string StationType = UnitInfo.StationType; switch (StationType) { case "中心": UnitInfo.StationType = "0"; break; case "分站": UnitInfo.StationType = "1"; break; default: break; } List <UnitInfoData> DataList = new List <UnitInfoData>(); DataList.Add(UnitInfo); Data.InsertUnitInfoData(DataList, ServerClient.UnitXZBM); } catch (Exception ex) { LogHelper.WriteLog("dtArgs_UnitInfoDataExchange", ex); } }