using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.MESReport.Entity.LineQTY;
using QMAPP.MESReport.DAL.LineQTY;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMAPP.Entity;
using System.Data;
using QMAPP.MD.BLL;
using QMAPP.MD.Entity;
using QMAPP.MESReport.Entity.Tables;
namespace QMAPP.MESReport.BLL.LineQTY
{
///
/// 合格率分析
/// 于子清
/// 2017-10-13
///
public class StandardRateCountBLL : BaseBLL
{
///
/// 获取合格率图表主数据
///
///
///
public DataResult> GetMainList(StandardRateDModel condition)
{
DataResult> result = new DataResult>();
try
{
result.Result = new StandardRateCountDAL().GetAllList(condition);
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
///
/// 获取不合格率图表主数据
///
///
///
public DataResult> GetMainListNot(StandardRateDModel condition)
{
DataResult> result = new DataResult>();
try
{
result.Result = new StandardRateCountDAL().GetAllListNot(condition);
var workCells = new WorkCellBLL().GetWorkCellList(new WorkCell());
foreach (StandardRateDModel item in result.Result)
{
//处理人
if (!string.IsNullOrEmpty(item.WORKCELL_CODE))
{
var workCell = workCells.FirstOrDefault(x => x.WORKCELL_CODE == item.WORKCELL_CODE);
if (workCell != null)
{
item.WORKCELL_NAME = workCell.WORKCELL_NAME;
}
}
}
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
}
}