示例#1
0
        /// <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;
            }
        }
示例#2
0
文件: SyncData.cs 项目: zhutoutou/SJH
 /// <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);
     }
 }
示例#3
0
 /// <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;
     }
 }
示例#4
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <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);
        }
示例#5
0
文件: SyncData.cs 项目: zhutoutou/SJH
        //20160105修改人:朱星汉 修改内容:添加病历记录删除表的上传
        /// <summary>
        ///  病历记录删除数据
        /// </summary>
        public void SyncLWBLTBDELB(LWBLTBDELB lwbltbdel, string UnitCode)
        {
            string strLocalRecordId  = "";
            string strTargetRecordId = lwbltbdel.ID;
            string strsql            = "select localRecordID from LWBLTBDYB where Targetdwbh= '" + UnitCode + "' and TargetRecordID = " + strTargetRecordId;
            object obj = DB120Help.GetSingle(strsql);

            if (obj != null)
            {
                strLocalRecordId = obj.ToString();
                strsql           = "delete from web_medicalrecords where id=" + strLocalRecordId + " and lsh in (select locallsh from lwbltbdyb)";
                int i = DB120Help.ExecuteSql(strsql);
                if (i > 0)
                {
                    LogHelper.WriteLog("病历信息删除成功");
                    strsql = "delete from web_medicalStatistics where medicalrecordsid=" + strLocalRecordId;
                    i      = DB120Help.ExecuteSql(strsql);
                    if (i > 0)
                    {
                        LogHelper.WriteLog("删除病历信息同时删除statistic值");
                    }
                    strsql = "delete from lwbltbdyb where localRecordID =" + strLocalRecordId + " and Targetdwbh='" + UnitCode + "'";
                    i      = DB120Help.ExecuteSql(strsql);
                    if (i > 0)
                    {
                        LogHelper.WriteLog("病历信息对应记录删除成功");
                    }
                }
            }
        }
示例#6
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <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);
        }
示例#7
0
        /// <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;
            }
        }
示例#8
0
 /// <summary>
 /// 更新患者病历信息isupdated=0
 /// </summary>
 /// <param name="czdh"></param>
 /// <param name="slh"></param>
 /// <returns></returns>
 public int UpdateSuffererCaseHistoryData(string HZXH, string slh)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateSuffererCaseHistoryDataStr(HZXH, slh));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#9
0
 /// <summary>
 /// 出车信息数据上报isupdated=0
 /// </summary>
 /// <param name="pk"></param>
 /// <returns></returns>
 public int UpdateDispatchVehicle(string lsh, string cs, string clbh)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateDispatchVehicleStr(lsh, cs, clbh));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#10
0
 /// <summary>
 /// 单位信息数据isupdated=0
 /// </summary>
 /// <param name="unitCode"></param>
 /// <returns></returns>
 public int UpdateUnitInfoData(string unitCode)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateUnitInfoDataStr(unitCode));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#11
0
 /// <summary>
 /// 联网车辆同步对应表数据isupdate=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdateLWCLTBDYBData(string LocalLSH, string LocalCS, string LocalCLBH)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateLWCLTBDYBDataStr(LocalLSH, LocalCS, LocalCLBH));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#12
0
 /// <summary>
 /// 联网调度关联表数据isupdate=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdateLWDDGLBData(string RemoteLSH, string RemoteDWBH, string LocalLSH)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateLWDDGLBDataStr(RemoteLSH, RemoteDWBH, LocalLSH));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#13
0
 /// <summary>
 /// 病历填写项目与值对应数据isupdate=0
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public int UpdateWeb_MedicalStatisticsData(string id)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateWeb_MedicalStatisticsDataStr(id));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#14
0
 //20160106修改人:朱星汉 修改内容:添加病历记录删除表的上传
 /// <summary>
 /// 病历删除表数据isupdate=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdateLWBLTBDELData(string id)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateLWBLTBDELDataStr(id));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#15
0
 /// <summary>
 /// 大型事故表数据isupdate=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdateDXSGBData(string LSH)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateDXSGBDataStr(LSH));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#16
0
 /// <summary>
 /// 病历基础信息表数据isupdate=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdateBLJCXXBData(string lx, string mc)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateBLJCXXBDataStr(lx, mc));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#17
