90 lines
3.1 KiB
C#
90 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
|
using Mini.Common;
|
|
using Mini.Model.CrmModel;
|
|
using Mini.Model.Entity;
|
|
using Mini.Model.ViewModel;
|
|
using Mini.Services.Bas;
|
|
using Mini.Services.ww;
|
|
using Mini.Web.WebHelper;
|
|
|
|
namespace Mini.Web.Areas.Admin.Controllers
|
|
{
|
|
public class MomentController : BaseController
|
|
{
|
|
private readonly Iww_hhuser_Service _iww_hhuser_service;
|
|
private readonly IBasParameterService _bas_parameter;
|
|
private readonly IBasConfigService _config;
|
|
public MomentController(Iww_hhuser_Service iww_hhuser_service, IBasParameterService bas_parameter, IBasConfigService config)
|
|
{
|
|
this._iww_hhuser_service = iww_hhuser_service;
|
|
this._bas_parameter = bas_parameter;
|
|
this._config = config;
|
|
|
|
}
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_朋友圈)]
|
|
[Area("Admin")]
|
|
public ActionResult Index(string weixincrmaccount)
|
|
{
|
|
//ToolBar
|
|
ToolBar tool = new ToolBar();
|
|
//string[] toolbtn = new ToolButtonView().ToolButtonRight(InitRights.朋友圈, userRightId);
|
|
string[] toolbtn;
|
|
if (!string.IsNullOrEmpty(weixincrmaccount) && userRightId.Contains("-1"))
|
|
{
|
|
toolbtn = new string[] { "Other1" };
|
|
}
|
|
else
|
|
{
|
|
toolbtn = new ToolButtonView().ToolButtonRight(InitRights.朋友圈, userRightId);
|
|
}
|
|
|
|
tool.AllowButton(toolbtn);
|
|
tool.AddOtherButton("Other1", "详细", "", "", true);
|
|
ViewBag.ToolBar = tool;
|
|
|
|
List<Ww_Corp> list = _iww_hhuser_service.Corp_Get();
|
|
List<SelectListItem> selectlist = new List<SelectListItem>();
|
|
foreach (Ww_Corp item in list)
|
|
{
|
|
selectlist.Add(new SelectListItem() { Text = item.corpname, Value = item.corpid });
|
|
}
|
|
ViewBag.Select = selectlist;
|
|
ViewBag.weixincrmaccount = weixincrmaccount;
|
|
return View();
|
|
}
|
|
|
|
[HttpPost]
|
|
[Area("Admin")]
|
|
[AuthorizeRedirect(Roles = InitRights.CONST_企业微信监控)]
|
|
public JsonResult GetMomentHtmlList(Laypage pager, string name, string corp, string columns, string weixincrmaccount)
|
|
{
|
|
|
|
var layUidata = new LayuiData<Ww_MomentModel>();
|
|
try
|
|
{
|
|
List<Ww_MomentModel> list = _iww_hhuser_service.Moment_Get(ref pager, name, corp);
|
|
layUidata.msg = "数据加载成功";
|
|
layUidata.code = 0;
|
|
layUidata.data = list;
|
|
layUidata.count = pager.count;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogHelper.Error(ex.ToString());
|
|
layUidata.SetFail(1, "出现错误!" + ex.Message);
|
|
}
|
|
return Json(layUidata);
|
|
}
|
|
|
|
[Area("Admin")]
|
|
public ActionResult Test()
|
|
{
|
|
return View();
|
|
}
|
|
}
|
|
} |