using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QMAPP.BLL;
using QMFrameWork.Data;
using QMAPP.FJC.Entity.ShipmentMonitor;
using QMAPP.FJC.DAL.Monitor;
namespace QMAPP.FJC.BLL.Monitor
{
///
/// 发运看板-逻辑层对象
/// 作 者:李炳海
/// 编写日期:2017年09月27日
///
public class ShipmentMonitorBLL:BaseBLL
{
#region 获取待发运FIS数据列表
///
/// 获取待发运FIS数据列表
///
/// 数据页
/// 数据页
public DataPage GetShipmentFisList(DataPage page)
{
//最迟发运时间
int latestTimes = 60;
//理论发运时间
int theoryTimes = 120;
//数据库当前时间
DateTime dbNowTime;
//获取显示设置
ShipMonitorSet setInfo = new ShipMonitorSetBLL().Get();
if (setInfo != null)
{
latestTimes = setInfo.LATESTTIMES;
theoryTimes = setInfo.THEORYTIMES;
}
//获取待发运FIS数据
page = new ShipmentMonitorDAL().GetShipmentFisList(page, out dbNowTime);
//处理状态
List list = page.Result as List;
foreach (ShipmentFisData item in list)
{
double overTime = (item.R100_ONLINEDATE - dbNowTime).TotalMinutes;
if (overTime <= latestTimes)
item.DisplayColor = "RED";
if(overTime>latestTimes&&overTime= theoryTimes)
item.DisplayColor = "GREEN";
item.ONLINEDATE = item.R100_ONLINEDATE.ToString("yyyy-MM-dd HH:mm:ss");
}
return page;
}
#endregion
#region 获取在途数量数据数据列表
///
/// 获取在途数量数据数据列表
///
/// 数据页
/// 数据页
public DataPage GetOnTheWayQTYList(DataPage page)
{
int wayTimes = 120;
//获取显示设置
ShipMonitorSet setInfo = new ShipMonitorSetBLL().Get();
if (setInfo != null)
{
wayTimes = setInfo.WAYTIMES;
}
//获取在途数量
page = new ShipmentMonitorDAL().GetOnTheWayQTYList(page,wayTimes);
return page;
}
#endregion
}
}