using System;
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Wms.Dashboard.Host.Models;
public class AsnTimeWindowDashboardDto
{
///
/// 供应商简称
///
[Display(Name = "供应商简称")]
public string SupplierShortName { get; set; }
///
/// 时间段
///
[Display(Name = "时间段")]
public string TimeSpan { get; set; }
///
/// 计划到达时间
///
[Display(Name = "计划到达时间")]
public DateTime PlanArriveDate { get; set; }
///
/// 实际到货时间
///
[Display(Name = "实际到货时间")]
public DateTime ReceiptTime { get; set; }
///
/// 收货状态
///
[Display(Name = "收货状态")]
public string ReceiptStatus
{
get
{
if (this.ReceiptTime == DateTime.MinValue)
{
if (this.PlanArriveDate > DateTime.Now)
{
return "计划";
}
else
{
return "延期";
}
}
else
{
var timeSpan = ReceiptTime - PlanArriveDate;
if (timeSpan.Minutes < DashboardConst.AsnReceiptTimeDifferenceMinutes || timeSpan.Minutes > -(DashboardConst.AsnReceiptTimeDifferenceMinutes))
{
return "准时";
}
else if (timeSpan.Minutes > DashboardConst.AsnReceiptTimeDifferenceMinutes)
{
return "延后";
}
else if (timeSpan.Minutes < -(DashboardConst.AsnReceiptTimeDifferenceMinutes))
{
return "提前";
}
else
{
return "";
}
}
}
}
///
/// 是否延期
///
[Display(Name = "是否延期")]
public bool IsDelay
{
get
{
if (this.ReceiptStatus == "延期")
{
return true;
}
return false;
}
}
}