/// <summary> /// 获取实时的车辆信息 /// </summary> /// <returns></returns> public List <VEHICLEREALSTATUS> getNewSSVehInfo() { try { List <VEHICLEREALSTATUS> list = new List <VEHICLEREALSTATUS>(); DataTable dt = DB120Help.GetRecord(GetDataSql.GetSSVehDataStr()); foreach (DataRow r in dt.Rows) { VEHICLEREALSTATUS aci = new VEHICLEREALSTATUS(); try { aci.VEHICLENAME = r["VEHICLENAME"].ToString(); aci.VEHICLECARD = r["VEHICLECARD"].ToString(); aci.VEHICLEDEPARTMENT = r["VEHICLEDEPARTMENT"].ToString(); aci.STATUS = r["STATUS"].ToString(); aci.JD = double.Parse(r["JD"].ToString()); aci.WD = double.Parse(r["WD"].ToString()); aci.LASTTIME = DateTime.Now; aci.READFLAG = 1; list.Add(aci); } catch (Exception ex) { LogHelper.WriteLog(aci.VEHICLENAME + ex.Message); } } return(list); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 获取急救数据信息 /// </summary> /// <returns></returns> public List <ALARM_EVENT_INFO> getNewEventInfo() { try { List <ALARM_EVENT_INFO> list = new List <ALARM_EVENT_INFO>(); DataTable dt = DB120Help.GetRecord(GetDataSql.GetALARMDataStr()); foreach (DataRow r in dt.Rows) { try { ALARM_EVENT_INFO aci = new ALARM_EVENT_INFO(); aci.CALLCOUNT = int.Parse(r["CALLCOUNT"].ToString()); aci.DEALCOUNT = int.Parse(r["DEALCOUNT"].ToString()); aci.DISPATCHCOUNT = int.Parse(r["DISPATCHCOUNT"].ToString()); aci.PAIENTCOUNT = int.Parse(r["PAIENTCOUNT"].ToString()); aci.LASTTIME = DateTime.Now; aci.DATATIME = r["DATATIME"].ToString(); aci.READFLAG = 1; list.Add(aci); } catch (Exception ex) { throw ex; } } return(list); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 是否已有病历项目-值对应记录的对应记录 /// </summary> /// <param name="strTargetStatisticsId"></param> /// <param name="TargetDWBH"></param> /// <param name="strTargetLSH"></param> /// <param name="strStatisticsId"></param> /// <returns></returns> private bool hasMedicalMatchStatistics(string strTargetStatisticsId, string TargetDWBH, string strTargetLSH, ref string strLocalStatisticsId) { //5.LWBLGXTBDYB 联网病历关系同步对应表 //create table LWBLGXTBDYB //( // locallsh 本地流水号 // localStatisticsID 本地病历关系ID号 // TargetLSH 对方流水号 // TargetStatisticsID 对方病历关系ID号 // TargetDWBH 对方单位编号 // ) bool result = false; try { string Sql = "select * from LWBLGXTBDYB where TargetStatisticsID =" + strTargetStatisticsId + " and TargetLSH = '" + strTargetLSH + "' and TargetDWBH = '" + TargetDWBH + "' "; DataTable dt = DB120Help.GetRecord(Sql); //判断是否已经关联患者病历信息 if (dt.Rows.Count > 0) { strLocalStatisticsId = dt.Rows[0]["localStatisticsID"].ToString(); result = true; } } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } return(result); }
/// <summary> /// 出车同步同时检测呼救区域记录 /// </summary> /// <param name="LocalLSH"></param> /// <param name="DWBH"></param> /// <returns></returns> private void CheckHJQY(string LSH, string dwbh) { try { string sql = ""; //20160104 修改人:朱星汉 修改内容:添加hjqy与dwmc sql = "select sl.hjqy,sl.gxyy,lw.sgsb from lwddglb lw,sljlb sl where lw.locallsh='" + LSH + "' and sl.lsh=lw.locallsh"; DataTable dt = DB120Help.GetRecord(sql); foreach (DataRow r in dt.Rows) { if (r["sgsb"].ToString() == "1" && r["HJQY"].ToString() == "" && r["GXYY"].ToString() == "") { sql = "select * from dwxxb where dwbh = '" + dwbh + "'"; dt = DB120Help.GetRecord(sql); foreach (DataRow k in dt.Rows) { string hjqy = k["SSQY"].ToString(); string gxyy = k["DWMC"].ToString(); sql = "update sljlb set hjqy='" + hjqy + "',gxyy='" + gxyy + "' where lsh='" + LSH + "'"; int i = DB120Help.ExecuteSql(sql); if (i > 0) { LOG.LogHelper.WriteLog("突发公共事件呼救区域修改成功,该记录流水号:" + LSH); } } } } } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } }
/// <summary> /// 是否已有车辆对应记录 /// </summary> /// <param name="TargetLSH"></param> /// <param name="TargetCLBH"></param> /// <param name="TargetCS"></param> /// <param name="TargetDWBH"></param> /// <param name="LocalCS"></param> /// <param name="LocalCLBH"></param> /// <returns></returns> private bool HasVehicleMatchRecord(string TargetLSH, string TargetCLBH, string TargetCS, string TargetDWBH, ref string LocalCS, ref string LocalCLBH) { LocalCS = ""; LocalCLBH = ""; bool result = false; try { string sql = "select * from LWCLTBDYB where TargetLSH = '" + TargetLSH + "' and TargetCS = '" + TargetCS + "' and TargetCLBH = '" + TargetCLBH + "' and TargetDWBH = '" + TargetDWBH + "'"; DataTable dt = DB120Help.GetRecord(sql); if (dt.Rows.Count > 0) { LocalCS = dt.Rows[0]["localCS"].ToString(); LocalCLBH = dt.Rows[0]["localCLBH"].ToString(); result = true; } } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } return(result); }
/// <summary> /// 获取历史的车辆信息 /// </summary> /// <returns></returns> public List <VEHICLEHISTROYSTATE> getNewLSVehInfo(string strID, string strLSH, string strCCXH) { int nCCXH = 0; try { List <VEHICLEHISTROYSTATE> list = new List <VEHICLEHISTROYSTATE>(); if (strID == "") { return(list); } if (strLSH != "") { if (strCCXH != "") { int.TryParse(strCCXH, out nCCXH); } else { int.TryParse((DB120Help.GetSingle(GetDataSql.GetCCXH(strLSH, strID)) == null ? "0" : DB120Help.GetSingle(GetDataSql.GetCCXH(strLSH, strID)).ToString()), out nCCXH); } } DataTable dt = DB120Help.GetRecord(GetDataSql.GetLSVehDataStr(strID)); foreach (DataRow r in dt.Rows) { try { VEHICLEHISTROYSTATE aci = new VEHICLEHISTROYSTATE(); aci.LSH = strLSH; aci.CCXH = nCCXH; aci.VEHICLENAME = r["VEHICLENAME"].ToString(); aci.VEHICLECARD = r["VEHICLECARD"].ToString(); aci.VEHICLEDEPARTMENT = r["VEHICLEDEPARTMENT"].ToString(); aci.JD = double.Parse(r["JD"].ToString()); aci.WD = double.Parse(r["WD"].ToString()); aci.REPORTTIME = DateTime.Now; aci.READFLAG = 1; list.Add(aci); } catch (Exception ex) { throw ex; } } return(list); } catch (System.Exception ex) { throw ex; } }
/// <summary> /// 是否已有病历对应记录 /// </summary> /// <param name="strTargetRecordId"></param> /// <param name="TargetDWBH"></param> /// <param name="strLocalRecordId"></param> /// <returns></returns> private bool hasMedicalMatchRecords(string strTargetRecordId, string TargetDWBH, string strTargetLSH, ref string strLocalRecordId) { bool result = false; try { string Sql = "select * from LWBLTBDYB where TargetRecordId =" + strTargetRecordId + " and TargetLSH = '" + strTargetLSH + "' and TargetDWBH = '" + TargetDWBH + "' "; DataTable dt = DB120Help.GetRecord(Sql); //判断是否已经关联患者病历信息 if (dt.Rows.Count > 0) { strLocalRecordId = dt.Rows[0]["localRecordId"].ToString(); result = true; } } catch (Exception ex) { LOG.LogHelper.WriteLog("", ex); } return(result); }