using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMFrameWork.Data;
using QMAPP.MESReport.Entity.LineQTY;
using QMAPP.MESReport.DAL.LineQTY;
using QMAPP.BLL;
using QMAPP.Entity;
using System.Data;
using QMAPP.MD.BLL;
using QMAPP.MD.Entity;
namespace QMAPP.MESReport.BLL.LineQTY
{
///
/// 生产完成率分析
/// 于子清
/// 2017-10-20
///
public class QTYCompletionRateBLL : BaseBLL
{
public DataResult> GetAllList(QTYCompletionRateDModel condition)
{
DataResult> result = new DataResult>();
try
{
result.Result = new QTYCompletionRateDAL().GetAllList(condition);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
//注塑
public DataResult> GetAllListNew1(QTYCompletionRateDModel condition)
{
DataResult> result = new DataResult>();
try
{
//result.Result = new QTYCompletionRateDAL().GetAllListNew1(condition);
var qtys = new QTYCompletionRateDAL().GetAllListNew1(condition);
//var materials = new MaterialBLL().GetAllList(new Material());
//foreach (QTYCompletionRateDModel item in qtys)
//{
// //处理人
// if (!string.IsNullOrEmpty(item.MATERIAL_CODE))
// {
// var material = materials.FirstOrDefault(x => x.MATERIAL_CODE == item.MATERIAL_CODE);
// if (material != null)
// {
// item.MATERIAL_NAME = material.MATERIAL_NAME;
// item.MATERIAL_SHORT = material.MATERIAL_SHORT;
// }
// }
//}
result.Result = qtys;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
//门板
public DataResult> GetAllListNew2(QTYCompletionRateDModel condition)
{
DataResult> result = new DataResult>();
try
{
//result.Result = new QTYCompletionRateDAL().GetAllListNew2(condition);
var qtys = new QTYCompletionRateDAL().GetAllListNew2(condition);
//var materials = new MaterialBLL().GetAllList(new Material());
//foreach (QTYCompletionRateDModel item in qtys)
//{
// //处理人
// if (!string.IsNullOrEmpty(item.MATERIAL_CODE))
// {
// var material = materials.FirstOrDefault(x => x.MATERIAL_CODE == item.MATERIAL_CODE);
// if (material != null)
// {
// item.MATERIAL_NAME = material.MATERIAL_NAME;
// item.MATERIAL_SHORT = material.MATERIAL_SHORT;
// }
// }
//}
result.Result = qtys;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
//仪表板
public DataResult> GetAllListNew3(QTYCompletionRateDModel condition)
{
DataResult> result = new DataResult>();
try
{
var qtys = new QTYCompletionRateDAL().GetAllListNew3(condition);
//var materials = new MaterialBLL().GetAllList(new Material());
//foreach (QTYCompletionRateDModel item in qtys)
//{
// //处理人
// if (!string.IsNullOrEmpty(item.MATERIAL_CODE))
// {
// var material = materials.FirstOrDefault(x => x.MATERIAL_CODE == item.MATERIAL_CODE);
// if (material != null)
// {
// item.MATERIAL_NAME = material.MATERIAL_NAME;
// item.MATERIAL_SHORT = material.MATERIAL_SHORT;
// }
// }
//}
result.Result = qtys;
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataResult GetExportData(QTYCompletionRateDModel model)
{
DataResult result = new DataResult();
try
{
result.IsSuccess = true;
result.Result = new QTYCompletionRateDAL().GetExportData(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = "导出错误!";
}
return result;
}
#endregion
}
}