371 lines
15 KiB
C#
371 lines
15 KiB
C#
using Ninject;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
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.Ww;
|
|
using WX.CRM.IBLL.Wx;
|
|
using WX.CRM.Model.Ww;
|
|
using WX.CRM.WebHelper;
|
|
|
|
namespace WX.CRM.WEB.Controllers.WeiXin
|
|
{
|
|
public class MyIllegalRecordController : BaseController
|
|
{
|
|
IWX_MyIllegalRecord wx_myillegalrecord;
|
|
[Inject]
|
|
public IWw_huser hh_huser { get; set; }
|
|
[Inject]
|
|
public ICSVR_CALLRECORD_Q _CSVR_CALLRECORD_Q { get; set; }
|
|
[Inject]
|
|
public IBAS_PARAMETER_Q _BAS_PARAMETER_Q { get; set; }
|
|
|
|
public MyIllegalRecordController(IWX_MyIllegalRecord _wx_myillegalrecord)
|
|
{
|
|
this.wx_myillegalrecord = _wx_myillegalrecord;
|
|
}
|
|
#region 微信消息违规
|
|
//
|
|
// GET: /MyIllegalRecord/
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_我的违规记录)]
|
|
//
|
|
public ActionResult MesageIllegal()
|
|
{
|
|
//ToolBar
|
|
ToolBar tool = new ToolBar();
|
|
string[] toolbtn = new ToolButtonView().ToolButtonRight(InitRights.我的违规记录, userRightId);
|
|
tool.AllowButton(toolbtn);
|
|
ViewBag.ToolBar = tool;
|
|
|
|
Pager pager = new Pager() { page = 1, rows = 10 };
|
|
string tableId = "tablist";
|
|
Table tab = new Table(tableId);
|
|
tab.AddHeadCol("JOBUSERNAME", "", "工作微信");
|
|
tab.AddHeadCol("alias", "", "工作微信号");
|
|
tab.AddHeadCol("USERNAME", "", "客户用户名");
|
|
tab.AddHeadCol("nickname", "", "昵称");
|
|
tab.AddHeadCol("conremark", "", "客户备注");
|
|
tab.AddHeadCol("MESSAGE", "40%", "消息");
|
|
tab.AddHeadCol("ORIGINALTIME", "", "消息时间");
|
|
tab.AddHeadCol("MSGSOURCE", "", "消息类型 ");
|
|
tab.AddHeadCol("REMARK", "", "违规细则 ");
|
|
tab.AddHeadCol("CTIME", "", "违规添加时间");
|
|
tab.AddHeadCol("BIGTYPE", "", "违规类型");
|
|
tab.AddHeadCol("PENALTY", "", "违规金额");
|
|
tab.AddHeadCol("RESULT", "", "处理结果");
|
|
tab.AddHeadRow();
|
|
|
|
ViewBag.gridTable = tab.GetHead() + Pagination.GetPage(pager, tableId, "10,20,50");
|
|
return View();
|
|
}
|
|
|
|
public ActionResult LookNotice(decimal type, DateTime? stime, DateTime? etime)
|
|
{
|
|
wx_myillegalrecord.UpadteNoticeLookStatus(UserId, type);
|
|
if (type == 1)
|
|
return Redirect("/WeiXin/Message/CountCompliance?stime=" + stime + "&etime=" + etime);
|
|
else if (type == 2)
|
|
return Redirect("/WeiXin/Message/ComplianceIndex?stime=" + stime + "&etime=" + etime);
|
|
else if (type == 3)
|
|
return Redirect("/WeiXin/MyIllegalRecord/MesageIllegal");
|
|
return View();
|
|
}
|
|
/// <summary>
|
|
/// 按照条件获取数据
|
|
/// </summary>
|
|
/// <param name="pager">分页信息</param>
|
|
/// <returns></returns>
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_我的违规记录)]
|
|
public JsonResult GetHtmlList(Pager pager, string columns, DateTime? stime, DateTime? etime, decimal ntype)
|
|
{
|
|
if (etime.HasValue)
|
|
{
|
|
etime = etime.Value.AddDays(1);
|
|
}
|
|
|
|
DataSet list = wx_myillegalrecord.GetMyIllegalRecord(ref pager, UserId, stime, etime, ntype);
|
|
Table table = new Table(columns, true);
|
|
table.gridPager = pager;
|
|
foreach (DataRow row in list.Tables[1].Rows)
|
|
{
|
|
table.AddCol(row["JOBUSERNAME"]);
|
|
table.AddCol(row["alias"]);
|
|
table.AddCol(row["USERNAME"]);
|
|
table.AddCol(row["nickname"]);
|
|
table.AddCol(row["conremark"]);
|
|
table.AddCol(row["MESSAGE"]);
|
|
if (row["ORIGINALTIME"] != DBNull.Value)
|
|
table.AddCol(Convert.ToDateTime(row["ORIGINALTIME"]).ToUnityString(2));
|
|
else
|
|
table.AddCol("");
|
|
table.AddCol(GetType(string.Format("{0}", row["MSGSOURCE"])));
|
|
table.AddCol(row["REMARK"]);
|
|
table.AddCol(Convert.ToDateTime(row["CTIME"]).ToUnityString(2));
|
|
table.AddCol(row["BIGTYPE"].ToString());
|
|
table.AddCol(row["PENALTY"]);
|
|
table.AddRow();
|
|
}
|
|
var json = new
|
|
{
|
|
totalPages = pager.totalPages,
|
|
totalRows = pager.totalRows,
|
|
rowsList = table.GetRows()
|
|
};
|
|
return Json(json, JsonRequestBehavior.AllowGet);
|
|
}
|
|
#endregion
|
|
|
|
#region 微信录音违规
|
|
//
|
|
// GET: /MyIllegalRecord/
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_我的违规记录)]
|
|
//
|
|
public ActionResult RecodeIllegal()
|
|
{
|
|
//ToolBar
|
|
ToolBar tool = new ToolBar();
|
|
string[] toolbtn = new ToolButtonView().ToolButtonRight(InitRights.我的违规记录, userRightId);
|
|
tool.AllowButton(toolbtn);
|
|
ViewBag.ToolBar = tool;
|
|
|
|
Pager pager = new Pager() { page = 1, rows = 10 };
|
|
string tableId = "tablist";
|
|
Table tab = new Table(tableId);
|
|
tab.AddHeadCol("JOBUSERNAME", "", "录音ID");
|
|
tab.AddHeadCol("alias", "", "客户ID");
|
|
tab.AddHeadCol("ORIGINALTIME", "", "时间");
|
|
//tab.AddHeadCol("MSGSOURCE", "", "消息类型 ");
|
|
tab.AddHeadCol("REMARK", "", "违规备注 ");
|
|
tab.AddHeadCol("CTIME", "", "违规添加时间");
|
|
tab.AddHeadCol("BIGTYPE", "", "违规类型");
|
|
tab.AddHeadCol("PENALTY", "", "违规金额");
|
|
tab.AddHeadCol("bofang", "", "播放");
|
|
tab.AddHeadRow();
|
|
|
|
ViewBag.gridTable = tab.GetHead() + Pagination.GetPage(pager, tableId, "10,20,50");
|
|
return View();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 按照条件获取数据
|
|
/// </summary>
|
|
/// <param name="pager">分页信息</param>
|
|
/// <returns></returns>
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_我的违规记录)]
|
|
public JsonResult RecodeGetHtmlList(Pager pager, string columns, DateTime? stime, DateTime? etime, decimal ntype)
|
|
{
|
|
if (etime.HasValue)
|
|
{
|
|
etime = etime.Value.AddDays(1);
|
|
}
|
|
|
|
DataSet list = wx_myillegalrecord.GetMyIllegalRecord(ref pager, UserId, stime, etime, ntype);
|
|
Table table = new Table(columns, true);
|
|
table.gridPager = pager;
|
|
foreach (DataRow row in list.Tables[1].Rows)
|
|
{
|
|
table.AddCol(row["RECORDID"]);
|
|
table.AddCol(row["RESID"]);
|
|
if (row["ORIGINALTIME"] != DBNull.Value)
|
|
table.AddCol(Convert.ToDateTime(row["ORIGINALTIME"]).ToUnityString(2));
|
|
else
|
|
table.AddCol("");
|
|
|
|
//table.AddCol(GetType(string.Format("{0}", row["MSGSOURCE"])));
|
|
table.AddCol(row["REMARK"]);
|
|
table.AddCol(Convert.ToDateTime(row["CTIME"]).ToUnityString(2));
|
|
table.AddCol(getBigTypeStr(row["BIGTYPE"].ToString()));
|
|
table.AddCol(row["PENALTY"]);
|
|
string cti;
|
|
string playurl = _getCallRecordUrl(row["ServerID"].ToString(), row["FileName"].ToString(), out cti);
|
|
var playcrl = string.Format("<input id=\"BtnPlayer\" type=\"button\" value=\" 播 放 \" onclick=\"PalyRecord('{0}','DivPlayer{1}','{2}')\" />",
|
|
playurl, row["RECORDID"], cti == null ? "" : cti);
|
|
playcrl += string.Format("<div id=\"DivPlayer{0}\"></div><input type=\"hidden\" id=\"hidRecordUrl\" value=\"{1}\" />", row["RECORDID"], playurl);
|
|
table.AddCol(playcrl);
|
|
table.AddRow();
|
|
}
|
|
var json = new
|
|
{
|
|
totalPages = pager.totalPages,
|
|
totalRows = pager.totalRows,
|
|
rowsList = table.GetRows()
|
|
};
|
|
return Json(json, JsonRequestBehavior.AllowGet);
|
|
}
|
|
/// <summary>
|
|
/// 获取录音地址
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private string _getCallRecordUrl(string _ServerID, string _FileName, out string cti)
|
|
{
|
|
var playurl = "";
|
|
cti = "";
|
|
var _IAD_localhostCallRecord = _BAS_PARAMETER_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 = _BAS_PARAMETER_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;
|
|
}
|
|
#endregion
|
|
|
|
|
|
private string GetType(string ntype)
|
|
{
|
|
string typemsg = "";
|
|
if (string.IsNullOrEmpty(ntype))
|
|
return "";
|
|
if (ntype == "1")
|
|
typemsg = "私聊消息";
|
|
if (ntype == "2")
|
|
typemsg = "群发消息";
|
|
return typemsg;
|
|
}
|
|
|
|
private string getBigTypeStr(string bigType)
|
|
{
|
|
string str = "";
|
|
if (bigType == "MessageComplianceA")
|
|
{
|
|
str = "一类违规";
|
|
}
|
|
else if (bigType == "MessageComplianceB")
|
|
{
|
|
str = "二类违规";
|
|
}
|
|
else if (bigType == "MessageComplianceC")
|
|
{
|
|
str = "三类违规";
|
|
}
|
|
else if (bigType == "MessageComplianceD")
|
|
{
|
|
str = "四类违规";
|
|
}
|
|
return str;
|
|
}
|
|
|
|
|
|
#region 微信消息违规
|
|
//
|
|
// GET: /MyIllegalRecord/
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_我的违规记录)]
|
|
//
|
|
public ActionResult QWllegal()
|
|
{
|
|
//ToolBar
|
|
ToolBar tool = new ToolBar();
|
|
string[] toolbtn = new ToolButtonView().ToolButtonRight(InitRights.我的违规记录, userRightId);
|
|
tool.AllowButton(toolbtn);
|
|
ViewBag.ToolBar = tool;
|
|
|
|
Pager pager = new Pager() { page = 1, rows = 10 };
|
|
string tableId = "tablist";
|
|
Table tab = new Table(tableId);
|
|
tab.AddHeadCol("corpid", "", "企业号");
|
|
tab.AddHeadCol("HHUSERID", "", "企微ID");
|
|
tab.AddHeadCol("HHUSERNAME", "", "名称");
|
|
tab.AddHeadCol("EXTUSERID", "10%", "客户ID");
|
|
tab.AddHeadCol("EXTNAME", "", "客户名称");
|
|
tab.AddHeadCol("MESSAGE", "25%", "消息");
|
|
tab.AddHeadCol("MSGTIME", "", "消息时间");
|
|
tab.AddHeadCol("REMARK", "", "违规细则 ");
|
|
tab.AddHeadCol("CTIME", "", "违规添加时间");
|
|
tab.AddHeadCol("BIGTYPE", "", "违规类型");
|
|
tab.AddHeadCol("PENALTY", "", "违规金额");
|
|
tab.AddHeadCol("RESULT", "", "处理结果");
|
|
tab.AddHeadRow();
|
|
|
|
ViewBag.gridTable = tab.GetHead() + Pagination.GetPage(pager, tableId, "10,20,50");
|
|
return View();
|
|
}
|
|
/// <summary>
|
|
/// 按照条件获取数据
|
|
/// </summary>
|
|
/// <param name="pager">分页信息</param>
|
|
/// <returns></returns>
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_我的违规记录)]
|
|
public JsonResult GetQWllegalHtmlList(Pager pager, string columns, DateTime? stime, DateTime? etime, decimal ntype)
|
|
{
|
|
if (etime.HasValue)
|
|
{
|
|
etime = etime.Value.AddDays(1);
|
|
}
|
|
|
|
DataSet list = wx_myillegalrecord.GetMyIllegalRecord(ref pager, UserId, stime, etime, ntype);
|
|
Table table = new Table(columns, true);
|
|
table.gridPager = pager;
|
|
List<Ww_Corp> corlist = hh_huser.Corp_Get();//企业号
|
|
foreach (DataRow row in list.Tables[1].Rows)
|
|
{
|
|
string corpid = row["corpid"].ToString();
|
|
Ww_Corp corp = corlist.FirstOrDefault(m => m.corpid == corpid);
|
|
if (corp != null)
|
|
{
|
|
table.AddCol(corp.corpname);
|
|
}
|
|
else
|
|
{
|
|
table.AddCol("");
|
|
}
|
|
table.AddCol(row["HHUSERID"]);
|
|
table.AddCol(row["HHUSERNAME"]);
|
|
table.AddCol(row["EXTUSERID"]);
|
|
table.AddCol(row["EXTNAME"]);
|
|
table.AddCol(row["MESSAGE"]);
|
|
if (row["ORIGINALTIME"] != DBNull.Value)
|
|
table.AddCol(Convert.ToDateTime(row["ORIGINALTIME"]).ToUnityString(2));
|
|
else
|
|
table.AddCol("");
|
|
//table.AddCol(GetType(string.Format("{0}", row["MSGSOURCE"])));
|
|
table.AddCol(row["REMARK"]);
|
|
table.AddCol(Convert.ToDateTime(row["CTIME"]).ToUnityString(2));
|
|
table.AddCol(row["BIGTYPE"].ToString());
|
|
table.AddCol(row["PENALTY"]);
|
|
table.AddCol(row["RESULT"]);
|
|
table.AddRow();
|
|
}
|
|
var json = new
|
|
{
|
|
totalPages = pager.totalPages,
|
|
totalRows = pager.totalRows,
|
|
rowsList = table.GetRows()
|
|
};
|
|
return Json(json, JsonRequestBehavior.AllowGet);
|
|
}
|
|
#endregion
|
|
}
|
|
}
|