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

235 lines
7.8 KiB

using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using QMFrameWork.Common.Encrypt;
using QMFrameWork.Data;
using QMAPP.FJC.DAL.Operation;
using QMAPP.FJC.Entity.Operation;
using QMAPP.BLL;
using QMAPP.Entity;
using QMAPP.FJC.Entity.ProduceManage;
using QMAPP.FJC.BLL.Dict;
using QMAPP.FJC.BLL.Basic;
using QMAPP.Entity;
using QMFrameWork.Log;
using QMAPP.FJC.Entity.Injection;
using QMAPP.FJC.DAL.FeedInManage;
namespace QMAPP.FJC.BLL.Operation
{
/// <summary>
/// 模块编号:
/// 作 用:成品信息查询
/// 作 者:郭兆福
/// 编写日期:2018年03月12日
///</summary>
public class ProductEndBLL : BaseBLL
{
#region 成品信息查询
#region 获取信息
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
public ProductEnd Get(ProductEnd model)
{
try
{
return new ProductEndDAL().Get(model);
}
catch (Exception ex)
{
throw ex;
}
}
/// <summary>
/// 获取信息
/// </summary>
/// <param name="">条件</param>
/// <returns>信息</returns>
//public ProductEnd GetByCondition(ProductEnd model)
//{
// try
// {
// List<ProductEnd> list = new ProductEndDAL().GetList(model);
// if (list.Count > 0)
// {
// return list[0];
// }
// return null;
// }
// catch (Exception ex)
// {
// throw ex;
// }
//}
public QMAPP.FJC.Entity.Basic.MaterialCodeInit GetMaterialSetByCondition(QMAPP.FJC.Entity.Basic.MaterialCodeInit condition)
{
return new QMAPP.FJC.DAL.Basic.MaterialCodeInitDAL().GetByCondition(condition);
}
#endregion
#region 获取列表
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <param name="page">数据页</param>
/// <returns>数据页</returns>
public DataResult<DataPage> GetList(ProductEnd condition, DataPage page)
{
DataResult<DataPage> result = new DataResult<DataPage>();
try
{
result.IsSuccess = true;
page = new ProductEndDAL().GetAllList(condition, page);
List<ProductEnd> list = page.Result as List<ProductEnd>;
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictColor = new DictManageBLL(DictKind.COLOR);
DictManageBLL dictSTATUS = new DictManageBLL(DictKind.LJSTATUS);
DictManageBLL dictOUTFLAG = new DictManageBLL(DictKind.OUTFLAG);
DictManageBLL dictHL = new DictManageBLL(DictKind.HAndL);
DictManageBLL dictYN = new DictManageBLL(DictKind.ValidFlg);
foreach (var info in list)
{
//替换工序类别显示值
info.CURRENTPROCESS = dictPROCESSTYPE.GetDictValue(info.CURRENTPROCESS);
//替换零件类别显示值
//info.COLOR = dictColor.GetDictValue(info.COLOR);
//替换零件类别显示值
info.STATUS = dictSTATUS.GetDictValue(info.STATUS);
//替换出库标记显示值
info.OUTFLAG = dictOUTFLAG.GetDictValue(info.OUTFLAG);
//替换使用状态显示值
//info.HB = dictHL.GetDictValue(info.HB);
//info.COMPLETEFLAG = dictYN.GetDictValue(info.COMPLETEFLAG);
////info.COMPLETETIMESTR = dictColor.GetDictValue(info.COLOR);
//info.COMPLETEDATE = (info.COMPLETETIME == System.DateTime.MinValue) ? ""
// : info.COMPLETETIME.ToString("yyyy-MM-dd HH:mm:ss");
}
page.Result = list;
result.Result = page;
}
catch (Exception ex)
{
LogManager.LogHelper.Error(new LogInfo()
{
ErrorInfo = ex,
Tag = ex.StackTrace,
Info = "本体信息获取列表错误!"
});
result.IsSuccess = false;
result.Msg = "本体信息获取列表错误!";
}
return result;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="condition">条件</param>
/// <returns>全部数据</returns>
//public List<ProductEnd> GetAllList(ProductEnd condition)
//{
// try
// {
// return new ProductEndDAL().GetList(condition);
// }
// catch (Exception ex)
// {
// throw ex;
// }
//}
#endregion
#region 加载零件列表
/// <summary>
/// 加载零件列表11111111111
/// </summary>
/// <param name="condition">条件</param>
/// <returns>数据页</returns>
public DataResult<List<ProductEnd>> GetListWithProduct(ProductEnd condition)
{
DataResult<List<ProductEnd>> result = new DataResult<List<ProductEnd>>();
result.IsSuccess = true;
try
{
result.Result = new ProductEndDAL().GetListWithProduct(condition);
}
catch (Exception ex)
{
throw ex;
}
return result;
}
#endregion
#region 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataResult<DataTable> GetExportData(ProductEnd model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
result.IsSuccess = true;
try
{
result.Result = new ProductEndDAL().GetExportData(model);
//处理字典信息
DictManageBLL dictPROCESSTYPE = new DictManageBLL(DictKind.PROCESSTYPE);
DictManageBLL dictColor = new DictManageBLL(DictKind.COLOR);
DictManageBLL dictSTATUS = new DictManageBLL(DictKind.LJSTATUS);
DictManageBLL dictOUTFLAG = new DictManageBLL(DictKind.OUTFLAG);
DictManageBLL dictHL = new DictManageBLL(DictKind.HAndL);
DictManageBLL dictYN = new DictManageBLL(DictKind.ValidFlg);
foreach (DataRow dr in result.Result.Rows)
{
//替换工序类别显示值
//dr["CURRENTPROCESS"] = dictPROCESSTYPE.GetDictValue(dr["CURRENTPROCESS"].ToString());
//替换零件类别显示值
dr["COLOR"] = dictColor.GetDictValue(dr["COLOR"].ToString());
//替换零件类别显示值
dr["STATUS"] = dictSTATUS.GetDictValue(dr["STATUS"].ToString());
//替换出库标记显示值
dr["OUTFLAG"] = dictOUTFLAG.GetDictValue(dr["OUTFLAG"].ToString());
//替换使用状态显示值
dr["HB"] = dictHL.GetDictValue(dr["HB"].ToString());
}
}
catch (Exception ex)
{
throw ex;
}
return result;
}
#endregion
#endregion
}
}