0
 /// <summary>
 /// 系统人员数据上报isupdated=0
 /// </summary>
 /// <param name="pk"></param>
 /// <returns></returns>
 public int UpdateSysUserData(string RYBH)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateSysUserDataStr(RYBH));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#18
0
 /// <summary>
 /// 调度分站记录信息数据isupdate=0
 /// </summary>
 /// <param name="lsh"></param>
 /// <returns></returns>
 public int UpdateDispatchStationInfoData(string lsh, string ccdw)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateDispatchStationInfoDataStr(lsh, ccdw));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#19
0
 /// <summary>
 /// 车辆信息数据上报isupdated=0
 /// </summary>
 /// <param name="pk"></param>
 /// <returns></returns>
 public int UpdateVehicleData(string clbh)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateVehicleDataStr(clbh));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#20
0
 /// <summary>
 /// 联网病历关系同步对应表数据isupdate=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdateLWBLGXTBDYBData(string LocalLSH, string LocalStatisticsID)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateLWBLGXTBDYBDataStr(LocalLSH, LocalStatisticsID));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#21
0
 /// <summary>
 /// 人员关系数据上报isupdated=0
 /// </summary>
 /// <param name="xh"></param>
 /// <returns></returns>
 public int UpdatePVRelationData(string xh)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdatePVRelationDataStr(xh));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#22
0
 /// <summary>
 /// 患者信息数据isupdated=0
 /// </summary>
 /// <param name="lsh"></param>
 /// <param name="czdh"></param>
 /// <returns></returns>
 public int UpdateSuffererData(string lsh, string HZXH)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateSuffererDataStr(lsh, HZXH));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#23
0
 /// <summary>
 /// 受理信息数据上报isupdated=0
 /// </summary>
 /// <param name="lsh"></param>
 /// <returns></returns>
 public int UpdateDealData(string lsh)
 {
     try
     {
         int i = DB120Help.OperationRecord(UpdateDataSql.UpdateDealDataStr(lsh));
         return(i);
     }
     catch
     {
         return(0);
     }
 }
示例#24
0
文件: SyncData.cs 项目: zhutoutou/SJH
 /// <summary>
 /// 出车同步同时检测调度分站记录
 /// </summary>
 /// <param name="LocalLSH"></param>
 /// <param name="PCSJ"></param>
 /// <param name="DWBH"></param>
 /// <returns></returns>
 private void CheckDispatchRecord(string LSH, string PCSJ, string dwbh)
 {
     try
     {
         string zxzby = "";
         string dwmc  = "";
         string sql   = "select dwmc from dwxxb where dwbh='" + dwbh + "'";
         object obj   = DB120Help.GetSingle(sql);
         if (obj != null)
         {
             dwmc = obj.ToString();
             sql  = "select ZBY from sljlb where lsh='" + LSH + "'";
             obj  = DB120Help.GetSingle(sql);
             if (obj != null)
             {
                 zxzby = obj.ToString();
             }
             sql = "select lsh from ddfzjlb where lsh='" + LSH + "' and ccdw='" + dwmc + "'";
             obj = DB120Help.GetSingle(sql);
             if (obj == null)
             {
                 sql = "insert into ddfzjlb (lsh,ccdw,fzddsj,zxzby) values ('" + LSH + "','" + dwmc + "',to_date('" + PCSJ + "','YYYY-MM-DD HH24:MI:SS'),'" + zxzby + "')";
                 int i = DB120Help.ExecuteSql(sql);
                 if (i > 0)
                 {
                     LOG.LogHelper.WriteLog("该分站调度记录插入成功:" + dwmc);
                 }
                 else
                 {
                     LOG.LogHelper.WriteLog("该分站调度记录插入失败:" + dwmc);
                 }
             }
         }
         else
         {
             LOG.LogHelper.WriteLog("该单位编号有问题:" + dwbh);
         }
     }
     catch (Exception ex)
     {
         LOG.LogHelper.WriteLog("", ex);
     }
 }
