//private DataTable GetStatisticsCharge(DateTime beginTime, DateTime endTime)
        //{
        //    if (m_StatisticsCharge == null)
        //        m_StatisticsCharge = m_DAL.GetALLStatisticsCharge(beginTime, endTime);
        //    return m_StatisticsCharge;
        //}


        #region 获取个人业务
        public PersonalStatisticsInfo GetPersonalStatisticsDD(DateTime beginTime, DateTime endTime)
        {
            string    selfWorkCode = UserOperateContext.Current.Session_UsrInfo.WorkCode;
            DataTable tableall     = GetStatisticsDD(beginTime, endTime);

            //在表里循环遍历,当某一行的PersonalCode跟session 中获取的ID 相等时,将那一行的数据取出,赋给Model,Return
            PersonalStatisticsInfo AEinfo = new PersonalStatisticsInfo();

            foreach (DataRow dr in tableall.Rows)
            {
                if (Convert.ToString(dr["WorkCode"]) == selfWorkCode)
                {
                    AEinfo.PersonName            = DBConvert.ConvertStringToString(dr["Name"]);
                    AEinfo.PTaskTimes            = DBConvert.ConvertStringToString(dr["SendCarTimes"]);
                    AEinfo.PFirstAidTimes        = DBConvert.ConvertStringToString(dr["FirstAidTimes"]);
                    AEinfo.PTransTimes           = DBConvert.ConvertStringToString(dr["TransTimes"]);
                    AEinfo.PGoHomeTimes          = DBConvert.ConvertStringToString(dr["GoHomeTimes"]);
                    AEinfo.PDays                 = DBConvert.ConvertStringToString(dr["Days"]);
                    AEinfo.PTaskTimesEveryDay    = DBConvert.ConvertStringToString(dr["AvgDaySendCarTimes"]);
                    AEinfo.PAvgSendTime          = DBConvert.ConvertStringToString(dr["AvgSendCarTime"]);
                    AEinfo.PAvgArriveTime        = DBConvert.ConvertStringToString(dr["AvgArrivingSceneTime"]);
                    AEinfo.PAvgLocalAidTime      = DBConvert.ConvertStringToString(dr["AvgSceneRescueTime"]);
                    AEinfo.PAvgTransTime         = DBConvert.ConvertStringToString(dr["AvgTransportTime"]);
                    AEinfo.PAvgHospitalTransTime = DBConvert.ConvertStringToString(dr["AvgHospitalDeliveryTime"]);
                    AEinfo.PAvgReactTime         = DBConvert.ConvertStringToString(dr["AvgResponseTime"]);
                    AEinfo.PAvgTurnTime          = DBConvert.ConvertStringToString(dr["AvgRevolveTime"]);
                }
            }
            return(AEinfo);
        }
Beispiel #2
0
        /// <summary>
        /// 根据表名来得到管理库字典数据(有效数据)
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns></returns>
        private List <M_Dictionary> GetManagerDictioinary(string Conn)
        {
            M_Dictionary        info;
            List <M_Dictionary> list   = new List <M_Dictionary>();
            StringBuilder       strSQL = new StringBuilder();

            strSQL.Append(" select ID,Name,SN,IsActive from " + m_TableName + " ");
            strSQL.Append(" where IsActive=1 order by SN");
            try
            {
                using (DataSet ds = SqlHelper.ExecuteDataSet(Conn, CommandType.Text, strSQL.ToString(), null))
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        info          = new M_Dictionary();
                        info.ID       = DBConvert.ConvertStringToString(dr["ID"]);
                        info.Name     = DBConvert.ConvertStringToString(dr["Name"]);
                        info.SN       = Convert.ToInt32(dr["SN"]);
                        info.IsActive = Convert.ToBoolean(dr["IsActive"]);
                        list.Add(info);
                    }
                    return(list);
                }
            }
            catch (Exception)
            {
                //Log4Net.LogError("DictionaryDAL/GetDictionary", ex.Message);
                return(null);
            }
        }
Beispiel #3
0
        /// <summary>
        /// 电话信息
        /// </summary>
        /// <param name="almCode"></param>
        /// <returns></returns>
        public static List <AttemperTelInfo> GetTelInfo(string almCode)
        {
            AttemperTelInfo        info;
            List <AttemperTelInfo> list = new List <AttemperTelInfo>();
            StringBuilder          sb   = new StringBuilder();

            sb.Append("select 主叫号码,通话时刻,结束时刻,台号,");
            sb.Append("调度员=tp.姓名,通话类型=tzact.名称 ");
            sb.Append("from dbo.TAlarmCall tac ");
            sb.Append("left join dbo.TZAlarmCallType tzact on tzact.编码=tac.通话类型编码 ");
            sb.Append("left join dbo.TPerson tp on tp.编码=tac.调度员编码 ");
            sb.Append("where 事件编码='" + almCode + "' ");
            using (DataSet ds = SQLHelper.ExecuteDataSet(AppConfig.ConnectionStringReport, CommandType.Text, sb.ToString(), null))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    info            = new AttemperTelInfo();
                    info.TelNumber  = DBConvert.ConvertStringToString(dr["主叫号码"]);
                    info.CallTime   = DBConvert.ConvertStringToString(dr["通话时刻"]);
                    info.EndTime    = DBConvert.ConvertStringToString(dr["结束时刻"]);
                    info.DaskNumber = DBConvert.ConvertStringToString(dr["台号"]);
                    info.Attemper   = DBConvert.ConvertStringToString(dr["调度员"]);
                    info.CallType   = DBConvert.ConvertStringToString(dr["通话类型"]);
                    list.Add(info);
                }
                return(list);
            }
        }
