using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PMS.Interface;
using PMS.Interface.Problems;
using PMS.BusinessModels.Problem;
using QWPlatform.SystemLibrary.Utils;
using System.Data;
using PMS.Interface.WorkFlow;
using System.IO;
using PMS.Interface.Product;
using PMS.Interface.ProManager;
using PMS.Interface.Support;
namespace PMS.WebUI.Controllers
{
///
/// 创 建 人:王海洋
/// 创建日期:2019-01-04
/// 功能描述:问题技术支持管理
///
public class SupportController : BaseController
{
//项目问题管理
IProjectProblems projectProblems = InterfaceFactory.CreateBusinessInstance();
IWorkFlow WorkFlowModule = InterfaceFactory.CreateBusinessInstance();
ICPWTJLModel CPWTJL_obj = InterfaceFactory.CreateBusinessInstance();
IProModule ProModule = InterfaceFactory.CreateBusinessInstance();
ISupport support = InterfaceFactory.CreateBusinessInstance();
IProduct product = InterfaceFactory.CreateBusinessInstance();
// GET: 支持管理主页
public ActionResult Index()
{
var UserInfo = GetCurrentUser();
ViewBag.DJRId = UserInfo.PersonID;
ViewBag.RYXZ = UserInfo.PersonProperty;
ViewBag.ProductId = base.GetMyConfigInfo()?.ProductID;
ViewBag.ModuleID = base.GetMyConfigInfo()?.ModuleID;
return View();
}
//获取需要处理的问题列表(1:技术支持,2:研发显示)
public ActionResult GetNeedProcessList(int page = 1, int rows = 20, int type = 1, string productid = "",string productModuleId="")
{
var json = projectProblems.GetNeedProccessProjectListJson(type, productid,productModuleId, page, rows);
return Content(json, "text/json");
}
//接收处理该问题
public ActionResult ReceiveProblem(string id)
{
if (!string.IsNullOrEmpty(id))
{//问题ID
//获取当前人员ID
var userInfo = GetCurrentUser();
var uid = userInfo.PersonID;
var name = userInfo.Name;
var r = projectProblems.IsReceive(id, uid);
var msg = (r == 0 || r == 2) ? "受理成功." : "问题已被他人受理";
if (r == 0)
{
//获取进入流程ID
var WorkId = WorkFlowModule.GetDealWorkId(id, userInfo.PersonProperty, userInfo.JobCode);
//受理问题
var DealModel = new ProblemDealModel();
DealModel.ProblemId = id;
DealModel.NextWorkId = WorkId;
DealModel.DealPeronName = userInfo.Name;
DealModel.DealPeronId = userInfo.PersonID;
var re = WorkFlowModule.ProblemAccept(DealModel);
msg = re ? "受理成功" : "受理发生错误,请检查职务!";
}
return Content(new PmsJsonResoult((r == 0 || r == 2), msg, null).ToString(), "text/json");
}
else
{//没有问题id
return Content(new PmsJsonResoult(false, "没有问题相关的ID", null).ToString(), "text/json");
}
}
//GET:产品问题首页
public ActionResult ProductIndex()
{
var UserInfo = GetCurrentUser();
ViewBag.DJRId = UserInfo.PersonID;
ViewBag.RYXZ = UserInfo.PersonProperty;
ViewBag.ProductId = base.GetMyConfigInfo()?.ProductID;
ViewBag.ModuleID = base.GetMyConfigInfo()?.ModuleID;
return View();
}
//GET : 产生一个新的技术支持登记的页面
public ActionResult NewSuport()
{
return View();
}
//受理问题处理
public ActionResult AcceptProblem()
{
return View();
}
}
}