ComplaintManageController.cs 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. using PMS.BusinessModels.ComplaintManage;
  2. using PMS.Interface.ComplaintManage;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Web;
  7. using System.Web.Mvc;
  8. using PMS.Interface;
  9. using PMS.Interface.PresonManager;
  10. using PMS.Interface.Channel;
  11. namespace PMS.WebUI.Controllers
  12. {
  13. /// <summary>
  14. /// 创建人:伍莲魁
  15. /// 创建时间:2018/12/13
  16. /// 模块功能:投诉管理模块控制器
  17. /// </summary>
  18. public class ComplaintManageController : BaseController
  19. {
  20. IComplaintList Complaint_List = InterfaceFactory.CreateBusinessInstance<IComplaintList>();
  21. IPersonModule PersonModule = InterfaceFactory.CreateBusinessInstance<IPersonModule>();
  22. IChannel Channel = InterfaceFactory.CreateBusinessInstance<IChannel>();
  23. // GET: Complaint
  24. public ActionResult ComplaintList()
  25. {
  26. return View();
  27. }
  28. #region 投诉列表
  29. /// <summary>
  30. /// 获取投诉列表Datagrid
  31. /// </summary>
  32. /// <param name="model"></param>
  33. /// <returns></returns>
  34. public ActionResult GetComplaintDatagrid(SelectComplaintListModel model)
  35. {
  36. if (model.Channel== "0")
  37. {
  38. model.Channel = GetAuthDats().Channel;
  39. }
  40. model.strUserId = GetCurrentUser().PersonID;
  41. var json = Complaint_List.GetComplaintDatagrid(model);
  42. return Content(json, "application/json");
  43. }
  44. /// <summary>
  45. /// 获取投诉附件
  46. /// </summary>
  47. /// <param name="id"></param>
  48. /// <returns></returns>
  49. public ActionResult GetComplaintFile(string id)
  50. {
  51. var json = Complaint_List.GetComplaintFile(id);
  52. return Content(json, "application/json");
  53. }
  54. /// <summary>
  55. /// 从FTP获取投诉图片
  56. /// </summary>
  57. /// <param name="id">投诉ID</param>
  58. /// <returns></returns>
  59. public ActionResult GetComplaintFileFromFTP(string id)
  60. {
  61. var json = Complaint_List.GetComplaintFileFromFTP(id);
  62. return Content(json, "application/json");
  63. }
  64. /// <summary>
  65. /// 获取投诉人详情信息
  66. /// </summary>
  67. /// <param name="PID">投诉人ID</param>
  68. /// <returns></returns>
  69. public ActionResult GetComplaintPerson(string PID)
  70. {
  71. var json = Complaint_List.GetComplaintPerson(PID);
  72. return Content(json, "application/json");
  73. }
  74. /// <summary>
  75. /// 获取项目投诉过程信息
  76. /// </summary>
  77. /// <param name="id">投诉ID</param>
  78. /// <returns></returns>
  79. public ActionResult GetDealProcess(string id)
  80. {
  81. var json= Complaint_List.GetDealProcess(id);
  82. return Content(json, "application/json");
  83. }
  84. /// <summary>
  85. /// 获取过程沟通
  86. /// </summary>
  87. /// <param name="id">投诉ID</param>
  88. /// <returns></returns>
  89. public ActionResult GetCommunicate(string id)
  90. {
  91. var json = Complaint_List.GetCommunicate(id);
  92. return Content(json, "application/json");
  93. }
  94. /// <summary>
  95. ///提交过程沟通内容
  96. /// </summary>
  97. /// <param name="id">投诉ID</param>
  98. /// <param name="Content">内容</param>
  99. /// <returns></returns>
  100. public ActionResult SubmitCmt(string id, string Content)
  101. {
  102. var UserInfo = GetCurrentUser();
  103. //调用业务接口进行保存
  104. var r = Complaint_List.SubmitCmt(id, Content, UserInfo.PersonID);
  105. if (r)
  106. {//保存成功
  107. return this.ResponseJson(System.Net.HttpStatusCode.OK, "提交成功");
  108. }
  109. else
  110. {//保存失败
  111. return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "提交失败");
  112. }
  113. }
  114. /// <summary>
  115. /// 打开处理窗口
  116. /// </summary>
  117. /// <param name="id">投诉ID</param>
  118. /// <param name="Event">投诉标题</param>
  119. /// <returns></returns>
  120. public ActionResult ComplaintDeal(string id,string Event)
  121. {
  122. ViewBag.id = id;
  123. ViewBag.Event = Event;
  124. var User = GetCurrentUser().PersonID;
  125. ViewBag.CurrentUser = User;
  126. return View();
  127. }
  128. /// <summary>
  129. /// 投诉受理
  130. /// </summary>
  131. /// <param name="model">受理表单模型</param>
  132. /// <returns></returns>
  133. public ActionResult ComplaintAccept(FormAcceptComplaint model)
  134. {
  135. var r = Complaint_List.ComplaintAccept(model);
  136. if (r)
  137. {//保存成功
  138. return this.ResponseJson(System.Net.HttpStatusCode.OK, "受理成功");
  139. }
  140. else
  141. {//保存失败
  142. return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "受理失败");
  143. }
  144. }
  145. /// <summary>
  146. /// 打开投诉分配窗口
  147. /// </summary>
  148. /// <returns></returns>
  149. public ActionResult ComplaintDistribute(string id, string Event)
  150. {
  151. ViewBag.id = id;
  152. ViewBag.Event = Event;
  153. return View();
  154. }
  155. /// <summary>
  156. /// 投诉分配
  157. /// </summary>
  158. /// <param name="model"></param>
  159. /// <returns></returns>
  160. public ActionResult ComplaintDistributeSub(FormAcceptComplaint model)
  161. {
  162. var UserInfo = GetCurrentUser();
  163. model.CurrentDealPerID = UserInfo.PersonID;
  164. var r = Complaint_List.ComplaintDistributeSub(model);
  165. if (r)
  166. {//保存成功
  167. return this.ResponseJson(System.Net.HttpStatusCode.OK, "分配成功");
  168. }
  169. else
  170. {//保存失败
  171. return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "分配失败");
  172. }
  173. }
  174. /// <summary>
  175. /// 获取渠道下的公司人员(combobox有权限)
  176. /// </summary>
  177. /// <returns></returns>
  178. public ActionResult GetPerson()
  179. {
  180. var UserInfo = GetCurrentUser();
  181. var t = UserInfo.AuthDats;
  182. string json = PersonModule.GetPerson(t);
  183. return Content(json, "application/json");
  184. }
  185. /// <summary>
  186. /// 获取渠道下的公司人员(combobox无权限)
  187. /// </summary>
  188. /// <param name="id">渠道ID</param>
  189. /// <returns></returns>
  190. public ActionResult GetPersonByChannel(string id)
  191. {
  192. string json = PersonModule.GetPersonByChannel(id);
  193. return Content(json, "application/json");
  194. }
  195. /// <summary>
  196. /// 获取渠道项目combotree :valueField: 'id', textField: '名称'
  197. /// </summary>
  198. /// <returns></returns>
  199. public ActionResult GetChannelProjectTree()
  200. {
  201. string json = Channel.GetChannelProjectTree();
  202. return Content(json, "application/json");
  203. }
  204. /// <summary>
  205. /// 获取渠道项目Combotree(含权限)
  206. /// </summary>
  207. /// <returns></returns>
  208. public ActionResult GetChannelComboTree()
  209. {
  210. var UserInfo = GetCurrentUser();
  211. var t = UserInfo.AuthDats;
  212. string json = Channel.GetChannelComboTree(t);
  213. return Content(json, "application/json");
  214. }
  215. #endregion
  216. }
  217. }