| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.SessionState;
- using System.Text;
- using System.Data;
- namespace HySoft.BaseCallCenter.Web.reportmanage.operationdata.controls
- {
- /// <summary>
- /// OneUserAPI 的摘要说明
- /// </summary>
- public class OneUserAPI : IHttpHandler
- {
- public void ProcessRequest(HttpContext context)
- {
- context.Response.ContentType = "text/plain";
- string action = context.Request.QueryString["action"];
- switch (action)
- {
- case "getlist":
- context.Response.Write(GetDataListHtml(context));//读取数据
- break;
- }
- }
- public string GetDataListHtml(HttpContext context)
- {
- StringBuilder htmlReport = new StringBuilder();//存储生成的HTML
- //拼接表头
- htmlReport.Append("<table cellspacing='0' cellpadding='0' border='1' width='100%'><tr height='35'>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>部门名称</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>工程师姓名</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>事件总数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>一般事件响应及时数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>紧急事件响应及时数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>事件响应及时率</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>一般事件解决及时数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>紧急事件解决及时数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>事件解决及时率</td>");
- //htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>紧急事件响应及时率</td>");
- //htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>紧急事件解决及时率</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>事件解决数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>事件解决率</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>事件平均解决时间(小时)</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>回访评分总和</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>回访事件总数</td>");
- htmlReport.Append("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>客户评分</td>");
- htmlReport.Append("</tr>");
- try
- {
- //前台传来的开始时间结束时间
- string txtStartTime = context.Request.QueryString["txtStartTime"];
- string txtEndTime = context.Request.QueryString["txtEndTime"];
- //拼接时间查询语句
- string sqltimeHistory = "";
- if (txtStartTime != null && txtStartTime.Trim() != "")
- {
- sqltimeHistory += " and CONVERT(varchar , F_OPTDATE, 120)>=CONVERT(varchar , '" + txtStartTime.Trim() + " 00:00:01', 120) ";
- }
- if (txtEndTime != null && txtEndTime.Trim() != "")
- {
- sqltimeHistory += " and CONVERT(varchar , F_OPTDATE, 120)<=CONVERT(varchar , '" + txtEndTime.Trim() + " 23:59:59', 120) ";
- }
- string sqltimeTask = "";
- if (txtStartTime != null && txtStartTime.Trim() != "")
- {
- sqltimeTask += " and CONVERT(varchar , F_CREATEDATE, 120)>=CONVERT(varchar , '" + txtStartTime.Trim() + " 00:00:01', 120) ";
- }
- if (txtEndTime != null && txtEndTime.Trim() != "")
- {
- sqltimeTask += " and CONVERT(varchar , F_CREATEDATE, 120)<=CONVERT(varchar , '" + txtEndTime.Trim() + " 23:59:59', 120) ";
- }
- //定义总结时候的一些变量
- double zong1 = 0;
- double zong2 = 0;
- double zong3 = 0;
- double zong4 = 0;
- double zong5 = 0;
- double zong6 = 0;
- double zong7 = 0;
- double zong8 = 0;
- double zongtime = 0;
- int zongtimecount = 0;
- double zongfen = 0;
- int zongfencount = 0;
- int count = 0;
- int gerenfenshu = 0;
- int gerencount = 0;
- //定义是否及时处理的时间变量
- #region 查询在字典那块设置的时间
- string ybgdJDcaoshi = "15552000";
- string ybgdCLcaoshi = "15552000";
- string jjgdJDcaoshi = "15552000";
- string jjgdCLcaoshi = "15552000";
- string sqlybgd = "SELECT * from T_Sys_DictionaryValue where F_DictionaryFlag='ybgd' order by F_Sort ";
- DataTable dtybgd = DBUtility.DbHelperSQL.Query(sqlybgd).Tables[0];
- if (dtybgd.Rows.Count > 1)
- {
- ybgdJDcaoshi = (Convert.ToInt32(dtybgd.Rows[0]["F_Name"]) * 3600).ToString();
- ybgdCLcaoshi = (Convert.ToInt32(dtybgd.Rows[1]["F_Name"]) * 3600).ToString();
- }
- string sqljjgd = "SELECT * from T_Sys_DictionaryValue where F_DictionaryFlag='jjgd' order by F_Sort ";
- DataTable dtjjgd = DBUtility.DbHelperSQL.Query(sqljjgd).Tables[0];
- if (dtjjgd.Rows.Count > 1)
- {
- jjgdJDcaoshi = (Convert.ToInt32(dtybgd.Rows[0]["F_Name"]) * 3600).ToString();
- jjgdCLcaoshi = (Convert.ToInt32(dtybgd.Rows[1]["F_Name"]) * 3600).ToString();
- }
- #endregion
- #region 查询在告警超时那块设置的时间
- //string JDcaoshi = "15552000";
- //string CLcaoshi = "15552000";
- //string sqlCLcaoshi = "select * from T_Wo_StateAlarmDate where F_WorkOrderTypeId=16 and F_WorkOrderStateId=7";
- //DataTable dtCLcaoshi = DBUtility.DbHelperSQL.Query(sqlCLcaoshi).Tables[0];
- //if (dtCLcaoshi.Rows.Count > 0)
- //{
- // if (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) > 0)
- // {
- // if (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Cunit"]) == 1)
- // {
- // CLcaoshi = (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) * 3600).ToString();
- // }
- // else if (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Cunit"]) == 2)
- // {
- // CLcaoshi = (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) * 3600 * 24).ToString();
- // }
- // else
- // {
- // CLcaoshi = (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) * 60).ToString();
- // }
- // }
- //}
- //string sqlcaoshi = "select * from T_Wo_StateAlarmDate where F_WorkOrderTypeId=16 and F_WorkOrderStateId=6";
- //DataTable dtJDcaoshi = DBUtility.DbHelperSQL.Query(sqlcaoshi).Tables[0];
- //if (dtJDcaoshi.Rows.Count > 0)
- //{
- // if (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) > 0)
- // {
- // if (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Cunit"]) == 1)
- // {
- // JDcaoshi = (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) * 3600).ToString();
- // }
- // else if (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Cunit"]) == 2)
- // {
- // JDcaoshi = (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) * 3600 * 24).ToString();
- // }
- // else
- // {
- // JDcaoshi = (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) * 60).ToString();
- // }
- // }
- //}
- #endregion
- //查询出来所有部门,按照工单量的多少排序
- DataTable dtDept = new DataTable();
- string sqlDept = "SELECT distinct(F_DeptId),(select COUNT(*) from T_Wo_WorkOrderTask where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OWNERID in(SELECT F_UserId from T_Sys_UserAccount where F_DeptId=t.F_DeptId and F_RoleId=30)" + sqltimeTask + ") as counts,(SELECT F_DeptName from T_Sys_Department where F_DeptId=t.F_DeptId) as deptname from T_Sys_UserAccount t where F_RoleId=30 order by counts desc ";
- dtDept = DBUtility.DbHelperSQL.Query(sqlDept).Tables[0];
- for (int j = 0; j < dtDept.Rows.Count; j++)
- {
- //工单量是0的跳出
- if (dtDept.Rows[j]["counts"] == null || dtDept.Rows[j]["counts"].ToString() == "" || dtDept.Rows[j]["counts"].ToString() == "0")
- {
- continue;
- }
- DataTable dt = new DataTable();
- //查询出来部门下的所有人员,按照工单量多少排序
- string sql = "select t.* from (SELECT *,(select COUNT(*) from T_Wo_WorkOrderTask where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OWNERID=T_Sys_UserAccount.F_UserId " + sqltimeTask + ") as counts from T_Sys_UserAccount where F_RoleId=30 and F_DeptId=" + dtDept.Rows[j]["F_DeptId"].ToString() + " ) t where t.counts>0 order by counts desc ";
- dt = DBUtility.DbHelperSQL.Query(sql).Tables[0];
- int s = dt.Rows.Count + 1;
- htmlReport.AppendFormat("<td rowspan='" + s + "' align='center' style='width:120px; vertical-align: middle; border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC;border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px;height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dtDept.Rows[j]["deptname"].ToString());
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- //查出来该人员的总工单量,接收的工单量,处理的工单量,已处理完成的工单量
- //sql = " select (select COUNT(*) from T_Wo_WorkOrderTask where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OWNERID=" + dt.Rows[i]["F_UserId"].ToString() + "" + sqltimeTask + ") as counts,";
- //sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME<" + JDcaoshi + "" + sqltimeHistory + ") as ybgdjiedan,";
- //sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME<" + CLcaoshi + "" + sqltimeHistory + ") as ybgdchuli,";
- //sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME is not null" + sqltimeHistory + ") as jiejue ";
- sql = " select (select COUNT(*) from T_Wo_WorkOrderTask where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OWNERID=" + dt.Rows[i]["F_UserId"].ToString() + "" + sqltimeTask + ") as counts,";
- sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 and F_REPAIRLEVEL is null or F_REPAIRLEVEL!=396 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME<" + ybgdJDcaoshi + "" + sqltimeHistory + ") as ybgdjiedan,";
- sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 and F_REPAIRLEVEL is null or F_REPAIRLEVEL!=396 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME<" + ybgdCLcaoshi + "" + sqltimeHistory + ") as ybgdchuli,";
- sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 and F_REPAIRLEVEL=396 " + sqltimeTask + " ) and F_WORKORDERSTATEID=6 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME<" + jjgdJDcaoshi + "" + sqltimeHistory + ") as jjgdjiedan,";
- sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 and F_REPAIRLEVEL=396 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME<" + jjgdCLcaoshi + "" + sqltimeHistory + ") as jjgdchuli,";
- sql += "(select count(*) from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + " and F_ELAPSEDTIME is not null" + sqltimeHistory + ") as jiejue ";
- DataTable dt1 = new DataTable();
- dt1 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
- if (dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "" || dt1.Rows[0]["counts"].ToString() == "0")
- {
- continue;
- }
- count = count + 1;
- //工单的处理时间,是接收时间加上处理的时间
- sql = @"select sum(F_ELAPSEDTIME) as sum1,(select sum(F_ELAPSEDTIME) from T_Wo_WorkOrderHistory where F_WORKORDERSTATEID=6 and F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + ")" + sqltimeHistory + ") as sum2 from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + "" + sqltimeHistory + "";
- DataTable dt2 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
- string time = "0";
- if (dt2.Rows[0]["sum1"].ToString() == "" && dt2.Rows[0]["sum2"].ToString() != "")
- {
- time = (Convert.ToDouble(dt2.Rows[0]["sum2"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) / 3600).ToString("f2");
- zongtime += Convert.ToDouble(dt2.Rows[0]["sum2"]);
- zongtimecount += Convert.ToInt32(dt1.Rows[0]["counts"]);
- }
- else if (dt2.Rows[0]["sum1"].ToString() != "" && dt2.Rows[0]["sum2"].ToString() == "")
- {
- time = (Convert.ToDouble(dt2.Rows[0]["sum1"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) / 3600).ToString("f2");
- zongtime += Convert.ToDouble(dt2.Rows[0]["sum1"]);
- zongtimecount += Convert.ToInt32(dt1.Rows[0]["counts"]);
- }
- else if (dt2.Rows[0]["sum1"].ToString() != "" && dt2.Rows[0]["sum2"].ToString() != "")
- {
- time = ((Convert.ToDouble(dt2.Rows[0]["sum1"]) + Convert.ToDouble(dt2.Rows[0]["sum2"])) / Convert.ToDouble(dt1.Rows[0]["counts"]) / 3600).ToString("f2");
- zongtime += Convert.ToDouble(dt2.Rows[0]["sum1"]) + Convert.ToDouble(dt2.Rows[0]["sum2"]);
- zongtimecount += Convert.ToInt32(dt1.Rows[0]["counts"]);
- }
- //查出来客户评分
- sql = "select count(*) as counts from T_Wo_WorkOrderHistoryInfo where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + ") and F_CUSTOMERSCORE is not null and F_CUSTOMERSCORE!=''" + sqltimeHistory + "";
- DataTable dt3 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
- sql = "select SUM(convert(int,F_CUSTOMERSCORE)) as sums from T_Wo_WorkOrderHistoryInfo where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderHistory where F_INSTANCEID in(select F_INSTANCEID from T_Wo_WorkOrderBase where 1=1 " + sqltimeTask + " ) and F_WORKORDERSTATEID=7 and F_OPTUSERID=" + dt.Rows[i]["F_UserId"].ToString() + ") and F_CUSTOMERSCORE is not null and F_CUSTOMERSCORE!=''" + sqltimeHistory + "";
- DataTable dt4 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
- string fenshu = "0";
- if (dt4.Rows[0]["sums"].ToString() != "")
- {
- fenshu = (Convert.ToInt32(dt4.Rows[0]["sums"]) / Convert.ToInt32(dt3.Rows[0]["counts"])).ToString();
- zongfen += Convert.ToDouble(dt4.Rows[0]["sums"]);
- zongfencount += Convert.ToInt32(dt3.Rows[0]["counts"]);
- gerenfenshu = Convert.ToInt32(dt4.Rows[0]["sums"]);
- gerencount = Convert.ToInt32(dt3.Rows[0]["counts"]);
- }
- else
- {
- gerenfenshu = 0;
- gerencount = 0;
- }
- //拼接表数据
- htmlReport.AppendFormat("<tr><td align='center'style='border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt.Rows[i]["F_UserName"].ToString());
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt1.Rows[0]["counts"].ToString());
- zong1 += Convert.ToInt32(dt1.Rows[0]["counts"]);
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt1.Rows[0]["ybgdjiedan"].ToString());
- zong2 += Convert.ToInt32(dt1.Rows[0]["ybgdjiedan"]);
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt1.Rows[0]["jjgdjiedan"].ToString());
- zong7 += Convert.ToInt32(dt1.Rows[0]["jjgdjiedan"]);
- if (dt1.Rows[0]["ybgdjiedan"] == null || dt1.Rows[0]["jjgdjiedan"] == null|| dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
- {
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>0.00%</td>");
- }
- else
- {
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", ((Convert.ToDouble(dt1.Rows[0]["ybgdjiedan"])+Convert.ToDouble(dt1.Rows[0]["jjgdjiedan"])) / Convert.ToDouble(dt1.Rows[0]["counts"]) * 100).ToString("f2") + "%");
- }
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt1.Rows[0]["ybgdchuli"].ToString() + " ");
- zong3 += Convert.ToInt32(dt1.Rows[0]["ybgdchuli"]);
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt1.Rows[0]["jjgdchuli"].ToString() + " ");
- zong8 += Convert.ToInt32(dt1.Rows[0]["jjgdchuli"]);
- if (dt1.Rows[0]["ybgdchuli"] == null || dt1.Rows[0]["jjgdchuli"] == null || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
- {
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>0.00%</td>");
- }
- else
- {
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", ((Convert.ToDouble(dt1.Rows[0]["ybgdchuli"])+Convert.ToDouble(dt1.Rows[0]["jjgdchuli"])) / Convert.ToDouble(dt1.Rows[0]["counts"]) * 100).ToString("f2") + "%");
- }
- //紧急请求开始
- //if (dt1.Rows[0]["jjgdjiedan"] == null || dt1.Rows[0]["jjgdjiedan"].ToString() == "0" || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
- //{
- // htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>0.00%</td>");
- //}
- //else
- //{
- // htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", (Convert.ToDouble(dt1.Rows[0]["jjgdjiedan"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) * 100).ToString("f2") + "%");
- //}
- //if (dt1.Rows[0]["jjgdchuli"] == null || dt1.Rows[0]["jjgdchuli"].ToString() == "0" || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
- //{
- // htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>0.00%</td>");
- //}
- //else
- //{
- // htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", (Convert.ToDouble(dt1.Rows[0]["jjgdchuli"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) * 100).ToString("f2") + "%");
- //}
- //紧急请求结束
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", dt1.Rows[0]["jiejue"].ToString());
- zong4 += Convert.ToInt32(dt1.Rows[0]["jiejue"]);
- if (dt1.Rows[0]["jiejue"] == null || dt1.Rows[0]["jiejue"].ToString() == "0" || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
- {
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>0.00%</td>");
- }
- else
- {
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", (Convert.ToDouble(dt1.Rows[0]["jiejue"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) * 100).ToString("f2") + "%");
- }
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", time);
- zong5 += Convert.ToDouble(time);
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", gerenfenshu);
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", gerencount);
- htmlReport.AppendFormat("<td align='center' style=' border-top: 0px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; padding-left: 2px; height: 18px; padding-top: 3px; padding-bottom: 3px;'>{0}</td>", fenshu);
- zong6 += Convert.ToInt32(fenshu);
- htmlReport.Append("</tr>");
- }
- }
- //拼接表下部的总计
- htmlReport.Append("<tr height='35'>");
- htmlReport.AppendFormat("<td colspan='2' style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", "总计");
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zong1);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zong2);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zong7);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", (Convert.ToDouble((zong2+zong7) / zong1) * 100).ToString("f2") + "%");
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zong3);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zong8);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", (Convert.ToDouble((zong3+zong8) / zong1) * 100).ToString("f2") + "%");
- //htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", (Convert.ToDouble(zong7 / zong1) * 100).ToString("f2") + "%");
- //htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", (Convert.ToDouble(zong8 / zong1) * 100).ToString("f2") + "%");
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zong4);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", (Convert.ToDouble(zong4 / zong1) * 100).ToString("f2") + "%");
- if (zongtimecount == 0)
- {
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>0.00%</td>");
- }
- else
- {
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", Convert.ToDouble(zongtime / zongtimecount / 3600).ToString("f2"));
- }
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zongfen);
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", zongfencount);
- if (zongfencount == 0)
- {
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>0.00</td>");
- }
- else
- {
- htmlReport.AppendFormat("<td style='height: 18px; background-color: #D5EDFE; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC; border-top: 1px solid #CCCCCC; border-bottom: 1px solid #CCCCCC; padding: 3px 3px 3px 3px; text-align: center;'>{0}</td>", (zongfen / zongfencount).ToString("f2"));
- }
- htmlReport.Append("</tr>");
- htmlReport.Append("</table>");
- }
- catch { }
- return htmlReport.ToString();
- }
- public bool IsReusable
- {
- get
- {
- return false;
- }
- }
- }
- }
|