TG.WXCRM.V4/WEB/Controllers/MessageCenter/MessageCenterController.cs

86 lines
3.2 KiB
C#

using Newtonsoft.Json;
using Ninject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using WX.CRM.BLL.Util;
using WX.CRM.Common;
using WX.CRM.Common.StockHelper;
using WX.CRM.IBLL.Res;
using WX.CRM.Model.Entity;
using WX.CRM.Model.Enum;
using WX.CRM.WebHelper;
namespace WX.CRM.WEB.Controllers.MessageCenter
{
public class MessageCenterController : BaseController
{
[Inject]
public IRES_SCENE _resScene { get; set; }
private CACHE_BL cache_BL = new CACHE_BL();
[AuthorizeRedirect(Roles = InitRights.CONST_消息中心)]
public ActionResult Index(int? notificationType)
{
ViewBag.notificationType = notificationType;
return View();
}
[AuthorizeRedirect(Roles = InitRights.CONST_成交客户重复联系统计)]
public ActionResult NotificationStatistics()
{
var scenetype = _resScene.GetSceneType();
ViewBag.SceneType = scenetype;
var webapi = cache_BL.GetValue_Parameter(Parameter.CRM_CORE_WEBAPI);
ViewBag.webapi = webapi;
var appid = System.Configuration.ConfigurationManager.AppSettings["appid"];
ViewBag.appid = appid;
ViewBag.Eid = Eid;
return View();
}
[AuthorizeRedirect(Roles = InitRights.CONST_消息中心)]
public ActionResult RepeatedContactNotification(int? notificationType)
{
var scenetype = _resScene.GetSceneType();
ViewBag.SceneType = scenetype;
var webapi = cache_BL.GetValue_Parameter(Parameter.CRM_CORE_WEBAPI);
ViewBag.webapi = webapi;
var appid = System.Configuration.ConfigurationManager.AppSettings["appid"];
ViewBag.appid = appid;
ViewBag.Eid = Eid;
ViewBag.notificationType = notificationType;
return View();
}
public ActionResult EarlyWarning(string sgin, int eid, string createTime)
{
var scenetype = _resScene.GetSceneType();
ViewBag.SceneType = scenetype;
var webapi = cache_BL.GetValue_Parameter(Parameter.ZXD_CORE_WEBAPI);
ViewBag.webapi = webapi;
var appid = System.Configuration.ConfigurationManager.AppSettings["appid"];
ViewBag.appid = appid;
ViewBag.Eid = eid;
ViewBag.CreateTime = createTime;
ViewBag.Sgin = sgin;
return View();
}
public string EarlyWarningPage(SearchEarlyWarningLogDto dto)
{
var webapi = cache_BL.GetValue_Parameter(Parameter.ZXD_CORE_WEBAPI);
webapi = $"{webapi}/Api/EarlyWarning/log/page";
var para = $"pageIndex={dto.PageIndex}&pageSize={dto.PageSize}&sgin={dto.Sgin}&AttainTimeFrom={dto.AttainTimeFrom}&AttainTimeTo={dto.AttainTimeTo}&Eid={dto.Eid}&Name={dto.Name}&Status={dto.Status}";
var result = Utility.GetData(webapi, para, Encoding.UTF8);
//var reqInfo = JsonConvert.DeserializeObject<ApiResult<dynamic>>(result);
//res = reqInfo.Data.data;
return result;
}
}
}