示例#25
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <summary>
        /// 是否已成功插入出车信息表数据
        /// </summary>
        /// <param name="DispatchVehicle"></param>
        /// <param name="UnitCode"></param>
        /// <param name="strLcoalLSH"></param>
        /// <param name="strLocalCLBH"></param>
        /// <param name="strLocalCS"></param>
        /// <returns></returns>
        private bool hasInsertedDispatchVehicleRecord(DispatchVehicleData DispatchVehicle, string UnitCode, string strLcoalLSH, ref string strLocalCLBH, ref string strLocalCS)
        {
            bool result = false;

            try
            {
                //选取对应的虚拟车辆
                string sql = "select clbh from (select clbh,0 as zt from clxxb where ssdw= (select DWMC from dwxxb where dwbh='" + UnitCode + "') and (clzt = '任务完成' or clzt='待命') union select clbh,1 as zt from clxxb where ssdw=(select DWMC from dwxxb where dwbh='" + UnitCode + "')and clzt<>'待命' and clzt<>'任务完成')a order by a.zt";
                object obj = DB120Help.GetSingle(sql);
                if (obj != null)
                {
                    strLocalCLBH = obj.ToString();
                    //在本地库选取对应的车次
                    sql        = "select nvl(max(cs),'00') from ccxxb where lsh ='" + strLcoalLSH + "'";
                    obj        = DB120Help.GetSingle(sql);
                    strLocalCS = (int.Parse(obj.ToString()) + 1).ToString("00");
                    //将取出对应的本地流水号,车次,车辆编号已经本身的业务信息插入本地库,同时插入后将对应的主键在联网信息表中进行关联

                    DispatchVehicle.VehicleCode  = strLocalCLBH;
                    DispatchVehicle.DealRecordID = strLcoalLSH;
                    DispatchVehicle.Times        = strLocalCS;

                    LogHelper.WriteLog("新增CCXXB,LSH:" + strLcoalLSH + ",CLBH:" + strLocalCLBH + ",CS:" + strLocalCS);
                    ParameterSql parSql = SyncDataSql.GetAddCCXXBSql(DispatchVehicle);
                    int          i      = DB120Help.ExecuteSql(parSql.StrSql, parSql.OrclPar);
                    if (i > 0)
                    {
                        result = true;
                    }
                }
                else
                {
                    LogHelper.WriteLog("本地库没有" + UnitCode + "的车辆");
                }
            }
            catch (Exception ex)
            {
                LOG.LogHelper.WriteLog("", ex);
            }
            return(result);
        }
示例#26
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <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);
        }
示例#27
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <summary>
        /// 是否已成功插入病历记录表数据
        /// </summary>
        /// <returns></returns>
        private bool hasInsertedMedicalRecords(Web_MedicalRecords MedicalRecords, string strLcoalLSH, string strLocalCS, string strLocalCLBH, ref string strLocalRecordId)
        {
            bool result = false;

            try
            {
                MedicalRecords.CLBH = strLocalCLBH;
                MedicalRecords.LSH  = strLcoalLSH;
                MedicalRecords.CS   = strLocalCS;
                //20151215 修改人:朱星汉 修改内容:TIMPLATEFLAG,MEDICALTYPE字段不能为空,默认值为0
                if (MedicalRecords.TIMPLATEFLAG == null || MedicalRecords.TIMPLATEFLAG == "")
                {
                    MedicalRecords.TIMPLATEFLAG = "0";
                }
                if (MedicalRecords.MEDICALTYPE == null || MedicalRecords.MEDICALTYPE == "")
                {
                    MedicalRecords.MEDICALTYPE = "0";
                }
                ParameterSql parSql = SyncDataSql.GetAddMedicalRecordsSql(MedicalRecords);
                int          i      = DB120Help.ExecuteSql(parSql.StrSql, parSql.OrclPar);
                if (i <= 0)
                {
                    LogHelper.WriteLog("病历记录数据更新本地库失败流水号:" + strLcoalLSH + " 车次:" + strLocalCS + " 车辆编号:" + strLocalCLBH);
                }
                else
                {
                    //插入成功,则获取当前的ID
                    string Sql = "select max(ID) from web_medicalrecords where lsh='" + strLcoalLSH + "' and cs='" + strLocalCS + "' and clbh ='" + strLocalCLBH + "'";
                    object obj = DB120Help.GetSingle(Sql);
                    strLocalRecordId = obj.ToString();
                    LogHelper.WriteLog("病历记录数据更新本地库成功本地ID:" + strLocalRecordId + " 流水号:" + strLcoalLSH + " 车次:" + strLocalCS + " 车辆编号:" + strLocalCLBH);
                    result = true;
                }
            }
            catch (Exception ex)
            {
                LOG.LogHelper.WriteLog("", ex);
            }
            return(result);
        }