Beispiel #4
0
        /// <summary>
        /// 打印命令单
        /// 2012.1.6 刘爱青
        /// </summary>
        /// <param name="TaskCode"></param>
        /// <returns></returns>
        public static StationCommandInfo PrintCommand(string TaskCode)
        {
            try
            {
                StringBuilder sb = new StringBuilder();
                sb.Append(" select 事件编码=tt.事件编码,收单时刻=tace.发送指令时刻,调度员=tp.工号,台号=right(tt.事件编码,2),现场地址=tace.现场地址,等车地址=tace.等车地址,送往地址=tace.送往地点,");
                sb.Append("呼救电话=tace.呼救电话,联系电话=tace.联系电话+tace.分机,联系人=tace.联系人,车辆='['+ta.实际标识+']'+'['+ta.车牌号码+']',");
                sb.Append("随车人员=tt.司机+' '+tt.医生+' '+tt.护士+' '+tt.担架工+' '+tt.抢救员,特殊要求=tace.特殊要求,");
                sb.Append("患者姓名=tace.患者姓名,性别=tace.性别,年龄=tace.年龄,民族=tace.民族,国籍=tace.国籍,患者人数=tace.患者人数,");
                sb.Append("初步判断=tace.主诉,备注=tace.备注,");
                sb.Append(" 分站=ts.名称 ");
                sb.Append("from TTask tt ");
                sb.Append(" left join TAcceptEvent tace on tace.事件编码=tt.事件编码 and tt.受理序号=tace.受理序号");
                sb.Append(" left join TAlarmEvent tae on tae.事件编码=tt.事件编码");
                sb.Append(" left join TAmbulance ta on ta.车辆编码=tt.车辆编码 ");
                sb.Append(" left join TStation ts on ts.编码=tt.分站编码 ");
                sb.Append(" left join TPerson tp on tp.编码=tt.责任调度人编码 ");
                sb.Append(" where tt.任务编码='").Append(TaskCode).Append("'");
                using (DataSet ds = SQLHelper.ExecuteDataSet(AppConfig.ConnectionStringReport, CommandType.Text, sb.ToString(), null))
                {
                    DataRow            dr   = ds.Tables[0].Rows[0];
                    StationCommandInfo info = new StationCommandInfo();
                    info.EventCode = DBConvert.ConvertStringToString(dr["事件编码"]);
                    info.ReceiveRecordCommandTime = DBConvert.ConvertStringToString(dr["收单时刻"]);
                    info.DispatcherWorkid         = DBConvert.ConvertStringToString(dr["调度员"]);
                    info.DeskID        = DBConvert.ConvertStringToString(dr["台号"]);
                    info.LocalAddr     = DBConvert.ConvertStringToString(dr["现场地址"]);
                    info.WaitAddr      = DBConvert.ConvertStringToString(dr["等车地址"]);
                    info.SendAddr      = DBConvert.ConvertStringToString(dr["送往地址"]);
                    info.AlarmTel      = DBConvert.ConvertStringToString(dr["呼救电话"]);
                    info.LinkTel       = DBConvert.ConvertStringToString(dr["联系电话"]);
                    info.LinkPerson    = DBConvert.ConvertStringToString(dr["联系人"]);
                    info.RealSignbunch = DBConvert.ConvertStringToString(dr["车辆"]);
                    info.AmbPersons    = DBConvert.ConvertStringToString(dr["随车人员"]);
                    info.SpecialNeed   = DBConvert.ConvertStringToString(dr["特殊要求"]);

                    info.PatientName  = DBConvert.ConvertStringToString(dr["患者姓名"]);
                    info.Sex          = DBConvert.ConvertStringToString(dr["性别"]);
                    info.Age          = DBConvert.ConvertStringToString(dr["年龄"]);
                    info.Nationality  = DBConvert.ConvertStringToString(dr["国籍"]);
                    info.Folk         = DBConvert.ConvertStringToString(dr["民族"]);
                    info.PatientCount = DBConvert.ConvertStringToString(dr["患者人数"]);
                    info.Judge        = DBConvert.ConvertStringToString(dr["初步判断"]);
                    info.Remark       = DBConvert.ConvertStringToString(dr["备注"]);

                    info.StationName = DBConvert.ConvertStringToString(dr["分站"]);
                    return(info);
                }
            }
            catch (Exception ex)
            {
                Log4Net.LogError("StatisticsDAL/PrintCommand()", ex.ToString());
                return(null);
            }
        }
