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

175 lines
5.8 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMAPP.KB.Entity;
using QMFrameWork.Data;
using QMAPP.FJC.Entity.WIPManage;
using QMFrameWork.Log;
using QMAPP.FJC.Entity;
using QMAPP.FJC.DAL.WIPManage;
using QMAPP.FJC.Entity.Produce;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.Entity.Basic;
using QMAPP.FJC.BLL.Basic;
using System.Data;
namespace QMAPP.FJC.BLL.WIPManage
{
/// <summary>
/// 模块编号:M7-1
/// 作 用:在制品库存
/// 作 者:王济
/// 编写日期:2015年07月06日
///</summary>
public class WIPInventoryBLL : BaseBLL
{
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(Product condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
DataPage dataPage = new WIPInventoryDAL().GetList(condition, page);
#region 转换记录状态
List<Product> materielList = dataPage.Result as List<Product>;
DictManageBLL dictStatusBll = new DictManageBLL(DictKind.STATUS);
DictManageBLL dictUsingStateBll = new DictManageBLL(DictKind.USINGSTATE);
DictManageBLL dictOutFlagBll = new DictManageBLL(DictKind.OUTFLAG);
foreach (Product m in materielList)
{
//零件状态
m.STATUS = dictStatusBll.GetDictValue(m.STATUS);
//使用状态
m.USINGSTATE = dictUsingStateBll.GetDictValue(m.USINGSTATE);
//出库状态
m.OUTFLAG = dictOutFlagBll.GetDictValue(m.OUTFLAG);
}
#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(Product model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
try
{
DataTable dt = new WIPInventoryDAL().GetExportData(model);
#region 转换字典
DictManageBLL dictStatusBll = new DictManageBLL(DictKind.STATUS);
DictManageBLL dictUsingStateBll = new DictManageBLL(DictKind.USINGSTATE);
DictManageBLL dictOutFlagBll = new DictManageBLL(DictKind.OUTFLAG);
foreach (DataRow item in dt.Rows)
{
item["STATUS"] = dictStatusBll.GetDictValue(item["STATUS"].ToString());
item["USINGSTATE"] = dictUsingStateBll.GetDictValue(item["USINGSTATE"].ToString());
item["OUTFLAG"] = dictOutFlagBll.GetDictValue(item["OUTFLAG"].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
#region 获取工序合集
/// <summary>
/// 获取工序合集
/// </summary>
/// <param name="">条件</param>
/// <returns>*信息</returns>
public List<ProcessInfo> GetProcessSetList(ProcessInfo model)
{
try
{
//获取设备信息集合
return new ProcessInfoBLL().GetAllList(model);
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "在制品库存逻辑层-获取班次信息集合!"
});
throw ex;
}
}
#endregion
#region 获取零件合集
/// <summary>
/// 获取工序合集
/// </summary>
/// <param name="">条件</param>
/// <returns>*信息</returns>
public List<ProductBasic> GetProductSetList(ProductBasic model)
{
try
{
//获取设备信息集合
return new ProductBasicBLL().GetAllList(model);
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "在制品库存逻辑层-获取班次信息集合!"
});
throw ex;
}
}
#endregion
}
}