地铁二期项目正式开始

OCXOptController.cs 29KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using System.Data;
  7. namespace YTSoft.BaseCallCenter.MVCWeb.Controllers
  8. {
  9. public class OCXOptController : Controller
  10. {
  11. //
  12. // GET: /OCXOpt/
  13. public ActionResult OCXOptAjax()
  14. {
  15. return View();
  16. }
  17. /// <summary>
  18. /// 通话处理
  19. /// </summary>
  20. /// <param name="OCXOptCallAjax"></param>
  21. /// <returns></returns>
  22. [ActionName("OCXOptCallAjax")]
  23. [HttpGet]
  24. public string OCXOptCallAjax(string optaction,string timeno,string callid,string userid,string usercode,string username,string extnumber,string callernum,string path)
  25. {
  26. //&timeno=" + timeno+"&callid=" + callID + "&userid=" + userid + "&usercode=" + usercode
  27. //+ "&username=" + username + "&extnumber" + extnumber + "&callernum=" + callerNum
  28. string res = "error";
  29. try
  30. {
  31. switch (optaction)
  32. {
  33. case "gethflist":
  34. //res=LoadHFList(context)
  35. break;
  36. case "getlist":
  37. //res=LoadList(context));
  38. break;
  39. case "getcallinlist":
  40. //来电弹屏通话记录
  41. //res=LoadCallInList(context));
  42. break;
  43. case "getgdlist":
  44. //
  45. //res=LoadGDList(context));
  46. break;
  47. case "deletelist":
  48. //res=Delete(context));
  49. break;
  50. case "clear":
  51. break;
  52. case "insertCallLogs":
  53. res = InsertCallLogs();
  54. break;
  55. case "getCallIdByPhone":
  56. //根据来电号码获取
  57. res = getCallIdByPhone(callernum);
  58. break;
  59. case "zhenlingEvent":
  60. //振铃事件
  61. res=zhenlingEvent(callid, userid, usercode, username, extnumber, callernum);
  62. break;
  63. case "zhaijiEvent":
  64. //摘机事件
  65. res=zhaijiEvent(callid);
  66. break;
  67. case "guajiEvent":
  68. //挂机事件
  69. res=guajiEvent(callid);
  70. break;
  71. case "luyinEvent":
  72. //录音开始事件
  73. res=luyinEvent(callid,path);
  74. break;
  75. case "callout":
  76. //外呼
  77. res = callout(callernum, userid, usercode, username, extnumber, callid);
  78. break;
  79. case "callouthf":
  80. //外呼回访
  81. res=callouthf(callernum, userid, usercode, username, extnumber, callid);
  82. break;
  83. }
  84. }
  85. catch
  86. { }
  87. return res;
  88. }
  89. #region 外呼回访
  90. public string callouthf(string phone, string userid, string usercode, string username, string extnumber, string hfid)
  91. {
  92. string res = "1||" + DateTime.Now.ToString("yyyyMMddHHmmssms");
  93. try
  94. {
  95. //处理判断本地或外地 zhgjie
  96. try
  97. {
  98. if (phone.Trim() != "")
  99. {
  100. //判断号码前是否存在0
  101. if (phone.Trim().Substring(0, 1) != "0")
  102. {
  103. //判断是否手机
  104. if (phone.Trim().Length > 10)
  105. {
  106. BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
  107. Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phone.Substring(0, 7));
  108. if (mobileModel != null)
  109. {
  110. if (mobileModel.F_ZipCode != "0371")
  111. {
  112. phone = "0" + phone;
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }
  119. catch
  120. { }
  121. Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
  122. model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms");
  123. model.CallNumber = phone;
  124. model.CallType = 1;
  125. if (!string.IsNullOrEmpty(userid))
  126. {
  127. model.UserId = Convert.ToInt32(userid);
  128. }
  129. if (!string.IsNullOrEmpty(usercode))
  130. {
  131. model.UserCode = usercode.Trim();
  132. }
  133. if (!string.IsNullOrEmpty(username))
  134. {
  135. model.UserName = HttpUtility.UrlDecode(username.Trim());
  136. //model.UserName=context.Request.Form["txtAgentName"]
  137. }
  138. if (!string.IsNullOrEmpty(extnumber))
  139. {
  140. model.ExtNumber = extnumber.Trim();
  141. //model.UserName=context.Request.Form["txtAgentName"]
  142. }
  143. model.CallState = 0;
  144. model.DealType = 7;
  145. model.IsDeal = 1;
  146. model.OperateType = 7;//回访
  147. model.OperateObject = "";
  148. model.OperateTime = DateTime.Now;
  149. try
  150. {
  151. if (hfid != "")
  152. {
  153. model.OperateObject = hfid;
  154. }
  155. }
  156. catch
  157. {
  158. }
  159. string cid = model.CallId;
  160. new BLL.T_Call_CallRecords().Add(model);
  161. try
  162. {
  163. //更新回访状态
  164. new BLL.T_Call_TaskTelNum().UpdateHC(Convert.ToInt32(hfid), 1);
  165. new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(hfid), 0);
  166. //string workorderid = CommonRequest.GetQueryString("workorderid");
  167. //if (workorderid != "")
  168. //{
  169. // Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
  170. // modelorder.CallId = model.CallId;
  171. // modelorder.F_WORKORDERID = Convert.ToInt32(workorderid);
  172. // modelorder.F_WORKORDERSTATEID = 6;
  173. // new BLL.T_Call_WorkOrder().Add(modelorder);
  174. //}
  175. }
  176. catch { }
  177. if (phone.Length > 5)
  178. {
  179. res = "2|" + phone + "|" + cid;
  180. }
  181. else
  182. {
  183. res = "1|" + phone + "|" + cid;
  184. }
  185. }
  186. catch { }
  187. return res;
  188. }
  189. #endregion
  190. #region 话机外呼
  191. public string callout(string phone,string userid,string usercode,string username,string extnumber,string workorderid)
  192. {
  193. string res = "1||" + DateTime.Now.ToString("yyyyMMddHHmmssms");
  194. try
  195. {
  196. //处理判断本地或外地 zhgjie
  197. try
  198. {
  199. if (phone.Trim() != "")
  200. {
  201. //判断号码前是否存在0
  202. if (phone.Trim().Substring(0, 1) != "0")
  203. {
  204. //判断是否手机
  205. if (phone.Trim().Length > 10)
  206. {
  207. BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
  208. Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phone.Substring(0, 7));
  209. if (mobileModel != null)
  210. {
  211. if (mobileModel.F_ZipCode != "0371")
  212. {
  213. phone = "0" + phone;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. }
  220. catch
  221. { }
  222. Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
  223. model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms");
  224. model.CallNumber = phone;
  225. model.CallType = 1;
  226. if (!string.IsNullOrEmpty(userid))
  227. {
  228. model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms") + userid;
  229. model.UserId = Convert.ToInt32(userid);
  230. }
  231. if (!string.IsNullOrEmpty(usercode))
  232. {
  233. model.UserCode = usercode.Trim();
  234. }
  235. if (!string.IsNullOrEmpty(username))
  236. {
  237. model.UserName = HttpUtility.UrlDecode(username.Trim());
  238. }
  239. if (!string.IsNullOrEmpty(extnumber))
  240. {
  241. model.ExtNumber = extnumber.Trim();
  242. //model.UserName=context.Request.Form["txtAgentName"]
  243. }
  244. model.CallState = 0;
  245. model.DealType = 6;
  246. model.IsDeal = 1;
  247. string cid = model.CallId;
  248. new BLL.T_Call_CallRecords().Add(model);
  249. try
  250. {
  251. if (workorderid != null)
  252. {
  253. if (workorderid != "")
  254. {
  255. Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
  256. modelorder.CallId = model.CallId;
  257. modelorder.F_WORKORDERID = Convert.ToInt32(workorderid);
  258. modelorder.F_WORKORDERSTATEID = 6;
  259. new BLL.T_Call_WorkOrder().Add(modelorder);
  260. }
  261. }
  262. }
  263. catch { }
  264. if (phone.Length > 5)
  265. {
  266. res = "2|" + phone + "|" + cid;
  267. }
  268. else
  269. {
  270. res = "1|" + phone + "|" + cid;
  271. }
  272. }
  273. catch { }
  274. return res;
  275. }
  276. #endregion
  277. #region 电话操作日志
  278. public string InsertCallLogs()
  279. {
  280. string res = "error";
  281. return res;
  282. }
  283. #endregion
  284. #region 根据来电号码获取callid
  285. public string getCallIdByPhone(string telphone)
  286. {
  287. string res = "";
  288. try
  289. {
  290. Model.T_Call_CallRecords model = new BLL.T_Call_CallRecords().GetModelByTelphone(telphone);
  291. if (model != null)
  292. {
  293. res = model.CallId.Trim();
  294. }
  295. }
  296. catch (Exception ex)
  297. {
  298. res = "";
  299. }
  300. return res;
  301. }
  302. #endregion
  303. #region 来电归属地查询
  304. public string GetPhoneLocation(string phoneNumber, bool isPhone)
  305. {
  306. string location = "未知";
  307. try
  308. {
  309. //如果是手机号码
  310. if (isPhone)
  311. {
  312. BLL.T_Sys_MobileData mobile_Bll = new BLL.T_Sys_MobileData();
  313. Model.T_Sys_MobileData mobileModel = mobile_Bll.GetModel(phoneNumber.Substring(0, 7));
  314. return mobileModel != null ? (mobileModel.F_CityDes + mobileModel.F_CardDes) : location;
  315. }
  316. else//如果是电话号码
  317. {
  318. BLL.T_Sys_TelTitleData numbBll = new BLL.T_Sys_TelTitleData();
  319. List<Model.T_Sys_TelTitleData> mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + phoneNumber.Substring(0, 4) + "'");
  320. if (mobileModel == null || mobileModel.Count <= 0)
  321. mobileModel = numbBll.GetModelList(" 1=1 and F_KeyPhoneNum='" + phoneNumber.Substring(0, 3) + "'");
  322. return mobileModel.Count > 0 ? mobileModel[0].F_TitleName : location;
  323. }
  324. }
  325. catch (System.Exception ex)
  326. {
  327. return location;
  328. }
  329. }
  330. #endregion
  331. #region 自动添加工单
  332. public bool SubmitOSubmit(string phone,string recordid,string callid,string locationaddress,string userid,string username,string usercode, out int workorderid)
  333. {
  334. bool bl = false;
  335. workorderid = 0;
  336. try
  337. {
  338. Model.T_Wo_WorkOrderBase model = new Model.T_Wo_WorkOrderBase();
  339. List<Model.T_Wo_WorkOrderBase> modellist = new BLL.T_Wo_WorkOrderBase().GetModelList(" F_RANGEID="+ recordid);
  340. if (modellist != null && modellist.Count > 0)
  341. {
  342. model = modellist[0];
  343. #region 工单信息
  344. if (string.IsNullOrEmpty(model.F_LINKMAN))
  345. {
  346. //model.F_WORKORDERTYPEID = Convert.ToInt32(typeid);//类型ID
  347. model.F_WORKORDERSTATEID = 0;//状态ID
  348. model.F_REPAIRREQUEST = "未处理";
  349. model.F_CODE = "";//工单编号
  350. model.F_WORKORDERNAME = "";//工单名称
  351. model.F_NUMBER = model.F_CODE;
  352. //model.F_CUSTOMERNAME = txtCustomerName.Text.Trim();//客户姓名
  353. model.F_CUSTOMERTELEPHONE = phone.Trim();//客户电话
  354. model.F_USERID = Convert.ToInt32(userid);//坐席id
  355. model.F_LINKMAN = usercode.Trim();//坐席工号
  356. model.F_REPAIRMANNAME = username.Trim();//坐席名称
  357. model.F_LINKMANTELEPHONE = phone.Trim();//联系人电话
  358. //model.F_ADSLACCOUNT = hfCallId.Value.Trim();
  359. model.F_BANDWIDTH = "";
  360. model.F_STANDARDADDRESS = locationaddress.Trim();
  361. //model.F_INSTALLADDRESS = F_INSTALLADDRESS;
  362. model.F_KSHADDRESSCODE = callid;
  363. model.F_RANGEID = Convert.ToInt32(recordid);
  364. model.F_PROVINCE = "";
  365. model.F_CITY = "";
  366. model.F_AREA = "";
  367. model.F_ROAD = "";
  368. model.F_HOUSING = "";
  369. model.F_REPAIRMANID = 1;
  370. model.F_WORKORDERFROM = "语音工单";
  371. //model.F_WORKORDERLEVELID = F_WORKORDERLEVELID;
  372. model.F_FILEFLAG = 0;
  373. model.F_CREATEBY = Convert.ToInt32(userid.Trim());
  374. model.F_CREATEDATE = DateTime.Now;
  375. model.F_RETURNVISITFLAG = 0;
  376. model.F_RETURNVISITSTATE = 0;
  377. model.F_RETURNVISITRESULT = 0;
  378. model.F_RETURNVISITCONTENT = "";
  379. model.F_DELETEFLAG = 0;
  380. model.F_ALLUSETIMES = 0;
  381. model.F_STARTTIME = DateTime.Now;
  382. model.F_OVERTIMES = 0;
  383. model.F_FORMID = 0;
  384. model.F_HASTENCOUNTS = 0;
  385. model.F_RANGEX = 0;
  386. model.F_RANGEY = 0;
  387. model.F_REPAIRCLOSEMANID = 0;
  388. model.F_REPAIRCLOSEMANNAME = "";
  389. model.F_REPAIRCLOSEREASONS = "";
  390. model.F_REPAIRCLOSEREPTID = 0;
  391. model.F_REPAIRCLOSEREPT = "";
  392. new BLL.T_Wo_WorkOrderBase().Update(model);
  393. }
  394. workorderid = model.F_WORKORDERID;
  395. #endregion
  396. }
  397. else {
  398. #region 工单信息
  399. //model.F_WORKORDERTYPEID = Convert.ToInt32(typeid);//类型ID
  400. model.F_WORKORDERSTATEID = 0;//状态ID
  401. model.F_REPAIRREQUEST = "未处理";
  402. model.F_CODE = "";//工单编号
  403. model.F_WORKORDERNAME = "";//工单名称
  404. model.F_NUMBER = model.F_CODE;
  405. //model.F_CUSTOMERNAME = txtCustomerName.Text.Trim();//客户姓名
  406. model.F_CUSTOMERTELEPHONE = phone.Trim();//客户电话
  407. model.F_USERID = Convert.ToInt32(userid);//坐席id
  408. model.F_LINKMAN = usercode.Trim();//坐席工号
  409. model.F_REPAIRMANNAME = username.Trim();//坐席名称
  410. model.F_LINKMANTELEPHONE = phone.Trim();//联系人电话
  411. //model.F_ADSLACCOUNT = hfCallId.Value.Trim();
  412. model.F_BANDWIDTH = "";
  413. model.F_STANDARDADDRESS = locationaddress.Trim();
  414. //model.F_INSTALLADDRESS = F_INSTALLADDRESS;
  415. model.F_KSHADDRESSCODE = callid;
  416. model.F_RANGEID = Convert.ToInt32(recordid);
  417. model.F_PROVINCE = "";
  418. model.F_CITY = "";
  419. model.F_AREA = "";
  420. model.F_ROAD = "";
  421. model.F_HOUSING = "";
  422. model.F_REPAIRMANID = 1;
  423. model.F_WORKORDERFROM = "语音工单";
  424. //model.F_WORKORDERLEVELID = F_WORKORDERLEVELID;
  425. model.F_FILEFLAG = 0;
  426. model.F_CREATEBY = Convert.ToInt32(userid.Trim());
  427. model.F_CREATEDATE = DateTime.Now;
  428. model.F_RETURNVISITFLAG = 0;
  429. model.F_RETURNVISITSTATE = 0;
  430. model.F_RETURNVISITRESULT = 0;
  431. model.F_RETURNVISITCONTENT = "";
  432. model.F_DELETEFLAG = 0;
  433. model.F_ALLUSETIMES = 0;
  434. model.F_STARTTIME = DateTime.Now;
  435. model.F_OVERTIMES = 0;
  436. model.F_FORMID = 0;
  437. model.F_HASTENCOUNTS = 0;
  438. model.F_RANGEX = 0;
  439. model.F_RANGEY = 0;
  440. model.F_REPAIRCLOSEMANID = 0;
  441. model.F_REPAIRCLOSEMANNAME = "";
  442. model.F_REPAIRCLOSEREASONS = "";
  443. model.F_REPAIRCLOSEREPTID = 0;
  444. model.F_REPAIRCLOSEREPT = "";
  445. #endregion
  446. workorderid = new BLL.T_Wo_WorkOrderBase().Add(model);//添加基本信息
  447. }
  448. if (workorderid > 0)
  449. {
  450. bl = true;
  451. }
  452. else
  453. {
  454. bl = false;
  455. }
  456. }
  457. catch (Exception ex)
  458. {
  459. }
  460. return bl;
  461. }
  462. #endregion
  463. #region 处理振铃事件
  464. public string zhenlingEvent(string callid, string userid, string usercode, string username, string extnumber, string callernum)
  465. {
  466. string res = "error";
  467. try
  468. {
  469. Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
  470. if (vmodel != null)
  471. {
  472. #region 存在通话记录
  473. Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
  474. model.CallId = callid;
  475. if (!string.IsNullOrEmpty(userid))
  476. {
  477. model.UserId = Convert.ToInt32(userid);
  478. }
  479. if (!string.IsNullOrEmpty(usercode))
  480. {
  481. model.UserCode = usercode.Trim();
  482. }
  483. if (!string.IsNullOrEmpty(username))
  484. {
  485. model.UserName = HttpUtility.UrlDecode(username.Trim());
  486. //model.UserName=context.Request.Form["txtAgentName"]
  487. }
  488. if (!string.IsNullOrEmpty(extnumber))
  489. {
  490. model.ExtNumber = extnumber.Trim();
  491. //model.UserName=context.Request.Form["txtAgentName"]
  492. }
  493. model.DealType = 5;
  494. bool bl = new BLL.T_Call_CallRecords().UpdateCallInRingTelRecord(model);
  495. if (bl)
  496. {
  497. string phone = callernum;
  498. #region 来电归属地查询
  499. string location = "";
  500. //来电归属地查询
  501. if (phone.Trim().Length == 11 && phone.Substring(0, 1) != "0")
  502. {
  503. location = GetPhoneLocation(phone, true);
  504. }
  505. else
  506. {
  507. location = GetPhoneLocation(phone, false);
  508. }
  509. #endregion
  510. #region 创建工单
  511. int workorderid = 0;
  512. bool wobl = SubmitOSubmit(phone, vmodel.CallRecordsId.ToString(), callid, location, userid, username, usercode, out workorderid);
  513. if (wobl)
  514. {
  515. try
  516. {
  517. Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
  518. modelorder.CallId = callid;
  519. modelorder.F_WORKORDERID = workorderid;
  520. modelorder.F_WORKORDERSTATEID = 0;
  521. new BLL.T_Call_WorkOrder().Add(modelorder);
  522. }
  523. catch { }
  524. res = workorderid.ToString();
  525. }
  526. #endregion
  527. }
  528. #endregion
  529. }
  530. else
  531. {
  532. Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
  533. model.CallId = callid;
  534. model.CallNumber = callernum.Trim();
  535. model.CallType = 0;
  536. if (!string.IsNullOrEmpty(userid))
  537. {
  538. //model.CallId = DateTime.Now.ToString("yyyyMMddHHmmssms") + CommonRequest.GetQueryString("userid");
  539. model.UserId = Convert.ToInt32(userid);
  540. }
  541. if (!string.IsNullOrEmpty(usercode))
  542. {
  543. model.UserCode = usercode.Trim();
  544. }
  545. if (!string.IsNullOrEmpty(username))
  546. {
  547. model.UserName = HttpUtility.UrlDecode(username.Trim());
  548. //model.UserName=context.Request.Form["txtAgentName"]
  549. }
  550. if (!string.IsNullOrEmpty(extnumber))
  551. {
  552. model.ExtNumber = extnumber.Trim();
  553. //model.UserName=context.Request.Form["txtAgentName"]
  554. }
  555. model.CallState = 0;
  556. model.DealType = 6;
  557. model.IsDeal = 1;
  558. string cid = model.CallId;
  559. int b = new BLL.T_Call_CallRecords().Add(model);
  560. if (b > 0)
  561. {
  562. string phone = callernum;
  563. #region 来电归属地查询
  564. string location = "";
  565. //来电归属地查询
  566. if (phone.Trim().Length == 11 && phone.Substring(0, 1) != "0")
  567. {
  568. location = GetPhoneLocation(phone, true);
  569. }
  570. else
  571. {
  572. location = GetPhoneLocation(phone, false);
  573. }
  574. #endregion
  575. #region 创建工单
  576. int workorderid = 0;
  577. bool wobl = SubmitOSubmit(phone, b.ToString(), callid, location, userid, username, usercode, out workorderid);
  578. if (wobl)
  579. {
  580. try
  581. {
  582. Model.T_Call_WorkOrder modelorder = new Model.T_Call_WorkOrder();
  583. modelorder.CallId = callid;
  584. modelorder.F_WORKORDERID = workorderid;
  585. modelorder.F_WORKORDERSTATEID = 0;
  586. new BLL.T_Call_WorkOrder().Add(modelorder);
  587. }
  588. catch { }
  589. res = workorderid.ToString();
  590. }
  591. #endregion
  592. }
  593. }
  594. }
  595. catch (Exception ex)
  596. {
  597. //res = ex.ToString();
  598. }
  599. return res;
  600. }
  601. #endregion
  602. #region 处理摘机事件
  603. public string zhaijiEvent(string callid)
  604. {
  605. string res = "error";
  606. try
  607. {
  608. Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
  609. model.CallId = callid;
  610. model.CallState = 1;
  611. model.DealType = 6;
  612. bool bl = new BLL.T_Call_CallRecords().UpdateCallInAnswerTelRecord(model);
  613. if (bl)
  614. {
  615. res = "success";
  616. //更新回访状态
  617. #region
  618. /*
  619. try
  620. {
  621. Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
  622. string type = vmodel.OperateType.ToString();
  623. if (type == "7")
  624. {
  625. new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
  626. }
  627. }
  628. catch
  629. {
  630. }
  631. */
  632. #endregion
  633. }
  634. }
  635. catch (Exception ex)
  636. {
  637. res = ex.ToString();
  638. }
  639. return res;
  640. }
  641. #endregion
  642. #region 处理挂机事件
  643. public string guajiEvent(string callid)
  644. {
  645. string res = "error";
  646. try
  647. {
  648. bool bl = new BLL.T_Call_CallRecords().UpdateCallInHookTelRecord(callid);
  649. if (bl)
  650. {
  651. res = "success";
  652. }
  653. }
  654. catch (Exception ex)
  655. {
  656. res = ex.ToString();
  657. }
  658. return res;
  659. }
  660. #endregion
  661. #region 处理录音开始事件
  662. public string luyinEvent(string callid,string path)
  663. {
  664. string res = "error";
  665. try
  666. {
  667. Model.T_Call_CallRecords model = new Model.T_Call_CallRecords();
  668. model.CallId = callid;
  669. model.CallState = 1;
  670. model.DealType = 6;
  671. model.FilePath = path;
  672. bool bl = new BLL.T_Call_CallRecords().UpdateCallInPathTelRecord(model);
  673. if (bl)
  674. {
  675. res = "success";
  676. //更新回访状态
  677. try
  678. {
  679. Model.T_Call_CallRecords vmodel = new BLL.T_Call_CallRecords().GetModelByCallId(callid);
  680. string type = vmodel.OperateType.ToString();
  681. if (type == "7")
  682. {
  683. new BLL.T_Call_TaskTelNum().UpdateYJ(Convert.ToInt32(vmodel.OperateObject.ToString()), 1);
  684. }
  685. }
  686. catch
  687. {
  688. }
  689. }
  690. }
  691. catch (Exception ex)
  692. {
  693. res = ex.ToString();
  694. }
  695. return res;
  696. }
  697. #endregion
  698. }
  699. }