using System; using System.Collections.Generic; using System.ComponentModel; using System.Text; namespace Wms.Screen.Dto.ZhongTian.Response { public class LocationUsageReportViewDto { /// /// 序号:从1开始顺序 /// [Description("序号")] public int Sort { get; set; } /// /// 仓库类型 /// [Description("仓库类型")] public string WarehouseName { get; set; } /// /// 巷道 /// [Description("巷道")] public string Tunnel { get; set; } /// /// 楼层 /// [Description("楼层")] public string Floor { get; set; } /// /// 巷道入库状态 /// [Description("巷道入库状态")] public string InStates { get; set; } /// /// 巷道出库状态 /// [Description("巷道出库状态")] public string OutStates { get; set; } /// /// 总货位 /// [Description("总货位")] public int AllLocationTotal { get; set; } /// /// 有效货位 /// [Description("有效货位")] public int CanUseLocation { get; set; } private int _SpareLocation; /// /// 空余货位 /// [Description("空余货位")] public int SpareLocation { get { return CanUseLocation - MaterilLocation - ContainLocation - LockLocation; } set { _SpareLocation = value; } } /// /// 有料货位 /// [Description("有料货位")] public int MaterilLocation { get; set; } /// /// 有容器货位 /// [Description("有容器货位")] public int ContainLocation { get; set; } /// /// 锁定货位 /// [Description("锁定货位")] public int LockLocation { get; set; } /// /// 停用货位 /// [Description("停用货位")] public int StopLocation { get; set; } /// /// 货位使用率 /// [Description("货位使用率")] public string MaterialUsage { get { string res = "0%"; //如果有料货位大于0,总货位大于0,则根据有料货位/总货位计算货位使用率 if (MaterilLocation > 0 && AllLocationTotal > 0) { //转为百分比,保留2位 res = (MaterilLocation / (AllLocationTotal * 1.0)).ToString("P2"); } return res; } } [Description("黄色预警货位使用率")] public int LocYWarnVal { get; set; } [Description("红色预警货位使用率")] public int LocRWarnVal { get; set; } /// /// 行显示颜色 /// [Description("行显示颜色")] public string LocRowColor { get { var rate = MaterilLocation / (AllLocationTotal * 1.0) * 100; string res = ""; if (rate >= LocRWarnVal) { res = "Red"; } else if (rate >= LocYWarnVal) { res = "Yellow"; } return res; } } } public class ZtLocationUsageReportViewDto : LocationUsageReportViewDto { /// /// 空余小货位 /// [Description("空余小货位")] public int LittleSizeLocation { get; set; } /// /// 空余大货位 /// [Description("空余大货位")] public int BigSizeLocation { get { return SpareLocation - LittleSizeLocation; } } } public class TunnelDto { public string WareHouseName { get; set; } public string Tunnel { get; set; } public string Floor { get; set; } public string Statu { get; set; } public string StatuName { get; set; } public string Code { get; set; } public string Name { get; set; } public string SContent { get; set; } public string SType { get; set; } public string Default1 { get; set; } public string Default2 { get; set; } public string Default3 { get; set; } public string Id { get; set; } public string Memo { get; set; } public string AddWho { get; set; } public string EditWho { get; set; } public DateTime AddTime { get; set; } public DateTime EditTime { get; set; } } }