Beispiel #5
0
        private List <M_Dictionary> GetDictionary(string Conn, string code)
        {
            M_Dictionary        info;
            List <M_Dictionary> list   = new List <M_Dictionary>();
            StringBuilder       strSQL = new StringBuilder();

            if (m_TableName == "TStation")
            {
                strSQL.Append(" select 编码,名称,顺序号,是否有效 from " + m_TableName + " ");
                strSQL.Append(" where 是否有效=1 ");
                WhereClauseUtility.AddIntEqual("中心编码", Convert.ToInt32(code), strSQL);
                strSQL.Append(" order by 顺序号");
            }
            else if (m_TableName == "TAmbulance")
            {
                strSQL.Append(" select 编码=车辆编码,名称=实际标识,顺序号=1,是否有效 from " + m_TableName + " ");
                strSQL.Append(" where 是否有效=1 ");
                WhereClauseUtility.AddStringEqual("分站编码", code, strSQL);
                strSQL.Append(" order by 实际标识");
            }
            else if (m_TableName == "TPerson")
            {
                strSQL.Append(" select 编码,名称=姓名,顺序号,是否有效 from " + m_TableName + " ");
                strSQL.Append(" where 是否有效=1 and 类型编码=2 order by 姓名");
            }
            else
            {
                strSQL.Append(" select 编码,名称,顺序号,是否有效 from " + m_TableName + " ");
                strSQL.Append(" where 是否有效=1 order by 顺序号");
            }
            try
            {
                using (DataSet ds = SqlHelper.ExecuteDataSet(Conn, CommandType.Text, strSQL.ToString(), null))
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        info          = new M_Dictionary();
                        info.ID       = DBConvert.ConvertStringToString(dr["编码"]);
                        info.Name     = DBConvert.ConvertStringToString(dr["名称"]);
                        info.SN       = Convert.ToInt32(dr["顺序号"]);
                        info.IsActive = Convert.ToBoolean(dr["是否有效"]);
                        list.Add(info);
                    }
                    return(list);
                }
            }
            catch (Exception)
            {
                //Log4Net.LogError("DictionaryDAL/GetDictionary", ex.Message);
                return(null);
            }
        }
Beispiel #6
0
        //通过id查到此id对应的IsActive,SN,PinYin字段的值
        public M_ZICDNewExt GetImpressionList(int id)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(" select IsActive,SN,PinYin  from M_ZICDNew where ID='" + id + "'");
            using (SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.MainConnectionString, CommandType.Text, sb.ToString(), null))
            {
                M_ZICDNewExt info = new M_ZICDNewExt();
                if (dr.Read())
                {
                    info.IsActive = Convert.ToBoolean(dr["IsActive"]);
                    info.SN       = Convert.ToInt32(dr["SN"]);
                    info.PinYin   = DBConvert.ConvertStringToString(dr["PinYin"]);
                }
                return(info);
            }
        }
Beispiel #7
0
        /// <summary>
        /// 事件信息
        /// </summary>
        /// <param name="almCode"></param>
        /// <returns></returns>
        public static List <AttemperAlarmInfo> GetAlarmInfo(string almCode)
        {
            AttemperAlarmInfo        info;
            List <AttemperAlarmInfo> list = new List <AttemperAlarmInfo>();
            StringBuilder            sb   = new StringBuilder();

            sb.Append(@"
declare @eventCode varchar(16)
set @eventCode='" + almCode + "' ");
            sb.Append(@"
SELECT tae.事件编码,tae.首次呼救电话,tac.患者姓名,tac.主诉,tac.联系人,
                tac.性别,病情=tzis.名称,tac.联系电话,tac.年龄,担架=case when 是否需要担架=1 then '需要' else '不需要' end,
                tac.分机,tac.民族,tac.特殊要求,tac.现场地址,事件类型=tzat.名称,tac.送往地点,tac.等车地址
                from TAcceptEvent tac 
                left join TAlarmEvent tae on tac.事件编码=tae.事件编码
                left join TZIllState tzis on tac.病情编码=tzis.编码 
                left join TZAlarmEventType tzat on tae.事件类型编码=tzat.编码 
                where tac.事件编码=@eventCode 
                and tac.受理序号=(select max(受理序号) from TAcceptEvent where 事件编码=@eventCode)");
            using (DataSet ds = SQLHelper.ExecuteDataSet(AppConfig.ConnectionStringReport, CommandType.Text, sb.ToString(), null))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    info                = new AttemperAlarmInfo();
                    info.AlarmCode      = DBConvert.ConvertStringToString(dr["事件编码"]);
                    info.AlarmCall      = DBConvert.ConvertStringToString(dr["首次呼救电话"]);
                    info.Name           = DBConvert.ConvertStringToString(dr["患者姓名"]);
                    info.Judge          = DBConvert.ConvertStringToString(dr["主诉"]);
                    info.LinkPerson     = DBConvert.ConvertStringToString(dr["联系人"]);
                    info.Sex            = DBConvert.ConvertStringToString(dr["性别"]);
                    info.IllState       = DBConvert.ConvertStringToString(dr["病情"]);
                    info.LinkPhone      = DBConvert.ConvertStringToString(dr["联系电话"]);
                    info.Age            = DBConvert.ConvertStringToString(dr["年龄"]);
                    info.IsNeedLitter   = DBConvert.ConvertStringToString(dr["担架"]);
                    info.ExtensionPhone = DBConvert.ConvertStringToString(dr["分机"]);
                    info.MinZu          = DBConvert.ConvertStringToString(dr["民族"]);
                    info.Request        = DBConvert.ConvertStringToString(dr["特殊要求"]);
                    info.LocalAddr      = DBConvert.ConvertStringToString(dr["现场地址"]);
                    info.AlarmType      = DBConvert.ConvertStringToString(dr["事件类型"]);
                    info.SendAddr       = DBConvert.ConvertStringToString(dr["送往地点"]);
                    info.WaitAddr       = DBConvert.ConvertStringToString(dr["等车地址"]);
                    list.Add(info);
                }
                return(list);
            }
        }
