地铁二期项目正式开始

CallRecordController.cs 66KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647
  1. using CallCenter.Utility;
  2. using Newtonsoft.Json;
  3. using Newtonsoft.Json.Linq;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Data;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Web;
  10. using System.Web.Mvc;
  11. using YTSoft.BaseCallCenter.Model;
  12. using YTSoft.BaseCallCenter.MVCWeb.Commons;
  13. using YTSoft.BaseCallCenter.MVCWeb.Models;
  14. using YTSoft.Common;
  15. using YTSoft.DBUtility;
  16. namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
  17. {
  18. public class CallRecordController : BaseController
  19. {
  20. //工单信息
  21. BLL.T_Wo_WorkOrderBase orderBLL = new BLL.T_Wo_WorkOrderBase();
  22. //客户信息
  23. BLL.T_Cus_CustomerBase cusBLL = new BLL.T_Cus_CustomerBase();
  24. //部门表
  25. BLL.T_Sys_Department deptBll = new BLL.T_Sys_Department();
  26. //用户表
  27. BLL.T_Sys_UserAccount userBll = new BLL.T_Sys_UserAccount();
  28. //通话记录
  29. BLL.T_Call_CallRecords recordBLL = new BLL.T_Call_CallRecords();
  30. #region 来电弹屏信息
  31. /// <summary>
  32. /// 来电弹屏页面
  33. /// </summary>
  34. /// <param name="workOrderNum">工单编号</param>
  35. /// <returns></returns>
  36. public ActionResult CallScreen(string workOrderNum)
  37. {
  38. //workOrderNum = "12";
  39. //实例化基础信息表
  40. CallScreenModel callScreenModel = new CallScreenModel();
  41. //获取业务工单信息
  42. if (!string.IsNullOrEmpty(workOrderNum))
  43. {
  44. callScreenModel.WorkOrderBaseModel = orderBLL.GetModel(int.Parse(workOrderNum.ToString()));
  45. if (callScreenModel.WorkOrderBaseModel==null)
  46. {
  47. callScreenModel.WorkOrderBaseModel = new Model.T_Wo_WorkOrderBase()
  48. {
  49. CustomerBaseModel = new T_Cus_CustomerBase { F_CustomerId = 0 },
  50. F_WORKORDERID = 0
  51. };
  52. }
  53. //如果电话号码不为空
  54. if (callScreenModel.WorkOrderBaseModel != null && !string.IsNullOrEmpty(callScreenModel.WorkOrderBaseModel.F_CUSTOMERTELEPHONE))
  55. {
  56. //获取客户基本信息
  57. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = cusBLL.GetCusInfoModel(callScreenModel.WorkOrderBaseModel.F_CUSTOMERTELEPHONE);
  58. }
  59. if (callScreenModel.WorkOrderBaseModel != null && !string.IsNullOrEmpty(callScreenModel.WorkOrderBaseModel.F_KSHADDRESSCODE))
  60. {
  61. Model.T_Call_CallRecords callRecordModel = recordBLL.GetModelByCallId(callScreenModel.WorkOrderBaseModel.F_KSHADDRESSCODE);
  62. if (callRecordModel != null)
  63. {
  64. if (callRecordModel.BusinessType != null)
  65. {
  66. //业务选择按键
  67. callScreenModel.SelectBussType = int.Parse(callRecordModel.BusinessType.ToString());
  68. }
  69. else
  70. {
  71. callScreenModel.SelectBussType =1;
  72. }
  73. }
  74. }
  75. }
  76. callScreenModel.WorkOrderTypeModelList = GetWorkTypeModelList();//业务类型字典表
  77. //获取处理年龄段字典表
  78. callScreenModel.AgeModelList = GetCodeType("NLD");
  79. return View(callScreenModel);
  80. }
  81. /// <summary>
  82. /// 业务工单录入页面
  83. /// </summary>
  84. /// <param name="workOrderNum">工单编号</param>
  85. /// <param name="flowid">业务类型</param>
  86. /// <returns></returns>
  87. public ActionResult CallWorkFolw(string workOrderNum, int? flowid)
  88. {
  89. //实例化基础信息表
  90. CallScreenModel callScreenModel = new CallScreenModel();
  91. //选择的业务类型
  92. if (flowid != null && flowid > 0)
  93. {
  94. callScreenModel.Flowid = flowid;
  95. }
  96. else
  97. {
  98. callScreenModel.Flowid = 0;
  99. }
  100. //获取业务工单信息
  101. if (!string.IsNullOrEmpty(workOrderNum))
  102. {
  103. callScreenModel.WorkOrderBaseModel = orderBLL.GetModel(int.Parse(workOrderNum.ToString()));
  104. if (callScreenModel.WorkOrderBaseModel == null)
  105. {
  106. callScreenModel.WorkOrderBaseModel = new Model.T_Wo_WorkOrderBase()
  107. {
  108. CustomerBaseModel = new T_Cus_CustomerBase { F_CustomerId = 0 },
  109. F_WORKORDERID = 0
  110. };
  111. }
  112. //如果电话号码不为空
  113. if (callScreenModel.WorkOrderBaseModel != null && !string.IsNullOrEmpty(callScreenModel.WorkOrderBaseModel.F_CUSTOMERTELEPHONE))
  114. {
  115. T_Cus_CustomerBase baseCusModel = cusBLL.GetCusInfoModel(callScreenModel.WorkOrderBaseModel.F_CUSTOMERTELEPHONE);
  116. if (baseCusModel != null && baseCusModel.F_CustomerId > 0)
  117. {
  118. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = baseCusModel;
  119. }
  120. else
  121. {
  122. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  123. }
  124. //选择的业务类型
  125. if (flowid != null && flowid > 0)
  126. {
  127. callScreenModel.BussnessContnet = GetTypeContenet(int.Parse(flowid.ToString()), callScreenModel.WorkOrderBaseModel.F_CREATEDATE.ToString());
  128. }
  129. }
  130. else
  131. {
  132. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  133. }
  134. //获取客户基本信息
  135. }
  136. //业务类型字典表
  137. callScreenModel.WorkOrderTypeModelList = GetWorkTypeModelList();
  138. //获取处理方式字典表
  139. callScreenModel.GoTypeModelList = GetCodeType("CLFS");
  140. //获取处理年龄段字典表
  141. callScreenModel.AgeModelList = GetCodeType("NLD");
  142. //获取部门列表
  143. callScreenModel.DepartmentList = deptBll.GetModelList("F_ParentId=0");
  144. callScreenModel.HistoryOrderList = historyBll.GetModelList("F_INSTANCEID=" + workOrderNum.ToInt32());
  145. return View(callScreenModel);
  146. }
  147. //历史工单表
  148. BLL.T_Wo_WorkOrderHistory historyBll = new BLL.T_Wo_WorkOrderHistory();
  149. /// <summary>
  150. /// 业务工单录入页面
  151. /// </summary>
  152. /// <param name="workOrderNum">工单编号</param>
  153. /// <param name="flowid">业务类型</param>
  154. /// <returns></returns>
  155. public ActionResult EditCallWorkFolw(string workOrderNum)
  156. {
  157. //实例化基础信息表
  158. CallScreenModel callScreenModel = new CallScreenModel();
  159. //获取业务工单信息
  160. if (!string.IsNullOrEmpty(workOrderNum))
  161. {
  162. callScreenModel.WorkOrderBaseModel = orderBLL.GetModel(int.Parse(workOrderNum.ToString()));
  163. //如果电话号码不为空
  164. if (callScreenModel.WorkOrderBaseModel != null && !string.IsNullOrEmpty(callScreenModel.WorkOrderBaseModel.F_CUSTOMERTELEPHONE))
  165. {
  166. T_Cus_CustomerBase baseCusModel = cusBLL.GetCusInfoModel(callScreenModel.WorkOrderBaseModel.F_CUSTOMERTELEPHONE);
  167. if (baseCusModel != null && baseCusModel.F_CustomerId > 0)
  168. {
  169. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = baseCusModel;
  170. }
  171. else
  172. {
  173. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  174. }
  175. }
  176. else
  177. {
  178. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  179. }
  180. //获取客户基本信息
  181. if (!string.IsNullOrEmpty( callScreenModel.WorkOrderBaseModel.F_EMPCODE))
  182. {
  183. T_Cus_CustomerBase baseCusModel = cusBLL.GetCusInfoModel(1,callScreenModel.WorkOrderBaseModel.F_EMPCODE);
  184. if (baseCusModel != null && baseCusModel.F_CustomerId > 0)
  185. {
  186. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = baseCusModel;
  187. }
  188. else
  189. {
  190. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  191. }
  192. }
  193. }
  194. //业务类型字典表
  195. callScreenModel.WorkOrderTypeModelList = GetWorkTypeModelList();
  196. //获取处理方式字典表
  197. callScreenModel.GoTypeModelList = GetCodeType("CLFS");
  198. //回访满意度
  199. callScreenModel.MYdModelList = GetCodeType("khyjfl");
  200. //获取处理年龄段字典表
  201. callScreenModel.AgeModelList = GetCodeType("NLD");
  202. //获取部门列表
  203. callScreenModel.DepartmentList = deptBll.GetModelList("F_ParentId=0");
  204. return View(callScreenModel);
  205. }
  206. /// <summary>
  207. /// 编辑历史工单
  208. /// </summary>
  209. /// <param name="workOrderBaseModel"></param>
  210. /// <returns></returns>
  211. [AcceptVerbs(HttpVerbs.Post)]
  212. public bool workOrderEditData(T_Wo_WorkOrderBase workOrderBaseModel)
  213. {
  214. //工单来源
  215. //workOrderBaseModel.F_REPAIRMANID = 1;
  216. //workOrderBaseModel.F_WORKORDERFROM = "语音";
  217. if (workOrderBaseModel.CustomerBaseModel != null)
  218. {
  219. //最近联络方式
  220. if (workOrderBaseModel.F_REPAIRMANID.ToString() == "4")
  221. {
  222. workOrderBaseModel.CustomerBaseModel.F_Kind = "3";
  223. workOrderBaseModel.F_CUSTOMERTELEPHONE = workOrderBaseModel.CustomerBaseModel.F_Mobile;
  224. }
  225. else
  226. {
  227. workOrderBaseModel.CustomerBaseModel.F_Kind = workOrderBaseModel.F_REPAIRMANID.ToString();
  228. }
  229. workOrderBaseModel.CustomerBaseModel.F_CustomerNature = workOrderBaseModel.F_WORKORDERFROM;
  230. //业务类型
  231. workOrderBaseModel.CustomerBaseModel.F_IndustryId = workOrderBaseModel.F_REPAIRLEVEL;
  232. workOrderBaseModel.CustomerBaseModel.F_Url = workOrderBaseModel.F_ADSLACCOUNT;
  233. //修改客户基础信息
  234. int cusid = cusBLL.EditCusInfoModel(workOrderBaseModel.CustomerBaseModel);
  235. if (cusid > 0)
  236. {
  237. workOrderBaseModel.F_CUSTOMERID = cusid;
  238. }
  239. }
  240. return orderBLL.UpdateHistoryWorkOrderInfoModel(workOrderBaseModel);
  241. }
  242. /// <summary>
  243. /// 撤回历史工单
  244. /// </summary>
  245. /// <param name="workOrderBaseModel"></param>
  246. /// <returns></returns>
  247. [AcceptVerbs(HttpVerbs.Get)]
  248. public bool ResetWorkOrder(int workOrderId)
  249. {
  250. bool result = false;;
  251. string bycode = F_UserCode;
  252. string byname =F_UserName;
  253. int bmid = F_DeptId;
  254. string bmmc = "";
  255. if (F_UserID > 0) {
  256. YTSoft.BaseCallCenter.BLL.T_Sys_Department depBll = new BLL.T_Sys_Department();
  257. List<Model.T_Sys_Department> list = new List<T_Sys_Department>();
  258. list = depBll.GetModelList("F_DeptId=" + bmid);
  259. if (list.Count>0)
  260. {
  261. bmmc = list[0].F_DeptName.ToString();
  262. result= orderBLL.ResetWorkOrder(workOrderId, F_UserID, F_UserName, F_DeptId, bmmc);
  263. }
  264. }
  265. return result;
  266. }
  267. /// <summary>
  268. /// 获取业务术语模板信息
  269. /// </summary>
  270. /// <param name="bussnessType">业务类型</param>
  271. /// <returns></returns>
  272. public string GetTypeContenet(int bussnessType, string creatDateTime)
  273. {
  274. try
  275. {
  276. //模板内容
  277. string bussContent = "";
  278. if (bussnessType > 0)
  279. {
  280. if (bussnessType > 0)
  281. {
  282. BLL.T_Wo_WorkOrderType bll = new BLL.T_Wo_WorkOrderType();
  283. Model.T_Wo_WorkOrderType orderTypeModel = new T_Wo_WorkOrderType();
  284. orderTypeModel = bll.GetModel(bussnessType);
  285. if (orderTypeModel != null && !string.IsNullOrEmpty(orderTypeModel.F_Remark))
  286. {
  287. bussContent += string.Format(orderTypeModel.F_Remark, DateTime.Parse(creatDateTime).ToString("f") + "分");
  288. }
  289. }
  290. }
  291. return bussContent;
  292. }
  293. catch (Exception ex)
  294. {
  295. }
  296. return null;
  297. }
  298. /// <summary>
  299. /// 保存用户信息
  300. /// </summary>
  301. /// <param name="workOrderBaseModel"></param>
  302. /// <returns></returns>
  303. [AcceptVerbs(HttpVerbs.Post)]
  304. public bool SaveCunInfo(T_Cus_CustomerBase CustomerBaseModel)
  305. {
  306. //客户属性
  307. if (string.IsNullOrEmpty(CustomerBaseModel.F_Kind))
  308. {
  309. CustomerBaseModel.F_Kind = "1";
  310. }
  311. if (string.IsNullOrEmpty(CustomerBaseModel.F_CustomerNature))
  312. {
  313. CustomerBaseModel.F_CustomerNature = "语音";
  314. }
  315. if (CustomerBaseModel.F_CustomerId > 0)
  316. {
  317. AddAction("t_cus_customerbase", CustomerBaseModel.F_CustomerId.ToMyString(), "更新客户信息", CustomerBaseModel.F_CustomerName.ToMyString());
  318. AddAction("t_cus_customerbase", CustomerBaseModel.F_CustomerId.ToMyString(), "更新客户信息", "数据:" + JsonConvert.SerializeObject(CustomerBaseModel), "关键信息");
  319. }
  320. else
  321. {
  322. YTSoft.BaseCallCenter.Model.T_Cus_CustomerBase modelcus= cusBLL.GetCusInfoModel(CustomerBaseModel.F_Telephone);
  323. if ( modelcus.F_CustomerId>0)
  324. {
  325. }
  326. AddAction("t_cus_customerbase", CustomerBaseModel.F_Telephone, "添加客户信息", CustomerBaseModel.F_CustomerName.ToMyString());
  327. AddAction("t_cus_customerbase", CustomerBaseModel.F_Telephone, "添加客户信息","数据:"+JsonConvert.SerializeObject(CustomerBaseModel), "关键信息");
  328. }
  329. return cusBLL.UpdateCusInfoModel(CustomerBaseModel);
  330. }
  331. /// <summary>
  332. /// 获取员工信息
  333. /// </summary>
  334. /// <param name="deptId">部门id</param>
  335. /// <returns></returns>
  336. public string GetDeptUsers(string deptId)
  337. {
  338. try
  339. {
  340. return JsonConvert.SerializeObject(userBll.GetModelList("F_DeptId=" + deptId));
  341. }
  342. catch (Exception ex)
  343. {
  344. }
  345. return null;
  346. }
  347. #endregion
  348. #region 微博工单
  349. /// <summary>
  350. /// 微信微博工单录入页面
  351. /// </summary>
  352. /// <param name="workOrderNum">工单编号</param>
  353. /// <param name="flowid">业务类型</param>
  354. /// <returns></returns>
  355. public ActionResult WBWorkFlow(string workOrderNum, int? flowid)
  356. {
  357. workOrderNum = "0"; flowid = 0;
  358. //实例化基础信息表
  359. CallScreenModel callScreenModel = new CallScreenModel();
  360. //选择的业务类型
  361. if (flowid != null && flowid > 0)
  362. {
  363. callScreenModel.Flowid = flowid;
  364. }
  365. else
  366. {
  367. callScreenModel.Flowid = 0;
  368. }
  369. //业务类型字典表
  370. callScreenModel.WorkOrderTypeModelList = GetWorkTypeModelList();
  371. //获取处理方式字典表
  372. callScreenModel.GoTypeModelList = GetCodeType("CLFS");
  373. //获取处理年龄段字典表
  374. callScreenModel.AgeModelList = GetCodeType("NLD");
  375. //获取部门列表
  376. callScreenModel.DepartmentList = deptBll.GetModelList("F_ParentId=0");
  377. return View(callScreenModel);
  378. }
  379. /// <summary>
  380. /// 微信编辑
  381. /// </summary>
  382. /// <param name="webChartNum">微信号</param>
  383. /// <param name="recordId">历史记录号</param>
  384. /// <param name="recordId">工单id</param>
  385. /// <returns></returns>
  386. public ActionResult WXWorkFlowEdit(int workOrderNum)
  387. {
  388. //实例化基础信息表
  389. CallScreenModel callScreenModel = new CallScreenModel();
  390. if ( workOrderNum > 0)
  391. {
  392. callScreenModel.WorkOrderBaseModel = orderBLL.GetModel(workOrderNum);
  393. //获取业务工单信息
  394. if (!string.IsNullOrEmpty(callScreenModel.WorkOrderBaseModel.F_EMPCODE))
  395. {
  396. T_Cus_CustomerBase baseCusModel = cusBLL.GetCusInfoModel(1, callScreenModel.WorkOrderBaseModel.F_EMPCODE);
  397. if (baseCusModel != null && baseCusModel.F_CustomerId > 0)
  398. {
  399. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = baseCusModel;
  400. }
  401. else
  402. {
  403. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  404. }
  405. }
  406. else
  407. {
  408. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  409. }
  410. //业务类型字典表
  411. callScreenModel.WorkOrderTypeModelList = GetWorkTypeModelList();
  412. //获取处理方式字典表
  413. callScreenModel.GoTypeModelList = GetCodeType("CLFS");
  414. //获取处理年龄段字典表
  415. callScreenModel.AgeModelList = GetCodeType("NLD");
  416. //获取部门列表
  417. callScreenModel.DepartmentList = deptBll.GetModelList("F_ParentId=0");
  418. callScreenModel.HistoryOrderList = historyBll.GetModelList("F_INSTANCEID=" + int.Parse(workOrderNum.ToString()));
  419. return View(callScreenModel);
  420. }
  421. return View();
  422. }
  423. /// <summary>
  424. /// 微博编辑
  425. /// </summary>
  426. /// <param name="webChartNum">微信号</param>
  427. /// <param name="recordId">历史记录号</param>
  428. /// <param name="recordId">工单id</param>
  429. /// <returns></returns>
  430. public ActionResult WBWorkFlowEdit(int workOrderNum)
  431. {
  432. //实例化基础信息表
  433. CallScreenModel callScreenModel = new CallScreenModel();
  434. if (workOrderNum > 0)
  435. {
  436. callScreenModel.WorkOrderBaseModel = orderBLL.GetModel(workOrderNum);
  437. //获取业务工单信息
  438. if (!string.IsNullOrEmpty(callScreenModel.WorkOrderBaseModel.F_EMPCODE))
  439. {//1微信,2微博
  440. T_Cus_CustomerBase baseCusModel = cusBLL.GetCusInfoModel(1, callScreenModel.WorkOrderBaseModel.F_EMPCODE);
  441. if (baseCusModel != null && baseCusModel.F_CustomerId > 0)
  442. {
  443. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = baseCusModel;
  444. }
  445. else
  446. {
  447. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  448. }
  449. }
  450. else
  451. {
  452. callScreenModel.WorkOrderBaseModel.CustomerBaseModel = new T_Cus_CustomerBase();
  453. }
  454. //业务类型字典表
  455. callScreenModel.WorkOrderTypeModelList = GetWorkTypeModelList();
  456. //获取处理方式字典表
  457. callScreenModel.GoTypeModelList = GetCodeType("CLFS");
  458. //获取处理年龄段字典表
  459. callScreenModel.AgeModelList = GetCodeType("NLD");
  460. //获取部门列表
  461. callScreenModel.DepartmentList = deptBll.GetModelList("F_ParentId=0");
  462. callScreenModel.HistoryOrderList = historyBll.GetModelList("F_INSTANCEID=" + int.Parse(workOrderNum.ToString()));
  463. return View(callScreenModel);
  464. }
  465. return View();
  466. }
  467. #endregion
  468. /// <summary>
  469. /// 补录工单处理信息
  470. /// </summary>
  471. /// <param name="workOrderBaseModel"></param>
  472. /// <returns></returns>
  473. [AcceptVerbs(HttpVerbs.Post)]
  474. public bool workOrderAddData(T_Wo_WorkOrderBase workOrderBaseModel)
  475. {
  476. if (workOrderBaseModel.F_REPAIRMANID == 4)
  477. {
  478. workOrderBaseModel.F_WORKORDERFROM = "微博工单";
  479. string wbh = workOrderBaseModel.CustomerBaseModel.F_CustomerEName.Trim();
  480. if (!string.IsNullOrEmpty(wbh))
  481. {
  482. workOrderBaseModel.F_EMPCODE = wbh;
  483. workOrderBaseModel.CustomerBaseModel.F_PostCode = wbh;
  484. }
  485. ////客户等级
  486. workOrderBaseModel.CustomerBaseModel.F_ScaleResume = "1";
  487. workOrderBaseModel.CustomerBaseModel.F_CustomerClass = "一般客户";
  488. }
  489. workOrderBaseModel.F_USERID = F_UserID;//id
  490. workOrderBaseModel.F_LINKMAN = F_UserCode;//工号
  491. workOrderBaseModel.F_REPAIRMANNAME = F_UserName;//姓名
  492. workOrderBaseModel.F_LINKMANTELEPHONE = workOrderBaseModel.CustomerBaseModel.F_Mobile;
  493. workOrderBaseModel.F_USERNAME = F_UserName;
  494. workOrderBaseModel.F_DEPTID = F_DeptId;
  495. T_Sys_Department deptmodel = deptBll.GetModel(F_DeptId);
  496. if (deptmodel != null)
  497. {
  498. workOrderBaseModel.F_DEPTCODE = deptmodel.F_DeptName;
  499. }
  500. AddAction("T_Wo_WorkOrderBase", workOrderBaseModel.F_WORKORDERID.ToMyString(), "录入工单", "数据:"+JsonConvert.SerializeObject(workOrderBaseModel), "关键信息");
  501. if (workOrderBaseModel.F_CONTENT == null)
  502. {
  503. workOrderBaseModel.F_CONTENT = "-";
  504. }
  505. if (workOrderBaseModel.F_RETURNVISITCONTENT == null)
  506. {
  507. workOrderBaseModel.F_RETURNVISITCONTENT = "-";
  508. }
  509. if (workOrderBaseModel.CustomerBaseModel != null)
  510. {
  511. //最近联络方式
  512. if (workOrderBaseModel.F_REPAIRMANID == 4)
  513. {
  514. workOrderBaseModel.CustomerBaseModel.F_Kind = "3";
  515. }
  516. else
  517. {
  518. workOrderBaseModel.CustomerBaseModel.F_Kind = workOrderBaseModel.F_REPAIRMANID.ToString();
  519. }
  520. workOrderBaseModel.CustomerBaseModel.F_CustomerNature = workOrderBaseModel.F_WORKORDERFROM;
  521. //业务类型
  522. workOrderBaseModel.CustomerBaseModel.F_IndustryId = workOrderBaseModel.F_REPAIRLEVEL;
  523. workOrderBaseModel.CustomerBaseModel.F_Url = workOrderBaseModel.F_ADSLACCOUNT;
  524. //修改客户基础信息
  525. int cusid = cusBLL.EditCusInfoModel(workOrderBaseModel.CustomerBaseModel);
  526. if (cusid > 1)
  527. {
  528. workOrderBaseModel.F_CUSTOMERID = cusid;
  529. }
  530. }
  531. if (workOrderBaseModel.F_WORKORDERSTATEID > 0)
  532. {
  533. workOrderBaseModel.F_CODE= orderBLL.GetOrderNumber(workOrderBaseModel.F_REPAIRLEVEL.ToInt32());
  534. if (workOrderBaseModel.F_HOUSING == "表扬" || workOrderBaseModel.F_HOUSING == "咨询" || workOrderBaseModel.F_HOUSING == "挂失")
  535. {
  536. workOrderBaseModel.F_WORKORDERTYPEID = 3;
  537. if (workOrderBaseModel.HistoryOrderList != null && workOrderBaseModel.HistoryOrderList.Count > 0)
  538. {
  539. Dictionary<int, string> dict = new Dictionary<int, string>() { };
  540. for (int i = workOrderBaseModel.HistoryOrderList.Count - 1; i >= 0; i--)
  541. {
  542. T_Wo_WorkOrderHistory modelhis = workOrderBaseModel.HistoryOrderList[i];
  543. Model.T_Sys_Department model = new BLL.T_Sys_Department().GetModel(string.Format("F_DeptId=(select top 1 F_DeptId from T_Sys_UserAccount where F_UserId={0})", modelhis.F_OPTUSERID));
  544. if (model != null && model.F_DeptId > 0)
  545. {
  546. if (dict.ContainsKey(model.F_DeptId))
  547. {
  548. workOrderBaseModel.HistoryOrderList.Remove(workOrderBaseModel.HistoryOrderList[i]);
  549. continue;
  550. }
  551. modelhis.F_OPTBTNID = model.F_DeptId;
  552. modelhis.F_NEXTOWNERARRID = model.F_DeptName;
  553. dict.Add(model.F_DeptId, "1");
  554. }
  555. }
  556. }
  557. }
  558. else if (workOrderBaseModel.F_WORKORDERTYPEID == 3)
  559. {
  560. Model.T_Wo_WorkOrderHistory historyModel = new Model.T_Wo_WorkOrderHistory();
  561. historyModel.F_INSTANCEID = workOrderBaseModel.F_WORKORDERID;
  562. historyModel.F_OPTDATE = DateTime.Now;
  563. historyModel.ReplayTime = DateTime.Now;
  564. historyModel.F_WORKORDERSTATEID = 1;
  565. historyModel.F_StateName = "已处理";
  566. historyModel.NeedReplayTime = workOrderBaseModel.F_REQUESTSERVICETIME;
  567. historyModel.F_OPTUSERID = F_UserID;
  568. historyModel.F_OPTBTNID = F_DeptId;
  569. historyModel.F_UserName = F_UserName;
  570. historyModel.F_REMARK = workOrderBaseModel.F_RETURNVISITCONTENT;
  571. historyModel.F_NEXTOWNERARRID = "计划经营部";
  572. workOrderBaseModel.HistoryOrderList = new List<T_Wo_WorkOrderHistory>();
  573. workOrderBaseModel.HistoryOrderList.Add(historyModel);
  574. }
  575. else
  576. {
  577. if (workOrderBaseModel.HistoryOrderList != null && workOrderBaseModel.HistoryOrderList.Count > 0)
  578. {
  579. Dictionary<int, string> dict = new Dictionary<int, string>() { };
  580. for (int i= workOrderBaseModel.HistoryOrderList.Count-1; i>=0;i--)
  581. {
  582. T_Wo_WorkOrderHistory modelhis = workOrderBaseModel.HistoryOrderList[i];
  583. if (dict.ContainsKey(modelhis.F_OPTUSERID.ToInt32()))
  584. {
  585. workOrderBaseModel.HistoryOrderList.Remove(workOrderBaseModel.HistoryOrderList[i]);
  586. continue;
  587. }
  588. Model.T_Sys_Department model= new BLL.T_Sys_Department().GetModel(string.Format("F_DeptId=(select top 1 F_DeptId from T_Sys_UserAccount where F_UserId={0})", modelhis.F_OPTUSERID));
  589. if (model != null && model.F_DeptId > 0)
  590. {
  591. modelhis.F_OPTBTNID = model.F_DeptId;
  592. modelhis.F_NEXTOWNERARRID = model.F_DeptName;
  593. }
  594. dict.Add(modelhis.F_OPTUSERID.ToInt32(), "1");
  595. }
  596. }
  597. }
  598. return false;
  599. if (workOrderBaseModel.F_WORKORDERTYPEID == 1)
  600. {
  601. AddAction("t_wo_workorderbase", workOrderBaseModel.F_WORKORDERID.ToMyString(), "转单处理工单", workOrderBaseModel.F_CODE);
  602. }
  603. else
  604. {
  605. AddAction("t_wo_workorderbase", workOrderBaseModel.F_WORKORDERID.ToMyString(), "即时处理工单", workOrderBaseModel.F_CODE);
  606. }
  607. }
  608. else
  609. { workOrderBaseModel.F_CODE = ""; }
  610. if (workOrderBaseModel.F_WORKORDERID == 0&& workOrderBaseModel.F_REPAIRMANID == 4)
  611. {
  612. workOrderBaseModel.F_CREATEDATE = DateTime.Now;
  613. workOrderBaseModel.F_HASTENCOUNTS = 0;
  614. int workid = orderBLL.AddWbgd(workOrderBaseModel);
  615. if (workid==0)
  616. {
  617. return false;
  618. }
  619. workOrderBaseModel.F_WORKORDERID = workid;
  620. }
  621. return orderBLL.UpdateWorkOrderInfoModel(workOrderBaseModel);
  622. }
  623. /// <summary>
  624. /// 来电弹屏处理工单
  625. /// </summary>
  626. /// <param name="workOrderBaseModel"></param>
  627. /// <returns></returns>
  628. [AcceptVerbs(HttpVerbs.Post)]
  629. public bool workOrderAddDatanew(T_Wo_WorkOrderBase workOrderBaseModel)
  630. {
  631. bool bl = false;
  632. try
  633. {
  634. //工单来源
  635. workOrderBaseModel.F_REPAIRMANID = 4;
  636. workOrderBaseModel.F_WORKORDERFROM = "微博工单";
  637. string wbh = workOrderBaseModel.CustomerBaseModel.F_CustomerEName.Trim();
  638. if (!string.IsNullOrEmpty(wbh))
  639. {
  640. workOrderBaseModel.F_EMPCODE = wbh;
  641. workOrderBaseModel.CustomerBaseModel.F_PostCode = wbh;
  642. }
  643. //当前用户信息
  644. workOrderBaseModel.F_USERID = F_UserID;//id
  645. workOrderBaseModel.F_LINKMAN = F_UserCode;//工号
  646. workOrderBaseModel.F_REPAIRMANNAME = F_UserName;//姓名
  647. workOrderBaseModel.F_LINKMANTELEPHONE = workOrderBaseModel.CustomerBaseModel.F_Mobile;
  648. if (F_UserID > 0)
  649. {
  650. T_Sys_UserAccount usermodel = new T_Sys_UserAccount();
  651. usermodel = userBll.GetModel(F_UserID);
  652. workOrderBaseModel.F_REPAIRMANNAME = usermodel.F_UserName;//姓名
  653. }
  654. if (workOrderBaseModel.CustomerBaseModel != null)
  655. {
  656. //最近联络方式
  657. if (workOrderBaseModel.F_REPAIRMANID.ToString() == "4")
  658. { workOrderBaseModel.CustomerBaseModel.F_Kind = "3"; }
  659. else
  660. {
  661. workOrderBaseModel.CustomerBaseModel.F_Kind = workOrderBaseModel.F_REPAIRMANID.ToString();
  662. }
  663. workOrderBaseModel.CustomerBaseModel.F_CustomerNature = workOrderBaseModel.F_WORKORDERFROM;
  664. //业务类型
  665. workOrderBaseModel.CustomerBaseModel.F_IndustryId = workOrderBaseModel.F_REPAIRLEVEL;
  666. workOrderBaseModel.CustomerBaseModel.F_Url = workOrderBaseModel.F_ADSLACCOUNT;
  667. workOrderBaseModel.CustomerBaseModel.F_CustomerId = Convert.ToInt32(workOrderBaseModel.F_CUSTOMERID);
  668. ////客户等级
  669. workOrderBaseModel.CustomerBaseModel.F_ScaleResume = "1";
  670. workOrderBaseModel.CustomerBaseModel.F_CustomerClass = "一般客户";
  671. //保存工单基础信息
  672. //修改客户基础信息
  673. int cusid = cusBLL.EditCusInfoModel(workOrderBaseModel.CustomerBaseModel);
  674. if (cusid > 0)
  675. {
  676. workOrderBaseModel.F_CUSTOMERID = cusid;
  677. }
  678. }
  679. if (workOrderBaseModel.F_WORKORDERID == 0)
  680. {
  681. workOrderBaseModel.F_CREATEDATE = DateTime.Now;
  682. workOrderBaseModel.F_HASTENCOUNTS = 0;
  683. bl = orderBLL.AddWbgd(workOrderBaseModel)>0;
  684. }
  685. else
  686. {
  687. try
  688. {
  689. YTSoft.BaseCallCenter.Model.T_Wo_WorkOrderBase m = new YTSoft.BaseCallCenter.BLL.T_Wo_WorkOrderBase().GetModel(workOrderBaseModel.F_WORKORDERID);
  690. workOrderBaseModel.F_LINKMANTELEPHONE = m.F_LINKMANTELEPHONE;
  691. workOrderBaseModel.F_CUSTOMERTELEPHONE = m.F_CUSTOMERTELEPHONE;
  692. workOrderBaseModel.F_NUMBER = m.F_CODE;
  693. }
  694. catch
  695. { }
  696. if (workOrderBaseModel.F_SERVICETYPE == "待处理")
  697. {
  698. workOrderBaseModel.F_WORKORDERNAME = "手工工单";
  699. return orderBLL.UpdateWorkOrderInfoModel(workOrderBaseModel);
  700. }
  701. else
  702. {
  703. workOrderBaseModel.F_WORKORDERNAME = "手工工单";
  704. return orderBLL.UpdateWorkOrderInfoModel(workOrderBaseModel);
  705. }
  706. }
  707. }
  708. catch (Exception ex) { }
  709. return bl;
  710. }
  711. /// <summary>
  712. /// 初始化列表
  713. /// </summary>
  714. /// <returns></returns>
  715. public ActionResult CallRecordList()
  716. {
  717. WorkOrderMyModel model = new WorkOrderMyModel();
  718. return View(model);
  719. }
  720. /// <summary>
  721. /// 听取录音
  722. /// </summary>
  723. /// <returns></returns>
  724. public ActionResult VoicePlay(string type, string callid)
  725. {
  726. Models.VoicePlayModel model = new VoicePlayModel();
  727. model.playpath = type;
  728. model.downpath = callid;
  729. AddAction("VoicePlay", callid, "听录音", string.Format("听了callid={0}的录音", callid), "敏感信息");
  730. //model.newpath = "";
  731. //try
  732. //{
  733. // model.playpath = GetSrc(type, callid);
  734. // if (type == "0")
  735. // {
  736. // model.downpath = model.playpath.Replace("playbyappid", "downbyappid");
  737. // }
  738. // else
  739. // {
  740. // model.downpath = model.playpath.Replace("playvoicemail", "downvoicemail");
  741. // }
  742. // if (!string.IsNullOrEmpty(model.playpath))
  743. // {
  744. // StringBuilder returnStr = new StringBuilder();
  745. // string wxAddUrl = model.playpath;
  746. // string addWxResult = HttpHelper.HttpPost(wxAddUrl, null);
  747. // model.playpath = addWxResult;
  748. // }
  749. //}
  750. //catch
  751. //{ }
  752. return View(model);
  753. }
  754. public ActionResult VoicePlay1(string type, string callid)
  755. {
  756. VoicePlayModel voicePlayModel = new VoicePlayModel();
  757. voicePlayModel.playpath = "";
  758. voicePlayModel.downpath = "";
  759. try
  760. {
  761. voicePlayModel.playpath = this.GetSrc(type, callid);
  762. voicePlayModel.downpath = !(type == "0") ? voicePlayModel.playpath.Replace("playvoicemail", "downvoicemail") : voicePlayModel.playpath.Replace("playbyappid", "downbyappid");
  763. if (!string.IsNullOrEmpty(voicePlayModel.playpath))
  764. {
  765. StringBuilder stringBuilder = new StringBuilder();
  766. string str = HttpHelper.HttpPost(voicePlayModel.playpath, (object)null);
  767. voicePlayModel.playpath = str;
  768. }
  769. }
  770. catch
  771. {
  772. }
  773. AddAction("VoicePlay1", callid, "听录音", string.Format("听了callid={0}的录音", callid), "敏感信息");
  774. return (ActionResult)this.View((object)voicePlayModel);
  775. }
  776. public string GetSrc(string type, string callid)
  777. {
  778. string s = "";
  779. BLL.T_Sys_SystemConfig bll_T_Sys_SystemConfig = new BLL.T_Sys_SystemConfig();
  780. try
  781. {
  782. string valueByParamCode = bll_T_Sys_SystemConfig.GetParamValueByParamCode(!(type == "0") ? "PlayLeaveVoice" : "PlayPath");
  783. string str = callid;
  784. s = str.IndexOf(":") >= 0 ? str.Replace("D:", valueByParamCode) : valueByParamCode + str;
  785. s = HttpUtility.HtmlEncode(s);
  786. }
  787. catch
  788. {
  789. }
  790. return s;
  791. }
  792. //public string GetSrc(string type, string callid)
  793. //{
  794. // string res = "";
  795. // try
  796. // {
  797. // string para = "PlayPath";
  798. // if (type == "0")
  799. // {
  800. // para = "PlayPath";
  801. // }
  802. // else
  803. // {
  804. // para = "PlayLeaveVoice";
  805. // }
  806. // BLL.T_Sys_SystemConfig bll_T_Sys_SystemConfig = new BLL.T_Sys_SystemConfig();
  807. // string CTIserverIP = bll_T_Sys_SystemConfig.GetParamValueByParamCode(para);//CTIIP
  808. // string path = callid;
  809. // if (path.IndexOf(":") < 0)
  810. // {
  811. // res = CTIserverIP + path;
  812. // }
  813. // else
  814. // {
  815. // res = path.Replace("D:", CTIserverIP);
  816. // }
  817. // res = HttpUtility.HtmlEncode(res);
  818. // }
  819. // catch
  820. // {
  821. // }
  822. // return res;
  823. //}
  824. /// <summary>
  825. /// 留言管理
  826. /// </summary>
  827. /// <returns></returns>
  828. public ActionResult CallLeaveList()
  829. {
  830. string userid = "0";
  831. YTSoft.BaseCallCenter.Model.T_Sys_UserAccount p_LoginUser = new YTSoft.BaseCallCenter.Model.T_Sys_UserAccount();
  832. try
  833. {
  834. if (Request.Cookies["BaseCallCenter_T_User"] != null)
  835. {
  836. userid = Request.Cookies["BaseCallCenter_T_User"]["F_UserId"];
  837. }
  838. int u = Convert.ToInt32(userid);
  839. }
  840. catch
  841. { }
  842. if (userid != "0")
  843. {
  844. p_LoginUser = new BLL.T_Sys_UserAccount().GetModel(Convert.ToInt32(userid));
  845. if (p_LoginUser != null)
  846. {
  847. if (Request.Cookies["BaseCallCenter_T_User"] != null)
  848. {
  849. p_LoginUser.F_ExtensionNumber = Request.Cookies["BaseCallCenter_T_User"]["F_ExtensionNumber"];
  850. }
  851. }
  852. }
  853. else
  854. {
  855. Response.Redirect("/Default/Login");
  856. }
  857. return View(p_LoginUser);
  858. }
  859. /// <summary>
  860. /// 坐席监控
  861. /// </summary>
  862. /// <returns></returns>
  863. public ActionResult SeatMonitoringList()
  864. {
  865. return View();
  866. }
  867. /// <summary>
  868. /// 获取通话记录
  869. /// </summary>
  870. /// <param name="page">当前页码</param>
  871. /// <param name="limit">每页数据量</param>
  872. /// <param name="sqlWhere">查询条件</param>
  873. /// <returns></returns>
  874. [ActionName("CallRecordData")]
  875. [HttpGet]
  876. public string CallRecordData(DateTime? NowDateTime, int page, int limit, string callnumber, string usercode, string callType,
  877. string callStatus, string dateParty,
  878. int F_WORKORDERTYPEID=0,string F_CONTENT="", string F_HOUSING="", string callid="0",string sort="")
  879. {
  880. AddAction("T_Call_CallRecords", callid.ToMyString(), "获取通话记录列表", string.Format("获取{0}通话记录列表", dateParty), "敏感信息");
  881. //数据结果集
  882. ResponseData dataModel = new ResponseData();
  883. string sql = "";
  884. if (callid!="0"&&!string.IsNullOrEmpty(callid))
  885. {
  886. sql += string.Format(" and callid='{0}'", callid);
  887. }
  888. if (!string.IsNullOrEmpty(dateParty))
  889. {
  890. string startDate = dateParty.Substring(0, 10);
  891. string endDate = dateParty.Substring(12);
  892. sql += " and BeginTime>= '" + startDate + " 00:00:00" + "'";
  893. sql += " and BeginTime<= '" + endDate + " 23:59:59" + "'";
  894. }
  895. else
  896. {
  897. sql += " and BeginTime>= '" + DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00" + "'";
  898. sql += " and BeginTime<= '" + DateTime.Now.ToString("yyyy-MM-dd") + " 23:59:59" + "'";
  899. }
  900. if (!string.IsNullOrEmpty(callnumber))
  901. {
  902. sql += " and CallNumber like '%" + callnumber.Trim() + "%'";
  903. }
  904. if (!string.IsNullOrEmpty(usercode))
  905. {
  906. sql += " and UserCode like '%" + usercode.Trim() + "%'";
  907. }
  908. //呼叫类型,0呼入1呼出
  909. if (!string.IsNullOrEmpty(callType))
  910. {
  911. sql += " and CallType =" + callType;
  912. }
  913. //呼叫状态,0:未接通电话1已接通电话
  914. if (!string.IsNullOrEmpty(callStatus))
  915. {
  916. sql += " and CallState =" + callStatus;
  917. }
  918. //工单类型 F_HOUSING select F_WORKORDERTYPEID,F_CONTENT,F_HOUSING from T_Wo_WorkOrderBase where 1=1 and F_CONTENT like '%'++'%'
  919. if (F_WORKORDERTYPEID>0)
  920. {
  921. sql += " AND F_WorkOrderTypeId IS NOT null and F_WORKORDERTYPEID=" + F_WORKORDERTYPEID;
  922. } //工单内容 F_CONTENT
  923. if (!string.IsNullOrEmpty(F_CONTENT))
  924. {
  925. sql += string.Format(" AND F_WorkOrderTypeId IS NOT null and T2.F_CONTENT like '%{0}%'", F_CONTENT);
  926. }
  927. //工单类型
  928. if (!string.IsNullOrEmpty(F_HOUSING))
  929. {
  930. sql += string.Format(" AND F_WorkOrderTypeId IS NOT null and T2.F_HOUSING='{0}'", F_HOUSING);
  931. }
  932. //呼叫状态,0:未接通电话1已接通电话
  933. if (!string.IsNullOrEmpty(callStatus))
  934. {
  935. sql += " and CallState =" + callStatus;
  936. }
  937. DataTable dt = new DataTable();
  938. int recordCount = 0;
  939. //BLL.T_Call_CallRecords busCall_CallRecords = new BLL.T_Call_CallRecords();
  940. //busCall_CallRecords.GetListByPage();
  941. Model.PageData<Model.T_Call_CallRecords_All> pageModel = new Model.PageData<Model.T_Call_CallRecords_All>();
  942. dt = BLL.PagerBLL.GetTableList(
  943. " (T_Call_CallRecords T1 LEFT JOIN T_Wo_WorkOrderBase T2 ON T1.CallId=T2.F_KSHADDRESSCODE ) ",
  944. "CallRecordsId",
  945. "T1.*,F_WORKORDERID,F_HOUSING,CONVERT(varchar,BeginTime, 120 ) as BeginTimeNew,CONVERT(varchar,TalkStartTime, 120 ) as TalkStartTimeNew,CONVERT(varchar,TalkEndTime, 120 ) as TalkEndTimeNew"
  946. + @",(select top 1 F_ScaleResume from T_Cus_CustomerBase n where
  947. CallNumber=F_Telephone) as F_ScaleResume,
  948. replace(replace(FilePath,'\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "')" +
  949. @" as fileurl,case
  950. when BusinessType=1 then '咨询'
  951. when BusinessType=2 then '建议'
  952. when BusinessType=3 then '表扬'
  953. when BusinessType=4 then '挂失'
  954. when BusinessType=9 then '投诉'
  955. when T1.F_ServiceType=1 then '咨询'
  956. when T1.F_ServiceType = 2 then '投诉'
  957. when T1.F_ServiceType = 3 then '建议'
  958. when T1.F_ServiceType = 4 then '表扬'
  959. when T1.F_ServiceType = 5 then '挂失'
  960. else '' end as
  961. BType, case when (isnull(BusinessType,0)>0 or isnull(T1.F_ServiceType,0)>0) then '人工服务' else '' end as ywtype ",
  962. sql,
  963. // "ORDER BY LongTime,CallRecordsId desc",
  964. string.IsNullOrEmpty(sort) ? " BeginTime desc": sort + " desc"
  965. ,
  966. limit,
  967. page,
  968. out recordCount);
  969. dataModel.code = 0;
  970. dataModel.count = recordCount;
  971. dataModel.data = dt;
  972. string json = JsonConvert.SerializeObject(dataModel);
  973. return json;
  974. }
  975. /// <summary>
  976. /// 获取留言记录
  977. /// </summary>
  978. /// <param name="page">当前页码</param>
  979. /// <param name="limit">每页数据量</param>
  980. /// <param name="sqlWhere">查询条件</param>
  981. /// <returns></returns>
  982. [ActionName("LeaveRecordData")]
  983. [HttpGet]
  984. public string LeaveRecordData(DateTime? NowDateTime, int page, int limit, string callnumber, string leavedate, string status)
  985. {
  986. AddAction("T_Call_LeaveRecord", status, "获取通话记录列表", string.Format("获取{0}留言记录列表", leavedate), "敏感信息");
  987. //数据结果集
  988. ResponseData dataModel = new ResponseData();
  989. string sql = "";
  990. if (!string.IsNullOrEmpty(callnumber))
  991. {
  992. sql += " and F_Phone like '%" + callnumber.Trim() + "%'";
  993. }
  994. //if (!string.IsNullOrEmpty(leavedate))
  995. //{
  996. // sql += " and datediff(day,'" + leavedate + "',F_LeaveTime)=0 ";
  997. //}
  998. string startDate = "";
  999. string endDate = "";
  1000. if (!string.IsNullOrEmpty(leavedate))
  1001. {
  1002. startDate = leavedate.Substring(0, 10);
  1003. endDate = leavedate.Substring(12);
  1004. sql += " and F_LeaveTime>= '" + startDate + " 00:00:00" + "'";
  1005. sql += " and F_LeaveTime<= '" + endDate + " 23:59:59" + "'";
  1006. }
  1007. else {
  1008. startDate = DateTime.Now.AddYears(-1).ToString("yyyy-MM-dd");
  1009. endDate = DateTime.Now.ToString("yyyy-MM-dd");
  1010. sql += " and F_LeaveTime>= '" + startDate + " 00:00:00" + "'";
  1011. sql += " and F_LeaveTime<= '" + endDate + " 23:59:59" + "'";
  1012. }
  1013. if (!string.IsNullOrEmpty(status))
  1014. {
  1015. sql += " and F_Status=" + status + " ";
  1016. }
  1017. DataTable dt = new DataTable();
  1018. int recordCount = 0;
  1019. dt = BLL.PagerBLL.GetListPager(
  1020. "T_Call_LeaveRecord",
  1021. "F_Id",
  1022. "*,CONVERT(varchar,F_LeaveTime, 120 ) as F_LeaveTimeNew,CONVERT(varchar,F_DealTime, 120 ) as F_DealTimeNew"
  1023. + ",(select top 1 F_ScaleResume from T_Cus_CustomerBase n where F_Phone=F_Telephone) as F_ScaleResume ," +
  1024. @"replace(replace(F_RecFileUrl, '\','/'),'" + GetSysconfig("newFilePath") + "','" + GetSysconfig("newPlayPath") + "') as TheLuyin",
  1025. sql,
  1026. "ORDER BY F_Id desc",
  1027. limit,
  1028. page,
  1029. true,
  1030. out recordCount);
  1031. dataModel.code = 0;
  1032. dataModel.count = recordCount;
  1033. dataModel.data = dt;
  1034. string json = JsonConvert.SerializeObject(dataModel);
  1035. return json;
  1036. }
  1037. /// <summary>
  1038. /// 留言创建工单处理
  1039. /// </summary>
  1040. /// <param name="LeaveOptAjax"></param>
  1041. /// <returns></returns>
  1042. [ActionName("LeaveOptAjax")]
  1043. [HttpGet]
  1044. public string LeaveOptAjax(string optaction, string timeno, string callid, string userid, string usercode, string username, string extnumber, string callernum, string leaveid)
  1045. {
  1046. //&timeno=" + timeno+"&callid=" + callID + "&userid=" + userid + "&usercode=" + usercode
  1047. //+ "&username=" + username + "&extnumber" + extnumber + "&callernum=" + callerNum
  1048. string res = "error";
  1049. try
  1050. {
  1051. switch (optaction)
  1052. {
  1053. case "leaveAddOrderEvent":
  1054. //振铃事件
  1055. res = leaveAddOrderEvent(callid, userid, usercode, username, extnumber, callernum, leaveid);
  1056. break;
  1057. }
  1058. }
  1059. catch
  1060. { }
  1061. return res;
  1062. }
  1063. #region 来电归属地查询
  1064. public string GetPhoneLocation(string phoneNumber, bool isPhone)
  1065. {
  1066. string location = "未知";
  1067. try
  1068. {
  1069. //如果是手机号码
  1070. if (isPhone)
  1071. {
  1072. BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
  1073. Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phoneNumber.Substring(0, 7));
  1074. return mobileModel != null ? (mobileModel.F_CityDes + mobileModel.F_CardDes) : location;
  1075. }
  1076. else//如果是电话号码
  1077. {
  1078. BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
  1079. List<Model.T_Sys_TelTitleData> mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + phoneNumber.Substring(0, 4) + "'");
  1080. if (mobileModel == null || mobileModel.Count <= 0)
  1081. mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + phoneNumber.Substring(0, 3) + "'");
  1082. return mobileModel.Count > 0 ? mobileModel[0].F_TitleName : location;
  1083. }
  1084. }
  1085. catch (System.Exception ex)
  1086. {
  1087. return location;
  1088. }
  1089. }
  1090. #endregion
  1091. #region 自动添加工单
  1092. public bool SubmitOSubmit(string phone, string recordid, string callid, string locationaddress, string userid, string username, string usercode, out int workorderid)
  1093. {
  1094. bool bl = false;
  1095. workorderid = 0;
  1096. try
  1097. {
  1098. Model.T_Wo_WorkOrderBase model = new Model.T_Wo_WorkOrderBase();
  1099. #region 工单信息
  1100. //model.F_WORKORDERTYPEID = Convert.ToInt32(typeid);//类型ID
  1101. model.F_WORKORDERSTATEID = 0;//状态ID
  1102. model.F_REPAIRREQUEST = "未处理";
  1103. model.F_CODE = "";//工单编号
  1104. model.F_WORKORDERNAME = "";//工单名称
  1105. model.F_NUMBER = model.F_CODE;
  1106. //model.F_CUSTOMERNAME = txtCustomerName.Text.Trim();//客户姓名
  1107. model.F_CUSTOMERTELEPHONE = phone.Trim();//客户电话
  1108. model.F_USERID = Convert.ToInt32(userid);//坐席id
  1109. model.F_LINKMAN = usercode.Trim();//坐席工号
  1110. model.F_REPAIRMANNAME = username.Trim();//坐席名称
  1111. model.F_LINKMANTELEPHONE = phone.Trim();//联系人电话
  1112. //model.F_ADSLACCOUNT = hfCallId.Value.Trim();
  1113. model.F_BANDWIDTH = "";
  1114. model.F_STANDARDADDRESS = locationaddress.Trim();
  1115. //model.F_INSTALLADDRESS = F_INSTALLADDRESS;
  1116. model.F_KSHADDRESSCODE = callid;
  1117. model.F_RANGEID = Convert.ToInt32(recordid);
  1118. model.F_PROVINCE = "";
  1119. model.F_CITY = "";
  1120. model.F_AREA = "";
  1121. model.F_ROAD = "";
  1122. model.F_HOUSING = "";
  1123. model.F_REPAIRMANID = 2;
  1124. model.F_WORKORDERFROM = "留言工单";
  1125. //model.F_WORKORDERLEVELID = F_WORKORDERLEVELID;
  1126. model.F_FILEFLAG = 0;
  1127. model.F_CREATEBY = Convert.ToInt32(userid.Trim());
  1128. model.F_CREATEDATE = DateTime.Now;
  1129. model.F_RETURNVISITFLAG = 0;
  1130. model.F_RETURNVISITSTATE = 0;
  1131. model.F_RETURNVISITRESULT = 0;
  1132. model.F_RETURNVISITCONTENT = "";
  1133. model.F_DELETEFLAG = 0;
  1134. model.F_ALLUSETIMES = 0;
  1135. model.F_STARTTIME = DateTime.Now;
  1136. model.F_OVERTIMES = 0;
  1137. model.F_FORMID = 0;
  1138. model.F_HASTENCOUNTS = 0;
  1139. model.F_RANGEX = 0;
  1140. model.F_RANGEY = 0;
  1141. model.F_REPAIRCLOSEMANID = 0;
  1142. model.F_REPAIRCLOSEMANNAME = "";
  1143. model.F_REPAIRCLOSEREASONS = "";
  1144. model.F_REPAIRCLOSEREPTID = 0;
  1145. model.F_REPAIRCLOSEREPT = "";
  1146. #endregion
  1147. int resorderbase = new BLL.T_Wo_WorkOrderBase().Add(model);//添加基本信息
  1148. workorderid = resorderbase;
  1149. if (resorderbase > 0)
  1150. {
  1151. bl = true;
  1152. }
  1153. else
  1154. {
  1155. bl = false;
  1156. }
  1157. }
  1158. catch (Exception ex)
  1159. {
  1160. }
  1161. return bl;
  1162. }
  1163. #endregion
  1164. #region 处理留言创建工单事件
  1165. public string leaveAddOrderEvent(string callid, string userid, string usercode, string username, string extnumber, string callernum, string leaveid)
  1166. {
  1167. string res = "error";
  1168. try
  1169. {
  1170. AddAction("leaveAddOrderEvent", callid, "创建留言工单", string.Format("{0}创建callid={1}留言工单{2}", username, callid, leaveid), "关键信息");
  1171. Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
  1172. if (vmodel != null)
  1173. {
  1174. string phone = callernum;
  1175. #region 来电归属地查询
  1176. string location = "";
  1177. //来电归属地查询
  1178. if (phone.Trim().Length == 11 && phone.Substring(0, 1) != "0")
  1179. {
  1180. location = GetPhoneLocation(phone, true);
  1181. }
  1182. else
  1183. {
  1184. location = GetPhoneLocation(phone, false);
  1185. }
  1186. #endregion
  1187. #region 创建工单
  1188. int workorderid = 0;
  1189. bool wobl = SubmitOSubmit(phone, vmodel.CallRecordsId.ToString(), callid, location, userid, username, usercode, out workorderid);
  1190. if (wobl)
  1191. {
  1192. //处理留言
  1193. #region 处理留言
  1194. Model.T_Call_LeaveRecord leavemodel = new BLL.T_Call_LeaveRecord().GetModel(Convert.ToInt32(leaveid));
  1195. if (leavemodel != null)
  1196. {
  1197. //leavemodel.F_CallAppId = workorderid.ToString();
  1198. //leavemodel.F_Status = 1;
  1199. //leavemodel.F_UserId = Convert.ToInt32(userid);
  1200. //leavemodel.F_UserName = username;
  1201. //leavemodel.F_UserCode = usercode;
  1202. //leavemodel.F_DealTime = DateTime.Now;
  1203. //leavemodel.F_DealContent = "留言创建工单";
  1204. //new BLL.T_Call_LeaveRecord().Update(leavemodel);
  1205. string strSql = @"
  1206. update T_Call_LeaveRecord set
  1207. F_CallAppId = " + workorderid.ToString() + @",F_Status = 1,
  1208. F_UserId = " + Convert.ToInt32(userid) + @",F_UserName = '" + username + @"',F_UserCode = '" + usercode + @"',F_DealTime = '" + DateTime.Now + @"',
  1209. F_DealContent = '留言创建工单' where F_Id = " + leavemodel.F_Id;
  1210. int rows = DbHelperSQL.ExecuteSql(strSql);
  1211. }
  1212. #endregion
  1213. try
  1214. {
  1215. Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
  1216. modelorder.CallId = callid;
  1217. modelorder.F_WORKORDERID = workorderid;
  1218. modelorder.F_WORKORDERSTATEID = 0;
  1219. new BLL.T_Call_WorkOrder().Add(modelorder);
  1220. }
  1221. catch { }
  1222. res = workorderid.ToString();
  1223. }
  1224. #endregion
  1225. }
  1226. }
  1227. catch (Exception ex)
  1228. {
  1229. //res = ex.ToString();
  1230. }
  1231. return res;
  1232. }
  1233. #endregion
  1234. /// <summary>
  1235. /// 获取坐席监控坐席列表
  1236. /// </summary>
  1237. /// <returns></returns>
  1238. [ActionName("getseatnewlist")]
  1239. [HttpGet]
  1240. public string getseatnewlist()
  1241. {
  1242. string strHtml = "";
  1243. string strList = "";
  1244. DataTable dt = new DataTable();
  1245. try
  1246. {
  1247. AddAction("T_Sys_UserAccount", "0", "获取坐席监控列表", "", "关键信息");
  1248. BLL.T_Sys_UserAccount bll = new BLL.T_Sys_UserAccount();
  1249. dt = bll.GetList(" f_seatflag=1 order by f_userid desc ").Tables[0];
  1250. if (dt.Rows.Count > 0)
  1251. {
  1252. for (int i = 0; i < dt.Rows.Count; i++)
  1253. {
  1254. strList += dt.Rows[i]["F_WorkNumber"] + ",";// "-" + dt.Rows[i]["ExtensionCode"] + ",";
  1255. strHtml += "<div id=\"div_" + dt.Rows[i]["F_WorkNumber"] + "\" style='float: left; width: 120px; height: 120px; text-align: center; padding: 8px;cursor:pointer'>";
  1256. strHtml += "<div style='height: 90px; border: 1px solid #CCCCCC; padding: 3px; text-align: center;cursor:pointer'";
  1257. strHtml += "onmouseover=\"this.style.border='1px solid #3A8BDC'\" onmouseout=\"this.style.border='1px solid #CCCCCC'\">";
  1258. strHtml += "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100%\" style=\"text-align: center;cursor:pointer\" ";
  1259. strHtml += " onclick=\"GetOneState('" + dt.Rows[i]["F_WorkNumber"] + "','"+ dt.Rows[i]["ExtensionCode"] + "','" + dt.Rows[i]["F_UserName"] + "')\">";
  1260. strHtml += " <tr><td><input type=\"text\" id=\"" + dt.Rows[i]["F_WorkNumber"] + "\" style=\"display: none\" /><input type=\"text\" id=\"txtSeatState_" + dt.Rows[i]["F_WorkNumber"] + "\" value=\"0\" style=\"display: none\" />";
  1261. strHtml += " <span id=\"span_" + dt.Rows[i]["F_WorkNumber"] + "\" style=\"color: #000000;\">";
  1262. strHtml += dt.Rows[i]["F_WorkNumber"] + "(" + dt.Rows[i]["F_UserName"] + ")</span>";
  1263. strHtml += "</td></tr> <tr> <td><img id=\"img_" + dt.Rows[i]["F_WorkNumber"] + "\" src=\"/Content/images/seatimgs/weiqianru.jpg\" />";
  1264. strHtml += "</td></tr><tr><td><span id=\"span_state_" + dt.Rows[i]["F_WorkNumber"] + "\" style=\"color: #cccccc;\">未签入</span>";
  1265. strHtml += " </td></tr></table></div></div>";
  1266. }
  1267. }
  1268. strList += "!@#";
  1269. strList = strList.Replace(",!@#", "").Replace("!@#", "");
  1270. }
  1271. catch
  1272. {
  1273. }
  1274. finally
  1275. {
  1276. dt.Clear();
  1277. dt.Dispose();
  1278. }
  1279. return strList + "~" + strHtml;
  1280. }
  1281. //外呼判断本地外地以及加前缀返回
  1282. [ActionName("GetCallOutprefix")]
  1283. [HttpGet]
  1284. public string GetCallOutprefix(string phone) {
  1285. AddAction("T_Sys_UserAccount", phone, "外呼获取外呼前缀", phone);
  1286. string phone1 = CallCenter.Utility.RequestString.ToDBC(RequestString.RemoveNotNumber(StringHelper.NoHTML(phone)));
  1287. string tophone = phone1;
  1288. string zipcode = ""; string bfix = ""; string wfix = ""; string fix = "";
  1289. // string userseatgroupid = CurrentUser.UserData.F_SeartGroupID.ToString();
  1290. //if (userseatgroupid != "" && userseatgroupid != "0")
  1291. //{
  1292. //Model.T_Sys_SeatGroup smodel = new BLL.T_Sys_SeatGroup().GetModel(int.Parse(userseatgroupid));
  1293. //if (smodel != null)
  1294. //{
  1295. zipcode = "0371";
  1296. bfix ="9";
  1297. wfix = "90";
  1298. //}
  1299. //}
  1300. int zip = GetZipCodeByPhone(phone1, zipcode);
  1301. #region
  1302. if (zip == 1)
  1303. {//手机本地号码
  1304. fix = bfix;
  1305. }
  1306. else if (zip == 2)
  1307. {//手机外地号码
  1308. fix = wfix;
  1309. }
  1310. else
  1311. {
  1312. tophone = phone1.TrimStart('0');
  1313. if (zip == 3)
  1314. {//本地固话去0加9 比如:988888517,937188888517
  1315. fix = bfix;
  1316. }
  1317. else if (zip == 4)
  1318. {//外地固话前加9 比如:9037188888517
  1319. fix = wfix;
  1320. }
  1321. }
  1322. #endregion
  1323. var obj = new
  1324. {
  1325. phone = fix + tophone,
  1326. fix = fix
  1327. };
  1328. return fix;
  1329. // return Success("外呼号码加前缀" + phone, obj);
  1330. }
  1331. /// <summary>
  1332. /// 根据号码和区号判断号码是否为归属地号码
  1333. /// 返回0为分机号或特殊号码
  1334. /// 返回1为手机本地号码
  1335. /// 返回2为手机外地号码
  1336. /// 返回3为固定电话本地号码
  1337. /// 返回4为固定电话外地号码
  1338. /// </summary>
  1339. /// <param name="phone"></param>
  1340. /// <param name="zipcode"></param>
  1341. /// <returns></returns>
  1342. [NonAction]
  1343. public int GetZipCodeByPhone(string phone, string zipcode)
  1344. {
  1345. int n = 0;
  1346. if (phone.Trim().Length >= 7)
  1347. {
  1348. //7位及7位以上是固定电话或手机
  1349. //判断是否手机
  1350. if (phone.Trim().Length == 11 && phone[0] == '1')
  1351. {//号码为11位,首位是1,为手机号
  1352. BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
  1353. Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModelList("F_MobileNum='" + phone.Substring(0, 7) + "'").FirstOrDefault();
  1354. if (mobileModel != null)
  1355. {
  1356. if (mobileModel.F_ZipCode.Equals(zipcode))
  1357. {
  1358. return 1;
  1359. }
  1360. else
  1361. {
  1362. return 2;
  1363. }
  1364. }
  1365. }
  1366. else
  1367. {
  1368. if (phone.Trim().Length == 11 && phone.Substring(0, 3).Equals(zipcode))
  1369. {//号码为11位
  1370. //截取前三位区号判断是否本地
  1371. bool resbd3 = phone.Substring(0, 3).Equals(zipcode);
  1372. //截取前四位区号判断是否本地
  1373. bool resbd4 = phone.Substring(0, 4).Equals(zipcode);
  1374. if (resbd3 || resbd4)
  1375. {
  1376. return 3;
  1377. }
  1378. else
  1379. {
  1380. return 4;
  1381. }
  1382. }
  1383. else if (phone.Trim().Length < 11)
  1384. {//号码小于11位,为本地
  1385. return 3;
  1386. }
  1387. else if (phone.Trim().Length > 11 && phone.Substring(0, 4).Equals(zipcode))
  1388. {//号码大于11位,截取前四位区号判断是否本地
  1389. return 3;
  1390. }
  1391. else
  1392. {
  1393. return 4;
  1394. }
  1395. }
  1396. }
  1397. return n;
  1398. }
  1399. /// <summary>
  1400. /// 获取来电业务类型
  1401. /// </summary>
  1402. /// <param name="CallId">通话记录Callid </param>
  1403. /// <returns></returns>
  1404. [ActionName("GetCallType")]
  1405. [HttpGet]
  1406. public string GetCallType(string CallId)
  1407. {
  1408. //数据结果集
  1409. ResponseData dataModel = new ResponseData();
  1410. //来电业务类型
  1411. string sql = " select F_ServiceType from T_Call_CallRecords where CallId='" + CallId + "' order by BeginTime desc ";
  1412. //排队数量
  1413. // string sql2 = " select COUNT(CallId) as CallId from T_Call_CallRecords where F_linenum=1 ";
  1414. DataTable dt = new DataTable();
  1415. DataSet ds = DbHelperSQL.Query(sql);
  1416. dt = ds.Tables[0];
  1417. //来电业务类型
  1418. dataModel.code = Convert.ToInt32(dt.Rows[0]["F_ServiceType"].ToString() == "" ? "0" : dt.Rows[0]["F_ServiceType"].ToString());
  1419. //DataTable dt2 = new DataTable();
  1420. //DataSet ds2 = DbHelperSQL.Query(sql2);
  1421. //dt2 = ds2.Tables[0];
  1422. ////排队数量
  1423. //dataModel.msg = dt2.Rows[0]["CallId"].ToString() == "" ? "0" : dt2.Rows[0]["CallId"].ToString();
  1424. // dataModel.count = recordCount;
  1425. // dataModel.data = dt;
  1426. string json = JsonConvert.SerializeObject(dataModel);
  1427. return json;
  1428. }
  1429. /// <summary>
  1430. /// 获取排队数量
  1431. /// </summary>
  1432. /// <param name="CallId">通话记录Callid </param>
  1433. /// <returns></returns>
  1434. [ActionName("GetCallLineNum")]
  1435. [HttpGet]
  1436. public string GetCallLineNum()
  1437. {
  1438. //数据结果集
  1439. ResponseData dataModel = new ResponseData();
  1440. //排队数量
  1441. string sql2 = " select COUNT(CallId) as CallId from T_Call_CallRecords where F_linenum=1 and isnull(TalkStartTime,0)=0 ";
  1442. DataTable dt2 = new DataTable();
  1443. DataSet ds2 = DbHelperSQL.Query(sql2);
  1444. dt2 = ds2.Tables[0];
  1445. //排队数量
  1446. dataModel.code = Convert.ToInt32(dt2.Rows[0]["CallId"].ToString() == "" ? "0" : dt2.Rows[0]["CallId"].ToString());
  1447. // dataModel.count = recordCount;
  1448. // dataModel.data = dt;
  1449. string json = JsonConvert.SerializeObject(dataModel);
  1450. // return json;
  1451. return dataModel.code.ToString();
  1452. }
  1453. }
  1454. }