示例#28
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <summary>
        /// 是否为联网调度单
        /// </summary>
        /// <param name="lsh"></param>
        /// <param name="dwbh"></param>
        /// <returns></returns>
        private bool IsLWDD(string lsh, string dwbh, ref string localLsh)
        {
            localLsh = "";
            bool result = false;

            try
            {
                string sql = "select LocalLSH from LWDDGLB where DDLX= '1' and RemoteLSH= '" + lsh + "' and RemoteDWBH = '" + dwbh + "' or sgsb='1' and RemoteLSH= '" + lsh + "' and RemoteDWBH = '" + dwbh + "'";
                object obj = DB120Help.GetSingle(sql);

                if (obj != null)
                {
                    localLsh = obj.ToString();
                    result   = true;
                }
            }
            catch (Exception ex)
            {
                LOG.LogHelper.WriteLog("", ex);
            }
            return(result);
        }
示例#29
0
文件: SyncData.cs 项目: zhutoutou/SJH
        /// <summary>
        /// 同步出车信息数据
        /// </summary>
        public void SyncDispatchVehicleData(DispatchVehicleData DispatchVehicle, string UnitCode)
        {
            try
            {
                string strLcoalLSH   = "";
                string strTargetLSH  = DispatchVehicle.DealRecordID;
                string strTargetCS   = DispatchVehicle.Times;
                string strTargetCLBH = DispatchVehicle.VehicleCode;
                if (IsLWDD(DispatchVehicle.DealRecordID, UnitCode, ref strLcoalLSH))
                {
                    LogHelper.WriteLog("联网单需要更新CCXX,LSH:" + strLcoalLSH);
                    CheckDispatchRecord(strLcoalLSH, DispatchVehicle.DispatchVehicleTime, UnitCode);
                    CheckHJQY(strLcoalLSH, UnitCode);
                    string strLocalCS   = "";
                    string strLocalCLBH = "";
                    if (HasVehicleMatchRecord(DispatchVehicle.DealRecordID, DispatchVehicle.VehicleCode, DispatchVehicle.Times,
                                              UnitCode, ref strLocalCS, ref strLocalCLBH))
                    {
                        LogHelper.WriteLog("进入HasVehicleMatchRecord=true,LSH:" + strLcoalLSH);
                        string sql = "select * from ccxxb where  lsh = '" + strLcoalLSH + "' and cs = '" + strLocalCS + "' and clbh = '" + strLocalCLBH + "'";
                        object obj = DB120Help.GetSingle(sql);
                        //如果已经存在记录更新当前出车信息
                        if (obj != null)
                        {
                            DispatchVehicle.VehicleCode  = strLocalCLBH;
                            DispatchVehicle.DealRecordID = strLcoalLSH;
                            DispatchVehicle.Times        = strLocalCS;

                            LogHelper.WriteLog("更新CCXXB,LSH:" + strLcoalLSH + ",CLBH:" + strLocalCLBH + ",CS:" + strLocalCS);
                            ParameterSql parSql = SyncDataSql.GetUpadateCCXXBSql(DispatchVehicle);
                            int          i      = DB120Help.ExecuteSql(parSql.StrSql, parSql.OrclPar);
                            if (i == 0)
                            {
                                LogHelper.WriteLog("车辆信息数据更新本地库失败本地流水号:" + strLcoalLSH + " 车次:" + strLocalCS + " 车辆编号:" + strLocalCLBH);
                            }
                            else
                            //成功更新车辆信息表中的车辆状态
                            {
                                sql = "update clxxb set clzt ='" + DispatchVehicle.VehicleZT + "' where clbh= '" + strLocalCLBH + "'";
                                i   = DB120Help.ExecuteSql(sql);
                                if (i != 0)
                                {
                                    LogHelper.WriteLog("车辆状态更新成功 车辆编号:" + strLocalCLBH);
                                }

                                DispatchVehicleDataResp Data = new DispatchVehicleDataResp();
                                Data.CommandID    = DispatchVehicle.CommandID + "Resp";
                                Data.DealRecordID = strTargetLSH;
                                Data.VehicleCode  = strTargetCLBH;
                                Data.Times        = strTargetCS;
                                Data.Result       = 1;
                                ExchangeDataResp(Data);
                            }
                        }
                    }
                    //未在联网信息关联表关联主键 需要插入记录,同时虚拟该车的车辆
                    else
                    {
                        LogHelper.WriteLog("进入HasVehicleMatchRecord=false,LSH:" + strLcoalLSH);
                        strTargetLSH  = DispatchVehicle.DealRecordID;
                        strTargetCS   = DispatchVehicle.Times;
                        strTargetCLBH = DispatchVehicle.VehicleCode;
                        if (hasInsertedDispatchVehicleRecord(DispatchVehicle, UnitCode, strLcoalLSH, ref strLocalCLBH, ref strLocalCS))
                        {
                            //成功更新车辆信息表中的车辆状态
                            string sql = "update clxxb set clzt ='" + DispatchVehicle.VehicleZT + "' where clbh= '" + strLocalCLBH + "'";
                            int    i   = DB120Help.ExecuteSql(sql);
                            if (i != 0)
                            {
                                LogHelper.WriteLog("车辆状态更新成功 车辆编号:" + strLocalCLBH);
                            }
                            //主键关联
                            sql = "insert into LWCLTBDYB (locallsh,localCS,localCLBH,TargetLSH,TargetCS,TargetCLBH,TargetDWBH) values ('"
                                  + strLcoalLSH + "','" + strLocalCS + "','" + strLocalCLBH + "','"
                                  + strTargetLSH + "','" + strTargetCS + "','" + strTargetCLBH + "','" + UnitCode + "')";
                            i = DB120Help.ExecuteSql(sql);
                            if (i > 0)
                            {
                                LogHelper.WriteLog("车辆信息表主键关联成功本地流水号:" + strLcoalLSH + " 车次:" + strLocalCS + " 车辆编号:" + strLocalCLBH + "  关联的流水号:" + strTargetLSH + " 车次:" + strTargetCS + " 车辆编号:" + strTargetCLBH);
                            }
                            else
                            {
                                LogHelper.WriteLog("车辆信息表主键关联失败本地流水号:" + strLcoalLSH + " 车次:" + strLocalCS + " 车辆编号:" + strLocalCLBH + "  关联的流水号:" + strTargetLSH + " 车次:" + strTargetCS + " 车辆编号:" + strTargetCLBH);
                            }

                            DispatchVehicleDataResp Data = new DispatchVehicleDataResp();
                            Data.CommandID    = DispatchVehicle.CommandID + "Resp";
                            Data.DealRecordID = strTargetLSH;
                            Data.VehicleCode  = strTargetCLBH;
                            Data.Times        = strTargetCS;
                            Data.Result       = 1;
                            ExchangeDataResp(Data);
                        }
                    }
                }
                //非联网单直接更新不需要重发消息
                else
                {
                    DispatchVehicleDataResp Data = new DispatchVehicleDataResp();
                    Data.CommandID    = DispatchVehicle.CommandID + "Resp";
                    Data.DealRecordID = strTargetLSH;
                    Data.VehicleCode  = strTargetCLBH;
                    Data.Times        = strTargetCS;
                    Data.Result       = 1;
                    ExchangeDataResp(Data);
                }
            }
            catch (Exception ex)
            {
                DispatchVehicleDataResp Data = new DispatchVehicleDataResp();

                Data.CommandID      = DispatchVehicle.CommandID + "Resp";
                Data.DealRecordID   = DispatchVehicle.DealRecordID;
                Data.VehicleCode    = DispatchVehicle.VehicleCode;
                Data.Times          = DispatchVehicle.Times;
                Data.Result         = 0;
                Data.FailtureReason = ex.Message;
                ExchangeDataResp(Data);
                LogHelper.WriteLog("", ex);
            }
        }
示例#30
0
        public bool DBIsConnected()
        {
            bool bIsConnected = DB120Help.IsConnected();

            return(bIsConnected);
        }