Beispiel #8
0
        public AcceptEventInfo GetEventNode(string code)
        {
            StringBuilder sb = new StringBuilder();

            sb.Append(@"  select A.事件编码,受理序号
                        from TAcceptEvent A
                         where A.事件编码='" + code + @"'
                    order by 受理序号 ");
            using (SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null))
            { // DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null);
                AcceptEventInfo ENinfo = new AcceptEventInfo();
                if (dr.Read())
                {
                    ENinfo.EventCode   = DBConvert.ConvertStringToString(dr["事件编码"]);
                    ENinfo.AcceptOrder = Convert.ToInt32(dr["受理序号"]);
                }
                return(ENinfo);
            }
        }
Beispiel #9
0
        public List <M_Dictionary> GetMSDictionaryInfos(string typeCode, string isPatient)
        {
            M_Dictionary        info;
            List <M_Dictionary> list  = new List <M_Dictionary>();
            StringBuilder       sbSQL = new StringBuilder();

            sbSQL.Append(" select td.ID,td.Name,td.TypeID,Type=tdt.Description,td.SN,td.IsActive ");
            //SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(SqlHelper.ConnectionPatientRecordTransaction);//取管理库的链接字符串
            //是病历字典表
            if (isPatient == "1")
            {
                sbSQL.Append(" from dbo.M_Dictionary td ");
                sbSQL.Append(" left join dbo.M_DictionaryType tdt on tdt.TypeID=td.TypeID ");
                sbSQL.Append(" where td.IsActive=1 ");
                WhereClauseUtility.AddStringInSelectQuery("td.TypeID", typeCode, sbSQL);//20150723修改为允许一次查询多个类
            }
            else
            {
                sbSQL.Append(" from dbo.TDictionary td ");
                sbSQL.Append(" left join dbo.TDictionaryType tdt on tdt.TypeID=td.TypeID ");
                sbSQL.Append(" where td.IsActive=1 ");//具体再修改
                WhereClauseUtility.AddStringEqual("td.TypeID", typeCode, sbSQL);
            }

            sbSQL.Append("order by td.SN ");
            using (DataSet ds = SqlHelper.ExecuteDataSet(SqlHelper.MainConnectionString, CommandType.Text, sbSQL.ToString(), null))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    info          = new M_Dictionary();
                    info.ID       = DBConvert.ConvertStringToString(dr["ID"]);
                    info.Name     = DBConvert.ConvertStringToString(dr["Name"]);
                    info.TypeID   = DBConvert.ConvertStringToString(dr["TypeID"]);
                    info.SN       = Convert.ToInt32(dr["SN"]);
                    info.IsActive = Convert.ToBoolean(dr["IsActive"]);
                    list.Add(info);
                }
                return(list);
            }
        }
Beispiel #10
0
        /// <summary>
        /// 受理信息
        /// </summary>
        /// <param name="almCode"></param>
        /// <returns></returns>
        public static List <AttemperAcceptInfo> GetAcceptInfo(string almCode)
        {
            AttemperAcceptInfo        info;
            List <AttemperAcceptInfo> list = new List <AttemperAcceptInfo>();
            StringBuilder             sb   = new StringBuilder();

            sb.Append(@"
declare @eventCode varchar(16)
set @eventCode='" + almCode + "' ");
            sb.Append(@"
                SELECT tac.受理序号,受理类型=tzac.名称,调度员=tp.姓名,
                tac.电话振铃时刻,tac.开始受理时刻,tac.发送指令时刻,tac.结束受理时刻,
                tac.备注,tac.MPDS备注 
                from TAcceptEvent tac 
                left join TPerson tp on tp.编码=tac.责任受理人编码 
                left join TZAcceptEventType tzac on tac.受理类型编码=tzac.编码 
                where tac.事件编码=@eventCode ");
            using (DataSet ds = SQLHelper.ExecuteDataSet(AppConfig.ConnectionStringReport, CommandType.Text, sb.ToString(), null))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    info                = new AttemperAcceptInfo();
                    info.Order          = DBConvert.ConvertStringToString(dr["受理序号"]);
                    info.AcceptType     = DBConvert.ConvertStringToString(dr["受理类型"]);
                    info.AttemperPerson = DBConvert.ConvertStringToString(dr["调度员"]);
                    info.ShakeTime      = DBConvert.ConvertStringToString(dr["电话振铃时刻"]);
                    info.StartTime      = DBConvert.ConvertStringToString(dr["开始受理时刻"]);
                    info.DispatchTime   = DBConvert.ConvertStringToString(dr["发送指令时刻"]);
                    info.EndTime        = DBConvert.ConvertStringToString(dr["结束受理时刻"]);
                    info.Remark         = DBConvert.ConvertStringToString(dr["备注"]);
                    info.MPDSRemark     = DBConvert.ConvertStringToString(dr["MPDS备注"]);
                    list.Add(info);
                }
                return(list);
            }
        }
