146 lines
5.5 KiB
C#
146 lines
5.5 KiB
C#
using Core.Web.WebHelper;
|
|
using Core.Web.WebHelper.UserRight;
|
|
using CRM.Core.BLL.Base;
|
|
using CRM.Core.BLL.EventBus.Events;
|
|
using CRM.Core.BLL.Res;
|
|
using CRM.Core.BLL.Soft;
|
|
using CRM.Core.BLL.Util;
|
|
using CRM.Core.BLL.Wx;
|
|
using CRM.Core.Common.EventBus;
|
|
using CRM.Core.Common.Layui;
|
|
using CRM.Core.Common.WebHelper;
|
|
using CRM.Core.DTO;
|
|
using CRM.Core.DTO.Ord;
|
|
using CRM.Core.Model.Entity;
|
|
using CRM.Core.Model.Enum;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Web;
|
|
using System.Web.Mvc;
|
|
using WX.CRM.Common;
|
|
using CRM.Core.BLL.Level2;
|
|
using CRM.Core.BLL;
|
|
using CRM.Core.BLL.FB;
|
|
using CRM.Core.Model.EntityFB;
|
|
using CRM.Core.Model;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using Core.Web.App_Start;
|
|
using CRM.Core.BLL.Application.Order;
|
|
using NPOI.HPSF;
|
|
|
|
namespace Core.Web.Controllers
|
|
{
|
|
public class AiAudioListController : Controller
|
|
{
|
|
private WX_SZZYORDER_BL _order = new WX_SZZYORDER_BL();
|
|
// GET: AiAudioList
|
|
[HttpGet]
|
|
public ActionResult HgRecordList()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
public JsonResult HgRecordList(int orderId, string deptcode)
|
|
{
|
|
try
|
|
{
|
|
var order = _order.Get(p => p.ORDERID == orderId);
|
|
if (order == null)
|
|
{
|
|
return Json(new retMsg { result = false, retmsg = "参数错误!" }, JsonRequestBehavior.AllowGet);
|
|
}
|
|
List<CRM.Core.BLL.Csvr.AudioRecordView> res = new List<CRM.Core.BLL.Csvr.AudioRecordView>();
|
|
var bll = new CRM.Core.BLL.Csvr.Csvr_AiCallTask_BL();
|
|
res = bll.GetAudioByOrderId(orderId);
|
|
|
|
var hgrecordbll = new CRM.Core.BLL.Csvr.Csvr_HgRecord_BL();
|
|
var recordlist = hgrecordbll.GetList(p => p.ORDERID == orderId).ToList();
|
|
foreach (var r in recordlist)
|
|
{
|
|
//var t = AESHelper.encyptData(r.RECORDID.ToString(), "UPWEBSITE");
|
|
CRM.Core.BLL.Csvr.AudioRecordView newObj = new CRM.Core.BLL.Csvr.AudioRecordView
|
|
{
|
|
RECORDID = r.RECORDID,
|
|
FILENAME = r.FILENAME,
|
|
RESID = r.RESID,
|
|
TIMELENGTH = r.TIMELENGTH,
|
|
SALESEID = r.SALESEID.ToString(),
|
|
TIMESTART = r.TIMESTART,
|
|
TIMEEND = r.TIMEEND,
|
|
ORDERID = r.ORDERID,
|
|
CONTENT = r.CONTENT,
|
|
Ctime = r.CTIME,
|
|
COMPANYCODE = r.COMPANYCODE
|
|
};
|
|
res.Add(newObj);
|
|
}
|
|
res = res.OrderBy(n => n.Ctime).ToList();
|
|
res.ForEach(r => r.sid = AESHelper.encyptData(r.RECORDID.ToString(), "UPWEBSITE"));
|
|
var data = new
|
|
{
|
|
msg = "数据加载成功!",
|
|
count = 1,
|
|
code = 0,
|
|
data = res
|
|
};
|
|
return Json(data, JsonRequestBehavior.AllowGet);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex.ToString());
|
|
return Json(new { }, JsonRequestBehavior.AllowGet);
|
|
}
|
|
}
|
|
[HttpPost]
|
|
public JsonResult RecordPlay(string FileName, string companyCode)
|
|
{
|
|
try
|
|
{
|
|
//ConStringHelper.CompanyCode code = (ConStringHelper.CompanyCode)Enum.Parse(typeof(ConStringHelper.CompanyCode), companyCode);
|
|
//_csvrCallRecord = new Csvr_CallRecord_BL(code);
|
|
var host = ConfigurationManager.AppSettings["video_" + companyCode].ToString();
|
|
//var model = _csvrCallRecord.Get(p => p.recordid == recordid);
|
|
//if (model == null)
|
|
// return Json(new retMsg { result = false, retcode = 0, retmsg = "未能找到记录,请稍后重试!" }, JsonRequestBehavior.AllowGet);
|
|
var url = host + FileName;
|
|
return Json(new retMsg { result = true, retcode = 1, retmsg = url }, JsonRequestBehavior.AllowGet);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex.ToString());
|
|
return Json(new retMsg
|
|
{
|
|
result = false,
|
|
retmsg = ex.ToString()
|
|
}, JsonRequestBehavior.AllowGet);
|
|
}
|
|
|
|
}
|
|
[HttpGet]
|
|
public ActionResult AudioDetail(string id)
|
|
{
|
|
//id = id.Replace(" ", "+"); // 加密后会把加号自动转成空格,加密后手动改回
|
|
//var ids = AESHelper.decyptData(id, "UPWEBSITE"); // 解密
|
|
//if (ids == null) return View();
|
|
//var recorddb = new CRM.Core.BLL.Csvr.Csvr_AiCallTask_BL();
|
|
//var model = recorddb.GetModel(int.Parse(ids));
|
|
ViewBag.id = id;
|
|
return View();
|
|
}
|
|
|
|
[HttpGet]
|
|
public JsonResult getData(string id)
|
|
{
|
|
id = id.Replace(" ", "+"); // 加密后会把加号自动转成空格,加密后手动改回
|
|
var ids = AESHelper.decyptData(id, "UPWEBSITE"); // 解密
|
|
if (ids == null) return Json("", JsonRequestBehavior.DenyGet);
|
|
var recorddb = new CRM.Core.BLL.Csvr.Csvr_AiCallTask_BL();
|
|
var data = recorddb.BuildAudioModel(int.Parse(ids));
|
|
return Json(data, JsonRequestBehavior.AllowGet);
|
|
}
|
|
}
|
|
} |