Exemplo n.º 1
0
        /// <summary>
        /// 获取引擎待办任务(主数据)
        /// </summary>
        /// <param name="strUserID"></param>
        /// <param name="strStatus"></param>
        /// <param name="iTop"></param>
        /// <param name="LastDay"></param>
        /// <returns></returns>
        public List<T_FLOW_ENGINEMSGLIST> GetEngineMainMsgList(string strUserID, string strStatus, string message, int iTop, int LastDay)
        {
            List<T_FLOW_ENGINEMSGLIST> DataList = new List<T_FLOW_ENGINEMSGLIST>();
            if (iTop <= 0)
            {
                return DataList;
            }
            try
            {
                dao.Open();
                string strFields = " APPLICATIONURL,MODELCODE,BEFOREPROCESSDATE,ORDERID,CREATEDATETIME,MESSAGEBODY,DOTASKID,CLOSEDDATE,RECEIVEUSERID,DOTASKSTATUS,SYSTEMCODE,MODELNAME ";
                string strLastDay = string.Empty;
                string sqlWhere = "";
                if (!string.IsNullOrWhiteSpace(message))
                {
                    sqlWhere = " and MESSAGEBODY like'%" + message + "%'";
                }
                string strsql = "";
                if (strStatus.ToUpper() == "OPEN")
                {
                    if (LastDay > 0)
                    {
                        strLastDay = " and CREATEDATETIME>to_date('" + DateTime.Now.AddDays(-LastDay).ToString("yyyy/MM/dd") + "','YYYY-MM-DD')";
                    }
                    strsql = "SELECT " + strFields + " FROM (SELECT " + strFields + " FROM  T_WF_DOTASK where RECEIVEUSERID='" + strUserID + "' and DOTASKSTATUS=0   " + sqlWhere + strLastDay + "  order by BEFOREPROCESSDATE) where rownum <=" + iTop;
                }
                else if (strStatus.ToUpper() == "CLOSE")
                {
                    if (LastDay > 0)
                    {
                        strLastDay = " and CLOSEDDATE>to_date('" + DateTime.Now.AddDays(-LastDay).ToString("yyyy/MM/dd") + "','YYYY-MM-DD')";
                    }
                    strsql = "SELECT " + strFields + " FROM (SELECT " + strFields + " FROM  T_WF_DOTASK where RECEIVEUSERID='" + strUserID + "' and DOTASKSTATUS=1 " + sqlWhere + strLastDay + "   order by CLOSEDDATE desc) where rownum <=" + iTop;

                }
                DataTable table = dao.GetDataTable(strsql);
                int tt = 0;
                if (table != null && table.Rows.Count > 0)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        tt++;
                        T_FLOW_ENGINEMSGLIST msgList = new T_FLOW_ENGINEMSGLIST();
                        msgList.MESSAGEID = string.Concat(dr["DOTASKID"]);
                        msgList.APPLICATIONURL = string.Concat(dr["APPLICATIONURL"]);
                        msgList.MESSAGESTATUS = dr["DOTASKSTATUS"].ToString();
                        msgList.ORDERNODECODE = string.Concat(dr["SYSTEMCODE"]) + "_" + string.Concat(dr["ORDERID"]);
                        msgList.APPLICATIONCODE = string.Concat(dr["SYSTEMCODE"]);
                        msgList.BEFOREPROCESSDATE = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);
                        msgList.CREATEDATE = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("yyyy/MM/dd");
                        msgList.CREATETIME = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("HH:mm");
                        msgList.MESSAGEBODY = string.Concat(dr["MESSAGEBODY"]);
                        msgList.OPERATIONDATE = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("yyyy/MM/dd") : "";
                        msgList.OPERATIONTIME = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("HH:mm") : "";
                        msgList.RECEIVEUSER = string.Concat(dr["RECEIVEUSERID"]);
                        msgList.MODELCODE = TypeConverter.ToString(dr["MODELCODE"]);
                        msgList.MODELNAME = TypeConverter.ToString(dr["MODELNAME"]);
                        DateTime OverTime = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);

                        TimeSpan timeSpan = OverTime - DateTime.Now;
                        if (TypeConverter.ToInt(timeSpan.TotalHours) == 0)//小于一小时范围内
                        {
                            if (timeSpan.Minutes > 0)
                            {
                                msgList.TEMPFIELD = "+" + TypeConverter.ToString(timeSpan.Minutes) + "M";
                            }
                            else if (timeSpan.Minutes == 0)
                            {
                                msgList.TEMPFIELD = "+0M";
                            }
                            else
                            {
                                msgList.TEMPFIELD = TypeConverter.ToString(timeSpan.Minutes) + "M";
                            }
                        }
                        else
                        {
                            if (timeSpan.TotalHours > 0)
                            {
                                msgList.TEMPFIELD = "+" + TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                            }
                            else if (timeSpan.TotalHours == 0)
                            {
                                msgList.TEMPFIELD = "+0H";
                            }
                            else
                            {
                                msgList.TEMPFIELD = TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                            }
                        }
                        DataList.Add(msgList);
                    }

                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(this, "GetEngineMainMsgList()", "获取引擎待办任务(主数据)", ex);
                return null;
            }
            finally
            {
                dao.Close();
            }
            return DataList;
        }
