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

122 lines
4.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMAPP.FJC.Entity.WIPManage;
using QMAPP.FJC.DAL.WIPManage;
using QMAPP.FJC.BLL.Dict;
using QMFrameWork.Log;
using QMAPP.FJC.Entity;
using System.Data;
using QMAPP.Entity;
namespace QMAPP.FJC.BLL.WIPManage
{
/// <summary>
/// 模块编号:M7-4
/// 作 用:低储报警信息逻辑层
/// 作 者:王丹丹
/// 编写日期:2015年06月19日
///</summary>
public class StorageAlarmBLL : BaseBLL
{
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(StorageAlarm condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
DataPage dataPage = new StorageAlarmDAL().GetList(condition, page);
#region 转换记录状态、工序类别显示类型
List<StorageAlarm> List = dataPage.Result as List<StorageAlarm>;
DictManageBLL dictAlarmStatusBll = new DictManageBLL(DictKind.ALARMSTATUS);
DictManageBLL dictProcessTypeBll = new DictManageBLL(DictKind.PROCESSTYPE);
foreach (StorageAlarm m in List)
{
//记录状态
m.ALARMSTATUS = dictAlarmStatusBll.GetDictValue(m.ALARMSTATUS);
//工序类别
m.PROCESSTYPE = dictProcessTypeBll.GetDictValue(m.PROCESSTYPE);
}
#endregion
result.Result = dataPage;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "低储报警信息逻辑层-获取列表!"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
#region 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataResult<DataTable> GetExportData(StorageAlarm model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
try
{
DataTable dt = new StorageAlarmDAL().GetExportData(model);
#region 转换记录状态、工序类别显示类型
DictManageBLL dictAlarmStatusBll = new DictManageBLL(DictKind.ALARMSTATUS);
DictManageBLL dictProcessTypeBll = new DictManageBLL(DictKind.PROCESSTYPE);
foreach (DataRow item in dt.Rows)
{
//记录状态
item["ALARMSTATUS"] = dictAlarmStatusBll.GetDictValue(item["ALARMSTATUS"].ToString());
//工序类别
item["PROCESSTYPE"] = dictProcessTypeBll.GetDictValue(item["PROCESSTYPE"].ToString());
}
#endregion
result.Result = dt;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "低储报警信息逻辑层-导出数据!"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
result.IsSuccess = true;
return result;
}
#endregion
}
}