/// <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 HandleDealData(string message) { try { DealData Deal = (DealData)XmlUtil.Deserialize(typeof(DealData), message); IDataExchangeDataAccess Data = DataAccess.DataExchangeDataAccess(); Data.DealDataRespExchange += new EventHandler <DataExchangeRespEventArgs>(Data_DealDataRespExchange); string Standing = Deal.Standing; switch (Standing) { //患者身份(1:普通人员;2:重要人员) case "1": Deal.Standing = "普通人员"; break; case "2": Deal.Standing = "重要人员"; break; default: break; } // 回车标志(0:否;1:是) string RejectFlag = Deal.RejectFlag; switch (RejectFlag) { case "0": Deal.RejectFlag = "否"; break; case "1": Deal.RejectFlag = "是"; break; default: break; } /// 呼救类型(1:普通呼叫;2:大型事故) string CallHelpType = Deal.CallHelpType; switch (CallHelpType) { case "1": Deal.CallHelpType = "普通呼叫"; break; case "2": Deal.CallHelpType = "大型事故"; break; default: break; } ////// 受理状态(1:接听;2:未处理;3:已处理;4:待派车;5:已派车;6:已完成;7:已归档) string DealStatus = Deal.DealStatus; switch (DealStatus) { case "1": Deal.DealStatus = "接听"; break; case "2": Deal.DealStatus = "未处理"; break; case "3": Deal.DealStatus = "已处理"; break; case "4": Deal.DealStatus = "待派车"; break; case "5": Deal.DealStatus = "已派车"; break; case "6": Deal.DealStatus = "已完成"; break; case "7": Deal.DealStatus = "已归档"; break; default: break; } /// 特殊案件标志(0:否;1:是) string SpecialCaseFalg = Deal.SpecialCaseFalg; switch (SpecialCaseFalg) { case "0": Deal.SpecialCaseFalg = "否"; break; case "1": Deal.SpecialCaseFalg = "是"; break; default: break; } /// 上报标志(0:否;1:是) string ReportFalg = Deal.ReportFalg; switch (ReportFalg) { case "0": Deal.RejectFlag = "否"; break; case "1": Deal.RejectFlag = "是"; break; default: break; } List <DealData> DataList = new List <DealData>(); DataList.Add(Deal); Data.InsertDealData(DataList, ServerClient.UnitXZBM); } catch (Exception ex) { LogHelper.WriteLog("", ex); } }