SupportController.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using PMS.Interface;
  7. using PMS.Interface.Problems;
  8. using PMS.BusinessModels.Problem;
  9. using QWPlatform.SystemLibrary.Utils;
  10. using System.Data;
  11. using PMS.Interface.WorkFlow;
  12. using System.IO;
  13. using PMS.Interface.Product;
  14. using PMS.Interface.ProManager;
  15. using PMS.Interface.Support;
  16. namespace PMS.WebUI.Controllers
  17. {
  18. /// <summary>
  19. /// 创 建 人:王海洋
  20. /// 创建日期:2019-01-04
  21. /// 功能描述:问题技术支持管理
  22. /// </summary>
  23. public class SupportController : BaseController
  24. {
  25. //项目问题管理
  26. IProjectProblems projectProblems = InterfaceFactory.CreateBusinessInstance<IProjectProblems>();
  27. IWorkFlow WorkFlowModule = InterfaceFactory.CreateBusinessInstance<IWorkFlow>();
  28. ICPWTJLModel CPWTJL_obj = InterfaceFactory.CreateBusinessInstance<ICPWTJLModel>();
  29. IProModule ProModule = InterfaceFactory.CreateBusinessInstance<IProModule>();
  30. ISupport support = InterfaceFactory.CreateBusinessInstance<ISupport>();
  31. IProduct product = InterfaceFactory.CreateBusinessInstance<IProduct>();
  32. // GET: 支持管理主页
  33. public ActionResult Index()
  34. {
  35. var UserInfo = GetCurrentUser();
  36. ViewBag.DJRId = UserInfo.PersonID;
  37. ViewBag.RYXZ = UserInfo.PersonProperty;
  38. ViewBag.ProductId = base.GetMyConfigInfo()?.ProductID;
  39. ViewBag.ModuleID = base.GetMyConfigInfo()?.ModuleID;
  40. return View();
  41. }
  42. //获取需要处理的问题列表(1:技术支持,2:研发显示)
  43. public ActionResult GetNeedProcessList(int page = 1, int rows = 20, int type = 1, string productid = "",string productModuleId="")
  44. {
  45. var json = projectProblems.GetNeedProccessProjectListJson(type, productid,productModuleId, page, rows);
  46. return Content(json, "text/json");
  47. }
  48. //接收处理该问题
  49. public ActionResult ReceiveProblem(string id)
  50. {
  51. if (!string.IsNullOrEmpty(id))
  52. {//问题ID
  53. //获取当前人员ID
  54. var userInfo = GetCurrentUser();
  55. var uid = userInfo.PersonID;
  56. var name = userInfo.Name;
  57. var r = projectProblems.IsReceive(id, uid);
  58. var msg = (r == 0 || r == 2) ? "受理成功." : "问题已被他人受理";
  59. if (r == 0)
  60. {
  61. //获取进入流程ID
  62. var WorkId = WorkFlowModule.GetDealWorkId(id, userInfo.PersonProperty, userInfo.JobCode);
  63. //受理问题
  64. var DealModel = new ProblemDealModel();
  65. DealModel.ProblemId = id;
  66. DealModel.NextWorkId = WorkId;
  67. DealModel.DealPeronName = userInfo.Name;
  68. DealModel.DealPeronId = userInfo.PersonID;
  69. var re = WorkFlowModule.ProblemAccept(DealModel);
  70. msg = re ? "受理成功" : "受理发生错误,请检查职务!";
  71. }
  72. return Content(new PmsJsonResoult((r == 0 || r == 2), msg, null).ToString(), "text/json");
  73. }
  74. else
  75. {//没有问题id
  76. return Content(new PmsJsonResoult(false, "没有问题相关的ID", null).ToString(), "text/json");
  77. }
  78. }
  79. //GET:产品问题首页
  80. public ActionResult ProductIndex()
  81. {
  82. var UserInfo = GetCurrentUser();
  83. ViewBag.DJRId = UserInfo.PersonID;
  84. ViewBag.RYXZ = UserInfo.PersonProperty;
  85. ViewBag.ProductId = base.GetMyConfigInfo()?.ProductID;
  86. ViewBag.ModuleID = base.GetMyConfigInfo()?.ModuleID;
  87. return View();
  88. }
  89. //GET : 产生一个新的技术支持登记的页面
  90. public ActionResult NewSuport()
  91. {
  92. return View();
  93. }
  94. //受理问题处理
  95. public ActionResult AcceptProblem()
  96. {
  97. return View();
  98. }
  99. }
  100. }