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.
117 lines
3.9 KiB
117 lines
3.9 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.BLL;
|
|
using QMAPP.Entity;
|
|
using QMAPP.FJC.Entity.Equipment;
|
|
using QMFrameWork.Data;
|
|
using QMAPP.FJC.BLL.Dict;
|
|
using QMAPP.FJC.DAL.Equipment;
|
|
using System.Data;
|
|
using QMFrameWork.Log;
|
|
using QMAPP.FJC.Entity;
|
|
|
|
namespace QMAPP.FJC.BLL.Equipment
|
|
{
|
|
/// <summary>
|
|
/// 设备维修保养记录
|
|
/// </summary>
|
|
public class EquipMentRecordBLL : BaseBLL
|
|
{
|
|
#region 获取列表
|
|
/// <summary>
|
|
/// 获取列表
|
|
/// </summary>
|
|
/// <param name="condition">条件</param>
|
|
/// <param name="page">数据页</param>
|
|
/// <returns>数据页</returns>
|
|
public DataResult<DataPage> GetList(EquipMentRecord condition, DataPage page)
|
|
{
|
|
DataResult<DataPage> result = new DataResult<DataPage>();
|
|
try
|
|
{
|
|
DataPage dataPage = new EquipMentRecordDAL().GetList(condition, page);
|
|
|
|
#region 转换报警类别、工序类别显示类型
|
|
List<EquipMentRecord> List = dataPage.Result as List<EquipMentRecord>;
|
|
|
|
DictManageBLL dictAlarmTypeBll = new DictManageBLL(DictKind.WARNTYPE);
|
|
DictManageBLL dictProcessTypeBll = new DictManageBLL(DictKind.PROCESSTYPE);
|
|
|
|
foreach (EquipMentRecord m in List)
|
|
{
|
|
// //报警类别
|
|
// m.WARNTYPE = dictAlarmTypeBll.GetDictValue(m.WARNTYPE);
|
|
// //工序类别
|
|
// 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(EquipMentRecord model)
|
|
{
|
|
DataResult<DataTable> result = new DataResult<DataTable>();
|
|
try
|
|
{
|
|
DataTable dt = new EquipMentRecordDAL().GetExportData(model);
|
|
|
|
#region 转换报警类别、工序类别显示类型
|
|
|
|
DictManageBLL dictAlarmTypeBll = new DictManageBLL(DictKind.WARNTYPE);
|
|
DictManageBLL dictProcessTypeBll = new DictManageBLL(DictKind.PROCESSTYPE);
|
|
|
|
foreach (DataRow item in dt.Rows)
|
|
{
|
|
////报警类别
|
|
//item["WARNTYPE"] = dictAlarmTypeBll.GetDictValue(item["WARNTYPE"].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
|
|
}
|
|
}
|
|
|