PingAnYeXianSZCG_API 接口代码

VisithfOptController.cs 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. using CallCenterApi.Interface.Controllers.Base;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. using System.Web.Mvc;
  7. namespace CallCenterApi.Interface.Controllers.visit
  8. {
  9. public class VisithfOptController : BaseController
  10. {
  11. public ActionResult AddInfo(string id, string phone, string resid, string hfjg, string hfinfo,
  12. string visis, string bzscore, string jcyscore, string hjscore, string ztscore, string score, string remark, string qid)
  13. {
  14. ActionResult res = NoToken("未知错误,请重新登录");
  15. if (Request.IsAuthenticated)
  16. {
  17. string uid = CurrentUser.UserData.F_UserId.ToString();
  18. string uname = CurrentUser.UserData.F_UserName;
  19. string resname = "";
  20. if (resid != null && resid.Trim() != "")
  21. {
  22. var config = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(resid));
  23. if (config != null)
  24. resname = config.F_Name;
  25. }
  26. bool hfstate = false;
  27. string ques = ""; int qqid = 0;
  28. if (qid != null && qid.Trim() != "")
  29. {
  30. qqid = int.Parse(qid);
  31. var config = new BLL.T_Sys_DictionaryValue().GetModel(int.Parse(qid));
  32. if (config != null)
  33. ques = config.F_Name;
  34. }
  35. bool hj = new BLL.T_Vis_Telphone().UpdateHJ(int.Parse(id), Convert.ToInt32(uid), uname, int.Parse(resid), resname);
  36. if (resname.Equals("正常接通"))
  37. hfstate = true;
  38. bool hf = new BLL.T_Vis_Telphone().UpdateHF(int.Parse(id), hfstate, hfstate, int.Parse(resid), resname, int.Parse(uid), uname,
  39. bzscore, jcyscore, hjscore, ztscore, score, remark, hfjg, hfinfo, visis, qqid, ques);
  40. bool bz = new BLL.T_Vis_Telphone().UpdateBZ(int.Parse(id), bzscore);
  41. if (hj & hf)
  42. {
  43. Model.T_Vis_TelRecords telrModel = new Model.T_Vis_TelRecords();
  44. telrModel.F_HFID = int.Parse(id);
  45. telrModel.F_HFInfo = "回访结果:" + hfjg + ";回访内容:" + hfinfo + ";是否成功:" + visis + "。";
  46. telrModel.F_HFRemark = "班组得分:" + bzscore + ";接车员得分:" + jcyscore + ";环检:" + hjscore
  47. + ";整体:" + ztscore + ";合计:" + score + ";问题客户分类:" + ques + ";备注:" + remark + "。";
  48. telrModel.F_HFState = hfstate ? 1 : 0;
  49. telrModel.F_HFTime = DateTime.Now;
  50. telrModel.F_HFUserId = int.Parse(uid);
  51. telrModel.F_HFUserName = uname;
  52. telrModel.F_ISCall = true;
  53. telrModel.F_ISCallRes = hfstate;
  54. telrModel.F_HFTelphone = phone;
  55. telrModel.F_CallUserName = uname;
  56. telrModel.F_CallUserID = int.Parse(uid);
  57. telrModel.F_CallResID = int.Parse(resid);
  58. telrModel.F_CallRes = resname;
  59. telrModel.F_CallDate = DateTime.Now;
  60. new BLL.T_Vis_TelRecords().Add(telrModel);
  61. res = Success("保存成功");
  62. }
  63. else
  64. {
  65. res = Error("保存信息失败");
  66. }
  67. }
  68. return res;
  69. }
  70. //获取回访内容详情
  71. [Authority]
  72. public ActionResult GetInfo(string telid)
  73. {
  74. //ActionResult res = NoToken("未知错误,请重新登录");
  75. //if (Request.IsAuthenticated)
  76. //{
  77. // if (telid != null && telid.Trim() != "")
  78. // {
  79. // BLL.T_Vis_Telphone telBLL = new BLL.T_Vis_Telphone();
  80. // Model.T_Vis_Telphone telModel = telBLL.GetModel(int.Parse(telid));
  81. // if (telModel != null)
  82. // res = Success("回访详情加载成功", telModel);
  83. // else
  84. // res = Error("回访内容不存在");
  85. // }
  86. // else
  87. // res = Error("参数获取失败");
  88. //}
  89. //return res;
  90. if (telid != null && telid.Trim() != "")
  91. {
  92. BLL.T_Vis_Telphone telBLL = new BLL.T_Vis_Telphone();
  93. BLL.T_Vis_Telphone_Mark bllTM = new BLL.T_Vis_Telphone_Mark();
  94. Model.T_Vis_Telphone telModel = telBLL.GetModel(int.Parse(telid));
  95. if (telModel == null)
  96. return Error("回访内容不存在");
  97. //判断电话是否标记
  98. var listmodel = bllTM.GetModelList(" F_CusPhone = '" + telModel.F_CusPhone + "' ").FirstOrDefault();
  99. var model = new
  100. {
  101. F_TelID = telModel.F_TelID,
  102. F_Sheng = telModel.F_Sheng,
  103. F_Store = telModel.F_Store,
  104. F_Prodate = telModel.F_Prodate,
  105. F_Reciver = telModel.F_Reciver,
  106. F_License = telModel.F_License,
  107. F_Brand = telModel.F_Brand,
  108. F_Models = telModel.F_Models,
  109. F_CusName = telModel.F_CusName,
  110. F_CusTelphone = telModel.F_CusTelphone,
  111. F_CusPhone = telModel.F_CusPhone,
  112. F_RepType = telModel.F_RepType,
  113. F_SurveyDate = telModel.F_SurveyDate,
  114. F_TScore = telModel.F_TScore,
  115. F_RScore = telModel.F_RScore,
  116. F_RingS = telModel.F_RingS,
  117. F_WholeS = telModel.F_WholeS,
  118. F_TotalS = telModel.F_TotalS,
  119. F_Remark = telModel.F_Remark,
  120. F_VisResult = telModel.F_VisResult,
  121. F_VisInfo = telModel.F_VisInfo,
  122. F_VisIS = telModel.F_VisIS,
  123. F_RepItem = telModel.F_RepItem,
  124. F_TheTeam = telModel.F_TheTeam,
  125. F_Elect = telModel.F_Elect,
  126. F_Sheetmetal = telModel.F_Sheetmetal,
  127. F_Paint = telModel.F_Paint,
  128. F_RepUser = telModel.F_RepUser,
  129. F_WoNumber = telModel.F_WoNumber,
  130. F_NewCus = telModel.F_NewCus,
  131. F_InputDate = telModel.F_InputDate,
  132. F_InputUserID = telModel.F_InputUserID,
  133. F_InputUserName = telModel.F_InputUserName,
  134. F_VisUserID = telModel.F_VisUserID,
  135. F_VisUserName = telModel.F_VisUserName,
  136. F_VisDate = telModel.F_VisDate,
  137. F_ISVis = telModel.F_ISVis,
  138. F_CallUserID = telModel.F_CallUserID,
  139. F_CallUserName = telModel.F_CallUserName,
  140. F_CallDate = telModel.F_CallDate,
  141. F_ISCall = telModel.F_ISCall,
  142. F_CallResID = telModel.F_CallResID,
  143. F_CallRes = telModel.F_CallRes,
  144. F_ISCallRes = telModel.F_ISCallRes,
  145. F_AllotUserID = telModel.F_AllotUserID,
  146. F_AllotUserName = telModel.F_AllotUserName,
  147. F_AllotZXID = telModel.F_AllotZXID,
  148. F_AllotZXName = telModel.F_AllotZXName,
  149. F_ISAllot = telModel.F_ISAllot,
  150. F_AllotDate = telModel.F_AllotDate,
  151. F_FileID = telModel.F_FileID,
  152. F_Extend1 = telModel.F_Extend1,
  153. F_Extend2 = telModel.F_Extend2,
  154. F_Extend3 = telModel.F_Extend3,
  155. F_Extend4 = telModel.F_Extend4,
  156. F_Extend5 = telModel.F_Extend5,
  157. F_Extend6 = telModel.F_Extend6,
  158. F_Extend7 = telModel.F_Extend7,
  159. F_Extend8 = telModel.F_Extend8,
  160. F_Extend9 = telModel.F_Extend9,
  161. F_Extend10 = telModel.F_Extend10,
  162. F_Extend11 = telModel.F_Extend11,
  163. F_Extend12 = telModel.F_Extend12,
  164. F_Extend13 = telModel.F_Extend13,
  165. F_Extend14 = telModel.F_Extend14,
  166. F_Extend15 = telModel.F_Extend15,
  167. F_Extend16 = telModel.F_Extend16,
  168. F_Extend17 = telModel.F_Extend17,
  169. F_Extend18 = telModel.F_Extend18,
  170. F_Extend19 = telModel.F_Extend19,
  171. F_Extend20 = telModel.F_Extend20,
  172. F_QuestionTypeID = telModel.F_QuestionTypeID,
  173. F_QuestionType = telModel.F_QuestionType,
  174. isPhoneMark = listmodel != null ? 1 : 0 //1已标记,0没有标记
  175. };
  176. return Success("回访详情加载成功", model);
  177. }
  178. else
  179. return Error("参数获取失败");
  180. }
  181. }
  182. }