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

108 lines
3.4 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMAPP.KB.Entity;
using QMFrameWork.Data;
using QMFrameWork.Log;
using QMAPP.FJC.Entity;
using QMAPP.FJC.Entity.WIPManage;
using QMAPP.FJC.DAL.WIPManage;
using QMAPP.FJC.BLL.Dict;
using System.Data;
namespace QMAPP.FJC.BLL.WIPManage
{
/// <summary>
/// 模块编号:M7-3
/// 作 用:在制品出库信息
/// 作 者:王济
/// 编写日期:2015年07月07日
///</summary>
public class WIPOutRecorderBLL : BaseBLL
{
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(WIPOutRecorder condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
DataPage dataPage = new WIPOutRecorderDAL().GetList(condition, page);
#region 转换记录状态
List<WIPOutRecorder> materielList = dataPage.Result as List<WIPOutRecorder>;
DictManageBLL dictOutFlagBll = new DictManageBLL(DictKind.OUTFLAG);
foreach (WIPOutRecorder m in materielList)
{
//出库状态
m.STATUS = dictOutFlagBll.GetDictValue(m.STATUS);
}
#endregion
result.Result = dataPage;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "在制品出库信息逻辑层-获取列表!"
});
result.IsSuccess = false;
result.Msg = Resource.SystemException;
throw ex;
}
}
#endregion
#region 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataResult<DataTable> GetExportData(WIPOutRecorder model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
try
{
DataTable dt = new WIPOutRecorderDAL().GetExportData(model);
#region 转换字典
DictManageBLL dictOutFlagBll = new DictManageBLL(DictKind.OUTFLAG);
foreach (DataRow item in dt.Rows)
{
item["STATUS"] = dictOutFlagBll.GetDictValue(item["STATUS"].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
}
}