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

135 lines
4.4 KiB

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
{
/// <summary>
/// 生产班次设备情况统计-逻辑层对象
/// 创建人:李炳海 2
/// 创建时间:2017.09.22
/// </summary>
public class LineShiftQTYCountBLL : BaseBLL
{
/// <summary>
/// 获取各班次设备生产情况主数据
/// </summary>
public DataResult<List<LineDayQTYCount>> GetEquQTYByShift(LineDayQTYCount condition)
{
DataResult<List<LineDayQTYCount>> result = new DataResult<List<LineDayQTYCount>>();
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;
}
}
/// <summary>
/// 班次趋势分析
/// </summary>
public DataResult<List<LineDayQTYCount>> GetEquQTYByShift1(LineDayQTYCount condition)
{
DataResult<List<LineDayQTYCount>> result = new DataResult<List<LineDayQTYCount>>();
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;
}
}
/// <summary>
/// 获取班次列表
/// </summary>
/// <param name="condition"></param>
/// <returns></returns>
public DataResult<List<T_QT_SHIFT>> GetTQTSHIFTList()
{
DataResult<List<T_QT_SHIFT>> result = new DataResult<List<T_QT_SHIFT>>();
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 导出数据
/// <summary>
/// 获取导出的数据
/// </summary>
/// <param name="user">查询条件</param>
/// <returns>数据</returns>
public DataResult<DataTable> GetExportData(LineDayQTYCount model)
{
DataResult<DataTable> result = new DataResult<DataTable>();
try
{
result.IsSuccess = true;
result.Result = new LineShiftQTYCountDAL().GetExportData(model);
}
catch (Exception ex)
{
result.IsSuccess = false;
result.Msg = "导出错误!";
}
return result;
}
#endregion
}
}