Exemple #1
0
        private void BindData()
        {
            bool     r;
            string   info;
            DateTime st = CommonFunction.ObjectToDateTime(BeginTime);
            DateTime et = CommonFunction.ObjectToDateTime(EndTime);

            r = BLL.Util.CheckForSelectCallRecordORIG(st, et, out info);
            if (r == false)
            {
                return;
            }

            int    _loginID  = -2;
            string _ownGroup = string.Empty;
            string _oneSelf  = string.Empty;

            _loginID = userID;

            Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                Name, ANI, Agent, TaskID, CallID, BeginTime, EndTime, AgentNum, PhoneNum, TaskCategory,
                SpanTime1, SpanTime2, AgentGroup, CallStatus, _loginID, _ownGroup, _oneSelf, Category, IVRScore, IncomingSource, selBusinessType, SelSolve
                );
            string    tableEndName = BLL.Util.CalcTableNameByMonth(3, query.BeginTime.Value);
            DataTable dt           = BLL.CallRecordInfo.Instance.GetCallRecordInfo(query, "c.CreateTime desc", 1, -1, tableEndName, out RecordCount);

            ExportData(dt);
        }
Exemple #2
0
        /// 评分型-成绩主表导出
        /// <summary>
        /// 评分型-成绩主表导出
        /// </summary>
        /// <param name="query"></param>
        /// <param name="tableEndName"></param>
        /// <returns></returns>
        public DataTable getResultByExport(Entities.QueryCallRecordInfo query, string tableEndName)
        {
            DataSet ds = null;

            string where = string.Empty;
            where        = getWhereBySelect(query);

            SqlParameter[] parameters =
            {
                new SqlParameter("@where",    SqlDbType.NVarChar, 4000),
                new SqlParameter("@tableend", SqlDbType.NVarChar, 20)
            };
            parameters[0].Value = where;
            parameters[1].Value = tableEndName;

            ds = SqlHelper.ExecuteDataset(CONNECTIONSTRINGS, CommandType.StoredProcedure, "p_QS_Result_selectByExport", parameters);
            if (ds != null && ds.Tables.Count > 0)
            {
                return(ds.Tables[0]);
            }
            else
            {
                return(null);
            }
        }
        //绑定数据
        public void BindData()
        {
            Entities.QueryCallRecordInfo query = new Entities.QueryCallRecordInfo();

            query.LoginID = userID;
            if (!string.IsNullOrEmpty(ScoreBeginTime))
            {
                query.ScoreBeginTime = ScoreBeginTime;
            }
            if (!string.IsNullOrEmpty(ScoreEndTime))
            {
                query.ScoreEndTime = ScoreEndTime;
            }
            if (!string.IsNullOrEmpty(ScoreCreater))
            {
                // query.ScoreCreater = int.Parse(ScoreCreater);
                query.QSScoreCreaters = " and b.UserID IN (" + BLL.Util.SqlFilterByInCondition(ScoreCreater) + ")";
            }
            query.QSResultStatus = "20002,20003,20004,20005,20006";
            query.IsFilterNull   = 1;
            int RecordCount = 0;

            string    tableEndName = "_QS";//查询质检话务冗余表
            DataTable dt           = BLL.QS_Result.Instance.GetQS_ResultFrequenyStatistics(query, "tCount desc", BLL.PageCommon.Instance.PageIndex, PageSize, tableEndName, out RecordCount);

            repeaterList.DataSource = dt;
            repeaterList.DataBind();

            AjaxPager.PageSize = 10;
            AjaxPager.InitPager(RecordCount);
        }
Exemple #4
0
        private DataTable GetQuaResult()
        {
            Entities.QueryCallRecordInfo query = GetQuery();
            string    tableEndName             = "_QS";//查询质检话务冗余表
            DataTable dt_BaseInfo = BLL.QS_Result.Instance.GetBaseInfoByQualifiedType(query, tableEndName);

            return(dt_BaseInfo);
        }
