天津投入产出系统后端
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.
 
 
 
 
 
 

128 lines
4.4 KiB

using System;
using System.Collections.Generic;
using System.Data;
using QMAPP.BLL;
using QMAPP.Entity;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.DAL.EquipMentAlarmManage;
using QMAPP.FJC.Entity.WarnManage;
using QMFrameWork.Data;
using QMFrameWork.Log;
namespace QMAPP.FJC.BLL.WarnManage
{
/// <summary>
/// 模块编号:M6-1设备报警记录查询
/// 作 用:设备报警记录查询
/// 作 者:张敬贺
/// 编写日期:2015年06月17日
///</summary>
public class EquipMentAlarmBLL : BaseBLL
{
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(WarnInfo condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
result.IsSuccess = true;
page = new EquipMentAlarmDAL().GetList(condition, page);
List<WarnInfo> list = page.Result as List<WarnInfo>;
//处理字典信息
DictManageBLL dictWARNTYPE = new DictManageBLL(DictKind.WARNTYPE);
DictManageBLL dictCREATETYPE = new DictManageBLL(DictKind.CREATETYPE);
DictManageBLL dictISDEAL = new DictManageBLL(DictKind.ISDEAL);
DictManageBLL dictISDONE = new DictManageBLL(DictKind.ISDONE);
foreach (var info in list)
{
//替换是否发送显示值
info.ISDEAL = dictISDEAL.GetDictValue(info.ISDEAL);
//替换是否完成显示值
info.ISDONE = dictISDONE.GetDictValue(info.ISDONE);
//替换报警类别显示值
info.WARNTYPE = dictWARNTYPE.GetDictValue(info.WARNTYPE);
//替换生成方式显示值
info.CREATETYPE = dictCREATETYPE.GetDictValue(info.CREATETYPE);
}
result.Result = page;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "设备报警信息获取列表错误!"
});
result.IsSuccess = false;
result.Msg = "设备报警信息获取列表错误!";
}
return result;
}
#endregion
#region 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataResult<DataTable> GetExportData(WarnInfo model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
try
{
result.IsSuccess = true;
result.Result = new EquipMentAlarmDAL().GetExportData(model);
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictWARNTYPE = new DictManageBLL(DictKind.WARNTYPE);
foreach (DataRow dr in result.Result.Rows)
{
//替换是否发送显示值
dr["ISDEAL"] = dictPROCESSTYPE.GetDictValue(dr["ISDEAL"].ToString());
//替换是否完成显示值
dr["ISDONE"] = dictWARNTYPE.GetDictValue(dr["ISDONE"].ToString());
//替换报警类别显示值
dr["WARNTYPE"] = dictWARNTYPE.GetDictValue(dr["WARNTYPE"].ToString());
//替换生成方式显示值
dr["CREATETYPE"] = dictWARNTYPE.GetDictValue(dr["CREATETYPE"].ToString());
}
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "设备报警信息导出错误!"
});
result.IsSuccess = false;
result.Msg = "设备报警信息导出错误!";
}
return result;
}
#endregion
}
}