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.MESReport.Entity.Tables;
namespace QMAPP.MESReport.BLL.LineQTY
{
///
/// 生产班次设备情况统计-逻辑层对象
/// 创建人:李炳海 2
/// 创建时间:2017.09.22
///
public class LineShiftQTYCountBLL : BaseBLL
{
///
/// 获取各班次设备生产情况主数据
///
public DataResult> GetEquQTYByShift(LineDayQTYCount condition)
{
DataResult> result = new DataResult>();
try
{
result.Result = new LineShiftQTYCountDAL().GetAllList(condition);
var shifts = new LineShiftQTYCountDAL().GetT_QT_SHIFTList();
foreach (LineDayQTYCount item in result.Result)
{
//处理人
if (!string.IsNullOrEmpty(item.SHIFT_CODE))
{
var shift = shifts.FirstOrDefault(x => x.SHIFT_CODE == item.SHIFT_CODE);
if (shift != null)
{
item.SHIFT_NAME = shift.SHIFT_NAME;
}
}
}
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
///
/// 班次趋势分析
///
public DataResult> GetEquQTYByShift1(LineDayQTYCount condition)
{
DataResult> result = new DataResult>();
try
{
result.Result = new LineShiftQTYCountDAL().GetAllList1(condition);
var shifts = new LineShiftQTYCountDAL().GetT_QT_SHIFTList();
foreach (LineDayQTYCount item in result.Result)
{
//处理人
if (!string.IsNullOrEmpty(item.SHIFT_CODE))
{
var shift = shifts.FirstOrDefault(x => x.SHIFT_CODE == item.SHIFT_CODE);
if (shift != null)
{
item.SHIFT_NAME = shift.SHIFT_NAME;
}
}
}
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
///
/// 获取班次列表
///
///
///
public DataResult> GetTQTSHIFTList()
{
DataResult> result = new DataResult>();
try
{
result.Result = new LineShiftQTYCountDAL().GetT_QT_SHIFTList();
result.IsSuccess = true;
return result;
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = ex.ToString();
return result;
}
}
#region 导出数据
///
/// 获取导出的数据
///
/// 查询条件
/// 数据
public DataResult GetExportData(LineDayQTYCount model)
{
DataResult result = new DataResult();
try
{
result.IsSuccess = true;
result.Result = new LineShiftQTYCountDAL().GetExportData(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = "导出错误!";
}
return result;
}
#endregion
}
}