Exemple #5
0
        /// 获取结果
        /// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        private DataTable GetResult()
        {
            Entities.QueryCallRecordInfo query = GetQuery();
            string    tableEndName             = "_QS";//查询质检话务冗余表
            DataTable dtResult = BLL.QS_Result.Instance.getResultByExport(query, tableEndName);

            return(dtResult);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int userId = BLL.Util.GetLoginUserID();
                if (!BLL.Util.CheckRight(userId, "SYS024MOD6314"))//"质检统计管理—抽查频次统计—导出"功能验证逻辑
                {
                    Response.Write(BLL.Util.GetNotAccessMsgPage("您没有访问该页面的权限"));
                    Response.End();
                }

                Entities.QueryCallRecordInfo query = new Entities.QueryCallRecordInfo();

                query.LoginID = BLL.Util.GetLoginUserID();;
                if (!string.IsNullOrEmpty(ScoreBeginTime))
                {
                    query.ScoreBeginTime = ScoreBeginTime;
                }
                if (!string.IsNullOrEmpty(ScoreEndTime))
                {
                    query.ScoreEndTime = ScoreEndTime;
                }
                if (!string.IsNullOrEmpty(ScoreCreater))
                {
                    //query.ScoreCreater = int.Parse(ScoreCreater);
                    query.QSScoreCreaters = " and b.UserID IN (" + BLL.Util.SqlFilterByInCondition(ScoreCreater) + ")";
                }
                query.QSResultStatus = "20002,20003,20004,20005,20006";
                query.IsFilterNull   = 1;
                int RecordCount = 0;

                string    tableEndName = "_QS";//查询质检话务冗余表
                DataTable dt           = BLL.QS_Result.Instance.GetQS_ResultFrequenyStatistics(query, "tCount desc", 1, -1, tableEndName, out RecordCount);

                if (dt != null)
                {
                    dt.Columns.Remove("RowNumber");
                    dt.Columns.Remove("CreateUserID");

                    dt.Columns["ScoreName"].ColumnName = "评分人";
                    dt.Columns["tCount"].ColumnName    = "评分次数";
                    dt.Columns["col1"].ColumnName      = "60秒";
                    dt.Columns["col2"].ColumnName      = "61-90秒";
                    dt.Columns["col3"].ColumnName      = "91-120秒";
                    dt.Columns["col4"].ColumnName      = "121-150秒";
                    dt.Columns["col5"].ColumnName      = "151-180秒";
                    dt.Columns["col6"].ColumnName      = "181-210秒";
                    dt.Columns["col7"].ColumnName      = "211-240秒";
                    dt.Columns["col8"].ColumnName      = "241-270秒";
                    dt.Columns["col9"].ColumnName      = "271-600秒";
                    dt.Columns["col10"].ColumnName     = "600以上";

                    BLL.Util.ExportToCSV("抽查频次统计" + DateTime.Now.ToString("yyyy-MM-dd-hh-mm-ss"), dt);
                }
            }
        }
Exemple #7
0
        //绑定数据
        public void BindData()
        {
            Entities.QueryCallRecordInfo query = new Entities.QueryCallRecordInfo();

            string errMsg = string.Empty;

            BLL.ConverToEntitie <Entities.QueryCallRecordInfo> conver = new BLL.ConverToEntitie <Entities.QueryCallRecordInfo>(query);
            errMsg = conver.Conver(JsonStr);

            #region 从JSONSTR中解析出通话时间
            string   begintime = "";
            string   endtime   = "";
            string[] array1    = JsonStr.Split('&');
            if (array1.Length >= 3)
            {
                begintime = array1[1].Split('=')[1];
                if (!string.IsNullOrEmpty(begintime))
                {
                    begintime       = begintime.Insert(10, " ");
                    query.BeginTime = DateTime.Parse(begintime);
                }
                endtime = array1[2].Split('=')[1];
                if (!string.IsNullOrEmpty(endtime))
                {
                    endtime       = endtime.Insert(10, " ");
                    query.EndTime = DateTime.Parse(endtime);
                }
            }
            #endregion

            if (errMsg != "")
            {
                return;
            }
            query.LoginID      = userID;
            query.IsFilterNull = 1;
            int RecordCount = 0;

            tableEndName = BLL.Util.CalcTableNameByMonth(3, query.BeginTime.Value);
            DataTable dt = BLL.QS_Result.Instance.GetQS_ResultList(query, " cob.CreateTime desc ", BLL.PageCommon.Instance.PageIndex, PageSize, tableEndName, out RecordCount);

            repeaterTableList.DataSource = dt;
            repeaterTableList.DataBind();

            AjaxPager.PageSize = 20;
            AjaxPager.InitPager(RecordCount);
        }
        private void BindData()
        {
            int    _loginID  = -2;
            string _ownGroup = string.Empty;
            string _oneSelf  = string.Empty;

            _loginID = userID;
            Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                Name, ANI, Agent, TaskID, CallID, BeginTime, EndTime, AgentNum, PhoneNum, TaskCategory,
                SpanTime1, SpanTime2, AgentGroup, CallStatus, _loginID, _ownGroup, _oneSelf, Category, IVRScore, IncomingSource, selBusinessType, SelSolve
                );

            string    tableEndName = BLL.Util.CalcTableNameByMonth(3, query.BeginTime.Value);
            DataTable dt           = BLL.CallRecordInfo.Instance.GetCallRecordInfo(query, "c.CreateTime desc", BLL.PageCommon.Instance.PageIndex, PageSize, tableEndName, out RecordCount);

            if (dt != null)
            {
                repeaterTableList.DataSource = dt;
                repeaterTableList.DataBind();
            }
            litPagerDown.Text = BLL.PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, BLL.PageCommon.Instance.PageIndex, 1);
        }
        private void BindData(string custID)
        {
            DataTable dt    = null;
            int       count = 0;

            if (RequestAction.ToLower().Equals("viewcrmreturnvisit"))//查看CRM系统中所有回访记录
            {
                BitAuto.YanFa.Crm2009.Entities.QueryReturnVisit QueryReturnVisit = new BitAuto.YanFa.Crm2009.Entities.QueryReturnVisit();
                QueryReturnVisit.CustID = custID;
                dt = BitAuto.YanFa.Crm2009.BLL.ReturnVisit.Instance.GetReturnVisit(QueryReturnVisit, PageCommon.Instance.PageIndex, PageSize, out count);
            }
            else
            {
                Entities.QueryCallRecordInfo query = new Entities.QueryCallRecordInfo();
                query.CustID = custID;
                dt           = BLL.CallRecordInfo.Instance.GetCC_CallRecordsByRV(query, PageCommon.Instance.PageIndex, PageSize, out count);
            }

            repeaterList.DataSource = dt;
            repeaterList.DataBind();
            AjaxPager_Custs.InitPager(count, "divReturnVisitRecordListPopup", PageSize);
        }
