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

119 lines
3.8 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.FeedInManage;
using QMAPP.FJC.Entity.FeedInManage;
using QMAPP.FJC.Entity.Injection;
using QMFrameWork.Data;
using QMFrameWork.Log;
using QMAPP.FJC.Entity.ProduceManage;
namespace QMAPP.FJC.BLL.ProduceManage
{
/// <summary>
/// 模块编号:M4-3
/// 作 用:不合格品记录查询
/// 作 者:张敬贺
/// 编写日期:2015年06月15日
///</summary>
public class UnQualityBLL : BaseBLL
{
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(Epidermis condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
result.IsSuccess = true;
page = new UnQualityDAL().GetList(condition, page);
List<UnQuality> list = page.Result as List<UnQuality>;
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictPRODUCTTYPE = new DictManageBLL(DictKind.PRODUCTTYPE);
foreach (var info in list)
{
//替换工序类别显示值
info.PROCESSTYPE = dictPROCESSTYPE.GetDictValue(info.PROCESSTYPE);
//替换零件类别显示值
info.PRODUCTTYPE = dictPRODUCTTYPE.GetDictValue(info.PRODUCTTYPE);
}
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(Epidermis model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
try
{
result.IsSuccess = true;
result.Result = new UnQualityDAL().GetExportData(model);
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictPRODUCTTYPE = new DictManageBLL(DictKind.PRODUCTTYPE);
foreach (DataRow dr in result.Result.Rows)
{
//替换工序类别显示值
dr["PROCESSTYPE"] = dictPROCESSTYPE.GetDictValue(dr["PROCESSTYPE"].ToString());
//替换零件类别显示值
dr["PRODUCTTYPE"] = dictPRODUCTTYPE.GetDictValue(dr["PRODUCTTYPE"].ToString());
}
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "不合格品信息导出错误!"
});
result.IsSuccess = false;
result.Msg = "不合格品信息导出错误!";
}
return result;
}
#endregion
}
}