Beispiel #11
0
        public AcceptEventInfo GetAcceptEventInfoByCode(string code, int orderNum)
        {
            AcceptEventInfo AEinfo;
            StringBuilder   sb = new StringBuilder();

            sb.Append(@"SELECT 事件编码=tae.事件编码,受理序号=tae.受理序号,受理类型编码,受理类型子编码,责任受理人编码,呼救电话=tae.呼救电话
            ,电话振铃时刻=tae.电话振铃时刻,开始受理时刻=tae.开始受理时刻,结束受理时刻=tae.结束受理时刻,发送指令时刻,现场地址,等车地址
            ,送往地点,往救地点类型编码,送往地点类型编码,联系人,联系电话,分机,患者姓名,性别
            ,年龄,国籍,主诉,病种判断,病情编码=tale.病情编码,是否需要担架,伤亡人数,特殊要求,是否标注
            ,X坐标,Y坐标,派车列表, 备注=tale.备注,TZET.名称 as 受理类型,TP.姓名 as 责任受理人,病情=tzis.名称 
            ,往救地点类型=tzlat.名称,送往地点类型=tzsat.名称,责任受理人工号=tp.工号

             FROM TAcceptEvent TAE
             inner join TZAcceptEventType TZET on TZET.编码 = TAE.受理类型编码
             inner join TPerson TP on TP.编码 = TAE.责任受理人编码
             left join TAlarmEvent tale on tae.事件编码= tale.事件编码
             left join TZIllState tzis on tzis.编码 = tale.病情编码
             left join TZLocalAddrType tzlat on tzlat.编码 = tale.往救地点类型编码
             left join TZSendAddrType tzsat on tzsat.编码 = tale.送往地点类型编码
            left join TTask tk on tae.事件编码 =tk.事件编码
             where tae.事件编码 = '" + code + @"' and tae.受理序号='" + orderNum + @"'");
            using (SqlDataReader dr = SqlHelper.ExecuteReader(SqlHelper.AttemperConnectionString, CommandType.Text, sb.ToString(), null))
            {
                AEinfo = new AcceptEventInfo();
                if (dr.Read())
                {
                    AEinfo.EventCode          = DBConvert.ConvertStringToString(dr["事件编码"]);
                    AEinfo.AcceptOrder        = Convert.ToInt32(dr["受理序号"]);
                    AEinfo.TypeId             = Convert.ToInt32(dr["受理类型编码"]);
                    AEinfo.DetailReasonId     = Convert.ToInt32(dr["受理类型子编码"]);
                    AEinfo.AcceptPersonCode   = DBConvert.ConvertStringToString(dr["责任受理人编码"]);
                    AEinfo.AcceptPersonWorkID = DBConvert.ConvertStringToString(dr["责任受理人工号"]);
                    AEinfo.AlarmTel           = DBConvert.ConvertStringToString(dr["呼救电话"]);
                    //  AEinfo.HangUpTime = DBConvert.ConvertNullableToNullableTime(dr["挂起时刻"].ToString());
                    AEinfo.RingTime        = DBConvert.ConvertNullableToNullableTime(dr["电话振铃时刻"].ToString());
                    AEinfo.AcceptBeginTime = DBConvert.ConvertNullableToNullableTime(dr["开始受理时刻"].ToString());
                    AEinfo.AcceptEndTime   = DBConvert.ConvertNullableToNullableTime(dr["结束受理时刻"].ToString());
                    AEinfo.CommandTime     = DBConvert.ConvertNullableToNullableTime(dr["发送指令时刻"].ToString());
                    AEinfo.LocalAddr       = DBConvert.ConvertStringToString(dr["现场地址"]);
                    AEinfo.WaitAddr        = DBConvert.ConvertStringToString(dr["等车地址"]);
                    AEinfo.SendAddr        = DBConvert.ConvertStringToString(dr["送往地点"]);
                    AEinfo.LocalAddrTypeId = Convert.ToInt32(dr["往救地点类型编码"]);
                    AEinfo.SendAddrTypeId  = Convert.ToInt32(dr["送往地点类型编码"]);
                    AEinfo.LinkMan         = DBConvert.ConvertStringToString(dr["联系人"]);
                    AEinfo.LinkTel         = DBConvert.ConvertStringToString(dr["联系电话"]);
                    AEinfo.Extension       = DBConvert.ConvertStringToString(dr["分机"]);
                    AEinfo.PatientName     = DBConvert.ConvertStringToString(dr["患者姓名"]);
                    AEinfo.Sex             = DBConvert.ConvertStringToString(dr["性别"]);
                    AEinfo.Age             = DBConvert.ConvertStringToString(dr["年龄"]);
                    // AEinfo.Folk = DBConvert.ConvertStringToString(dr["民族"]);
                    AEinfo.National      = DBConvert.ConvertStringToString(dr["国籍"]);
                    AEinfo.AlarmReason   = DBConvert.ConvertStringToString(dr["主诉"]);
                    AEinfo.Judge         = DBConvert.ConvertStringToString(dr["病种判断"]);
                    AEinfo.IllStateId    = Convert.ToInt32(dr["病情编码"]);
                    AEinfo.IsNeedLitter  = Convert.ToBoolean(dr["是否需要担架"]);
                    AEinfo.PatientCount  = Convert.ToInt32(dr["伤亡人数"]);
                    AEinfo.SpecialNeed   = DBConvert.ConvertStringToString(dr["特殊要求"]);
                    AEinfo.IsLabeled     = Convert.ToBoolean(dr["是否标注"]);
                    AEinfo.X             = Convert.ToDouble(dr["X坐标"]);
                    AEinfo.Y             = Convert.ToDouble(dr["Y坐标"]);
                    AEinfo.AmbulanceList = DBConvert.ConvertStringToString(dr["派车列表"]);
                    AEinfo.Remark        = DBConvert.ConvertStringToString(dr["备注"]);
                    AEinfo.AcceptType    = DBConvert.ConvertStringToString(dr["受理类型"]);
                    AEinfo.Dispatcher    = DBConvert.ConvertStringToString(dr["责任受理人"]);
                    AEinfo.IllState      = DBConvert.ConvertStringToString(dr["病情"]);
                    AEinfo.LocalAddrType = DBConvert.ConvertStringToString(dr["往救地点类型"]);
                    AEinfo.SendAddrType  = DBConvert.ConvertStringToString(dr["送往地点类型"]);
                    //AEinfo.AcceptPersonWorkID = DBConvert.ConvertStringToString(dr["责任受理人工号"]);
                    // AEinfo.BackUpOne = DBConvert.ConvertStringToString(dr["保留字段1"]);
                    //AEinfo.BackUpTwo = DBConvert.ConvertStringToString(dr["保留字段2"]);
                    // AEinfo.HangUpTime = DBConvert.ConvertNullableToNullableTime(dr["挂起时刻"].ToString());
                }
                return(AEinfo);
            }
        }
        public CenterStatisticsInfo GetCenterStatisticsDD(DateTime beginTime, DateTime endTime)
        {
            string selfCenterID = UserOperateContext.Current.Session_UsrInfo.P_Department.DispatchSubCenterID;

            if (selfCenterID != null && selfCenterID != "")
            {
                DataTable tableall = GetStatisticsDD(beginTime, endTime);

                //在表里循环遍历,当某一行的CenterID跟session 中获取的selfCenterID 相等时,将那一行的数据取出,赋给Model,Return
                CenterStatisticsInfo ACinfo = new CenterStatisticsInfo();
                int STaskTimes = 0; int SFirstAidTimes = 0; int STransTimes = 0; int a = 0; int SGoHomeTimes = 0; int SDays = 0; int STaskTimesEveryDay = 0;
                int SAvgSendTime = 0; int SAvgArriveTime = 0; int SAvgLocalAidTime = 0; int SAvgTransTime = 0; int SAvgHospitalTransTime = 0;
                int SAvgReactTime = 0; int SAvgTurnTime = 0;
                foreach (DataRow dr in tableall.Rows)
                {
                    if (Convert.ToString(dr["center"]) == selfCenterID)
                    {
                        a                      = a + 1;
                        STaskTimes            += Convert.ToInt32(dr["SendCarTimes"]);
                        SFirstAidTimes        += Convert.ToInt32(dr["FirstAidTimes"]);
                        STransTimes           += Convert.ToInt32(dr["TransTimes"]);
                        SGoHomeTimes          += Convert.ToInt32(dr["GoHomeTimes"]);
                        SDays                 += Convert.ToInt32(dr["Days"]);
                        STaskTimesEveryDay    += Convert.ToInt32(dr["AvgDaySendCarTimes"]);
                        SAvgSendTime          += Convert.ToInt32(dr["AvgSendCarTime"]);
                        SAvgArriveTime        += Convert.ToInt32(dr["AvgArrivingSceneTime"]);
                        SAvgLocalAidTime      += Convert.ToInt32(dr["AvgSceneRescueTime"]);
                        SAvgTransTime         += Convert.ToInt32(dr["AvgTransportTime"]);
                        SAvgHospitalTransTime += Convert.ToInt32(dr["AvgHospitalDeliveryTime"]);
                        SAvgReactTime         += Convert.ToInt32(dr["AvgResponseTime"]);
                        SAvgTurnTime          += Convert.ToInt32(dr["AvgRevolveTime"]);

                        ACinfo.CenterName = DBConvert.ConvertStringToString(dr["tcName"]);
                    }
                }
                if (a != 0)
                {
                    ACinfo.CTaskTimes            = Convert.ToString(STaskTimes);
                    ACinfo.CFirstAidTimes        = Convert.ToString(SFirstAidTimes);
                    ACinfo.CTransTimes           = Convert.ToString(STransTimes);
                    ACinfo.CGoHomeTimes          = Convert.ToString(SGoHomeTimes);
                    ACinfo.CDays                 = Convert.ToString(SDays);
                    ACinfo.CTaskTimesEveryDay    = Convert.ToString(STaskTimesEveryDay / a);
                    ACinfo.CAvgSendTime          = Convert.ToString(SAvgSendTime / a);
                    ACinfo.CAvgArriveTime        = Convert.ToString(SAvgArriveTime / a);
                    ACinfo.CAvgLocalAidTime      = Convert.ToString(SAvgLocalAidTime / a);
                    ACinfo.CAvgTransTime         = Convert.ToString(SAvgTransTime / a);
                    ACinfo.CAvgHospitalTransTime = Convert.ToString(SAvgHospitalTransTime / a);
                    ACinfo.CAvgReactTime         = Convert.ToString(SAvgReactTime / a);
                    ACinfo.CAvgTurnTime          = Convert.ToString(SAvgTurnTime / a);

                    return(ACinfo);
                }
                else
                {
                    return(new CenterStatisticsInfo());
                }
            }
            else
            {
                return(new CenterStatisticsInfo());
            }
        }
        //获取分站调度信息
        public StationStatisticsInfo GetStationStatisticsDD(DateTime beginTime, DateTime endTime)
        {
            string selfWorkCode  = UserOperateContext.Current.Session_UsrInfo.WorkCode;
            string selfStationID = m_DAL.GetstaionCodeByWorkCodeTAmbulance(selfWorkCode);

            if (selfStationID != null && selfStationID != "")
            {
                DataTable tableall = GetStatisticsDD(beginTime, endTime);
                //在表里循环遍历,当某一行的station跟session 中获取的selfStationID 相等时,将那一行的数据取出,赋给Model,Return
                StationStatisticsInfo ASinfo = new StationStatisticsInfo();
                int STaskTimes = 0; int SFirstAidTimes = 0; int STransTimes = 0; int a = 0; int SGoHomeTimes = 0; int SDays = 0; int STaskTimesEveryDay = 0;
                int SAvgSendTime = 0; int SAvgArriveTime = 0; int SAvgLocalAidTime = 0; int SAvgTransTime = 0; int SAvgHospitalTransTime = 0;
                int SAvgReactTime = 0; int SAvgTurnTime = 0;
                foreach (DataRow dr in tableall.Rows)
                {
                    if (Convert.ToString(dr["station"]) == selfStationID)
                    {
                        a                      = a + 1;
                        STaskTimes            += Convert.ToInt32(dr["SendCarTimes"]);
                        SFirstAidTimes        += Convert.ToInt32(dr["FirstAidTimes"]);
                        STransTimes           += Convert.ToInt32(dr["TransTimes"]);
                        SGoHomeTimes          += Convert.ToInt32(dr["GoHomeTimes"]);
                        SDays                 += Convert.ToInt32(dr["Days"]);
                        STaskTimesEveryDay    += Convert.ToInt32(dr["AvgDaySendCarTimes"]);
                        SAvgSendTime          += Convert.ToInt32(dr["AvgSendCarTime"]);
                        SAvgArriveTime        += Convert.ToInt32(dr["AvgArrivingSceneTime"]);
                        SAvgLocalAidTime      += Convert.ToInt32(dr["AvgSceneRescueTime"]);
                        SAvgTransTime         += Convert.ToInt32(dr["AvgTransportTime"]);
                        SAvgHospitalTransTime += Convert.ToInt32(dr["AvgHospitalDeliveryTime"]);
                        SAvgReactTime         += Convert.ToInt32(dr["AvgResponseTime"]);
                        SAvgTurnTime          += Convert.ToInt32(dr["AvgRevolveTime"]);

                        ASinfo.StationName = DBConvert.ConvertStringToString(dr["tsName"]);
                    }
                }
                if (a != 0)
                {
                    ASinfo.STaskTimes            = Convert.ToString(STaskTimes);
                    ASinfo.SFirstAidTimes        = Convert.ToString(SFirstAidTimes);
                    ASinfo.STransTimes           = Convert.ToString(STransTimes);
                    ASinfo.SGoHomeTimes          = Convert.ToString(SGoHomeTimes);
                    ASinfo.SDays                 = Convert.ToString(SDays);
                    ASinfo.STaskTimesEveryDay    = Convert.ToString(STaskTimesEveryDay / a);
                    ASinfo.SAvgSendTime          = Convert.ToString(SAvgSendTime / a);
                    ASinfo.SAvgArriveTime        = Convert.ToString(SAvgArriveTime / a);
                    ASinfo.SAvgLocalAidTime      = Convert.ToString(SAvgLocalAidTime / a);
                    ASinfo.SAvgTransTime         = Convert.ToString(SAvgTransTime / a);
                    ASinfo.SAvgHospitalTransTime = Convert.ToString(SAvgHospitalTransTime / a);
                    ASinfo.SAvgReactTime         = Convert.ToString(SAvgReactTime / a);
                    ASinfo.SAvgTurnTime          = Convert.ToString(SAvgTurnTime / a);

                    return(ASinfo);
                }
                else
                {
                    return(new StationStatisticsInfo());
                }
            }
            else
            {
                return(new StationStatisticsInfo());
            }
        }
Beispiel #14
0
        /// <summary>
        /// 出车信息
        /// </summary>
        /// <param name="almCode"></param>
        /// <returns></returns>
        public static List <AttemperTaskInfo> GetTaskInfo(string almCode)
        {
            AttemperTaskInfo        info;
            List <AttemperTaskInfo> list = new List <AttemperTaskInfo>();
            StringBuilder           sb   = new StringBuilder();

            sb.Append(@"
declare @eventCode varchar(16)
set @eventCode='" + almCode + "' ");
            sb.Append(@"
            select tt.任务编码,tt.事件编码,tt.受理序号,tam.实际标识,
            接收命令时刻,出车时刻,到达现场时刻,离开现场时刻,到达医院时刻,完成时刻,返回站中时刻,
            出车结果=case when 是否正常结束=1 then '正常完成' else '异常结束' end,
            异常结束原因=tztar.名称,tt.司机,tt.医生,tt.护士,tt.担架工,tt.抢救员,备注 
            ,分站=ts.名称,tam.车牌号码,责任调度人=tp.姓名 ");
            //刘爱青 2012.12.18 增加按键时刻操作来源
            if (AppConfig.GetBoolConfigValue("IsShowOrigin"))
            {
                sb.Append(@",接收命令时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                            from TAmbulanceStateTime tast 
                                            left join TPerson tp on tast.操作员编码=tp.编码 
                                            where tast.任务编码=tt.任务编码 and tast.车辆状态编码=1 and tast.时刻值=tt.接收命令时刻) 
                        ,出车时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                        from TAmbulanceStateTime tast 
                                        left join TPerson tp on tast.操作员编码=tp.编码 
                                        where tast.任务编码=tt.任务编码 and tast.车辆状态编码=2 and tast.时刻值=tt.出车时刻)
                     ,到达现场时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                        from TAmbulanceStateTime tast 
                                        left join TPerson tp on tast.操作员编码=tp.编码 
                                        where tast.任务编码=tt.任务编码 and tast.车辆状态编码=3 and tast.时刻值=tt.到达现场时刻) 
                    ,离开现场时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                        from TAmbulanceStateTime tast 
                                        left join TPerson tp on tast.操作员编码=tp.编码 
                                        where tast.任务编码=tt.任务编码 and tast.车辆状态编码=4 and tast.时刻值=tt.离开现场时刻) 
                    ,到达医院时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                        from TAmbulanceStateTime tast 
                                        left join TPerson tp on tast.操作员编码=tp.编码 
                                        where tast.任务编码=tt.任务编码 and tast.车辆状态编码=5 and tast.时刻值=tt.到达医院时刻)
                        ,完成时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                        from TAmbulanceStateTime tast 
                                        left join TPerson tp on tast.操作员编码=tp.编码 
                                        where tast.任务编码=tt.任务编码 and tast.车辆状态编码=6 and tast.时刻值=tt.完成时刻) 
                    ,返回站中时刻来源=(select top 1 来源=case when tast.操作来源编码=1 then tp.姓名 else '车载' end
                                        from TAmbulanceStateTime tast 
                                        left join TPerson tp on tast.操作员编码=tp.编码 
                                        where tast.任务编码=tt.任务编码 and tast.车辆状态编码=7 and tast.时刻值=tt.返回站中时刻) ");
            }
            sb.Append(@"from dbo.TTask tt 
            left join dbo.TAmbulance tam on tam.车辆编码=tt.车辆编码 
            left join dbo.TZTaskAbendReason tztar on tztar.编码=tt.异常结束原因编码 
            left join dbo.TStation ts on ts.编码=tt.分站编码 
            left join TPerson tp on tp.编码=tt.责任调度人编码 
            where 事件编码=@eventCode ");
            using (DataSet ds = SQLHelper.ExecuteDataSet(AppConfig.ConnectionStringReport, CommandType.Text, sb.ToString(), null))
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    info                = new AttemperTaskInfo();
                    info.TaskCode       = DBConvert.ConvertStringToString(dr["任务编码"]);
                    info.AlarmEventCode = DBConvert.ConvertStringToString(dr["事件编码"]);
                    info.Order          = DBConvert.ConvertStringToString(dr["受理序号"]);
                    info.AmbMark        = DBConvert.ConvertStringToString(dr["实际标识"]);
                    if (AppConfig.GetBoolConfigValue("IsShowOrigin"))
                    {
                        info.ReceiveTime  = dr["接收命令时刻"] == DBNull.Value ? "" : dr["接收命令时刻"].ToString() + "\r\n(" + dr["接收命令时刻来源"].ToString() + ")";
                        info.OutTime      = dr["出车时刻"] == DBNull.Value ? "" : dr["出车时刻"].ToString() + "\r\n(" + dr["出车时刻来源"].ToString() + ")";
                        info.ArriveTime   = dr["到达现场时刻"] == DBNull.Value ? "" : dr["到达现场时刻"].ToString() + "\r\n(" + dr["到达现场时刻来源"].ToString() + ")";
                        info.LeaveTime    = dr["离开现场时刻"] == DBNull.Value ? "" : dr["离开现场时刻"].ToString() + "\r\n(" + dr["离开现场时刻来源"].ToString() + ")";
                        info.ArriHsplTime = dr["到达医院时刻"] == DBNull.Value ? "" : dr["到达医院时刻"].ToString() + "\r\n(" + dr["到达医院时刻来源"].ToString() + ")";
                        info.FinishTime   = dr["完成时刻"] == DBNull.Value ? "" : dr["完成时刻"].ToString() + "\r\n(" + dr["完成时刻来源"].ToString() + ")";
                        info.ReturnTime   = dr["返回站中时刻"] == DBNull.Value ? "" : dr["返回站中时刻"].ToString() + "\r\n(" + dr["返回站中时刻来源"].ToString() + ")";
                    }
                    else
                    {
                        info.ReceiveTime  = DBConvert.ConvertStringToString(dr["接收命令时刻"]);
                        info.OutTime      = DBConvert.ConvertStringToString(dr["出车时刻"]);
                        info.ArriveTime   = DBConvert.ConvertStringToString(dr["到达现场时刻"]);
                        info.LeaveTime    = DBConvert.ConvertStringToString(dr["离开现场时刻"]);
                        info.ArriHsplTime = DBConvert.ConvertStringToString(dr["到达医院时刻"]);
                        info.FinishTime   = DBConvert.ConvertStringToString(dr["完成时刻"]);
                        info.ReturnTime   = DBConvert.ConvertStringToString(dr["返回站中时刻"]);
                    }
                    info.TaskResult     = DBConvert.ConvertStringToString(dr["出车结果"]);
                    info.TaskAbdReason  = DBConvert.ConvertStringToString(dr["异常结束原因"]);
                    info.Driver         = DBConvert.ConvertStringToString(dr["司机"]);
                    info.Doctor         = DBConvert.ConvertStringToString(dr["医生"]);
                    info.Nurse          = DBConvert.ConvertStringToString(dr["护士"]);
                    info.Litter         = DBConvert.ConvertStringToString(dr["担架工"]);
                    info.JiJiuYuan      = DBConvert.ConvertStringToString(dr["抢救员"]);
                    info.Remark         = DBConvert.ConvertStringToString(dr["备注"]);
                    info.Station        = DBConvert.ConvertStringToString(dr["分站"]);
                    info.AmbPlate       = DBConvert.ConvertStringToString(dr["车牌号码"]);
                    info.AttemperPerson = DBConvert.ConvertStringToString(dr["责任调度人"]);
                    list.Add(info);
                }
                return(list);
            }
        }