Exemple #10
0
        private void BindData()
        {
            int    _loginID  = -2;
            string _ownGroup = string.Empty;
            string _oneSelf  = string.Empty;

            _loginID = userID;
            #region 调整分组前数据权限
            //判断数据权限,数据权限如果为 2-全部,则查看所有数据

            /*
             * Entities.UserDataRigth model_userDataRight = BLL.UserDataRigth.Instance.GetUserDataRigth(userID);
             * if (model_userDataRight != null)
             * {
             *  if (model_userDataRight.RightType != 2)//数据权限不为 2-全部
             *  {
             *      _loginID = userID;
             *      //判断分组权限,如果权限是2-本组,则能看到本组人创建的信息;如果权限是1-本人,则只能看本人创建的信息
             *      DataTable dt_userGroupDataRight = BLL.UserGroupDataRigth.Instance.GetUserGroupDataRigthByUserID(userID);
             *      string ownGroup = string.Empty;//权限是本组的 组串
             *      string oneSelf = string.Empty; //权限是本人的 组串
             *      for (int i = 0; i < dt_userGroupDataRight.Rows.Count; i++)
             *      {
             *          if (dt_userGroupDataRight.Rows[i]["RightType"].ToString() == "2")
             *          {
             *              ownGroup += dt_userGroupDataRight.Rows[i]["BGID"].ToString() + ",";
             *          }
             *          if (dt_userGroupDataRight.Rows[i]["RightType"].ToString() == "1")
             *          {
             *              oneSelf += dt_userGroupDataRight.Rows[i]["BGID"].ToString() + ",";
             *          }
             *      }
             *      _ownGroup = ownGroup.TrimEnd(',');
             *      _oneSelf = oneSelf.TrimEnd(',');
             *  }
             * }*/
            #endregion

            Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                Name, ANI, Agent, TaskID, CallID, BeginTime, EndTime, AgentNum, PhoneNum, TaskCategory,
                SpanTime1, SpanTime2, AgentGroup, CallStatus, _loginID, _ownGroup, _oneSelf, Category, IVRScore, IncomingSource, selBusinessType, ""
                );
            query.OutTypes = OutTypes;
            int projectid;
            if (int.TryParse(ProjectId, out projectid))
            {
                query.ProjectId = projectid;
            }
            int issuccess;
            if (int.TryParse(IsSuccess, out issuccess))
            {
                query.IsSuccess = issuccess;
            }
            int failreason;
            if (int.TryParse(FailReason, out failreason))
            {
                query.FailReason = failreason;
            }
            string    tableEndName = BLL.Util.CalcTableNameByMonth(3, query.BeginTime.Value);
            DataTable dt           = BLL.CallRecordInfo.Instance.GetCallRecordInfo(query, "c.CreateTime desc", BLL.PageCommon.Instance.PageIndex, PageSize, tableEndName, out RecordCount);

            if (dt != null)
            {
                repeaterTableList.DataSource = dt;
                repeaterTableList.DataBind();
            }
            litPagerDown.Text = BLL.PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, BLL.PageCommon.Instance.PageIndex, 1);
        }
        private void BindData()
        {
            int    _loginID  = -2;
            string _ownGroup = string.Empty;
            string _oneSelf  = string.Empty;

            _loginID = userID;

            //默认显示上周一周话务数据
            //上周一时间=today-(6+today.dayofweek)
            string sBeginTime = "", sEndTime = "";

            if (string.IsNullOrEmpty(BeginTime) && string.IsNullOrEmpty(EndTime))
            {
                DateTime LastMonday = DateTime.Now.AddDays(-(6 + Convert.ToDouble(DateTime.Now.DayOfWeek)));
                DateTime LastSunday = LastMonday.AddDays(6);

                sBeginTime = LastMonday.ToShortDateString();
                sEndTime   = LastSunday.ToShortDateString();
            }
            else
            {
                sBeginTime = BeginTime;
                sEndTime   = EndTime;
            }

            Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                "", "", "", "", "", sBeginTime, sEndTime, "", "", "",
                "", "", AgentGroup, CallStatus, _loginID, _ownGroup, _oneSelf, "", "", "", "", ""
                );

            query.QueryType    = RequestQueryType;
            query.CreateUserID = RequestAgentUserID;
            query.AgentNum     = RequestAgentNum;
            if (RequestAgentUserID > 0)
            {
                query.Agent = this.RequestAgentUserID.ToString();//userid
            }

            DataTable     dt   = null;
            SqlConnection conn = null;

            try
            {
                conn = CallRecordReport.Instance.CreateSqlConnection();
                string msg                  = "";
                string searchTableName      = "Report_CallRecord_Hour";
                string searchAgentTableName = "Report_AgentState_Hour";
                if (query.QueryType == 4 && DateTime.Now.Date == Convert.ToDateTime(BeginTime).Date)
                {
                    Dictionary <ReportTempType, string> dic1 = CallRecordReport.Instance.CreateReportCallRecordStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Hour, out msg);
                    searchTableName = dic1[ReportTempType.Hour];

                    Dictionary <ReportTempType, string> dic2 = CallRecordReport.Instance.CreateReportAgentStateStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Hour, out msg);
                    searchAgentTableName = dic2[ReportTempType.Hour];
                }
                else if (query.QueryType != 4 && DateTime.Now.Date == Convert.ToDateTime(BeginTime).Date&& DateTime.Now.Date == Convert.ToDateTime(EndTime).Date)
                {
                    Dictionary <ReportTempType, string> dic1 = CallRecordReport.Instance.CreateReportCallRecordStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Day, out msg);
                    searchTableName = dic1[ReportTempType.Day];

                    Dictionary <ReportTempType, string> dic2 = CallRecordReport.Instance.CreateReportAgentStateStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Day, out msg);
                    searchAgentTableName = dic2[ReportTempType.Day];
                }
                else if (query.QueryType == 4)
                {
                    searchTableName      = "Report_CallRecord_Hour";
                    searchAgentTableName = "Report_AgentState_Hour";
                }
                else
                {
                    searchTableName      = "Report_CallRecord_Day";
                    searchAgentTableName = "Report_AgentState_Day";
                }
                dt = CallRecordReport.Instance.GetCallOutReportData(query, conn, searchTableName, searchAgentTableName, BLL.PageCommon.Instance.PageIndex, PageSize, out RecordCount);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                CallRecordReport.Instance.CloseSqlConnection(conn);
            }

            if (query.QueryType == 4)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    dt.Rows[i]["p_gongshilv"] = "--";
                    dt.Rows[i]["T_SignIn"]    = "--";
                }
            }
            repeaterTableList.DataSource = dt;
            repeaterTableList.DataBind();

            litPagerDown.Text = BLL.PageCommon.Instance.LinkStringByPost(BLL.Util.GetUrl(), GroupLength, RecordCount, PageSize, BLL.PageCommon.Instance.PageIndex, 1);
        }
        private void BindData()
        {
            Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                "", "", "", "", "", BeginTime, EndTime, "", "", "",
                "", "", AgentGroup, CallStatus, userID, "", "", "", "", "", "", ""
                );

            query.QueryType    = RequestQueryType;
            query.CreateUserID = RequestAgentUserID;
            query.AgentNum     = RequestAgentNum;
            if (RequestAgentUserID > 0)
            {
                query.Agent = this.RequestAgentUserID.ToString();//userid
            }
            DataTable     dts  = null;
            SqlConnection conn = null;
            DataTable     dt2  = null;

            try
            {
                conn = CallRecordReport.Instance.CreateSqlConnection();
                string msg                  = "";
                string searchTableName      = "Report_CallRecord_Hour";
                string searchAgentTableName = "Report_AgentState_Hour";
                if (query.QueryType == 4 && DateTime.Now.Date == Convert.ToDateTime(BeginTime).Date)
                {
                    Dictionary <ReportTempType, string> dic1 = CallRecordReport.Instance.CreateReportCallRecordStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Hour, out msg);
                    searchTableName = dic1[ReportTempType.Hour];

                    Dictionary <ReportTempType, string> dic2 = CallRecordReport.Instance.CreateReportAgentStateStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Hour, out msg);
                    searchAgentTableName = dic2[ReportTempType.Hour];
                }
                else if (query.QueryType != 4 && DateTime.Now.Date == Convert.ToDateTime(BeginTime).Date&& DateTime.Now.Date == Convert.ToDateTime(EndTime).Date)
                {
                    Dictionary <ReportTempType, string> dic1 = CallRecordReport.Instance.CreateReportCallRecordStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Day, out msg);
                    searchTableName = dic1[ReportTempType.Day];

                    Dictionary <ReportTempType, string> dic2 = CallRecordReport.Instance.CreateReportAgentStateStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Day, out msg);
                    searchAgentTableName = dic2[ReportTempType.Day];
                }
                else if (query.QueryType == 4)
                {
                    searchTableName      = "Report_CallRecord_Hour";
                    searchAgentTableName = "Report_AgentState_Hour";
                }
                else
                {
                    searchTableName      = "Report_CallRecord_Day";
                    searchAgentTableName = "Report_AgentState_Day";
                }

                dts = CallRecordReport.Instance.GetCallOutReportData(query, conn, searchTableName, searchAgentTableName, 1, -1, out RecordCount);
                dt2 = CallRecordReport.Instance.GetCallOutDataReportTotal(query, conn, searchTableName, searchAgentTableName);

                dts.Columns.Remove("RN");
                dts.Columns.Remove("UserID");
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                CallRecordReport.Instance.CloseSqlConnection(conn);
            }


            object[] objArray = new object[dts.Columns.Count];
            objArray[0] = "合计共(" + RecordCount + ")项";
            objArray[1] = "--";
            objArray[2] = "--";
            // objArray[3] = 0;
            for (int j = 0; j < dt2.Columns.Count; j++)
            {
                objArray[j + 3] = dt2.Rows[0][j];
            }
            dts.Rows.Add(objArray);
            if (RequestQueryType == 4)
            {
                for (int i = 0; i < dts.Rows.Count; i++)
                {
                    dts.Rows[i]["p_gongshilv"] = "--";
                    dts.Rows[i]["T_SignIn"]    = "--";
                }
            }
            ExportData(dts);
        }
