using PMS.BusinessModels.ComplaintManage;
using PMS.Interface.ComplaintManage;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PMS.Interface;
using PMS.Interface.PresonManager;
using PMS.Interface.Channel;
namespace PMS.WebUI.Controllers
{
///
/// 创建人:伍莲魁
/// 创建时间:2018/12/13
/// 模块功能:投诉管理模块控制器
///
public class ComplaintManageController : BaseController
{
IComplaintList Complaint_List = InterfaceFactory.CreateBusinessInstance();
IPersonModule PersonModule = InterfaceFactory.CreateBusinessInstance();
IChannel Channel = InterfaceFactory.CreateBusinessInstance();
// GET: Complaint
public ActionResult ComplaintList()
{
return View();
}
#region 投诉列表
///
/// 获取投诉列表Datagrid
///
///
///
public ActionResult GetComplaintDatagrid(SelectComplaintListModel model)
{
if (model.Channel== "0")
{
model.Channel = GetAuthDats().Channel;
}
model.strUserId = GetCurrentUser().PersonID;
var json = Complaint_List.GetComplaintDatagrid(model);
return Content(json, "application/json");
}
///
/// 获取投诉附件
///
///
///
public ActionResult GetComplaintFile(string id)
{
var json = Complaint_List.GetComplaintFile(id);
return Content(json, "application/json");
}
///
/// 从FTP获取投诉图片
///
/// 投诉ID
///
public ActionResult GetComplaintFileFromFTP(string id)
{
var json = Complaint_List.GetComplaintFileFromFTP(id);
return Content(json, "application/json");
}
///
/// 获取投诉人详情信息
///
/// 投诉人ID
///
public ActionResult GetComplaintPerson(string PID)
{
var json = Complaint_List.GetComplaintPerson(PID);
return Content(json, "application/json");
}
///
/// 获取项目投诉过程信息
///
/// 投诉ID
///
public ActionResult GetDealProcess(string id)
{
var json= Complaint_List.GetDealProcess(id);
return Content(json, "application/json");
}
///
/// 获取过程沟通
///
/// 投诉ID
///
public ActionResult GetCommunicate(string id)
{
var json = Complaint_List.GetCommunicate(id);
return Content(json, "application/json");
}
///
///提交过程沟通内容
///
/// 投诉ID
/// 内容
///
public ActionResult SubmitCmt(string id, string Content)
{
var UserInfo = GetCurrentUser();
//调用业务接口进行保存
var r = Complaint_List.SubmitCmt(id, Content, UserInfo.PersonID);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "提交成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "提交失败");
}
}
///
/// 打开处理窗口
///
/// 投诉ID
/// 投诉标题
///
public ActionResult ComplaintDeal(string id,string Event)
{
ViewBag.id = id;
ViewBag.Event = Event;
var User = GetCurrentUser().PersonID;
ViewBag.CurrentUser = User;
return View();
}
///
/// 投诉受理
///
/// 受理表单模型
///
public ActionResult ComplaintAccept(FormAcceptComplaint model)
{
var r = Complaint_List.ComplaintAccept(model);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "受理成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "受理失败");
}
}
///
/// 打开投诉分配窗口
///
///
public ActionResult ComplaintDistribute(string id, string Event)
{
ViewBag.id = id;
ViewBag.Event = Event;
return View();
}
///
/// 投诉分配
///
///
///
public ActionResult ComplaintDistributeSub(FormAcceptComplaint model)
{
var UserInfo = GetCurrentUser();
model.CurrentDealPerID = UserInfo.PersonID;
var r = Complaint_List.ComplaintDistributeSub(model);
if (r)
{//保存成功
return this.ResponseJson(System.Net.HttpStatusCode.OK, "分配成功");
}
else
{//保存失败
return this.ResponseJson(System.Net.HttpStatusCode.InternalServerError, "分配失败");
}
}
///
/// 获取渠道下的公司人员(combobox有权限)
///
///
public ActionResult GetPerson()
{
var UserInfo = GetCurrentUser();
var t = UserInfo.AuthDats;
string json = PersonModule.GetPerson(t);
return Content(json, "application/json");
}
///
/// 获取渠道下的公司人员(combobox无权限)
///
/// 渠道ID
///
public ActionResult GetPersonByChannel(string id)
{
string json = PersonModule.GetPersonByChannel(id);
return Content(json, "application/json");
}
///
/// 获取渠道项目combotree :valueField: 'id', textField: '名称'
///
///
public ActionResult GetChannelProjectTree()
{
string json = Channel.GetChannelProjectTree();
return Content(json, "application/json");
}
///
/// 获取渠道项目Combotree(含权限)
///
///
public ActionResult GetChannelComboTree()
{
var UserInfo = GetCurrentUser();
var t = UserInfo.AuthDats;
string json = Channel.GetChannelComboTree(t);
return Content(json, "application/json");
}
#endregion
}
}