市长热线演示版

TowUserAPI.ashx.cs 33KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.SessionState;
  6. using System.Text;
  7. using System.Data;
  8. namespace HySoft.BaseCallCenter.Web.reportmanage.operationdata.controls
  9. {
  10. /// <summary>
  11. /// TowUserAPI 的摘要说明
  12. /// </summary>
  13. public class TowUserAPI : IHttpHandler
  14. {
  15. public void ProcessRequest(HttpContext context)
  16. {
  17. context.Response.ContentType = "text/plain";
  18. string action = context.Request.QueryString["action"];
  19. switch (action)
  20. {
  21. case "getlist":
  22. context.Response.Write(GetDataListHtml(context));//读取数据
  23. break;
  24. }
  25. }
  26. public string GetDataListHtml(HttpContext context)
  27. {
  28. StringBuilder htmlReport = new StringBuilder();//存储生成的HTML
  29. htmlReport.Append("<table cellspacing='0' cellpadding='0' border='1' width='100%'><tr height='35'>");
  30. 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>");
  31. 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>");
  32. 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>");
  33. 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>");
  34. 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>");
  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>");
  36. 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>");
  37. 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>");
  38. //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>");
  39. //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>");
  40. 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>");
  41. 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>");
  42. 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>");
  43. 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>");
  44. 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>");
  45. 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>");
  46. htmlReport.Append("</tr>");
  47. try
  48. {
  49. string txtStartTime = context.Request.QueryString["txtStartTime"];
  50. string txtEndTime = context.Request.QueryString["txtEndTime"];
  51. string sqltimeHistory = "";
  52. if (txtStartTime != null && txtStartTime.Trim() != "")
  53. {
  54. sqltimeHistory += " and CONVERT(varchar , F_OPTDATE, 120)>=CONVERT(varchar , '" + txtStartTime.Trim() + " 00:00:01', 120) ";
  55. }
  56. if (txtEndTime != null && txtEndTime.Trim() != "")
  57. {
  58. sqltimeHistory += " and CONVERT(varchar , F_OPTDATE, 120)<=CONVERT(varchar , '" + txtEndTime.Trim() + " 23:59:59', 120) ";
  59. }
  60. string sqltimeTask = "";
  61. if (txtStartTime != null && txtStartTime.Trim() != "")
  62. {
  63. sqltimeTask += " and CONVERT(varchar , F_CREATEDATE, 120)>=CONVERT(varchar , '" + txtStartTime.Trim() + " 00:00:01', 120) ";
  64. }
  65. if (txtEndTime != null && txtEndTime.Trim() != "")
  66. {
  67. sqltimeTask += " and CONVERT(varchar , F_CREATEDATE, 120)<=CONVERT(varchar , '" + txtEndTime.Trim() + " 23:59:59', 120) ";
  68. }
  69. double zong1 = 0;
  70. double zong2 = 0;
  71. double zong3 = 0;
  72. double zong4 = 0;
  73. double zong5 = 0;
  74. double zong6 = 0;
  75. double zong7 = 0;
  76. double zong8 = 0;
  77. double zongfen = 0;
  78. int zongfencount = 0;
  79. double zongtime = 0;
  80. int zongtimecount = 0;
  81. int count = 0;
  82. int gerenfenshu = 0;
  83. int gerencount = 0;
  84. #region 查询在字典那块设置的时间
  85. string ybgdJDcaoshi = "15552000";
  86. string ybgdCLcaoshi = "15552000";
  87. string jjgdJDcaoshi = "15552000";
  88. string jjgdCLcaoshi = "15552000";
  89. string sqlybgd = "SELECT * from T_Sys_DictionaryValue where F_DictionaryFlag='ybgd' order by F_Sort ";
  90. DataTable dtybgd = DBUtility.DbHelperSQL.Query(sqlybgd).Tables[0];
  91. if (dtybgd.Rows.Count > 1)
  92. {
  93. ybgdJDcaoshi = (Convert.ToInt32(dtybgd.Rows[0]["F_Name"]) * 3600).ToString();
  94. ybgdCLcaoshi = (Convert.ToInt32(dtybgd.Rows[1]["F_Name"]) * 3600).ToString();
  95. }
  96. string sqljjgd = "SELECT * from T_Sys_DictionaryValue where F_DictionaryFlag='jjgd' order by F_Sort ";
  97. DataTable dtjjgd = DBUtility.DbHelperSQL.Query(sqljjgd).Tables[0];
  98. if (dtjjgd.Rows.Count > 1)
  99. {
  100. jjgdJDcaoshi = (Convert.ToInt32(dtybgd.Rows[0]["F_Name"]) * 3600).ToString();
  101. jjgdCLcaoshi = (Convert.ToInt32(dtybgd.Rows[1]["F_Name"]) * 3600).ToString();
  102. }
  103. #endregion
  104. #region 查询在告警超时那块设置的时间
  105. //string JDcaoshi = "15552000";
  106. //string CLcaoshi = "15552000";
  107. //string sqlCLcaoshi = "select * from T_Wo_StateAlarmDate where F_WorkOrderTypeId=16 and F_WorkOrderStateId=7";
  108. //DataTable dtCLcaoshi = DBUtility.DbHelperSQL.Query(sqlCLcaoshi).Tables[0];
  109. //if (dtCLcaoshi.Rows.Count > 0)
  110. //{
  111. // if (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) > 0)
  112. // {
  113. // if (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Cunit"]) == 1)
  114. // {
  115. // CLcaoshi = (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) * 3600).ToString();
  116. // }
  117. // else if (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Cunit"]) == 2)
  118. // {
  119. // CLcaoshi = (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) * 3600 * 24).ToString();
  120. // }
  121. // else
  122. // {
  123. // CLcaoshi = (Convert.ToInt32(dtCLcaoshi.Rows[0]["F_Ccount"]) * 60).ToString();
  124. // }
  125. // }
  126. //}
  127. //string sqlcaoshi = "select * from T_Wo_StateAlarmDate where F_WorkOrderTypeId=16 and F_WorkOrderStateId=6";
  128. //DataTable dtJDcaoshi = DBUtility.DbHelperSQL.Query(sqlcaoshi).Tables[0];
  129. //if (dtJDcaoshi.Rows.Count > 0)
  130. //{
  131. // if (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) > 0)
  132. // {
  133. // if (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Cunit"]) == 1)
  134. // {
  135. // JDcaoshi = (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) * 3600).ToString();
  136. // }
  137. // else if (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Cunit"]) == 2)
  138. // {
  139. // JDcaoshi = (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) * 3600*24).ToString();
  140. // }
  141. // else
  142. // {
  143. // JDcaoshi = (Convert.ToInt32(dtJDcaoshi.Rows[0]["F_Ccount"]) * 60).ToString();
  144. // }
  145. // }
  146. //}
  147. #endregion
  148. DataTable dt = new DataTable();
  149. string 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=T_Sys_UserAccount.F_UserId " + sqltimeTask + ") as counts from T_Sys_UserAccount where F_RoleId=31 order by counts desc ";
  150. dt = DBUtility.DbHelperSQL.Query(sql).Tables[0];
  151. for (int i = 0; i < dt.Rows.Count; i++)
  152. {
  153. 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,";
  154. 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,";
  155. 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,";
  156. 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,";
  157. 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,";
  158. 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 ";
  159. DataTable dt1 = new DataTable();
  160. dt1 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
  161. if (dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "" || dt1.Rows[0]["counts"].ToString() == "0")
  162. {
  163. continue;
  164. }
  165. count = count + 1;
  166. 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 + "";
  167. DataTable dt2 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
  168. string time = "0";
  169. if (dt2.Rows[0]["sum1"].ToString() == "" && dt2.Rows[0]["sum2"].ToString() != "")
  170. {
  171. time = (Convert.ToDouble(dt2.Rows[0]["sum2"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) / 3600).ToString("f2");
  172. zongtime += Convert.ToDouble(dt2.Rows[0]["sum2"]);
  173. zongtimecount += Convert.ToInt32(dt1.Rows[0]["counts"]);
  174. }
  175. else if (dt2.Rows[0]["sum1"].ToString() != "" && dt2.Rows[0]["sum2"].ToString() == "")
  176. {
  177. time = (Convert.ToDouble(dt2.Rows[0]["sum1"]) / Convert.ToDouble(dt1.Rows[0]["counts"]) / 3600).ToString("f2");
  178. zongtime += Convert.ToDouble(dt2.Rows[0]["sum1"]);
  179. zongtimecount += Convert.ToInt32(dt1.Rows[0]["counts"]);
  180. }
  181. else
  182. if (dt2.Rows[0]["sum1"].ToString() != "" && dt2.Rows[0]["sum2"].ToString() != "")
  183. {
  184. time = ((Convert.ToDouble(dt2.Rows[0]["sum1"]) + Convert.ToDouble(dt2.Rows[0]["sum2"])) / Convert.ToDouble(dt1.Rows[0]["counts"]) / 3600).ToString("f2");
  185. zongtime += Convert.ToDouble(dt2.Rows[0]["sum1"]) + Convert.ToDouble(dt2.Rows[0]["sum2"]);
  186. zongtimecount += Convert.ToInt32(dt1.Rows[0]["counts"]);
  187. }
  188. 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 + "";
  189. DataTable dt3 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
  190. 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 + "";
  191. DataTable dt4 = DBUtility.DbHelperSQL.Query(sql).Tables[0];
  192. string fenshu = "0";
  193. if (dt4.Rows[0]["sums"].ToString() != "")
  194. {
  195. fenshu = (Convert.ToInt32(dt4.Rows[0]["sums"]) / Convert.ToInt32(dt3.Rows[0]["counts"])).ToString();
  196. zongfen += Convert.ToDouble(dt4.Rows[0]["sums"]);
  197. zongfencount += Convert.ToInt32(dt3.Rows[0]["counts"]);
  198. gerenfenshu = Convert.ToInt32(dt4.Rows[0]["sums"]);
  199. gerencount = Convert.ToInt32(dt3.Rows[0]["counts"]);
  200. }
  201. else
  202. {
  203. gerenfenshu = 0;
  204. gerencount = 0;
  205. }
  206. 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());
  207. 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());
  208. zong1 += Convert.ToInt32(dt1.Rows[0]["counts"]);
  209. 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());
  210. zong2 += Convert.ToInt32(dt1.Rows[0]["ybgdjiedan"]);
  211. 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());
  212. zong7 += Convert.ToInt32(dt1.Rows[0]["jjgdjiedan"]);
  213. if (dt1.Rows[0]["ybgdjiedan"] == null || dt1.Rows[0]["jjgdjiedan"] == null|| dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
  214. {
  215. 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>");
  216. }
  217. else
  218. {
  219. 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") + "%");
  220. }
  221. 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() + "&nbsp");
  222. zong3 += Convert.ToInt32(dt1.Rows[0]["ybgdchuli"]);
  223. 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() + "&nbsp");
  224. zong8 += Convert.ToInt32(dt1.Rows[0]["jjgdchuli"]);
  225. if (dt1.Rows[0]["ybgdchuli"] == null || dt1.Rows[0]["jjgdchuli"] == null || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
  226. {
  227. 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>");
  228. }
  229. else
  230. {
  231. 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") + "%");
  232. }
  233. //紧急请求开始
  234. //if (dt1.Rows[0]["jjgdjiedan"] == null || dt1.Rows[0]["jjgdjiedan"].ToString() == "0" || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
  235. //{
  236. // 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>");
  237. //}
  238. //else
  239. //{
  240. // 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") + "%");
  241. //}
  242. //if (dt1.Rows[0]["jjgdchuli"] == null || dt1.Rows[0]["jjgdchuli"].ToString() == "0" || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
  243. //{
  244. // 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>");
  245. //}
  246. //else
  247. //{
  248. // 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") + "%");
  249. //}
  250. //紧急请求结束
  251. 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());
  252. zong4 += Convert.ToInt32(dt1.Rows[0]["jiejue"]);
  253. if (dt1.Rows[0]["jiejue"] == null || dt1.Rows[0]["jiejue"].ToString() == "0" || dt1.Rows[0]["counts"] == null || dt1.Rows[0]["counts"].ToString() == "0")
  254. {
  255. 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>");
  256. }
  257. else
  258. {
  259. 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") + "%");
  260. }
  261. 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);
  262. zong5 += Convert.ToDouble(time);
  263. 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);
  264. 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);
  265. 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);
  266. zong6 += Convert.ToInt32(fenshu);
  267. htmlReport.Append("</tr>");
  268. }
  269. htmlReport.Append("<tr height='35'>");
  270. 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>", "总计");
  271. 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);
  272. 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);
  273. 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);
  274. 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") + "%");
  275. 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);
  276. 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);
  277. 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") + "%");
  278. //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") + "%");
  279. //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") + "%");
  280. 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);
  281. 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") + "%");
  282. if (zongtimecount == 0)
  283. {
  284. 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>");
  285. }
  286. else
  287. {
  288. 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"));
  289. }
  290. 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);
  291. 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);
  292. if (zongfencount == 0)
  293. {
  294. 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>");
  295. }
  296. else
  297. {
  298. 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"));
  299. }
  300. htmlReport.Append("</tr>");
  301. htmlReport.Append("</table>");
  302. }
  303. catch { }
  304. return htmlReport.ToString();
  305. }
  306. public bool IsReusable
  307. {
  308. get
  309. {
  310. return false;
  311. }
  312. }
  313. }
  314. }