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.
97 lines
2.7 KiB
97 lines
2.7 KiB
4 years ago
|
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
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 发运看板-逻辑层对象
|
||
|
/// 作 者:李炳海
|
||
|
/// 编写日期:2017年09月27日
|
||
|
/// </summary>
|
||
|
public class ShipmentMonitorBLL:BaseBLL
|
||
|
{
|
||
|
#region 获取待发运FIS数据列表
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取待发运FIS数据列表
|
||
|
/// </summary>
|
||
|
/// <param name="page">数据页</param>
|
||
|
/// <returns>数据页</returns>
|
||
|
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<ShipmentFisData> list = page.Result as List<ShipmentFisData>;
|
||
|
|
||
|
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 = "YELLOW";
|
||
|
|
||
|
if (overTime >= theoryTimes)
|
||
|
item.DisplayColor = "GREEN";
|
||
|
|
||
|
item.ONLINEDATE = item.R100_ONLINEDATE.ToString("yyyy-MM-dd HH:mm:ss");
|
||
|
|
||
|
}
|
||
|
|
||
|
return page;
|
||
|
}
|
||
|
|
||
|
#endregion
|
||
|
|
||
|
#region 获取在途数量数据数据列表
|
||
|
|
||
|
/// <summary>
|
||
|
/// 获取在途数量数据数据列表
|
||
|
/// </summary>
|
||
|
/// <param name="page">数据页</param>
|
||
|
/// <returns>数据页</returns>
|
||
|
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
|
||
|
}
|
||
|
}
|