159 lines
4.9 KiB
C#
159 lines
4.9 KiB
C#
using Learun.Application.Base.SystemModule;
|
||
using Learun.Application.TwoDevelopment.ZZDT_EC;
|
||
using Learun.Cache.Base;
|
||
using Learun.Cache.Factory;
|
||
using Learun.Util;
|
||
using Learun.Util.Operat;
|
||
using System.Web.Mvc;
|
||
|
||
namespace Learun.Application.Web.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
|
||
/// Copyright (c) 2013-2018 Hexagon PPM
|
||
/// 创建人:研发部
|
||
/// 日 期:2017.03.09
|
||
/// 描 述:主页控制器
|
||
/// </summary>
|
||
public class HomeController : MvcControllerBase
|
||
{
|
||
#region 视图功能
|
||
private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL();
|
||
/// <summary>
|
||
/// 单位平台 框架
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
public ActionResult AdminSystemManage()
|
||
{
|
||
UserInfo userInfo = LoginUserInfo.Get();
|
||
if (userInfo != null)
|
||
{
|
||
ViewBag.UserId = userInfo.userId;
|
||
}
|
||
return View();
|
||
}
|
||
|
||
|
||
/// <summary>
|
||
/// 网页端 公司级 首页
|
||
/// </summary>
|
||
[HttpGet]
|
||
public ActionResult AdminSystemPageIndex()
|
||
{
|
||
return View();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 项目平台 框架
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
public ActionResult AdminProjectManage(string ProjectId)
|
||
{
|
||
//写入项目ID
|
||
UserInfo userInfo = LoginUserInfo.Get();
|
||
if (userInfo != null)
|
||
{
|
||
ViewBag.UserId = userInfo.userId;
|
||
}
|
||
return View();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 项目平台 首页
|
||
/// </summary>
|
||
[HttpGet]
|
||
public ActionResult AdminProjectPageIndex()
|
||
{
|
||
return View();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 初始化页面(项目管理)
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpGet]
|
||
public ActionResult AdminProject()
|
||
{
|
||
UserInfo userInfo = LoginUserInfo.Get();
|
||
if (userInfo != null)
|
||
{
|
||
ViewBag.UserId = userInfo.userId;
|
||
}
|
||
return View();
|
||
}
|
||
#endregion
|
||
|
||
private ICache cache = CacheFactory.CaChe();
|
||
#region 清空缓存
|
||
/// <summary>
|
||
/// 清空缓存
|
||
/// </summary>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
[AjaxOnly]
|
||
public ActionResult ClearRedis()
|
||
{
|
||
for (int i = 0; i < 16; i++)
|
||
{
|
||
cache.RemoveAll(i);
|
||
}
|
||
return Success("清空成功");
|
||
}
|
||
#endregion
|
||
|
||
/// <summary>
|
||
/// 访问功能。点击主页面左侧导航树下的某个节点。比如点击(图纸目录、样板目录)
|
||
/// </summary>
|
||
/// <param name="moduleId">功能Id</param>
|
||
/// <param name="moduleName">功能模块</param>
|
||
/// <param name="moduleUrl">访问路径</param>
|
||
/// <returns></returns>
|
||
[HttpPost]
|
||
public ActionResult VisitModule(string moduleName, string moduleUrl)
|
||
{
|
||
UserInfo userInfo = LoginUserInfo.Get();
|
||
LogEntity logEntity = new LogEntity();
|
||
logEntity.F_CategoryId = 2;
|
||
logEntity.F_OperateTypeId = ((int)OperationType.Visit).ToString();
|
||
logEntity.F_OperateType = EnumAttribute.GetDescription(OperationType.Visit);
|
||
logEntity.F_OperateAccount = userInfo.account;
|
||
logEntity.F_OperateUserId = userInfo.userId;
|
||
logEntity.F_Module = moduleName;
|
||
logEntity.F_ExecuteResult = 1;
|
||
logEntity.F_ExecuteResultJson = "访问地址:" + moduleUrl;
|
||
logEntity.WriteLog();
|
||
return Success("ok");
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取当前项目信息
|
||
/// </summary>
|
||
public ActionResult GetProject()
|
||
{
|
||
string ProjectId = Request.Params["ProjectId"];
|
||
ec_projectIBLL projectIBLL = new ec_projectBLL();
|
||
var data = projectIBLL.GetEntity(ProjectId);
|
||
return Success(data);
|
||
}
|
||
|
||
#region 模拟用户跳转
|
||
public ActionResult MonitLogin(string username, string password)
|
||
{
|
||
string account = Request["account"];
|
||
Organization.UserEntity userEntity1 = new Organization.UserBLL().GetEntityByAccount(account);
|
||
if (userEntity1 != null)
|
||
{
|
||
OperatorHelper.Instance.AddLoginUser(userEntity1.F_Account, "Learun_ADMS_6.1_PC", null);//写入缓存信息
|
||
var jsonData = new
|
||
{
|
||
UpdatePassWord = true
|
||
};
|
||
return RedirectToAction("AdminSystemManage", "Home");
|
||
}
|
||
return RedirectToAction("Index", "Login");
|
||
}
|
||
#endregion
|
||
}
|
||
} |