天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

144 lines
4.7 KiB

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using QMFrameWork.WebUI.Attribute;
using QMAPP.Web.Models.Sys;
using QMFrameWork.Data;
using QMAPP.Entity.Sys;
using QMAPP.Common.Web.Controllers;
using QMFrameWork.WebUI.DataSource;
namespace QMAPP.Web.Controllers
{
/// <summary>
/// 系统操作记录
/// </summary>
public class SystemLogController : QController
{
#region 记录列表
/// <summary>
/// 记录列表
/// </summary>
/// <returns>结果</returns>
[HandleException]
public ActionResult SystemOperateLogList(bool? callBack)
{
SystemOperateLogModel seachModel = new SystemOperateLogModel();
if (callBack == true)
{
TryGetSelectBuffer<SystemOperateLogModel>(out seachModel);
}
seachModel.rownumbers = false;
seachModel.url = "/SystemOperateLog/GetList";
return View("SystemOperateLogList", seachModel);
}
/// <summary>
/// 获取用户信息列表
/// </summary>
/// <param name="callBack">是否回调</param>
/// <returns>用户信息列表</returns>
[HandleException]
public ActionResult GetList(bool? callBack)
{
List<SystemOperateLogModel> log = new List<SystemOperateLogModel>();
SystemOperateLogModel seachModel = new SystemOperateLogModel();
DataPage page = new DataPage();
//SystemOperateLogBLL logBll = null;
SystemOperateLog condition = null;
try
{
//获取查询对象
seachModel = GetModel<SystemOperateLogModel>(seachModel);
#region 获取缓存值
if (callBack != null)
{
TryGetSelectBuffer<SystemOperateLogModel>(out seachModel);
}
else
{
//保存搜索条件
SetSelectBuffer<SystemOperateLogModel>(seachModel);
}
#endregion
//获取前台分页控件的分页大小
page = this.GetDataPage(seachModel);
//获取数据
condition = CopyToModel<SystemOperateLog, SystemOperateLogModel>(seachModel);
//logBll = BLLFactory.CreateBLL<SystemOperateLogBLL>();
////控制层得到用户的IP地址
////设置到实体的父类属性中..
//page = logBll.GetList(condition, page);
#region 调用服务
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
page = agent.InvokeServiceFunction<DataPage>("SystemOperateLogBLL_GetList", condition, page);
#endregion
DateGridResult<SystemOperateLog> result = new DateGridResult<SystemOperateLog>();
result.Total = page.RecordCount;
result.Rows = (List<SystemOperateLog>)page.Result;
return Content(result.GetJsonSource());
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region 导出excel
/// <summary>
/// 导出excel
/// </summary>
/// <returns>结果</returns>
[HttpPost]
public ActionResult ExportExcel()
{
SystemOperateLogModel seachModel = null;
SystemOperateLog condition = null;
DataTable exportDt = new DataTable();
try
{
//获取查询对象
seachModel = GetModel<SystemOperateLogModel>();
condition = CopyToModel<SystemOperateLog, SystemOperateLogModel>(seachModel);
//获取数据
//SystemOperateLogBLL logBll = null;
//logBll = BLLFactory.CreateBLL<SystemOperateLogBLL>();
//exportDt = logBll.GetExportData(condition);
#region 调用服务
QMAPP.ServicesAgent.ServiceAgent agent = this.GetServiceAgent();
exportDt = agent.InvokeServiceFunction<DataTable>("SystemOperateLogBLL_GetExportData", condition);
#endregion
//导出
QMFrameWork.WebUI.Util.IEFileTool efTool = new QMFrameWork.WebUI.Util.IEFileTool();
return efTool.GetExcelFileResult("SystemOperateLog", "SystemOperateLog.xls", exportDt);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
}
}