Exemple #13
0
        private string getWhereBySelect(Entities.QueryCallRecordInfo query)
        {
            string where = string.Empty;

            #region 数据权限判断
            if (query.LoginID != Constant.INT_INVALID_VALUE)
            {
                string whereDataRight = "";
                whereDataRight = Dal.UserGroupDataRigth.Instance.GetSqlRightstr("cob", "BGID", "CreateUserID", query.LoginID);

                where += whereDataRight;
            }
            #endregion

            #region 条件
            if (query.ANI != Constant.STRING_INVALID_VALUE)
            {
                where += " and c.ANI like '%" + StringHelper.SqlFilter(query.ANI) + "%'";
            }
            //申诉起始时间和结束时间都不为空
            if (query.AppealBeginTime != Constant.STRING_INVALID_VALUE && query.AppealBeginTime != "" && query.AppealEndTime != Constant.STRING_INVALID_VALUE && query.AppealEndTime != "")
            {
                where += " and exists ( select RecID from QS_ApprovalHistory where   ApprovalType='30007' and QS_ApprovalHistory.QS_RID=q.QS_RID and CreateTime >='" + StringHelper.SqlFilter(query.AppealBeginTime) + " 0:0:0' and CreateTime <='" + StringHelper.SqlFilter(query.AppealEndTime) + " 23:59:59')";
            }
            //申诉起始时间不为空和结束时间为空
            if (query.AppealBeginTime != Constant.STRING_INVALID_VALUE && query.AppealBeginTime != "" && (query.AppealEndTime == Constant.STRING_INVALID_VALUE || query.AppealEndTime == ""))
            {
                where += " and exists ( select RecID from QS_ApprovalHistory where   ApprovalType='30007' and QS_ApprovalHistory.QS_RID=q.QS_RID and CreateTime >='" + StringHelper.SqlFilter(query.AppealBeginTime) + " 0:0:0')";
            }
            //申诉起始时间为空和结束时间不为空
            if ((query.AppealBeginTime == Constant.STRING_INVALID_VALUE || query.AppealBeginTime == "") && query.AppealEndTime != Constant.STRING_INVALID_VALUE)
            {
                where += " and exists ( select RecID from QS_ApprovalHistory where   ApprovalType='30007' and QS_ApprovalHistory.QS_RID=q.QS_RID and CreateTime <='" + StringHelper.SqlFilter(query.AppealEndTime) + " 23:59:59')";
            }
            if (query.BeginTime != Constant.DATE_INVALID_VALUE)
            {
                //where += " and cob.CreateTime>='" + DateTime.Parse(query.BeginTime.ToString()).ToShortDateString() + " 0:0:0'";
                where += " and c.CreateTime>='" + DateTime.Parse(query.BeginTime.ToString()) + "'";
            }
            if (query.EndTime != Constant.DATE_INVALID_VALUE)
            {
                //where += " and cob.CreateTime<='" + DateTime.Parse(query.EndTime.ToString()).ToShortDateString() + " 23:59:59'";
                where += " and c.CreateTime<='" + DateTime.Parse(query.EndTime.ToString()) + "'";
            }
            if (query.CallID != Constant.INT_INVALID_VALUE)
            {
                where += " and cob.CallID=" + query.CallID;
            }
            if (query.SCID != Constant.INT_INVALID_VALUE && query.SCID != -1)
            {
                where += " and cob.SCID=" + query.SCID;
            }
            if (query.BGID != Constant.INT_INVALID_VALUE && query.BGID != -1)
            {
                where += " and cob.BGID=" + query.BGID;
            }
            if (query.PhoneNum != Constant.STRING_INVALID_VALUE)
            {
                where += " and c.PhoneNum like '%" + StringHelper.SqlFilter(query.PhoneNum) + "%'";
            }
            if (query.ScoreBeginTime != Constant.STRING_INVALID_VALUE)
            {
                where += " and q.CreateTime>='" + StringHelper.SqlFilter(query.ScoreBeginTime) + " 0:0:0'";
            }
            if (query.ScoreEndTime != Constant.STRING_INVALID_VALUE)
            {
                where += " and q.CreateTime<='" + StringHelper.SqlFilter(query.ScoreEndTime) + " 23:59:59'";
            }
            if (query.QSResultStatus != Constant.STRING_INVALID_VALUE && CommonFunction.ObjectToInteger(query.QSResultStatus) > 0)
            {
                where += " and (q.Status in (" + Dal.Util.SqlFilterByInCondition(query.QSResultStatus) + ")";

                if (query.QSResultStatus.Contains("20001"))
                {
                    where += " or q.Status is null ";
                }

                where += ")";
            }
            if (query.BusinessID != Constant.STRING_INVALID_VALUE)
            {
                where += " and cob.BusinessID='" + StringHelper.SqlFilter(query.BusinessID) + "'";
            }
            if (query.CallType != Constant.STRING_INVALID_VALUE)
            {
                where += " and c.CallStatus in (" + Dal.Util.SqlFilterByInCondition(query.CallType) + ")";
            }
            if (query.SpanTime1 != Constant.INT_INVALID_VALUE)
            {
                where += " and c.tallTime>=" + query.SpanTime1;
            }
            if (query.SpanTime2 != Constant.INT_INVALID_VALUE)
            {
                where += " and c.tallTime<=" + query.SpanTime2;
            }
            if (query.CreateUserID != Constant.INT_INVALID_VALUE && query.CreateUserID != -1)
            {
                where += " and cob.CreateUserID=" + query.CreateUserID;
            }
            if (query.ScoreCreater != Constant.INT_INVALID_VALUE && query.ScoreCreater != -1)
            {
                where += " and q.CreateUserID=" + query.ScoreCreater;
            }
            //申诉结果
            if (query.QSStateResult != Constant.STRING_INVALID_VALUE && query.QSStateResult != Constant.STRING_EMPTY_VALUE)
            {
                where += " and q.StateResult in (" + Dal.Util.SqlFilterByInCondition(query.QSStateResult) + ")";
            }
            //评分表
            if (query.ScoreTable != Constant.INT_INVALID_VALUE && query.ScoreTable != -1)
            {
                //将要用此评分表评分的
                where += " and ((QS_RulesRange.QS_RTID=" + query.ScoreTable + " And q.CallID is null)";
                //已经用此评分表评过分的
                where += " or (q.QS_RTID=" + query.ScoreTable + "))";
            }
            if (query.IsFilterNull != Constant.INT_INVALID_VALUE && query.IsFilterNull == 1)
            {
                where += " And (c.TallTime>0 and c.CallID>0 and cob.BusinessID is not null and cob.BusinessID <> '')";
            }
            //if (query.Qualified != Constant.STRING_INVALID_VALUE)
            //{
            //    where += " and q.IsQualified in (" + Dal.Util.SqlFilterByInCondition(query.Qualified) + ")";
            //}
            if (query.QSResultScore != Constant.STRING_INVALID_VALUE)
            {
                where += " and isnull(ivr.Score,0) in (" + Dal.Util.SqlFilterByInCondition(query.QSResultScore) + ")";
            }
            //问题解决 第一级
            if (query.SelSolve != Constant.INT_INVALID_VALUE && query.SelSolve >= 0)
            {
                where += "  AND isnull(ivr.Score,0) like '" + query.SelSolve + "%'";
            }
            //满意度 第2级
            if (query.IVRScore != Constant.INT_INVALID_VALUE && query.IVRScore >= 0)
            {
                where += "  AND isnull(ivr.Score,0) like '[12]" + query.IVRScore + "'";
            }
            //话务坐席所属分组
            int CallAgentBGID = CommonFunction.ObjectToInteger(query.CallAgentBGID);
            if (CallAgentBGID > 0)
            {
                where += " AND cob.CreateUserID IN (SELECT UserID FROM dbo.EmployeeAgent WHERE BGID=" + CallAgentBGID + " )";
            }
            #endregion

            return(where);
        }
