360 lines
18 KiB
C#
360 lines
18 KiB
C#
using Ninject;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web.Mvc;
|
|
using WX.CRM.Common;
|
|
using WX.CRM.IBLL.Base;
|
|
using WX.CRM.IBLL.Csvr;
|
|
using WX.CRM.IBLL.Util;
|
|
using WX.CRM.Model.Entity;
|
|
using WX.CRM.Model.MAP;
|
|
using WX.CRM.WebHelper;
|
|
|
|
namespace WX.CRM.WEB.Controllers.Csvr
|
|
{
|
|
public class RecordSharedController : BaseController
|
|
{
|
|
private readonly ICSVR_RECORDSHARED recordShared;
|
|
private readonly ICSVR_RECORDSHARED_Q recordShared_Q;
|
|
private readonly IBAS_PARAMETER_Q pataMeter_Q;
|
|
private readonly ICACHE_Q cache_Q;
|
|
|
|
[Inject]
|
|
public ICSVR_CALLRECORD_Q _CSVR_CALLRECORD_Q { get; set; }
|
|
|
|
[Inject]
|
|
public IBAS_SUBCOMTYPE_Q bas_SubComType_Q_BL { get; set; }
|
|
|
|
[Inject]
|
|
public IBAS_COMTYPE_Q bas_ComType_Q_BL { get; set; }
|
|
|
|
private ValidationErrors errors = new WX.CRM.Common.ValidationErrors();
|
|
|
|
public RecordSharedController(ICSVR_RECORDSHARED _recordShared, ICSVR_RECORDSHARED_Q _recordShared_Q, IBAS_PARAMETER_Q _pataMeter_Q, ICACHE_Q _cache_Q)
|
|
{
|
|
this.recordShared = _recordShared;
|
|
this.recordShared_Q = _recordShared_Q;
|
|
this.pataMeter_Q = _pataMeter_Q;
|
|
this.cache_Q = _cache_Q;
|
|
}
|
|
|
|
#region 首页
|
|
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_共享录音)]
|
|
public ActionResult Index()
|
|
{
|
|
ToolBar tb = new ToolBar();
|
|
string[] toolbtn = new ToolButtonView().ToolButtonRight(InitRights.共享录音, userRightId); ;
|
|
tb.AllowButton(toolbtn);
|
|
ViewBag.ToolBar = tb;
|
|
|
|
Pager pg = new Pager() { page = 1, rows = 10 };
|
|
|
|
WebHelper.Table tab = new WebHelper.Table("tablist");
|
|
tab.AddHiddenHeadCol("PKID", "PKID");
|
|
tab.AddHeadCol("RECORDID", "", "录音编号");
|
|
tab.AddHeadCol("UMID", "", "客户ID");
|
|
tab.AddHeadCol("RECORDTYPEID", "", "录音业务类型");
|
|
//tab.AddHeadCol("RECORDSHAREDTYPE", "", "共享录音分类");
|
|
tab.AddHeadCol("SERVICENUMBER", "", "主叫号码");
|
|
tab.AddHeadCol("TELNUMBERLAST4", "", "被叫号码");
|
|
tab.AddHeadCol("TIMELENGTH", "", "时长(秒)");
|
|
tab.AddHeadCol("TIMESTART", "", "录音开始时间");
|
|
tab.AddHeadCol("SALESEID", "", "受理人");
|
|
tab.AddHeadCol("INNERUSERID", "", "操作人");
|
|
tab.AddHeadCol("CTIME", "", "共享时间");
|
|
tab.AddHeadCol("MEMO", "30%", "点评");
|
|
tab.AddHeadCol("", "", "播放");
|
|
tab.AddHeadRow();
|
|
ViewBag.gridTable = tab.GetHead() + Pagination.GetPage(pg, "tablist", "5,8,10,15");
|
|
return View();
|
|
}
|
|
|
|
#endregion 首页
|
|
|
|
#region 查询
|
|
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_共享录音)]
|
|
public JsonResult GetHtmlList(Pager gp, string columns)
|
|
{
|
|
decimal recordTypeID = Request.Form["RecordType"].GetDecimal(0);
|
|
string resid = Request.Form["Resid"];
|
|
decimal recordid = Request.Form["Recordid"].GetDecimal(0);
|
|
decimal sharetypeid = Request.Form["RecordSharedType"].GetDecimal(0);
|
|
string stime = Request.Form["STime"];
|
|
string etime = Request.Form["ETime"];
|
|
decimal serviceEid = Request.Form["serviceEid"].GetDecimal(0);
|
|
decimal shareEid = Request.Form["shareEid"].GetDecimal(0);
|
|
|
|
List<CSVR_RECORDSHAREDVIEW> list = recordShared_Q.GetList_RecordShared(ref gp, recordTypeID, resid, recordid, sharetypeid, stime, etime, serviceEid, shareEid);
|
|
Table tb = new Table(columns, true);
|
|
tb.gridPager = gp;
|
|
|
|
foreach (var model in list)
|
|
{
|
|
tb.AddHiddenCol(model.PKID);
|
|
tb.AddCol(model.RECORDID);
|
|
var restd = string.Format("<a href=\"javascript:parent.ChildAddTab('{0}', '{1}', '')\">{2}</a>", "客户详细", "/Csvr/CustomerInfo/CustomerDetail?resid=" + model.RESID, model.RESID);
|
|
tb.AddCol(restd);
|
|
tb.AddCol(model.RECORDSHAREDTYPE == 1 ? cache_Q.GetList_RecordType().Where(m => m.ID == model.RECORDTYPEID).FirstOrDefault().NAME : bas_SubComType_Q_BL.GetModel_Subcomtype(model.SUBTYPE) == null ? "" : bas_SubComType_Q_BL.GetModel_Subcomtype(model.SUBTYPE).map_SUBTYPENAME);
|
|
//tb.AddCol(getRecordSharedStatus(model.RECORDSHAREDTYPE));
|
|
tb.AddCol(model.SERVICENUMBER);
|
|
tb.AddCol(model.TELNUMBERLAST4);
|
|
tb.AddCol(model.TIMELENGTH);
|
|
tb.AddCol(model.TIMESTART);
|
|
tb.AddCol(InnerUserHelper.Instance.EidAndName(InnerUserHelper.Instance.GetUserIdByEid(model.SALESEID)));
|
|
tb.AddCol(InnerUserHelper.Instance.EidAndName(model.INNERUSERID));
|
|
tb.AddCol(model.CTIME);
|
|
tb.AddCol(model.MEMO);
|
|
|
|
string cti;
|
|
|
|
string playurl = _getCallRecordUrl(model.SERVERID, model.FILENAME, out cti);
|
|
//var _IAD_localhostCallRecord = pataMeter_Q.GetModel_Patameter("ICSR_IAD_localhostCallRecord");
|
|
//if (null != _IAD_localhostCallRecord)
|
|
//{
|
|
// var FuturesRecordServerUrl = _IAD_localhostCallRecord.PARAVALUE; //Utility.GetSettingByKey("CallRecordApi");//?serverID=1&file=1
|
|
// var playurl = FuturesRecordServerUrl + "?serverID=" + model.SERVERID+ "&file=" + model.FILENAME.ToString().Replace("\\", "/");
|
|
// var cti = _CSVR_CALLRECORD_Q.Sys_Environment_CTI_VER();
|
|
// if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.深海捷移动坐席).ToString())
|
|
// {
|
|
// playurl = FuturesRecordServerUrl + "?file=" + model.FILENAME.ToString().Replace("\\", "/");
|
|
// }
|
|
// if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.深海捷固定坐席).ToString())
|
|
// {
|
|
// var shjctiinterface = Utility.GetSettingByKey("shj");
|
|
// playurl = shjctiinterface + "?action=record_download&filename=/var/spool/asterisk/monitor/" + model.FILENAME.ToString().Replace("\\", "/");
|
|
// }
|
|
// var playcrl = string.Format("<input id=\"BtnPlayer\" type=\"button\" value=\" 播 放 \" onclick=\"PalyRecord('{0}','DivPlayer{1}','{2}')\" />",
|
|
// playurl, model.RECORDID, cti == null ? "" : cti);
|
|
// playcrl += string.Format("<div id=\"DivPlayer{0}\"></div>", model.RECORDID);
|
|
// tb.AddCol(playcrl);
|
|
//}
|
|
|
|
var playcrl = string.Format("<input id=\"BtnPlayer\" type=\"button\" value=\" 播 放 \" onclick=\"PalyRecord('{0}','DivPlayer{1}','{2}')\" />",
|
|
playurl, model.RECORDID, cti == null ? "" : cti);
|
|
playcrl += string.Format("<div id=\"DivPlayer{0}\"></div><input type=\"hidden\" id=\"hidRecordUrl\" value=\"{1}\" />", model.RECORDID, playurl);
|
|
tb.AddCol(playcrl);
|
|
|
|
tb.AddRow();
|
|
}
|
|
var json = new
|
|
{
|
|
totalPages = gp.totalPages,
|
|
totalRows = gp.totalRows,
|
|
rowsList = tb.GetRows()
|
|
};
|
|
return Json(json, JsonRequestBehavior.AllowGet);
|
|
}
|
|
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_共享录音)]
|
|
public ActionResult Index2()
|
|
{
|
|
ToolBar tb = new ToolBar();
|
|
string[] toolbtn = new ToolButtonView().ToolButtonRight(InitRights.共享录音, userRightId); ;
|
|
tb.AllowButton(toolbtn);
|
|
ViewBag.ToolBar = tb;
|
|
|
|
Pager pg = new Pager() { page = 1, rows = 10 };
|
|
|
|
WebHelper.Table tab = new WebHelper.Table("tablist");
|
|
tab.AddHiddenHeadCol("PKID", "PKID");
|
|
tab.AddHeadCol("RECORDID", "", "录音编号");
|
|
tab.AddHeadCol("UMID", "", "客户ID");
|
|
tab.AddHeadCol("RECORDTYPEID", "", "违规类别");
|
|
tab.AddHeadCol("SERVICENUMBER", "", "主叫号码");
|
|
tab.AddHeadCol("TELNUMBERLAST4", "", "被叫号码");
|
|
tab.AddHeadCol("TIMELENGTH", "", "时长(秒)");
|
|
tab.AddHeadCol("TIMESTART", "", "录音开始时间");
|
|
tab.AddHeadCol("SALESEID", "", "受理人");
|
|
tab.AddHeadCol("INNERUSERID", "", "操作人");
|
|
tab.AddHeadCol("CTIME", "", "共享时间");
|
|
tab.AddHeadCol("MEMO", "", "违规细则");
|
|
tab.AddHeadCol("PENALTY", "", "违规金额");
|
|
tab.AddHeadCol("RESULT", "", "处理结果");
|
|
tab.AddHeadCol("", "", "播放");
|
|
tab.AddHeadRow();
|
|
ViewBag.inneruserid = UserId;
|
|
ViewBag.userGroupId = userGroupId;
|
|
ViewBag.saleDeptId = saleDeptId;
|
|
ViewBag.roleCodes = DataCacheHelper.GetCache().Get_RoleCodes(userRoleId);
|
|
|
|
//大类
|
|
var list = bas_ComType_Q_BL.GetList().Where(m => m.map_TYPECODE.Contains("MessageCompliance")).OrderBy(m => m.map_TYPECODE).ToList();
|
|
var bigTypeList = new List<SelectListItem>();
|
|
if (list != null)
|
|
{
|
|
foreach (var m in list)
|
|
{
|
|
bigTypeList.Add(new SelectListItem { Text = m.map_TYPENAME, Value = m.map_TYPECODE });
|
|
}
|
|
}
|
|
ViewBag.BigTypeList = bigTypeList;
|
|
ViewBag.gridTable = tab.GetHead() + Pagination.GetPage(pg, "tablist", "5,8,10,15");
|
|
return View();
|
|
}
|
|
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_共享录音)]
|
|
public JsonResult GetHtmlList2(Pager gp, string columns, QueryUserComboDto usercomboDto)
|
|
{
|
|
//decimal recordTypeID = Request.Form["RecordType"].GetDecimal(0);
|
|
string bigType = Request.Form["bigType"];
|
|
string subType = Request.Form["subType"];
|
|
string resid = Request.Form["Resid"];
|
|
decimal recordid = Request.Form["Recordid"].GetDecimal(0);
|
|
decimal sharetypeid = Request.Form["RecordSharedType"].GetDecimal(0);
|
|
string stime = Request.Form["STime"];
|
|
string etime = Request.Form["ETime"];
|
|
decimal shareEid = Request.Form["shareEid"].GetDecimal(0);
|
|
decimal groupId = Request["groupId"].GetDecimal(0);
|
|
decimal userId = Request["userId"].GetDecimal(0);
|
|
|
|
List<CSVR_RECORDSHARED_Extend> list = recordShared_Q.GetList_WgRecordShared(ref gp, resid, recordid, sharetypeid, stime, etime, shareEid, bigType, subType, usercomboDto);
|
|
Table tb = new Table(columns, true);
|
|
tb.gridPager = gp;
|
|
|
|
foreach (CSVR_RECORDSHARED_Extend model in list)
|
|
{
|
|
tb.AddHiddenCol(model.RecordShared.PKID);
|
|
tb.AddCol(model.RecordShared.RECORDID);
|
|
var restd = string.Format("<a href=\"javascript:parent.ChildAddTab('{0}', '{1}', '')\">{2}</a>", "客户详细", "/Csvr/CustomerInfo/CustomerDetail?resid=" + model.RecordShared.RESID, model.RecordShared.RESID);
|
|
tb.AddCol(restd);
|
|
string typeStr;
|
|
if (model.RecordShared.RECORDSHAREDTYPE == 1)
|
|
{
|
|
typeStr = cache_Q.GetList_RecordType().Where(m => m.ID == model.RecordShared.RECORDTYPEID).FirstOrDefault().NAME;
|
|
}
|
|
else
|
|
{
|
|
typeStr = bas_ComType_Q_BL.GetModel_Comtype(model.RecordShared.BIGTYPE).map_TYPENAME + "-" + bas_SubComType_Q_BL.GetModel_Subcomtype(model.RecordShared.SUBTYPE).map_SUBTYPENAME;
|
|
}
|
|
tb.AddCol(typeStr);
|
|
tb.AddCol(model.RecordShared.SERVICENUMBER);
|
|
tb.AddCol(model.RecordShared.TELNUMBERLAST4);
|
|
tb.AddCol(model.RecordShared.TIMELENGTH);
|
|
tb.AddCol(model.RecordShared.TIMESTART);
|
|
tb.AddCol(InnerUserHelper.Instance.EidAndName(InnerUserHelper.Instance.GetUserIdByEid(model.RecordShared.SALESEID)));
|
|
tb.AddCol(InnerUserHelper.Instance.EidAndName(model.RecordShared.INNERUSERID));
|
|
tb.AddCol(model.RecordShared.CTIME);
|
|
tb.AddCol(model.RecordShared.MEMO);
|
|
tb.AddCol(model.PENALTY);
|
|
tb.AddCol(model.RESULT);
|
|
|
|
string cti;
|
|
|
|
string playurl = _getCallRecordUrl(model.RecordShared.SERVERID, model.RecordShared.FILENAME, out cti);
|
|
//var _IAD_localhostCallRecord = pataMeter_Q.GetModel_Patameter("ICSR_IAD_localhostCallRecord");
|
|
//if (null != _IAD_localhostCallRecord)
|
|
//{
|
|
// var FuturesRecordServerUrl = _IAD_localhostCallRecord.PARAVALUE; //Utility.GetSettingByKey("CallRecordApi");//?serverID=1&file=1
|
|
// var playurl = FuturesRecordServerUrl + "?serverID=" + model.SERVERID+ "&file=" + model.FILENAME.ToString().Replace("\\", "/");
|
|
// var cti = _CSVR_CALLRECORD_Q.Sys_Environment_CTI_VER();
|
|
// if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.深海捷移动坐席).ToString())
|
|
// {
|
|
// playurl = FuturesRecordServerUrl + "?file=" + model.FILENAME.ToString().Replace("\\", "/");
|
|
// }
|
|
// if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.深海捷固定坐席).ToString())
|
|
// {
|
|
// var shjctiinterface = Utility.GetSettingByKey("shj");
|
|
// playurl = shjctiinterface + "?action=record_download&filename=/var/spool/asterisk/monitor/" + model.FILENAME.ToString().Replace("\\", "/");
|
|
// }
|
|
// var playcrl = string.Format("<input id=\"BtnPlayer\" type=\"button\" value=\" 播 放 \" onclick=\"PalyRecord('{0}','DivPlayer{1}','{2}')\" />",
|
|
// playurl, model.RECORDID, cti == null ? "" : cti);
|
|
// playcrl += string.Format("<div id=\"DivPlayer{0}\"></div>", model.RECORDID);
|
|
// tb.AddCol(playcrl);
|
|
//}
|
|
|
|
var playcrl = string.Format("<input id=\"BtnPlayer\" type=\"button\" value=\" 播 放 \" onclick=\"PalyRecord('{0}','DivPlayer{1}','{2}')\" />",
|
|
playurl, model.RecordShared.RECORDID, cti == null ? "" : cti);
|
|
playcrl += string.Format("<div id=\"DivPlayer{0}\"></div><input type=\"hidden\" id=\"hidRecordUrl\" value=\"{1}\" />", model.RecordShared.RECORDID, playurl);
|
|
tb.AddCol(playcrl);
|
|
|
|
tb.AddRow();
|
|
}
|
|
var json = new
|
|
{
|
|
totalPages = gp.totalPages,
|
|
totalRows = gp.totalRows,
|
|
rowsList = tb.GetRows()
|
|
};
|
|
return Json(json, JsonRequestBehavior.AllowGet);
|
|
}
|
|
|
|
#endregion 查询
|
|
|
|
#region 删除
|
|
|
|
[AuthorizeToolBar(InitRights.CONST_共享录音, InitToolBar.CONST_Delete)]
|
|
public JsonResult Delete(string pkid)
|
|
{
|
|
return JsonHandler.DeleteMessage(errors, recordShared.Delete_RecordShared(ref errors, pkid.GetDecimal(-1)));
|
|
}
|
|
|
|
#endregion 删除
|
|
|
|
private string _getCallRecordUrl(string _ServerID, string _FileName, out string cti)
|
|
{
|
|
var playurl = "";
|
|
cti = "";
|
|
var _IAD_localhostCallRecord = pataMeter_Q.GetModel_Patameter("ICSR_IAD_localhostCallRecord");
|
|
if (null != _IAD_localhostCallRecord)
|
|
{
|
|
var FuturesRecordServerUrl = _IAD_localhostCallRecord.PARAVALUE;
|
|
playurl = FuturesRecordServerUrl + "?serverID=" + _ServerID + "&file=" + _FileName.Replace("\\", "/");
|
|
cti = _CSVR_CALLRECORD_Q.Sys_Environment_CTI_VER();
|
|
if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.深海捷移动坐席).ToString())
|
|
{
|
|
playurl = FuturesRecordServerUrl + "?file=" + _FileName.Replace("\\", "/");
|
|
}
|
|
if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.深海捷固定坐席).ToString())
|
|
{
|
|
var shjctiinterface = Utility.GetSettingByKey("shj");
|
|
playurl = shjctiinterface + "?action=record_download&filename=/var/spool/asterisk/monitor/" + _FileName.Replace("\\", "/");
|
|
}
|
|
if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.和声).ToString())
|
|
{
|
|
playurl = FuturesRecordServerUrl + "?file=" + _FileName;
|
|
}
|
|
if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.艾讯).ToString())
|
|
{
|
|
playurl = FuturesRecordServerUrl + _FileName;
|
|
}
|
|
if (cti != null && cti == ((int)WX.CRM.Model.Enum.CTI_VER.艾讯new).ToString())
|
|
{
|
|
_IAD_localhostCallRecord = pataMeter_Q.GetModel_Patameter("ICSR_IAD_localhostCallRecord_AX");
|
|
var filename = _FileName;
|
|
if (null != _IAD_localhostCallRecord)
|
|
{
|
|
playurl = _IAD_localhostCallRecord.PARAVALUE + (filename.StartsWith("UP") ? "/home/" + filename : filename);
|
|
playurl = playurl.Replace("\\", "/");
|
|
}
|
|
}
|
|
}
|
|
return playurl;
|
|
}
|
|
|
|
private string getRecordSharedStatus(decimal? status)
|
|
{
|
|
if (!status.HasValue)
|
|
{
|
|
return "";
|
|
}
|
|
if (status == 1)
|
|
{
|
|
return "优秀录音";
|
|
}
|
|
else if (status == 2)
|
|
{
|
|
return "违规录音";
|
|
}
|
|
else if (status == 3)
|
|
{
|
|
return "升级违规录音";
|
|
}
|
|
else
|
|
{
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
} |