Exemplo n.º 2
0
        private T_FLOW_ENGINEMSGLIST GeneralEngineMsgModel(DataRow dr)
        {
            T_FLOW_ENGINEMSGLIST msgList = new T_FLOW_ENGINEMSGLIST();
            msgList.MESSAGEID = string.Concat(dr["DOTASKID"]);
            msgList.APPLICATIONCODE = string.Concat(dr["SYSTEMCODE"]);
            msgList.ORDERNODECODE = string.Concat(dr["ORDERID"]);
            msgList.MESSAGESTATUS = string.Concat(dr["DOTASKSTATUS"]);
            msgList.APPLICATIONURL = string.Concat(dr["applicationurl"]);
            msgList.BEFOREPROCESSDATE = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);
            msgList.CREATEDATE = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("yyyy/MM/dd");
            msgList.CREATETIME = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("HH:mm");
            msgList.MESSAGEBODY = string.Concat(dr["MESSAGEBODY"]);
            msgList.OPERATIONDATE = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("yyyy/MM/dd") : "";
            msgList.OPERATIONTIME = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("HH:mm") : "";
            msgList.RECEIVEUSER = string.Concat(dr["RECEIVEUSERID"]);
            msgList.MODELCODE = TypeConverter.ToString(dr["MODELCODE"]);
            msgList.MODELNAME = TypeConverter.ToString(dr["MODELNAME"]);
            DateTime OverTime = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);

            TimeSpan timeSpan = OverTime - DateTime.Now;
            if (TypeConverter.ToInt(timeSpan.TotalHours) == 0)//小于一小时范围内
            {
                if (timeSpan.Minutes > 0)
                {
                    msgList.TEMPFIELD = "+" + TypeConverter.ToString(timeSpan.Minutes) + "M";
                }
                else if (timeSpan.Minutes == 0)
                {
                    msgList.TEMPFIELD = "+0M";
                }
                else
                {
                    msgList.TEMPFIELD = TypeConverter.ToString(timeSpan.Minutes) + "M";
                }
            }
            else
            {
                if (timeSpan.TotalHours > 0)
                {
                    msgList.TEMPFIELD = "+" + TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                }
                else if (timeSpan.TotalHours == 0)
                {
                    msgList.TEMPFIELD = "+0H";
                }
                else
                {
                    msgList.TEMPFIELD = TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                }
            }
            return msgList;
        }