Exemple #14
0
        private Entities.QueryCallRecordInfo GetQuery()
        {
            Entities.QueryCallRecordInfo query = new Entities.QueryCallRecordInfo();
            if (RequestPhoneNum != "")
            {
                query.PhoneNum = RequestPhoneNum;
            }
            if (RequestBeginTime != "")
            {
                query.BeginTime = DateTime.Parse(RequestBeginTime);
            }
            if (RequestEndTime != "")
            {
                query.EndTime = DateTime.Parse(RequestEndTime);
            }
            int bgid = 0;

            if (RequestBGID != "" && int.TryParse(RequestBGID, out bgid))
            {
                query.BGID = bgid;
            }
            int scid = 0;

            if (RequestSCID != "" && int.TryParse(RequestSCID, out scid))
            {
                query.SCID = scid;
            }
            if (RequestANI != "")
            {
                query.ANI = RequestANI;
            }
            int spanTime1 = 0;

            if (RequestSpanTime1 != "" && int.TryParse(RequestSpanTime1, out spanTime1))
            {
                query.SpanTime1 = spanTime1;
            }
            int spanTime2 = 0;

            if (RequestSpanTime2 != "" && int.TryParse(RequestSpanTime2, out spanTime2))
            {
                query.SpanTime2 = spanTime2;
            }
            int createUserid = 0;

            if (RequestCreateUserID != "" && int.TryParse(RequestCreateUserID, out createUserid))
            {
                query.CreateUserID = createUserid;
            }
            if (RequestBusinessID != "")
            {
                query.BusinessID = RequestBusinessID;
            }
            if (RequestScoreBeginTime != "")
            {
                query.ScoreBeginTime = RequestScoreBeginTime;
            }
            if (RequestScoreEndTime != "")
            {
                query.ScoreEndTime = RequestScoreEndTime;
            }
            int scoreTable = 0;

            if (RequestScoreTable != "" && int.TryParse(RequestScoreTable, out scoreTable))
            {
                query.ScoreTable = scoreTable;
            }
            long callid = 0;

            if (RequestCallID != "" && long.TryParse(RequestCallID, out callid))
            {
                query.CallID = callid;
            }
            if (RequestAppealBeginTime != "")
            {
                query.AppealBeginTime = RequestAppealBeginTime;
            }
            if (RequestAppealEndTime != "")
            {
                query.AppealEndTime = RequestAppealEndTime;
            }
            int screaterid = 0;

            if (RequestScoreCreater != "" && int.TryParse(RequestScoreCreater, out screaterid))
            {
                query.ScoreCreater = screaterid;
            }
            if (RequestCallType != "")
            {
                query.CallType = RequestCallType;
            }
            if (RequestQSResultStatus != "")
            {
                query.QSResultStatus = RequestQSResultStatus;
            }
            if (RequestQSStateResult != "")
            {
                query.QSStateResult = RequestQSStateResult;
            }
            //if (RequestQualified != "")
            //{
            //    query.Qualified = RequestQualified;
            //}
            if (RequestQSResultScore != "")
            {
                query.QSResultScore = RequestQSResultScore;
            }
            query.CallAgentBGID = RequestCallAgentBGID;
            query.LoginID       = BLL.Util.GetLoginUserID();
            query.IsFilterNull  = 1;
            return(query);
        }
