Нет описания

CallInController.cs 67KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870
  1. using CallCenterApi.Interface.Controllers.Base;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. namespace CallCenterApi.Interface.Controllers.report
  10. {
  11. //[Authority]
  12. public class CallInController : BaseController
  13. {
  14. //来电数据分析
  15. //获取数据
  16. public ActionResult GetDataList(string stime,string endtime)
  17. {
  18. ActionResult res = NoToken("未知错误,请重新登录");
  19. DataTable dt = new DataTable();
  20. DataTable dtlist = new DataTable();
  21. Hashtable tab = new Hashtable();
  22. string sql = "";
  23. #region 查询数据
  24. //来电记录
  25. if (stime != null && stime.Trim() != "")
  26. {
  27. sql += " and BeginTime>='" + stime + " 00:00:00' ";
  28. }
  29. if (endtime != null && endtime.Trim() != "")
  30. {
  31. sql += " and BeginTime<='" + endtime + " 23:59:59' ";
  32. }
  33. #region 获取数据
  34. dtlist = new BLL.T_Call_CallRecords().GetList(" CallType=0 " + sql).Tables[0];
  35. #region 参数
  36. //总计
  37. int all_all_all_count = 0;
  38. int all_sq_all_count = 0;
  39. int all_sh_all_count = 0;
  40. int all_ts_all_count = 0;
  41. int all_qt_all_count = 0;
  42. //工作时间内小计
  43. int work_all_all_count = 0;
  44. int work_sq_all_count = 0;
  45. int work_sh_all_count = 0;
  46. int work_ts_all_count = 0;
  47. int work_qt_all_count = 0;
  48. //工作时间内小计-已接来电
  49. int work_jt_all_count = 0;
  50. int work_jt_sq_count = 0;
  51. int work_jt_sh_count = 0;
  52. int work_jt_ts_count = 0;
  53. int work_jt_qt_count = 0;
  54. #region 工作内未接
  55. int work_wjt_all_count1 = 0;
  56. int work_wjt_all_count2 = 0;
  57. int work_wjt_all_count3 = 0;
  58. int work_wjt_all_count4 = 0;
  59. int work_wjt_sq_count1 = 0;
  60. int work_wjt_sq_count2 = 0;
  61. int work_wjt_sq_count3 = 0;
  62. int work_wjt_sq_count4 = 0;
  63. int work_wjt_sh_count1 = 0;
  64. int work_wjt_sh_count2 = 0;
  65. int work_wjt_sh_count3 = 0;
  66. int work_wjt_sh_count4 = 0;
  67. int work_wjt_ts_count1 = 0;
  68. int work_wjt_ts_count2 = 0;
  69. int work_wjt_ts_count3 = 0;
  70. int work_wjt_ts_count4 = 0;
  71. int work_wjt_qt_count1 = 0;
  72. int work_wjt_qt_count2 = 0;
  73. int work_wjt_qt_count3 = 0;
  74. int work_wjt_qt_count4 = 0;
  75. #endregion
  76. #region 非工作时间接通参数
  77. int unwork1_jt_all_count = 0;
  78. int unwork1_jt_sq_count = 0;
  79. int unwork1_jt_sh_count = 0;
  80. int unwork1_jt_ts_count = 0;
  81. int unwork1_jt_qt_count = 0;
  82. int unwork2_jt_all_count = 0;
  83. int unwork2_jt_sq_count = 0;
  84. int unwork2_jt_sh_count = 0;
  85. int unwork2_jt_ts_count = 0;
  86. int unwork2_jt_qt_count = 0;
  87. int unwork3_jt_all_count = 0;
  88. int unwork3_jt_sq_count = 0;
  89. int unwork3_jt_sh_count = 0;
  90. int unwork3_jt_ts_count = 0;
  91. int unwork3_jt_qt_count = 0;
  92. #endregion
  93. #region 非工作内上班前2小时未接
  94. int unwork1_wjt_all_count1 = 0;
  95. int unwork1_wjt_all_count2 = 0;
  96. int unwork1_wjt_all_count3 = 0;
  97. int unwork1_wjt_all_count4 = 0;
  98. int unwork1_wjt_sq_count1 = 0;
  99. int unwork1_wjt_sq_count2 = 0;
  100. int unwork1_wjt_sq_count3 = 0;
  101. int unwork1_wjt_sq_count4 = 0;
  102. int unwork1_wjt_sh_count1 = 0;
  103. int unwork1_wjt_sh_count2 = 0;
  104. int unwork1_wjt_sh_count3 = 0;
  105. int unwork1_wjt_sh_count4 = 0;
  106. int unwork1_wjt_ts_count1 = 0;
  107. int unwork1_wjt_ts_count2 = 0;
  108. int unwork1_wjt_ts_count3 = 0;
  109. int unwork1_wjt_ts_count4 = 0;
  110. int unwork1_wjt_qt_count1 = 0;
  111. int unwork1_wjt_qt_count2 = 0;
  112. int unwork1_wjt_qt_count3 = 0;
  113. int unwork1_wjt_qt_count4 = 0;
  114. #endregion
  115. #region 非工作内下班后3小时未接
  116. int unwork2_wjt_all_count1 = 0;
  117. int unwork2_wjt_all_count2 = 0;
  118. int unwork2_wjt_all_count3 = 0;
  119. int unwork2_wjt_all_count4 = 0;
  120. int unwork2_wjt_sq_count1 = 0;
  121. int unwork2_wjt_sq_count2 = 0;
  122. int unwork2_wjt_sq_count3 = 0;
  123. int unwork2_wjt_sq_count4 = 0;
  124. int unwork2_wjt_sh_count1 = 0;
  125. int unwork2_wjt_sh_count2 = 0;
  126. int unwork2_wjt_sh_count3 = 0;
  127. int unwork2_wjt_sh_count4 = 0;
  128. int unwork2_wjt_ts_count1 = 0;
  129. int unwork2_wjt_ts_count2 = 0;
  130. int unwork2_wjt_ts_count3 = 0;
  131. int unwork2_wjt_ts_count4 = 0;
  132. int unwork2_wjt_qt_count1 = 0;
  133. int unwork2_wjt_qt_count2 = 0;
  134. int unwork2_wjt_qt_count3 = 0;
  135. int unwork2_wjt_qt_count4 = 0;
  136. #endregion
  137. #region 非工作内其他时间未接
  138. int unwork3_wjt_all_count1 = 0;
  139. int unwork3_wjt_all_count2 = 0;
  140. int unwork3_wjt_all_count3 = 0;
  141. int unwork3_wjt_all_count4 = 0;
  142. int unwork3_wjt_sq_count1 = 0;
  143. int unwork3_wjt_sq_count2 = 0;
  144. int unwork3_wjt_sq_count3 = 0;
  145. int unwork3_wjt_sq_count4 = 0;
  146. int unwork3_wjt_sh_count1 = 0;
  147. int unwork3_wjt_sh_count2 = 0;
  148. int unwork3_wjt_sh_count3 = 0;
  149. int unwork3_wjt_sh_count4 = 0;
  150. int unwork3_wjt_ts_count1 = 0;
  151. int unwork3_wjt_ts_count2 = 0;
  152. int unwork3_wjt_ts_count3 = 0;
  153. int unwork3_wjt_ts_count4 = 0;
  154. int unwork3_wjt_qt_count1 = 0;
  155. int unwork3_wjt_qt_count2 = 0;
  156. int unwork3_wjt_qt_count3 = 0;
  157. int unwork3_wjt_qt_count4 = 0;
  158. #endregion
  159. //非工作时间内小计
  160. int unwork_all_all_count = 0;
  161. int unwork_sq_all_count = 0;
  162. int unwork_sh_all_count = 0;
  163. int unwork_ts_all_count = 0;
  164. int unwork_qt_all_count = 0;
  165. #endregion
  166. if (dtlist != null)
  167. {
  168. #region 总计
  169. all_all_all_count = dtlist.Rows.Count;
  170. all_sq_all_count = dtlist.Select("BusinessType=1").Length;
  171. all_sh_all_count = dtlist.Select("BusinessType=2").Length;
  172. all_ts_all_count = dtlist.Select("BusinessType=3 or BusinessType=31 or BusinessType=32 ").Length;
  173. all_qt_all_count = all_all_all_count - all_sh_all_count - all_sq_all_count - all_ts_all_count;
  174. tab.Add("all_all_all_count", all_all_all_count.ToString());//总合计
  175. tab.Add("all_sq_all_count", all_sq_all_count.ToString());//总售前合计
  176. tab.Add("all_sh_all_count", all_sh_all_count.ToString());//总售后合计
  177. tab.Add("all_ts_all_count", all_ts_all_count.ToString());//总投诉合计
  178. tab.Add("all_qt_all_count", all_qt_all_count.ToString());//总其他合计
  179. #endregion
  180. #region 工作时间来电
  181. #region 工作时间来电小计
  182. //查询工作时间
  183. work_all_all_count = dtlist.Select("WorkTimesDiff=0").Length;
  184. work_sq_all_count = dtlist.Select("WorkTimesDiff=0 and BusinessType=1").Length;
  185. work_sh_all_count = dtlist.Select("WorkTimesDiff=0 and BusinessType=2").Length;
  186. work_ts_all_count = dtlist.Select("WorkTimesDiff=0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  187. work_qt_all_count = work_all_all_count - work_sq_all_count - work_sh_all_count - work_ts_all_count;
  188. tab.Add("work_all_all_count", work_all_all_count.ToString());//小计
  189. tab.Add("work_sq_all_count", work_sq_all_count.ToString());//售前小计
  190. tab.Add("work_sh_all_count", work_sh_all_count.ToString());//售后小计
  191. tab.Add("work_ts_all_count", work_ts_all_count.ToString());//投诉小计
  192. tab.Add("work_qt_all_count", work_qt_all_count.ToString());//其他小计
  193. #endregion
  194. #region 工作时间来电-已接来电
  195. work_jt_all_count = dtlist.Select("CallState=1 and WorkTimesDiff=0").Length;
  196. work_jt_sq_count = dtlist.Select("CallState=1 and WorkTimesDiff=0 and BusinessType=1").Length;
  197. work_jt_sh_count = dtlist.Select("CallState=1 and WorkTimesDiff=0 and BusinessType=2").Length;
  198. work_jt_ts_count = dtlist.Select("CallState=1 and WorkTimesDiff=0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  199. work_jt_qt_count = work_jt_all_count - work_jt_sq_count - work_jt_sh_count - work_jt_ts_count;
  200. tab.Add("work_jt_all_count", work_jt_all_count.ToString());//接通合计
  201. tab.Add("work_jt_sq_count", work_jt_sq_count.ToString());//售前接通合计
  202. tab.Add("work_jt_sh_count", work_jt_sh_count.ToString());//售后接通合计
  203. tab.Add("work_jt_ts_count", work_jt_ts_count.ToString());//投诉接通合计
  204. tab.Add("work_jt_qt_count", work_jt_qt_count.ToString());//其他接通合计
  205. #endregion
  206. #region 工作时间来电-未接来电
  207. work_wjt_all_count1 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=1 ").Length;
  208. work_wjt_sq_count1 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=1 and BusinessType=1").Length;
  209. work_wjt_sh_count1 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=1 and BusinessType=2").Length;
  210. work_wjt_ts_count1 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=1 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  211. work_wjt_qt_count1 = work_wjt_all_count1 - work_wjt_sq_count1 - work_wjt_sh_count1 - work_wjt_ts_count1;
  212. tab.Add("work_wjt_all_count1", work_wjt_all_count1.ToString());//坐席未登录
  213. tab.Add("work_wjt_sq_count1", work_wjt_sq_count1.ToString());//售前坐席未登录
  214. tab.Add("work_wjt_sh_count1", work_wjt_sh_count1.ToString());//售后坐席未登录
  215. tab.Add("work_wjt_ts_count1", work_wjt_ts_count1.ToString());//投诉坐席未登录
  216. tab.Add("work_wjt_qt_count1", work_wjt_qt_count1.ToString());//其他坐席未登录
  217. work_wjt_all_count2 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=2 ").Length;
  218. work_wjt_sq_count2 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=2 and BusinessType=1").Length;
  219. work_wjt_sh_count2 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=2 and BusinessType=2").Length;
  220. work_wjt_ts_count2 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=2 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  221. work_wjt_qt_count2 = work_wjt_all_count2 - work_wjt_sq_count2 - work_wjt_sh_count2 - work_wjt_ts_count2;
  222. tab.Add("work_wjt_all_count2", work_wjt_all_count2.ToString());//坐席忙
  223. tab.Add("work_wjt_sq_count2", work_wjt_sq_count2.ToString());//售前坐席忙
  224. tab.Add("work_wjt_sh_count2", work_wjt_sh_count2.ToString());//售后坐席忙
  225. tab.Add("work_wjt_ts_count2", work_wjt_ts_count2.ToString());//投诉坐席忙
  226. tab.Add("work_wjt_qt_count2", work_wjt_qt_count2.ToString());//其他坐席忙
  227. work_wjt_all_count3 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=3 ").Length;
  228. work_wjt_sq_count3 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=3 and BusinessType=1").Length;
  229. work_wjt_sh_count3 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=3 and BusinessType=2").Length;
  230. work_wjt_ts_count3 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=3 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  231. work_wjt_qt_count3 = work_wjt_all_count3 - work_wjt_sq_count3 - work_wjt_sh_count3 - work_wjt_ts_count3;
  232. tab.Add("work_wjt_all_count3", work_wjt_all_count3.ToString());//振铃
  233. tab.Add("work_wjt_sq_count3", work_wjt_sq_count3.ToString());//售前振铃
  234. tab.Add("work_wjt_sh_count3", work_wjt_sh_count3.ToString());//售后振铃
  235. tab.Add("work_wjt_ts_count3", work_wjt_ts_count3.ToString());//投诉振铃
  236. tab.Add("work_wjt_qt_count3", work_wjt_qt_count3.ToString());//其他振铃
  237. work_wjt_all_count4 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=0 ").Length;
  238. work_wjt_sq_count4 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=0 and BusinessType=1").Length;
  239. work_wjt_sh_count4 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=0 and BusinessType=2").Length;
  240. work_wjt_ts_count4 = dtlist.Select("CallState=0 and WorkTimesDiff=0 and NoCallState=0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  241. work_wjt_qt_count4 = work_wjt_all_count4 - work_wjt_sq_count4 - work_wjt_sh_count4 - work_wjt_ts_count4;
  242. tab.Add("work_wjt_all_count4", work_wjt_all_count4.ToString());//其他
  243. tab.Add("work_wjt_sq_count4", work_wjt_sq_count4.ToString());//售前其他
  244. tab.Add("work_wjt_sh_count4", work_wjt_sh_count4.ToString());//售后其他
  245. tab.Add("work_wjt_ts_count4", work_wjt_ts_count4.ToString());//投诉其他
  246. tab.Add("work_wjt_qt_count4", work_wjt_qt_count4.ToString());//其他其他
  247. #endregion
  248. #region 工作时间来电占比
  249. #region 工作时间来电合计占比
  250. if (work_all_all_count != 0)
  251. {
  252. tab.Add("work_jt_all_zb", (Convert.ToDecimal(work_jt_all_count) * 100 / Convert.ToDecimal(work_all_all_count)).ToString("f") + "%");//接通合计占比
  253. tab.Add("work_wjt_all_zb1", (Convert.ToDecimal(work_wjt_all_count1) * 100 / Convert.ToDecimal(work_all_all_count)).ToString("f") + "%");//坐席未登录合计占比
  254. tab.Add("work_wjt_all_zb2", (Convert.ToDecimal(work_wjt_all_count2) * 100 / Convert.ToDecimal(work_all_all_count)).ToString("f") + "%");//坐席忙合计占比
  255. tab.Add("work_wjt_all_zb3", (Convert.ToDecimal(work_wjt_all_count3) * 100 / Convert.ToDecimal(work_all_all_count)).ToString("f") + "%");//振铃合计占比
  256. tab.Add("work_wjt_all_zb4", (Convert.ToDecimal(work_wjt_all_count4) * 100 / Convert.ToDecimal(work_all_all_count)).ToString("f") + "%");//其他合计占比
  257. }
  258. else
  259. {
  260. tab.Add("work_jt_all_zb", "-");//接通合计占比
  261. tab.Add("work_wjt_all_zb1", "-");//坐席未登录合计占比
  262. tab.Add("work_wjt_all_zb2", "-");//坐席忙合计占比
  263. tab.Add("work_wjt_all_zb3", "-");//振铃合计占比
  264. tab.Add("work_wjt_all_zb4", "-");//其他合计占比
  265. }
  266. #endregion
  267. #region 来电售前占比
  268. if (work_sq_all_count != 0)
  269. {
  270. tab.Add("work_jt_sq_zb", (Convert.ToDecimal(work_jt_sq_count) * 100 / Convert.ToDecimal(work_sq_all_count)).ToString("f") + "%");//接通售前占比
  271. tab.Add("work_wjt_sq_zb1", (Convert.ToDecimal(work_wjt_sq_count1) * 100 / Convert.ToDecimal(work_sq_all_count)).ToString("f") + "%");//坐席未登录售前占比
  272. tab.Add("work_wjt_sq_zb2", (Convert.ToDecimal(work_wjt_sq_count2) * 100 / Convert.ToDecimal(work_sq_all_count)).ToString("f") + "%");//坐席忙售前占比
  273. tab.Add("work_wjt_sq_zb3", (Convert.ToDecimal(work_wjt_sq_count3) * 100 / Convert.ToDecimal(work_sq_all_count)).ToString("f") + "%");//振铃售前占比
  274. tab.Add("work_wjt_sq_zb4", (Convert.ToDecimal(work_wjt_sq_count4) * 100 / Convert.ToDecimal(work_sq_all_count)).ToString("f") + "%");//其他售前占比
  275. }
  276. else
  277. {
  278. tab.Add("work_jt_sq_zb", "-");//接通售前占比
  279. tab.Add("work_wjt_sq_zb1", "-");//坐席未登录售前占比
  280. tab.Add("work_wjt_sq_zb2", "-");//坐席忙售前占比
  281. tab.Add("work_wjt_sq_zb3", "-");//振铃售前占比
  282. tab.Add("work_wjt_sq_zb4", "-");//其他售前占比
  283. }
  284. #endregion
  285. #region 来电售后占比
  286. if (work_sh_all_count != 0)
  287. {
  288. tab.Add("work_jt_sh_zb", (Convert.ToDecimal(work_jt_sh_count) * 100 / Convert.ToDecimal(work_sh_all_count)).ToString("f") + "%");//接通售后占比
  289. tab.Add("work_wjt_sh_zb1", (Convert.ToDecimal(work_wjt_sh_count1) * 100 / Convert.ToDecimal(work_sh_all_count)).ToString("f") + "%");//坐席未登录售后占比
  290. tab.Add("work_wjt_sh_zb2", (Convert.ToDecimal(work_wjt_sh_count2) * 100 / Convert.ToDecimal(work_sh_all_count)).ToString("f") + "%");//坐席忙售后占比
  291. tab.Add("work_wjt_sh_zb3", (Convert.ToDecimal(work_wjt_sh_count3) * 100 / Convert.ToDecimal(work_sh_all_count)).ToString("f") + "%");//振铃售后占比
  292. tab.Add("work_wjt_sh_zb4", (Convert.ToDecimal(work_wjt_sh_count4) * 100 / Convert.ToDecimal(work_sh_all_count)).ToString("f") + "%");//其他售后占比
  293. }
  294. else
  295. {
  296. tab.Add("work_jt_sh_zb", "-");//接通售后占比
  297. tab.Add("work_wjt_sh_zb1", "-");//坐席未登录售后占比
  298. tab.Add("work_wjt_sh_zb2", "-");//坐席忙售后占比
  299. tab.Add("work_wjt_sh_zb3", "-");//振铃售后占比
  300. tab.Add("work_wjt_sh_zb4", "-");//其他售后占比
  301. }
  302. #endregion
  303. #region 来电投诉占比
  304. if (work_ts_all_count != 0)
  305. {
  306. tab.Add("work_jt_ts_zb", (Convert.ToDecimal(work_jt_ts_count) * 100 / Convert.ToDecimal(work_ts_all_count)).ToString("f") + "%");//接通投诉占比
  307. tab.Add("work_wjt_ts_zb1", (Convert.ToDecimal(work_wjt_ts_count1) * 100 / Convert.ToDecimal(work_ts_all_count)).ToString("f") + "%");//坐席未登录投诉占比
  308. tab.Add("work_wjt_ts_zb2", (Convert.ToDecimal(work_wjt_ts_count2) * 100 / Convert.ToDecimal(work_ts_all_count)).ToString("f") + "%");//坐席忙投诉占比
  309. tab.Add("work_wjt_ts_zb3", (Convert.ToDecimal(work_wjt_ts_count3) * 100 / Convert.ToDecimal(work_ts_all_count)).ToString("f") + "%");//振铃投诉占比
  310. tab.Add("work_wjt_ts_zb4", (Convert.ToDecimal(work_wjt_ts_count4) * 100 / Convert.ToDecimal(work_ts_all_count)).ToString("f") + "%");//其他投诉占比
  311. }
  312. else
  313. {
  314. tab.Add("work_jt_sh_zb", "-");//接通投诉占比
  315. tab.Add("work_wjt_sh_zb1", "-");//坐席未登录投诉占比
  316. tab.Add("work_wjt_sh_zb2", "-");//坐席忙投诉占比
  317. tab.Add("work_wjt_sh_zb3", "-");//振铃投诉占比
  318. tab.Add("work_wjt_sh_zb4", "-");//其他投诉占比
  319. }
  320. #endregion
  321. #region 来电其他占比
  322. if (work_qt_all_count != 0)
  323. {
  324. tab.Add("work_jt_qt_zb", (Convert.ToDecimal(work_jt_qt_count) * 100 / Convert.ToDecimal(work_qt_all_count)).ToString("f") + "%");//接通其他占比
  325. tab.Add("work_wjt_qt_zb1", (Convert.ToDecimal(work_wjt_qt_count1) * 100 / Convert.ToDecimal(work_qt_all_count)).ToString("f") + "%");//坐席未登录其他占比
  326. tab.Add("work_wjt_qt_zb2", (Convert.ToDecimal(work_wjt_qt_count2) * 100 / Convert.ToDecimal(work_qt_all_count)).ToString("f") + "%");//坐席忙其他占比
  327. tab.Add("work_wjt_qt_zb3", (Convert.ToDecimal(work_wjt_qt_count3) * 100 / Convert.ToDecimal(work_qt_all_count)).ToString("f") + "%");//振铃其他占比
  328. tab.Add("work_wjt_qt_zb4", (Convert.ToDecimal(work_wjt_qt_count4) * 100 / Convert.ToDecimal(work_qt_all_count)).ToString("f") + "%");//其他其他占比
  329. }
  330. else
  331. {
  332. tab.Add("work_jt_qt_zb", "-");//接通其他占比
  333. tab.Add("work_wjt_qt_zb1", "-");//坐席未登录其他占比
  334. tab.Add("work_wjt_qt_zb2", "-");//坐席忙其他占比
  335. tab.Add("work_wjt_qt_zb3", "-");//振铃其他占比
  336. tab.Add("work_wjt_qt_zb4", "-");//其他其他占比
  337. }
  338. #endregion
  339. #endregion
  340. #endregion
  341. #region 非工作时间来电
  342. #region 非工作时间来电小计
  343. //查询非工作时间
  344. unwork_all_all_count = dtlist.Select("WorkTimesDiff<>0").Length;
  345. unwork_sq_all_count = dtlist.Select("WorkTimesDiff<>0 and BusinessType=1").Length;
  346. unwork_sh_all_count = dtlist.Select("WorkTimesDiff<>0 and BusinessType=2").Length;
  347. unwork_ts_all_count = dtlist.Select("WorkTimesDiff<>0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  348. unwork_qt_all_count = unwork_all_all_count - unwork_sq_all_count - unwork_sh_all_count - unwork_ts_all_count;
  349. tab.Add("unwork_all_all_count", unwork_all_all_count.ToString());//小计
  350. tab.Add("unwork_sq_all_count", unwork_sq_all_count.ToString());//售前小计
  351. tab.Add("unwork_sh_all_count", unwork_sh_all_count.ToString());//售后小计
  352. tab.Add("unwork_ts_all_count", unwork_ts_all_count.ToString());//投诉小计
  353. tab.Add("unwork_qt_all_count", unwork_qt_all_count.ToString());//其他小计
  354. #endregion
  355. #region 非工作时间来电-已接来电
  356. #region 上班前2小时
  357. int pretime = -7200; //2小时7200秒
  358. unwork1_jt_all_count = dtlist.Select("CallState=1 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + "").Length;
  359. unwork1_jt_sq_count = dtlist.Select("CallState=1 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and BusinessType=1").Length;
  360. unwork1_jt_sh_count = dtlist.Select("CallState=1 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and BusinessType=2").Length;
  361. unwork1_jt_ts_count = dtlist.Select("CallState=1 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  362. unwork1_jt_qt_count = unwork1_jt_all_count - unwork1_jt_sq_count - unwork1_jt_sh_count - unwork1_jt_ts_count;
  363. tab.Add("unwork1_jt_all_count", unwork1_jt_all_count.ToString());//接通合计
  364. tab.Add("unwork1_jt_sq_count", unwork1_jt_sq_count.ToString());//售前接通合计
  365. tab.Add("unwork1_jt_sh_count", unwork1_jt_sh_count.ToString());//售后接通合计
  366. tab.Add("unwork1_jt_ts_count", unwork1_jt_ts_count.ToString());//投诉接通合计
  367. tab.Add("unwork1_jt_qt_count", unwork1_jt_qt_count.ToString());//其他接通合计
  368. #endregion
  369. #region 下班后3小时
  370. int nexttime = 10800; //3小时10800秒
  371. unwork2_jt_all_count = dtlist.Select("CallState=1 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + "").Length;
  372. unwork2_jt_sq_count = dtlist.Select("CallState=1 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and BusinessType=1").Length;
  373. unwork2_jt_sh_count = dtlist.Select("CallState=1 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and BusinessType=2").Length;
  374. unwork2_jt_ts_count = dtlist.Select("CallState=1 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  375. unwork2_jt_qt_count = unwork2_jt_all_count - unwork2_jt_sq_count - unwork2_jt_sh_count - unwork2_jt_ts_count;
  376. tab.Add("unwork2_jt_all_count", unwork2_jt_all_count.ToString());//接通合计
  377. tab.Add("unwork2_jt_sq_count", unwork2_jt_sq_count.ToString());//售前接通合计
  378. tab.Add("unwork2_jt_sh_count", unwork2_jt_sh_count.ToString());//售后接通合计
  379. tab.Add("unwork2_jt_ts_count", unwork2_jt_ts_count.ToString());//投诉接通合计
  380. tab.Add("unwork2_jt_qt_count", unwork2_jt_qt_count.ToString());//其他接通合计
  381. #endregion
  382. #region 其他非工作时间
  383. unwork3_jt_all_count = dtlist.Select("CallState=1 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ")").Length;
  384. unwork3_jt_sq_count = dtlist.Select("CallState=1 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and BusinessType=1").Length;
  385. unwork3_jt_sh_count = dtlist.Select("CallState=1 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and BusinessType=2").Length;
  386. unwork3_jt_ts_count = dtlist.Select("CallState=1 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  387. unwork3_jt_qt_count = unwork3_jt_all_count - unwork3_jt_sq_count - unwork3_jt_sh_count - unwork3_jt_ts_count;
  388. tab.Add("unwork3_jt_all_count", unwork3_jt_all_count.ToString());//其他合计
  389. tab.Add("unwork3_jt_sq_count", unwork3_jt_sq_count.ToString());//售前其他合计
  390. tab.Add("unwork3_jt_sh_count", unwork3_jt_sh_count.ToString());//售后其他合计
  391. tab.Add("unwork3_jt_ts_count", unwork3_jt_ts_count.ToString());//投诉其他合计
  392. tab.Add("unwork3_jt_qt_count", unwork3_jt_qt_count.ToString());//其他其他合计
  393. #endregion
  394. #endregion
  395. #region 非工作时间来电-未接来电
  396. #region 上班前2小时
  397. unwork1_wjt_all_count1 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=1 ").Length;
  398. unwork1_wjt_sq_count1 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=1 and BusinessType=1").Length;
  399. unwork1_wjt_sh_count1 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=1 and BusinessType=2").Length;
  400. unwork1_wjt_ts_count1 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=1 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  401. unwork1_wjt_qt_count1 = unwork1_wjt_all_count1 - unwork1_wjt_sq_count1 - unwork1_wjt_sh_count1 - unwork1_wjt_ts_count1;
  402. tab.Add("unwork1_wjt_all_count1", unwork1_wjt_all_count1.ToString());//坐席未登录
  403. tab.Add("unwork1_wjt_sq_count1", unwork1_wjt_sq_count1.ToString());//售前坐席未登录
  404. tab.Add("unwork1_wjt_sh_count1", unwork1_wjt_sh_count1.ToString());//售后坐席未登录
  405. tab.Add("unwork1_wjt_ts_count1", unwork1_wjt_ts_count1.ToString());//投诉坐席未登录
  406. tab.Add("unwork1_wjt_qt_count1", unwork1_wjt_qt_count1.ToString());//其他坐席未登录
  407. unwork1_wjt_all_count2 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=2 ").Length;
  408. unwork1_wjt_sq_count2 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=2 and BusinessType=1").Length;
  409. unwork1_wjt_sh_count2 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=2 and BusinessType=2").Length;
  410. unwork1_wjt_ts_count2 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=2 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  411. unwork1_wjt_qt_count2 = unwork1_wjt_all_count2 - unwork1_wjt_sq_count2 - unwork1_wjt_sh_count2 - unwork1_wjt_ts_count2;
  412. tab.Add("unwork1_wjt_all_count2", unwork1_wjt_all_count2.ToString());//坐席忙
  413. tab.Add("unwork1_wjt_sq_count2", unwork1_wjt_sq_count2.ToString());//售前坐席忙
  414. tab.Add("unwork1_wjt_sh_count2", unwork1_wjt_sh_count2.ToString());//售后坐席忙
  415. tab.Add("unwork1_wjt_ts_count2", unwork1_wjt_ts_count2.ToString());//投诉坐席忙
  416. tab.Add("unwork1_wjt_qt_count2", unwork1_wjt_qt_count2.ToString());//其他坐席忙
  417. unwork1_wjt_all_count3 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=3 ").Length;
  418. unwork1_wjt_sq_count3 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=3 and BusinessType=1").Length;
  419. unwork1_wjt_sh_count3 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=3 and BusinessType=2").Length;
  420. unwork1_wjt_ts_count3 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=3 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  421. unwork1_wjt_qt_count3 = unwork1_wjt_all_count3 - unwork1_wjt_sq_count3 - unwork1_wjt_sh_count3 - unwork1_wjt_ts_count3;
  422. tab.Add("unwork1_wjt_all_count3", unwork1_wjt_all_count3.ToString());//振铃
  423. tab.Add("unwork1_wjt_sq_count3", unwork1_wjt_sq_count3.ToString());//售前振铃
  424. tab.Add("unwork1_wjt_sh_count3", unwork1_wjt_sh_count3.ToString());//售后振铃
  425. tab.Add("unwork1_wjt_ts_count3", unwork1_wjt_ts_count3.ToString());//投诉振铃
  426. tab.Add("unwork1_wjt_qt_count3", unwork1_wjt_qt_count3.ToString());//其他振铃
  427. unwork1_wjt_all_count4 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=0 ").Length;
  428. unwork1_wjt_sq_count4 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=0 and BusinessType=1").Length;
  429. unwork1_wjt_sh_count4 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=0 and BusinessType=2").Length;
  430. unwork1_wjt_ts_count4 = dtlist.Select("CallState=0 and WorkTimesDiff<0 and WorkTimesDiff>" + pretime.ToString() + " and NoCallState=0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  431. unwork1_wjt_qt_count4 = unwork1_wjt_all_count4 - unwork1_wjt_sq_count4 - unwork1_wjt_sh_count4 - unwork1_wjt_ts_count4;
  432. tab.Add("unwork1_wjt_all_count4", unwork1_wjt_all_count4.ToString());//其他
  433. tab.Add("unwork1_wjt_sq_count4", unwork1_wjt_sq_count4.ToString());//售前其他
  434. tab.Add("unwork1_wjt_sh_count4", unwork1_wjt_sh_count4.ToString());//售后其他
  435. tab.Add("unwork1_wjt_ts_count4", unwork1_wjt_ts_count4.ToString());//投诉其他
  436. tab.Add("unwork1_wjt_qt_count4", unwork1_wjt_qt_count4.ToString());//其他其他
  437. #endregion
  438. #region 下班后3小时
  439. unwork2_wjt_all_count1 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=1 ").Length;
  440. unwork2_wjt_sq_count1 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=1 and BusinessType=1").Length;
  441. unwork2_wjt_sh_count1 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=1 and BusinessType=2").Length;
  442. unwork2_wjt_ts_count1 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=1 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  443. unwork2_wjt_qt_count1 = unwork2_wjt_all_count1 - unwork2_wjt_sq_count1 - unwork2_wjt_sh_count1 - unwork2_wjt_ts_count1;
  444. tab.Add("unwork2_wjt_all_count1", unwork2_wjt_all_count1.ToString());//坐席未登录
  445. tab.Add("unwork2_wjt_sq_count1", unwork2_wjt_sq_count1.ToString());//售前坐席未登录
  446. tab.Add("unwork2_wjt_sh_count1", unwork2_wjt_sh_count1.ToString());//售后坐席未登录
  447. tab.Add("unwork2_wjt_ts_count1", unwork2_wjt_ts_count1.ToString());//投诉坐席未登录
  448. tab.Add("unwork2_wjt_qt_count1", unwork2_wjt_qt_count1.ToString());//其他坐席未登录
  449. unwork2_wjt_all_count2 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=2 ").Length;
  450. unwork2_wjt_sq_count2 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=2 and BusinessType=1").Length;
  451. unwork2_wjt_sh_count2 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=2 and BusinessType=2").Length;
  452. unwork2_wjt_ts_count2 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=2 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  453. unwork2_wjt_qt_count2 = unwork2_wjt_all_count2 - unwork2_wjt_sq_count2 - unwork2_wjt_sh_count2 - unwork2_wjt_ts_count2;
  454. tab.Add("unwork2_wjt_all_count2", unwork2_wjt_all_count2.ToString());//坐席忙
  455. tab.Add("unwork2_wjt_sq_count2", unwork2_wjt_sq_count2.ToString());//售前坐席忙
  456. tab.Add("unwork2_wjt_sh_count2", unwork2_wjt_sh_count2.ToString());//售后坐席忙
  457. tab.Add("unwork2_wjt_ts_count2", unwork2_wjt_ts_count2.ToString());//投诉坐席忙
  458. tab.Add("unwork2_wjt_qt_count2", unwork2_wjt_qt_count2.ToString());//其他坐席
  459. unwork2_wjt_all_count3 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=3 ").Length;
  460. unwork2_wjt_sq_count3 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=3 and BusinessType=1").Length;
  461. unwork2_wjt_sh_count3 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=3 and BusinessType=2").Length;
  462. unwork2_wjt_ts_count3 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=3 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  463. unwork2_wjt_qt_count3 = unwork2_wjt_all_count3 - unwork2_wjt_sq_count3 - unwork2_wjt_sh_count3 - unwork2_wjt_ts_count3;
  464. tab.Add("unwork2_wjt_all_count3", unwork2_wjt_all_count3.ToString());//振铃
  465. tab.Add("unwork2_wjt_sq_count3", unwork2_wjt_sq_count3.ToString());//售前振铃
  466. tab.Add("unwork2_wjt_sh_count3", unwork2_wjt_sh_count3.ToString());//售后振铃
  467. tab.Add("unwork2_wjt_ts_count3", unwork2_wjt_ts_count3.ToString());//投诉振铃
  468. tab.Add("unwork2_wjt_qt_count3", unwork2_wjt_qt_count3.ToString());//其他振铃
  469. unwork2_wjt_all_count4 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=0 ").Length;
  470. unwork2_wjt_sq_count4 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=0 and BusinessType=1").Length;
  471. unwork2_wjt_sh_count4 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=0 and BusinessType=2").Length;
  472. unwork2_wjt_ts_count4 = dtlist.Select("CallState=0 and WorkTimesDiff>0 and WorkTimesDiff<" + nexttime.ToString() + " and NoCallState=0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  473. unwork2_wjt_qt_count4 = unwork2_wjt_all_count4 - unwork2_wjt_sq_count4 - unwork2_wjt_sh_count4 - unwork2_wjt_ts_count4;
  474. tab.Add("unwork2_wjt_all_count4", unwork2_wjt_all_count4.ToString());//其他
  475. tab.Add("unwork2_wjt_sq_count4", unwork2_wjt_sq_count4.ToString());//售前其他
  476. tab.Add("unwork2_wjt_sh_count4", unwork2_wjt_sh_count4.ToString());//售后其他
  477. tab.Add("unwork2_wjt_ts_count4", unwork2_wjt_ts_count4.ToString());//投诉其他
  478. tab.Add("unwork2_wjt_qt_count4", unwork2_wjt_qt_count4.ToString());//其他其他
  479. #endregion
  480. #region 其他非工作时间
  481. unwork3_wjt_all_count1 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=1 ").Length;
  482. unwork3_wjt_sq_count1 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=1 and BusinessType=1").Length;
  483. unwork3_wjt_sh_count1 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=1 and BusinessType=2").Length;
  484. unwork3_wjt_ts_count1 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=1 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  485. unwork3_wjt_qt_count1 = unwork3_wjt_all_count1 - unwork3_wjt_sq_count1 - unwork3_wjt_sh_count1 - unwork3_wjt_ts_count1;
  486. tab.Add("unwork3_wjt_all_count1", unwork3_wjt_all_count1.ToString());//坐席未登录
  487. tab.Add("unwork3_wjt_sq_count1", unwork3_wjt_sq_count1.ToString());//售前坐席未登录
  488. tab.Add("unwork3_wjt_sh_count1", unwork3_wjt_sh_count1.ToString());//售后坐席未登录
  489. tab.Add("unwork3_wjt_ts_count1", unwork3_wjt_ts_count1.ToString());//投诉坐席未登录
  490. tab.Add("unwork3_wjt_qt_count1", unwork3_wjt_qt_count1.ToString());//其他坐席未登录
  491. unwork3_wjt_all_count2 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=2 ").Length;
  492. unwork3_wjt_sq_count2 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=2 and BusinessType=1").Length;
  493. unwork3_wjt_sh_count2 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=2 and BusinessType=2").Length;
  494. unwork3_wjt_ts_count2 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=2 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  495. unwork3_wjt_qt_count2 = unwork3_wjt_all_count2 - unwork3_wjt_sq_count2 - unwork3_wjt_sh_count2 - unwork3_wjt_ts_count2;
  496. tab.Add("unwork3_wjt_all_count2", unwork3_wjt_all_count2.ToString());//坐席忙
  497. tab.Add("unwork3_wjt_sq_count2", unwork3_wjt_sq_count2.ToString());//售前坐席忙
  498. tab.Add("unwork3_wjt_sh_count2", unwork3_wjt_sh_count2.ToString());//售后坐席忙
  499. tab.Add("unwork3_wjt_ts_count2", unwork3_wjt_ts_count2.ToString());//投诉坐席忙
  500. tab.Add("unwork3_wjt_qt_count2", unwork3_wjt_qt_count2.ToString());//其他坐席
  501. unwork3_wjt_all_count3 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=3 ").Length;
  502. unwork3_wjt_sq_count3 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=3 and BusinessType=1").Length;
  503. unwork3_wjt_sh_count3 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=3 and BusinessType=2").Length;
  504. unwork3_wjt_ts_count3 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=3 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  505. unwork3_wjt_qt_count3 = unwork3_wjt_all_count3 - unwork3_wjt_sq_count3 - unwork3_wjt_sh_count3 - unwork3_wjt_ts_count3;
  506. tab.Add("unwork3_wjt_all_count3", unwork3_wjt_all_count3.ToString());//振铃
  507. tab.Add("unwork3_wjt_sq_count3", unwork3_wjt_sq_count3.ToString());//售前振铃
  508. tab.Add("unwork3_wjt_sh_count3", unwork3_wjt_sh_count3.ToString());//售后振铃
  509. tab.Add("unwork3_wjt_ts_count3", unwork3_wjt_ts_count3.ToString());//投诉振铃
  510. tab.Add("unwork3_wjt_qt_count3", unwork3_wjt_qt_count3.ToString());//其他振铃
  511. unwork3_wjt_all_count4 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=0 ").Length;
  512. unwork3_wjt_sq_count4 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=0 and BusinessType=1").Length;
  513. unwork3_wjt_sh_count4 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=0 and BusinessType=2").Length;
  514. unwork3_wjt_ts_count4 = dtlist.Select("CallState=0 and (WorkTimesDiff<=" + pretime.ToString() + " or WorkTimesDiff>=" + nexttime.ToString() + ") and NoCallState=0 and (BusinessType=3 or BusinessType=31 or BusinessType=32) ").Length;
  515. unwork3_wjt_qt_count4 = unwork3_wjt_all_count4 - unwork3_wjt_sq_count4 - unwork3_wjt_sh_count4 - unwork3_wjt_ts_count4;
  516. tab.Add("unwork3_wjt_all_count4", unwork3_wjt_all_count4.ToString());//其他
  517. tab.Add("unwork3_wjt_sq_count4", unwork3_wjt_sq_count4.ToString());//售前其他
  518. tab.Add("unwork3_wjt_sh_count4", unwork3_wjt_sh_count4.ToString());//售后其他
  519. tab.Add("unwork3_wjt_ts_count4", unwork3_wjt_ts_count4.ToString());//投诉其他
  520. tab.Add("unwork3_wjt_qt_count4", unwork3_wjt_qt_count4.ToString());//其他其他
  521. #endregion
  522. #endregion
  523. #region 非工作时间来电占比
  524. #region 非工作时间来电合计占比
  525. if (unwork_all_all_count != 0)
  526. {
  527. tab.Add("unwork1_jt_all_zb", (Convert.ToDecimal(unwork1_jt_all_count) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//接通合计占比
  528. tab.Add("unwork1_wjt_all_zb1", (Convert.ToDecimal(unwork1_wjt_all_count1) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//坐席未登录合计占比
  529. tab.Add("unwork1_wjt_all_zb2", (Convert.ToDecimal(unwork1_wjt_all_count2) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//坐席忙合计占比
  530. tab.Add("unwork1_wjt_all_zb3", (Convert.ToDecimal(unwork1_wjt_all_count3) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//振铃合计占比
  531. tab.Add("unwork1_wjt_all_zb4", (Convert.ToDecimal(unwork1_wjt_all_count4) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//其他合计占比
  532. tab.Add("unwork2_jt_all_zb", (Convert.ToDecimal(unwork2_jt_all_count) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//接通合计占比
  533. tab.Add("unwork2_wjt_all_zb1", (Convert.ToDecimal(unwork2_wjt_all_count1) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//坐席未登录合计占比
  534. tab.Add("unwork2_wjt_all_zb2", (Convert.ToDecimal(unwork2_wjt_all_count2) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//坐席忙合计占比
  535. tab.Add("unwork2_wjt_all_zb3", (Convert.ToDecimal(unwork2_wjt_all_count3) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//振铃合计占比
  536. tab.Add("unwork2_wjt_all_zb4", (Convert.ToDecimal(unwork2_wjt_all_count4) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//其他合计占比
  537. tab.Add("unwork3_jt_all_zb", (Convert.ToDecimal(unwork3_jt_all_count) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//接通合计占比
  538. tab.Add("unwork3_wjt_all_zb1", (Convert.ToDecimal(unwork3_wjt_all_count1) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//坐席未登录合计占比
  539. tab.Add("unwork3_wjt_all_zb2", (Convert.ToDecimal(unwork3_wjt_all_count2) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//坐席忙合计占比
  540. tab.Add("unwork3_wjt_all_zb3", (Convert.ToDecimal(unwork3_wjt_all_count3) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//振铃合计占比
  541. tab.Add("unwork3_wjt_all_zb4", (Convert.ToDecimal(unwork3_wjt_all_count4) * 100 / Convert.ToDecimal(unwork_all_all_count)).ToString("f") + "%");//其他合计占比
  542. }
  543. else
  544. {
  545. tab.Add("unwork1_jt_all_zb", "-");//接通合计占比
  546. tab.Add("unwork1_wjt_all_zb1", "-");//坐席未登录合计占比
  547. tab.Add("unwork1_wjt_all_zb2", "-");//坐席忙合计占比
  548. tab.Add("unwork1_wjt_all_zb3", "-");//振铃合计占比
  549. tab.Add("unwork1_wjt_all_zb4", "-");//其他合计占比
  550. tab.Add("unwork2_jt_all_zb", "-");//接通合计占比
  551. tab.Add("unwork2_wjt_all_zb1", "-");//坐席未登录合计占比
  552. tab.Add("unwork2_wjt_all_zb2", "-");//坐席忙合计占比
  553. tab.Add("unwork2_wjt_all_zb3", "-");//振铃合计占比
  554. tab.Add("unwork2_wjt_all_zb4", "-");//其他合计占比
  555. tab.Add("unwork3_jt_all_zb", "-");//接通合计占比
  556. tab.Add("unwork3_wjt_all_zb1", "-");//坐席未登录合计占比
  557. tab.Add("unwork3_wjt_all_zb2", "-");//坐席忙合计占比
  558. tab.Add("unwork3_wjt_all_zb3", "-");//振铃合计占比
  559. tab.Add("unwork3_wjt_all_zb4", "-");//其他合计占比
  560. }
  561. #endregion
  562. #region 来电售前占比
  563. if (unwork_sq_all_count != 0)
  564. {
  565. tab.Add("unwork1_jt_sq_zb", (Convert.ToDecimal(unwork1_jt_sq_count) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//接通合计占比
  566. tab.Add("unwork1_wjt_sq_zb1", (Convert.ToDecimal(unwork1_wjt_sq_count1) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//坐席未登录合计占比
  567. tab.Add("unwork1_wjt_sq_zb2", (Convert.ToDecimal(unwork1_wjt_sq_count2) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//坐席忙合计占比
  568. tab.Add("unwork1_wjt_sq_zb3", (Convert.ToDecimal(unwork1_wjt_sq_count3) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//振铃合计占比
  569. tab.Add("unwork1_wjt_sq_zb4", (Convert.ToDecimal(unwork1_wjt_sq_count4) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//其他合计占比
  570. tab.Add("unwork2_jt_sq_zb", (Convert.ToDecimal(unwork2_jt_sq_count) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//接通合计占比
  571. tab.Add("unwork2_wjt_sq_zb1", (Convert.ToDecimal(unwork2_wjt_sq_count1) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//坐席未登录合计占比
  572. tab.Add("unwork2_wjt_sq_zb2", (Convert.ToDecimal(unwork2_wjt_sq_count2) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//坐席忙合计占比
  573. tab.Add("unwork2_wjt_sq_zb3", (Convert.ToDecimal(unwork2_wjt_sq_count3) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//振铃合计占比
  574. tab.Add("unwork2_wjt_sq_zb4", (Convert.ToDecimal(unwork2_wjt_sq_count4) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//其他合计占比
  575. tab.Add("unwork3_jt_sq_zb", (Convert.ToDecimal(unwork3_jt_sq_count) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//接通合计占比
  576. tab.Add("unwork3_wjt_sq_zb1", (Convert.ToDecimal(unwork3_wjt_sq_count1) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//坐席未登录合计占比
  577. tab.Add("unwork3_wjt_sq_zb2", (Convert.ToDecimal(unwork3_wjt_sq_count2) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//坐席忙合计占比
  578. tab.Add("unwork3_wjt_sq_zb3", (Convert.ToDecimal(unwork3_wjt_sq_count3) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//振铃合计占比
  579. tab.Add("unwork3_wjt_sq_zb4", (Convert.ToDecimal(unwork3_wjt_sq_count4) * 100 / Convert.ToDecimal(unwork_sq_all_count)).ToString("f") + "%");//其他合计占比
  580. }
  581. else
  582. {
  583. tab.Add("unwork1_jt_sq_zb", "-");//接通合计占比
  584. tab.Add("unwork1_wjt_sq_zb1", "-");//坐席未登录合计占比
  585. tab.Add("unwork1_wjt_sq_zb2", "-");//坐席忙合计占比
  586. tab.Add("unwork1_wjt_sq_zb3", "-");//振铃合计占比
  587. tab.Add("unwork1_wjt_sq_zb4", "-");//其他合计占比
  588. tab.Add("unwork2_jt_sq_zb", "-");//接通合计占比
  589. tab.Add("unwork2_wjt_sq_zb1", "-");//坐席未登录合计占比
  590. tab.Add("unwork2_wjt_sq_zb2", "-");//坐席忙合计占比
  591. tab.Add("unwork2_wjt_sq_zb3", "-");//振铃合计占比
  592. tab.Add("unwork2_wjt_sq_zb4", "-");//其他合计占比
  593. tab.Add("unwork3_jt_sq_zb", "-");//接通合计占比
  594. tab.Add("unwork3_wjt_sq_zb1", "-");//坐席未登录合计占比
  595. tab.Add("unwork3_wjt_sq_zb2", "-");//坐席忙合计占比
  596. tab.Add("unwork3_wjt_sq_zb3", "-");//振铃合计占比
  597. tab.Add("unwork3_wjt_sq_zb4", "-");//其他合计占比
  598. }
  599. #endregion
  600. #region 来电售后占比
  601. if (unwork_sh_all_count != 0)
  602. {
  603. tab.Add("unwork1_jt_sh_zb", (Convert.ToDecimal(unwork1_jt_sh_count) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//接通合计占比
  604. tab.Add("unwork1_wjt_sh_zb1", (Convert.ToDecimal(unwork1_wjt_sh_count1) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//坐席未登录合计占比
  605. tab.Add("unwork1_wjt_sh_zb2", (Convert.ToDecimal(unwork1_wjt_sh_count2) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//坐席忙合计占比
  606. tab.Add("unwork1_wjt_sh_zb3", (Convert.ToDecimal(unwork1_wjt_sh_count3) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//振铃合计占比
  607. tab.Add("unwork1_wjt_sh_zb4", (Convert.ToDecimal(unwork1_wjt_sh_count4) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//其他合计占比
  608. tab.Add("unwork2_jt_sh_zb", (Convert.ToDecimal(unwork2_jt_sh_count) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//接通合计占比
  609. tab.Add("unwork2_wjt_sh_zb1", (Convert.ToDecimal(unwork2_wjt_sh_count1) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//坐席未登录合计占比
  610. tab.Add("unwork2_wjt_sh_zb2", (Convert.ToDecimal(unwork2_wjt_sh_count2) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//坐席忙合计占比
  611. tab.Add("unwork2_wjt_sh_zb3", (Convert.ToDecimal(unwork2_wjt_sh_count3) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//振铃合计占比
  612. tab.Add("unwork2_wjt_sh_zb4", (Convert.ToDecimal(unwork2_wjt_sh_count4) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//其他合计占比
  613. tab.Add("unwork3_jt_sh_zb", (Convert.ToDecimal(unwork3_jt_sh_count) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//接通合计占比
  614. tab.Add("unwork3_wjt_sh_zb1", (Convert.ToDecimal(unwork3_wjt_sh_count1) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//坐席未登录合计占比
  615. tab.Add("unwork3_wjt_sh_zb2", (Convert.ToDecimal(unwork3_wjt_sh_count2) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//坐席忙合计占比
  616. tab.Add("unwork3_wjt_sh_zb3", (Convert.ToDecimal(unwork3_wjt_sh_count3) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//振铃合计占比
  617. tab.Add("unwork3_wjt_sh_zb4", (Convert.ToDecimal(unwork3_wjt_sh_count4) * 100 / Convert.ToDecimal(unwork_sh_all_count)).ToString("f") + "%");//其他合计占比
  618. }
  619. else
  620. {
  621. tab.Add("unwork1_jt_sh_zb", "-");//接通合计占比
  622. tab.Add("unwork1_wjt_sh_zb1", "-");//坐席未登录合计占比
  623. tab.Add("unwork1_wjt_sh_zb2", "-");//坐席忙合计占比
  624. tab.Add("unwork1_wjt_sh_zb3", "-");//振铃合计占比
  625. tab.Add("unwork1_wjt_sh_zb4", "-");//其他合计占比
  626. tab.Add("unwork2_jt_sh_zb", "-");//接通合计占比
  627. tab.Add("unwork2_wjt_sh_zb1", "-");//坐席未登录合计占比
  628. tab.Add("unwork2_wjt_sh_zb2", "-");//坐席忙合计占比
  629. tab.Add("unwork2_wjt_sh_zb3", "-");//振铃合计占比
  630. tab.Add("unwork2_wjt_sh_zb4", "-");//其他合计占比
  631. tab.Add("unwork3_jt_sh_zb", "-");//接通合计占比
  632. tab.Add("unwork3_wjt_sh_zb1", "-");//坐席未登录合计占比
  633. tab.Add("unwork3_wjt_sh_zb2", "-");//坐席忙合计占比
  634. tab.Add("unwork3_wjt_sh_zb3", "-");//振铃合计占比
  635. tab.Add("unwork3_wjt_sh_zb4", "-");//其他合计占比
  636. }
  637. #endregion
  638. #region 来电投诉占比
  639. if (unwork_ts_all_count != 0)
  640. {
  641. tab.Add("unwork1_jt_ts_zb", (Convert.ToDecimal(unwork1_jt_ts_count) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//接通合计占比
  642. tab.Add("unwork1_wjt_ts_zb1", (Convert.ToDecimal(unwork1_wjt_ts_count1) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//坐席未登录合计占比
  643. tab.Add("unwork1_wjt_ts_zb2", (Convert.ToDecimal(unwork1_wjt_ts_count2) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//坐席忙合计占比
  644. tab.Add("unwork1_wjt_ts_zb3", (Convert.ToDecimal(unwork1_wjt_ts_count3) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//振铃合计占比
  645. tab.Add("unwork1_wjt_ts_zb4", (Convert.ToDecimal(unwork1_wjt_ts_count4) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//其他合计占比
  646. tab.Add("unwork2_jt_ts_zb", (Convert.ToDecimal(unwork2_jt_ts_count) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//接通合计占比
  647. tab.Add("unwork2_wjt_ts_zb1", (Convert.ToDecimal(unwork2_wjt_ts_count1) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//坐席未登录合计占比
  648. tab.Add("unwork2_wjt_ts_zb2", (Convert.ToDecimal(unwork2_wjt_ts_count2) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//坐席忙合计占比
  649. tab.Add("unwork2_wjt_ts_zb3", (Convert.ToDecimal(unwork2_wjt_ts_count3) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//振铃合计占比
  650. tab.Add("unwork2_wjt_ts_zb4", (Convert.ToDecimal(unwork2_wjt_ts_count4) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//其他合计占比
  651. tab.Add("unwork3_jt_ts_zb", (Convert.ToDecimal(unwork3_jt_ts_count) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//接通合计占比
  652. tab.Add("unwork3_wjt_ts_zb1", (Convert.ToDecimal(unwork3_wjt_ts_count1) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//坐席未登录合计占比
  653. tab.Add("unwork3_wjt_ts_zb2", (Convert.ToDecimal(unwork3_wjt_ts_count2) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//坐席忙合计占比
  654. tab.Add("unwork3_wjt_ts_zb3", (Convert.ToDecimal(unwork3_wjt_ts_count3) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//振铃合计占比
  655. tab.Add("unwork3_wjt_ts_zb4", (Convert.ToDecimal(unwork3_wjt_ts_count4) * 100 / Convert.ToDecimal(unwork_ts_all_count)).ToString("f") + "%");//其他合计占比
  656. }
  657. else
  658. {
  659. tab.Add("unwork1_jt_ts_zb", "-");//接通合计占比
  660. tab.Add("unwork1_wjt_ts_zb1", "-");//坐席未登录合计占比
  661. tab.Add("unwork1_wjt_ts_zb2", "-");//坐席忙合计占比
  662. tab.Add("unwork1_wjt_ts_zb3", "-");//振铃合计占比
  663. tab.Add("unwork1_wjt_ts_zb4", "-");//其他合计占比
  664. tab.Add("unwork2_jt_ts_zb", "-");//接通合计占比
  665. tab.Add("unwork2_wjt_ts_zb1", "-");//坐席未登录合计占比
  666. tab.Add("unwork2_wjt_ts_zb2", "-");//坐席忙合计占比
  667. tab.Add("unwork2_wjt_ts_zb3", "-");//振铃合计占比
  668. tab.Add("unwork2_wjt_ts_zb4", "-");//其他合计占比
  669. tab.Add("unwork3_jt_ts_zb", "-");//接通合计占比
  670. tab.Add("unwork3_wjt_ts_zb1", "-");//坐席未登录合计占比
  671. tab.Add("unwork3_wjt_ts_zb2", "-");//坐席忙合计占比
  672. tab.Add("unwork3_wjt_ts_zb3", "-");//振铃合计占比
  673. tab.Add("unwork3_wjt_ts_zb4", "-");//其他合计占比
  674. }
  675. #endregion
  676. #region 来电其他占比
  677. if (unwork_qt_all_count != 0)
  678. {
  679. tab.Add("unwork1_jt_qt_zb", (Convert.ToDecimal(unwork1_jt_qt_count) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//接通合计占比
  680. tab.Add("unwork1_wjt_qt_zb1", (Convert.ToDecimal(unwork1_wjt_qt_count1) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//坐席未登录合计占比
  681. tab.Add("unwork1_wjt_qt_zb2", (Convert.ToDecimal(unwork1_wjt_qt_count2) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//坐席忙合计占比
  682. tab.Add("unwork1_wjt_qt_zb3", (Convert.ToDecimal(unwork1_wjt_qt_count3) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//振铃合计占比
  683. tab.Add("unwork1_wjt_qt_zb4", (Convert.ToDecimal(unwork1_wjt_qt_count4) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//其他合计占比
  684. tab.Add("unwork2_jt_qt_zb", (Convert.ToDecimal(unwork2_jt_qt_count) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//接通合计占比
  685. tab.Add("unwork2_wjt_qt_zb1", (Convert.ToDecimal(unwork2_wjt_qt_count1) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//坐席未登录合计占比
  686. tab.Add("unwork2_wjt_qt_zb2", (Convert.ToDecimal(unwork2_wjt_qt_count2) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//坐席忙合计占比
  687. tab.Add("unwork2_wjt_qt_zb3", (Convert.ToDecimal(unwork2_wjt_qt_count3) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//振铃合计占比
  688. tab.Add("unwork2_wjt_qt_zb4", (Convert.ToDecimal(unwork2_wjt_qt_count4) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//其他合计占比
  689. tab.Add("unwork3_jt_qt_zb", (Convert.ToDecimal(unwork3_jt_qt_count) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//接通合计占比
  690. tab.Add("unwork3_wjt_qt_zb1", (Convert.ToDecimal(unwork3_wjt_qt_count1) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//坐席未登录合计占比
  691. tab.Add("unwork3_wjt_qt_zb2", (Convert.ToDecimal(unwork3_wjt_qt_count2) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//坐席忙合计占比
  692. tab.Add("unwork3_wjt_qt_zb3", (Convert.ToDecimal(unwork3_wjt_qt_count3) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//振铃合计占比
  693. tab.Add("unwork3_wjt_qt_zb4", (Convert.ToDecimal(unwork3_wjt_qt_count4) * 100 / Convert.ToDecimal(unwork_qt_all_count)).ToString("f") + "%");//其他合计占比
  694. }
  695. else
  696. {
  697. tab.Add("unwork1_jt_qt_zb", "-");//接通合计占比
  698. tab.Add("unwork1_wjt_qt_zb1", "-");//坐席未登录合计占比
  699. tab.Add("unwork1_wjt_qt_zb2", "-");//坐席忙合计占比
  700. tab.Add("unwork1_wjt_qt_zb3", "-");//振铃合计占比
  701. tab.Add("unwork1_wjt_qt_zb4", "-");//其他合计占比
  702. tab.Add("unwork2_jt_qt_zb", "-");//接通合计占比
  703. tab.Add("unwork2_wjt_qt_zb1", "-");//坐席未登录合计占比
  704. tab.Add("unwork2_wjt_qt_zb2", "-");//坐席忙合计占比
  705. tab.Add("unwork2_wjt_qt_zb3", "-");//振铃合计占比
  706. tab.Add("unwork2_wjt_qt_zb4", "-");//其他合计占比
  707. tab.Add("unwork3_jt_qt_zb", "-");//接通合计占比
  708. tab.Add("unwork3_wjt_qt_zb1", "-");//坐席未登录合计占比
  709. tab.Add("unwork3_wjt_qt_zb2", "-");//坐席忙合计占比
  710. tab.Add("unwork3_wjt_qt_zb3", "-");//振铃合计占比
  711. tab.Add("unwork3_wjt_qt_zb4", "-");//其他合计占比
  712. }
  713. #endregion
  714. #endregion
  715. #endregion
  716. }
  717. #endregion
  718. #endregion
  719. res = Success("获取来电数据分析数据成功", tab);
  720. dtlist.Clear();
  721. dtlist.Dispose();
  722. dt.Clear();
  723. dt.Dispose();
  724. return res;
  725. }
  726. }
  727. }