Exemplo n.º 3
0
        /// <summary>
        ///  手机版待办任务分页查询
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="strReceiveUser"></param>
        /// <param name="strStatus"></param>
        /// <param name="msgBody"></param>
        /// <param name="beginDate"></param>
        /// <param name="endDate"></param>
        /// <param name="rowCount"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public List<T_FLOW_ENGINEMSGLIST> MsgListByPagingForMobile(int pageIndex, int pageSize, string strReceiveUser, string strStatus, string msgBody, DateTime beginDate, DateTime endDate, ref int rowCount, ref int pageCount)
        {
            List<T_FLOW_ENGINEMSGLIST> DataList = new List<T_FLOW_ENGINEMSGLIST>();
            try
            {
                string strOrderBy = "BEFOREPROCESSDATE";
                if (strStatus.ToUpper() == "CLOSE")
                {
                    strOrderBy = " CLOSEDDATE DESC";
                }
                int limitPageSize = 0;
                Int32.TryParse(ConfigurationManager.AppSettings["LimitPageSize"].ToString(), out limitPageSize);
                //如果当前pageSize大于最大记录数,则当前pageSize=设置最大记录数。
                pageSize = pageSize > limitPageSize ? limitPageSize : pageSize;

                #region where
                int status = 0;
                if (strStatus.ToUpper() == "CLOSE")
                {
                    status = 1;
                }
                else if (strStatus.ToUpper() == "OPEN")
                {
                    status = 0;
                }
                string where = " RECEIVEUSERID='" + strReceiveUser + "' and dotaskstatus=" + status + " ";
                if (!string.IsNullOrEmpty(msgBody))
                    where += " and MESSAGEBODY LIKE '%" + msgBody + "%'";
                if (strStatus.ToUpper() == "CLOSE")
                {
                    if (beginDate != DateTime.MinValue && endDate != DateTime.MinValue)
                    {
                        where += " and CLOSEDDATE>=to_date('" + beginDate + "','YYYY-MM-DD') and CLOSEDDATE<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                    else if (beginDate != DateTime.MinValue)
                    {
                        where += " and CLOSEDDATE>=to_date('" + beginDate + "','YYYY-MM-DD')";
                    }
                    else if (endDate != DateTime.MinValue)
                    {
                        where += " and  CLOSEDDATE<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                }
                if (strStatus.ToUpper() == "OPEN")
                {
                    if (beginDate != DateTime.MinValue && endDate != DateTime.MinValue)
                    {
                        where += " and CREATEDATETIME>=to_date('" + beginDate + "','YYYY-MM-DD') and CREATEDATETIME<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                    else if (beginDate != DateTime.MinValue)
                    {
                        where += " and CREATEDATETIME>=to_date('" + beginDate + "','YYYY-MM-DD')";
                    }
                    else if (endDate != DateTime.MinValue)
                    {
                        where += " and  CREATEDATETIME<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                }
                #endregion

                dao.Open();
                string strCountSql = "SELECT count(1) FROM  T_WF_DOTASK a RIGHT JOIN T_WF_MOBILEFILTER b on a.MODELCODE = b.MODELCODE   where " + where;

                DataTable tbCount = dao.GetDataTable(strCountSql);
                if (tbCount != null && tbCount.Rows.Count > 0)
                {
                    rowCount = TypeConverter.ToInt(tbCount.Rows[0][0]);
                }
                if (rowCount == 0)//检查统计没有数据直接返回
                    return null;
                pageCount = rowCount / pageSize + (rowCount % pageSize > 0 ? 1 : 0);
                string fields = "BEFOREPROCESSDATE,CREATEDATETIME,MESSAGEBODY,applicationurl,DOTASKID,CLOSEDDATE,RECEIVEUSERID,DOTASKSTATUS";

                int iRecStart = (pageIndex - 1) * pageSize + 1;
                int iRecEnd = pageIndex * pageSize;
                where = string.IsNullOrEmpty(where) ? " 1=1 " : where;
                string strSql = "select MODELCODE,MODELNAME,ORDERID," + fields + ",SYSTEMCODE " +
                        " from( " +
                        " select rownum num,MODELCODE,MODELNAME,ORDERID," + fields + ",SYSTEMCODE " +
                        " from( " +
                            "SELECT a.MODELCODE,a.MODELNAME,a.ORDERID," + fields + ",a.SYSTEMCODE,ROUND(TO_NUMBER(sysdate - BEFOREPROCESSDATE) * 24 * 60) as OverTime FROM T_WF_DOTASK a RIGHT JOIN T_WF_MOBILEFILTER b on a.MODELCODE = b.MODELCODE " +
                            "where " + where + " order by " + strOrderBy + " ) temp1 " +
                            " where rownum<=" + iRecEnd +
                        ")temp2  " +
                        "where temp2.num>=" + iRecStart;
                //LogHelper.WriteLog("手机版待办任务分页查询 SQL语句:\r\n" + strSql);
                DataTable table = dao.GetDataTable(strSql);
                if (table != null && table.Rows.Count > 0)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        T_FLOW_ENGINEMSGLIST msgList = new T_FLOW_ENGINEMSGLIST();
                        msgList.MESSAGEID = string.Concat(dr["DOTASKID"]);
                        msgList.ORDERNODECODE = string.Concat(dr["ORDERID"]);
                        msgList.APPLICATIONURL = string.Concat(dr["applicationurl"]);
                        msgList.APPLICATIONCODE = string.Concat(dr["SYSTEMCODE"]);
                        msgList.BEFOREPROCESSDATE = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);
                        msgList.CREATEDATE = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("yyyy/MM/dd");
                        msgList.CREATETIME = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("HH:mm");
                        msgList.MESSAGEBODY = string.Concat(dr["MESSAGEBODY"]);
                        msgList.OPERATIONDATE = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("yyyy/MM/dd") : "";
                        msgList.OPERATIONTIME = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("HH:mm") : "";
                        msgList.RECEIVEUSER = string.Concat(dr["RECEIVEUSERID"]);
                        msgList.MODELCODE = TypeConverter.ToString(dr["MODELCODE"]);
                        msgList.MODELNAME = TypeConverter.ToString(dr["MODELNAME"]);
                        DateTime OverTime = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);
                        TimeSpan timeSpan = OverTime - DateTime.Now;
                        if (TypeConverter.ToInt(timeSpan.TotalHours) == 0)//小于一小时范围内
                        {
                            if (timeSpan.Minutes > 0)
                            {
                                msgList.TEMPFIELD = "+" + TypeConverter.ToString(timeSpan.Minutes) + "M";
                            }
                            else if (timeSpan.Minutes == 0)
                            {
                                msgList.TEMPFIELD = "+0M";
                            }
                            else
                            {
                                msgList.TEMPFIELD = TypeConverter.ToString(timeSpan.Minutes) + "M";
                            }
                        }
                        else
                        {
                            if (timeSpan.TotalHours > 0)
                            {
                                msgList.TEMPFIELD = "+" + TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                            }
                            else if (timeSpan.TotalHours == 0)
                            {
                                msgList.TEMPFIELD = "+0H";
                            }
                            else
                            {
                                msgList.TEMPFIELD = TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                            }
                        }
                        DataList.Add(msgList);
                    }

                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(this, "MsgListByPagingForMobile()", "手机版待办任务分页查询", ex);
                return null;
            }
            finally
            {
                dao.Close();
            }
            return DataList;
        }
Exemplo n.º 4
0
 public T_FLOW_ENGINEMSGLIST PendingDetailTasksByPhone(string ordernodecode)
 {
     try
     {
         string sql = "SELECT * FROM T_WF_DOTASK where orderid='" + ordernodecode + "'ORDER BY CREATEDATETIME DESC ";
         dao.Open();
         //LogHelper.WriteLog("获取引擎细节任务(细节数据)SQL语句:\r\n" + sql);
         DataTable dt = dao.GetDataTable(sql);
         if (dt != null && dt.Rows.Count > 0)
         {
             T_FLOW_ENGINEMSGLIST msg = new T_FLOW_ENGINEMSGLIST();
             msg.APPLICATIONURL = string.Concat(dt.Rows[0]["APPLICATIONURL"]);
             msg.APPFIELDVALUE = string.Concat(dt.Rows[0]["APPFIELDVALUE"]);
             msg.MESSAGESTATUS = string.Concat(dt.Rows[0]["DOTASKSTATUS"]) == "1" ? "close" : "open";//供手机使用
             msg.SYSTEMNAME = string.Concat(dt.Rows[0]["SYSTEMNAME"]);
             msg.MODELNAME = string.Concat(dt.Rows[0]["MODELNAME"]);
             msg.FLOWXML = TypeConverter.ToString(dt.Rows[0]["FLOWXML"]);
             msg.APPXML = TypeConverter.ToString(dt.Rows[0]["APPXML"]);
             msg.ORDERNODECODE = TypeConverter.ToString(dt.Rows[0]["SYSTEMCODE"]) + "_" + TypeConverter.ToString(dt.Rows[0]["ORDERID"]);
             return msg;
         }
         return null;
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(this, "PendingDetailTasksByPhone()", "获取引擎细节任务(细节数据)", ex);
         return null;
     }
     finally
     {
         dao.Close();
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 获取引擎细节任务(细节数据)
        /// </summary>
        /// <param name="strMsgID"></param>
        /// <returns></returns>
        public T_FLOW_ENGINEMSGLIST GetEngineMsgDetail(string dotaskid, bool isPhone)
        {
            try
            {
                string sql = "SELECT * FROM T_WF_DOTASK where dotaskid='" + dotaskid + "' ";
                dao.Open();
                DataTable dt = dao.GetDataTable(sql);
                if (dt != null && dt.Rows.Count > 0)
                {
                    T_FLOW_ENGINEMSGLIST msg = new T_FLOW_ENGINEMSGLIST();
                    msg.APPLICATIONURL = string.Concat(dt.Rows[0]["APPLICATIONURL"]);
                    msg.APPFIELDVALUE = string.Concat(dt.Rows[0]["APPFIELDVALUE"]);
                    msg.MESSAGESTATUS = string.Concat(dt.Rows[0]["DOTASKSTATUS"]) == "1" ? "close" : "open";//供手机使用
                    //msg.SYSTEMNAME = string.Concat(dt.Rows[0]["SYSTEMNAME"]);
                    msg.MODELNAME = string.Concat(dt.Rows[0]["MODELNAME"]);

                    if (isPhone)//手机需要的字段
                    {
                        msg.FLOWXML = TypeConverter.ToString(dt.Rows[0]["FLOWXML"]);
                        msg.APPXML = TypeConverter.ToString(dt.Rows[0]["APPXML"]);
                        msg.ORDERNODECODE = TypeConverter.ToString(dt.Rows[0]["SYSTEMCODE"]) + "_" + TypeConverter.ToString(dt.Rows[0]["ORDERID"]);
                    }
                    return msg;
                }
                return null;
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(this, "GetEngineMsgDetail()", "获取引擎细节任务(细节数据)", ex);
                return null;
            }
            finally
            {
                dao.Close();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 待办任务分页查询
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="strReceiveUser"></param>
        /// <param name="strStatus"></param>
        /// <param name="msgBody"></param>
        /// <param name="beginDate"></param>
        /// <param name="endDate"></param>
        /// <param name="rowCount"></param>
        /// <param name="pageCount"></param>
        /// <returns></returns>
        public List<T_FLOW_ENGINEMSGLIST> MsgListByPaging(int pageIndex, int pageSize, string strReceiveUser, string strStatus, string msgBody, DateTime beginDate, DateTime endDate, ref int rowCount, ref int pageCount)
        {
            List<T_FLOW_ENGINEMSGLIST> DataList = new List<T_FLOW_ENGINEMSGLIST>();
            try
            {
                string strOrderBy = " BEFOREPROCESSDATE ";
                if (strStatus.ToUpper() == "CLOSE")
                {
                    strOrderBy = "CLOSEDDATE DESC";
                }
                int limitPageSize = 0;
                Int32.TryParse(ConfigurationManager.AppSettings["LimitPageSize"].ToString(), out limitPageSize);
                //如果当前pageSize大于最大记录数,则当前pageSize=设置最大记录数。
                pageSize = pageSize > limitPageSize ? limitPageSize : pageSize;

                #region where
                int status = 0;
                string where = "";
                if (strStatus.ToUpper() == "CLOSE")
                {
                    status = 1;
                    where = " RECEIVEUSERID='" + strReceiveUser + "' and DOTASKSTATUS=" + status + " ";
                }
                else if (strStatus.ToUpper() == "OPEN")
                {
                    status = 0;
                    where = " RECEIVEUSERID='" + strReceiveUser + "' and DOTASKSTATUS=" + status + " ";
                }
                else
                {
                    strOrderBy = " CREATEDATETIME DESC";
                    where = " RECEIVEUSERID='" + strReceiveUser + "' ";
                }
                if (!string.IsNullOrEmpty(msgBody))
                    where += " and MESSAGEBODY LIKE '%" + msgBody + "%'";
                if (strStatus.ToUpper() == "CLOSE")
                {
                    if (beginDate != DateTime.MinValue && endDate != DateTime.MinValue)
                    {
                        where += " and CLOSEDDATE>=to_date('" + beginDate + "','YYYY-MM-DD') and CLOSEDDATE<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                    else if (beginDate != DateTime.MinValue)
                    {
                        where += " and CLOSEDDATE>=to_date('" + beginDate + "','YYYY-MM-DD')";
                    }
                    else if (endDate != DateTime.MinValue)
                    {
                        where += " and  CLOSEDDATE<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                }
                if (strStatus.ToUpper() == "OPEN")
                {
                    if (beginDate != DateTime.MinValue && endDate != DateTime.MinValue)
                    {
                        where += " and CREATEDATETIME>=to_date('" + beginDate + "','YYYY-MM-DD') and CREATEDATETIME<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                    else if (beginDate != DateTime.MinValue)
                    {
                        where += " and CREATEDATETIME>=to_date('" + beginDate + "','YYYY-MM-DD')";
                    }
                    else if (endDate != DateTime.MinValue)
                    {
                        where += " and  CREATEDATETIME<=to_date('" + endDate + "','YYYY-MM-DD')";
                    }
                }
                #endregion

                string strCountSql = "SELECT count(DOTASKID) FROM  T_WF_DOTASK where " + where;
                DataTable dt = dao.GetDataTable(strCountSql);
                //Tracer.Debug("MsgListByPaging()" + strCountSql);
                if (dt != null && dt.Rows.Count > 0)
                {
                    rowCount = int.Parse(dt.Rows[0][0].ToString());
                }
                if (rowCount == 0)//检查统计没有数据直接返回
                    return null;
                pageCount = rowCount / pageSize + (rowCount % pageSize > 0 ? 1 : 0);
                string fields = " ORDERID,APPLICATIONURL,MODELCODE,BEFOREPROCESSDATE,CREATEDATETIME,MESSAGEBODY,DOTASKID,CLOSEDDATE,RECEIVEUSERID,DOTASKSTATUS,SYSTEMCODE,MODELNAME ";
                int iRecStart = (pageIndex - 1) * pageSize + 1;
                //if (rowCount % pageSize == 0 && pageIndex > 1)
                //{
                //    iRecStart = (pageIndex - 2) * pageSize + 1;
                //}
                int iRecEnd = pageIndex * pageSize;
                where = string.IsNullOrEmpty(where) ? " 1=1 " : where;
                string strSql = "select " + fields + " " +
                        " from( " +
                        " select rownum num," + fields + " " +
                        " from( " +
                            "SELECT " + fields + " FROM T_WF_DOTASK " +
                            "where " + where + " order by  " + strOrderBy + ") temp1 " +
                            " where rownum<=" + iRecEnd +
                        ")temp2  " +
                        "where temp2.num>=" + iRecStart;
                DataTable table = dao.GetDataTable(strSql);
                //Tracer.Debug("MsgListByPaging()" + table.Rows.Count + "||" + strSql);
                if (table != null && table.Rows.Count > 0)
                {
                    foreach (DataRow dr in table.Rows)
                    {
                        //Tracer.Debug("消息:" + dr["MESSAGEBODY"].ToString() + "||状态:" + dr["DOTASKSTATUS"].ToString() + "\n\r");
                        T_FLOW_ENGINEMSGLIST msgList = new T_FLOW_ENGINEMSGLIST();
                        msgList.MESSAGEID = string.Concat(dr["DOTASKID"]);
                        msgList.ORDERNODECODE = string.Concat(dr["ORDERID"]);
                        msgList.APPLICATIONURL = string.Concat(dr["APPLICATIONURL"]);
                        msgList.MESSAGESTATUS = string.Concat(dr["DOTASKSTATUS"]);
                        msgList.APPLICATIONCODE = string.Concat(dr["SYSTEMCODE"]);
                        msgList.BEFOREPROCESSDATE = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);
                        msgList.CREATEDATE = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("yyyy/MM/dd");
                        msgList.CREATETIME = Convert.ToDateTime(dr["CREATEDATETIME"].ToString()).ToString("HH:mm");
                        msgList.MESSAGEBODY = string.Concat(dr["MESSAGEBODY"]);
                        msgList.OPERATIONDATE = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("yyyy/MM/dd") : "";
                        msgList.OPERATIONTIME = dr["CLOSEDDATE"].ToString() != "" ? Convert.ToDateTime(dr["CLOSEDDATE"].ToString()).ToString("HH:mm") : "";
                        msgList.RECEIVEUSER = string.Concat(dr["RECEIVEUSERID"]);
                        msgList.MODELCODE = TypeConverter.ToString(dr["MODELCODE"]);
                        msgList.MODELNAME = TypeConverter.ToString(dr["MODELNAME"]);
                        DateTime OverTime = TypeConverter.ToDateTime(dr["BEFOREPROCESSDATE"]);
                        TimeSpan timeSpan = OverTime - DateTime.Now;
                        if (TypeConverter.ToInt(timeSpan.TotalHours) == 0)//小于一小时范围内
                        {
                            if (timeSpan.Minutes > 0)
                            {
                                msgList.TEMPFIELD = "+" + TypeConverter.ToString(timeSpan.Minutes) + "M";
                            }
                            else if (timeSpan.Minutes == 0)
                            {
                                msgList.TEMPFIELD = "+0M";
                            }
                            else
                            {
                                msgList.TEMPFIELD = TypeConverter.ToString(timeSpan.Minutes) + "M";
                            }
                        }
                        else
                        {
                            if (timeSpan.TotalHours > 0)
                            {
                                msgList.TEMPFIELD = "+" + TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                            }
                            else if (timeSpan.TotalHours == 0)
                            {
                                msgList.TEMPFIELD = "+0H";
                            }
                            else
                            {
                                msgList.TEMPFIELD = TypeConverter.ToString(TypeConverter.ToInt(timeSpan.TotalHours)) + "H";
                            }
                        }
                        DataList.Add(msgList);
                    }
                }
            }
            catch (Exception ex)
            {
                Tracer.Debug("MsgListByPaging()待办任务分页列表"+ ex.ToString());
                return null;
            }
            finally
            {

            }
            //Tracer.Debug("平台待办分页接口 数量=" + DataList.Count);
            return DataList;
        }