Exemple #15
0
 /// 评分型-成绩主表导出
 /// <summary>
 /// 评分型-成绩主表导出
 /// </summary>
 /// <param name="query"></param>
 /// <param name="tableEndName"></param>
 /// <returns></returns>
 public DataTable getResultByExport(Entities.QueryCallRecordInfo query, string tableEndName)
 {
     return(Dal.QS_Result.Instance.getResultByExport(query, tableEndName));
 }
Exemple #16
0
        public void ProcessRequest(HttpContext context)
        {
            BitAuto.YanFa.SysRightManager.Common.UserInfo.Check();

            context.Response.ContentType = "text/plain";
            string message = "";

            if ((context.Request["Action"] + "").Trim() == "CallPhoneReportTotalNew")
            {
                //默认显示上周一周话务数据
                //上周一时间=today-(6+today.dayofweek)
                string sBeginTime = "", sEndTime = "";
                if (string.IsNullOrEmpty(BeginTime) && string.IsNullOrEmpty(EndTime))
                {
                    DateTime LastMonday = DateTime.Now.AddDays(-(6 + Convert.ToDouble(DateTime.Now.DayOfWeek)));
                    DateTime LastSunday = LastMonday.AddDays(6);

                    sBeginTime = LastMonday.ToShortDateString();
                    sEndTime   = LastSunday.ToShortDateString();
                }
                else
                {
                    sBeginTime = BeginTime;
                    sEndTime   = EndTime;
                }

                int _loginID = BLL.Util.GetLoginUserID();

                Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                    "", "", "", "", "", sBeginTime, sEndTime, "", "", "",
                    "", "", AgentGroup, CallStatus, _loginID, "", "", "", "", "", "", ""
                    );

                query.QueryType    = RequestQueryType;
                query.CreateUserID = RequestAgentUserID;
                query.AgentNum     = RequestAgentNum;
                if (RequestAgentUserID > 0)
                {
                    query.Agent = this.RequestAgentUserID.ToString();//userid
                }

                DataTable     dt   = null;
                SqlConnection conn = null;
                try
                {
                    conn = CallRecordReport.Instance.CreateSqlConnection();
                    string msg                  = "";
                    string searchTableName      = "Report_CallRecord_Hour";
                    string searchAgentTableName = "Report_AgentState_Hour";
                    if (query.QueryType == 4 && DateTime.Now.Date == Convert.ToDateTime(BeginTime).Date)
                    {
                        Dictionary <ReportTempType, string> dic1 = CallRecordReport.Instance.CreateReportCallRecordStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Hour, out msg);
                        searchTableName = dic1[ReportTempType.Hour];

                        Dictionary <ReportTempType, string> dic2 = CallRecordReport.Instance.CreateReportAgentStateStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Hour, out msg);
                        searchAgentTableName = dic2[ReportTempType.Hour];
                    }
                    else if (query.QueryType != 4 && DateTime.Now.Date == Convert.ToDateTime(BeginTime).Date&& DateTime.Now.Date == Convert.ToDateTime(EndTime).Date)
                    {
                        Dictionary <ReportTempType, string> dic1 = CallRecordReport.Instance.CreateReportCallRecordStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Day, out msg);
                        searchTableName = dic1[ReportTempType.Day];

                        Dictionary <ReportTempType, string> dic2 = CallRecordReport.Instance.CreateReportAgentStateStatForDayTmp(conn, query.BeginTime.Value, ReportTempType.Day, out msg);
                        searchAgentTableName = dic2[ReportTempType.Day];
                    }
                    else if (query.QueryType == 4)
                    {
                        searchTableName      = "Report_CallRecord_Hour";
                        searchAgentTableName = "Report_AgentState_Hour";
                    }
                    else
                    {
                        searchTableName      = "Report_CallRecord_Day";
                        searchAgentTableName = "Report_AgentState_Day";
                    }

                    dt = CallRecordReport.Instance.GetCallOutDataReportTotal(query, conn, searchTableName, searchAgentTableName);
                    if (query.QueryType == 4)
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            dt.Rows[i]["p_gongshilv"] = "--";
                            dt.Rows[i]["T_SignIn"]    = "--";
                        }
                    }
                }
                catch (Exception)
                {
                    throw;
                }
                finally
                {
                    CallRecordReport.Instance.CloseSqlConnection(conn);
                }

                JsonDataNew jsondata = new JsonDataNew();
                if (string.IsNullOrEmpty(dt.Rows[0]["N_Total"].ToString()))
                {
                    jsondata.N_Total     = 0;
                    jsondata.N_ETotal    = 0;
                    jsondata.p_gongshilv = "0.00%";
                    jsondata.T_Talk      = "0.00";
                    jsondata.T_SignIn    = "--";
                    jsondata.T_Ringing   = "0.00";
                    jsondata.t_pjtime    = "0.00";
                    jsondata.t_pjring    = "0.00";
                    jsondata.p_jietonglv = "--";
                }
                else
                {
                    jsondata.p_gongshilv = dt.Rows[0]["p_gongshilv"].ToString();
                    jsondata.T_Talk      = dt.Rows[0]["T_Talk"].ToString();
                    jsondata.T_SignIn    = dt.Rows[0]["T_SignIn"].ToString();
                    jsondata.T_Ringing   = dt.Rows[0]["T_Ringing"].ToString();
                    jsondata.N_Total     = Convert.ToInt32(dt.Rows[0]["N_Total"]);
                    jsondata.t_pjtime    = dt.Rows[0]["t_pjtime"].ToString();
                    jsondata.N_ETotal    = Convert.ToInt32(dt.Rows[0]["N_ETotal"]);
                    jsondata.t_pjring    = dt.Rows[0]["t_pjring"].ToString();
                    jsondata.p_jietonglv = dt.Rows[0]["p_jietonglv"].ToString();
                }

                message = Newtonsoft.Json.JavaScriptConvert.SerializeObject(jsondata);
                context.Response.Write(message);
                context.Response.End();
            }
            else
            {
                success = false;
                message = "request error";
                BitAuto.ISDC.CC2012.BLL.AJAXHelper.WrapJsonResponse(success, result, message);
            }
        }
Exemple #17
0
        private void BindData()
        {
            bool     r;
            string   info;
            DateTime st = CommonFunction.ObjectToDateTime(BeginTime);
            DateTime et = CommonFunction.ObjectToDateTime(EndTime);

            r = BLL.Util.CheckForSelectCallRecordORIG(st, et, out info);
            if (r == false)
            {
                return;
            }

            int    _loginID  = -2;
            string _ownGroup = string.Empty;
            string _oneSelf  = string.Empty;

            _loginID = userID;
            #region 调整分组前数据权限

            /*
             * //判断数据权限,数据权限如果为 2-全部,则查看所有数据
             * Entities.UserDataRigth model_userDataRight = BLL.UserDataRigth.Instance.GetUserDataRigth(userID);
             * if (model_userDataRight != null)
             * {
             *  if (model_userDataRight.RightType != 2)//数据权限不为 2-全部
             *  {
             *      _loginID = userID;
             *      //判断分组权限,如果权限是2-本组,则能看到本组人创建的信息;如果权限是1-本人,则只能看本人创建的信息
             *      DataTable dt_userGroupDataRight = BLL.UserGroupDataRigth.Instance.GetUserGroupDataRigthByUserID(userID);
             *      string ownGroup = string.Empty;//权限是本组的 组串
             *      string oneSelf = string.Empty; //权限是本人的 组串
             *      for (int i = 0; i < dt_userGroupDataRight.Rows.Count; i++)
             *      {
             *          if (dt_userGroupDataRight.Rows[i]["RightType"].ToString() == "2")
             *          {
             *              ownGroup += dt_userGroupDataRight.Rows[i]["BGID"].ToString() + ",";
             *          }
             *          if (dt_userGroupDataRight.Rows[i]["RightType"].ToString() == "1")
             *          {
             *              oneSelf += dt_userGroupDataRight.Rows[i]["BGID"].ToString() + ",";
             *          }
             *      }
             *      _ownGroup = ownGroup.TrimEnd(',');
             *      _oneSelf = oneSelf.TrimEnd(',');
             *  }
             * }
             */
            #endregion

            Entities.QueryCallRecordInfo query = BLL.CallRecordInfo.Instance.GetQueryModel(
                Name, ANI, Agent, TaskID, CallID, BeginTime, EndTime, AgentNum, PhoneNum, TaskCategory,
                SpanTime1, SpanTime2, AgentGroup, CallStatus, _loginID, _ownGroup, _oneSelf, Category, IVRScore, IncomingSource, selBusinessType, ""
                );
            query.OutTypes = OutTypes;

            int projectid;
            if (int.TryParse(ProjectId, out projectid))
            {
                query.ProjectId = projectid;
            }
            int issuccess;
            if (int.TryParse(IsSuccess, out issuccess))
            {
                query.IsSuccess = issuccess;
            }
            int failreason;
            if (int.TryParse(FailReason, out failreason))
            {
                query.FailReason = failreason;
            }
            string    tableEndName = BLL.Util.CalcTableNameByMonth(3, query.BeginTime.Value);
            DataTable dt           = BLL.CallRecordInfo.Instance.GetCallRecordInfo(query, "c.CreateTime desc", 1, -1, tableEndName, out RecordCount);
            ExportData(dt);
        }