LocationUsageReportViewDto.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Text;
  5. namespace Wms.Screen.Dto.ZhongTian.Response
  6. {
  7. public class LocationUsageReportViewDto
  8. {
  9. /// <summary>
  10. /// 序号:从1开始顺序
  11. /// </summary>
  12. [Description("序号")]
  13. public int Sort { get; set; }
  14. /// <summary>
  15. /// 仓库类型
  16. /// </summary>
  17. [Description("仓库类型")]
  18. public string WarehouseName { get; set; }
  19. /// <summary>
  20. /// 巷道
  21. /// </summary>
  22. [Description("巷道")]
  23. public string Tunnel { get; set; }
  24. /// <summary>
  25. /// 楼层
  26. /// </summary>
  27. [Description("楼层")]
  28. public string Floor { get; set; }
  29. /// <summary>
  30. /// 巷道入库状态
  31. /// </summary>
  32. [Description("巷道入库状态")]
  33. public string InStates { get; set; }
  34. /// <summary>
  35. /// 巷道出库状态
  36. /// </summary>
  37. [Description("巷道出库状态")]
  38. public string OutStates { get; set; }
  39. /// <summary>
  40. /// 总货位
  41. /// </summary>
  42. [Description("总货位")]
  43. public int AllLocationTotal { get; set; }
  44. /// <summary>
  45. /// 有效货位
  46. /// </summary>
  47. [Description("有效货位")]
  48. public int CanUseLocation { get; set; }
  49. private int _SpareLocation;
  50. /// <summary>
  51. /// 空余货位
  52. /// </summary>
  53. [Description("空余货位")]
  54. public int SpareLocation
  55. {
  56. get
  57. {
  58. return CanUseLocation - MaterilLocation - ContainLocation - LockLocation;
  59. }
  60. set { _SpareLocation = value; }
  61. }
  62. /// <summary>
  63. /// 有料货位
  64. /// </summary>
  65. [Description("有料货位")]
  66. public int MaterilLocation { get; set; }
  67. /// <summary>
  68. /// 有容器货位
  69. /// </summary>
  70. [Description("有容器货位")]
  71. public int ContainLocation { get; set; }
  72. /// <summary>
  73. /// 锁定货位
  74. /// </summary>
  75. [Description("锁定货位")]
  76. public int LockLocation { get; set; }
  77. /// <summary>
  78. /// 停用货位
  79. /// </summary>
  80. [Description("停用货位")]
  81. public int StopLocation
  82. {
  83. get; set;
  84. }
  85. /// <summary>
  86. /// 货位使用率
  87. /// </summary>
  88. [Description("货位使用率")]
  89. public string MaterialUsage
  90. {
  91. get
  92. {
  93. string res = "0%";
  94. //如果有料货位大于0,总货位大于0,则根据有料货位/总货位计算货位使用率
  95. if (MaterilLocation > 0 && AllLocationTotal > 0)
  96. {
  97. //转为百分比,保留2位
  98. res = (MaterilLocation / (AllLocationTotal * 1.0)).ToString("P2");
  99. }
  100. return res;
  101. }
  102. }
  103. [Description("黄色预警货位使用率")]
  104. public int LocYWarnVal
  105. {
  106. get; set;
  107. }
  108. [Description("红色预警货位使用率")]
  109. public int LocRWarnVal
  110. {
  111. get; set;
  112. }
  113. /// <summary>
  114. /// 行显示颜色
  115. /// </summary>
  116. [Description("行显示颜色")]
  117. public string LocRowColor
  118. {
  119. get
  120. {
  121. var rate = MaterilLocation / (AllLocationTotal * 1.0) * 100;
  122. string res = "";
  123. if (rate >= LocRWarnVal)
  124. {
  125. res = "Red";
  126. }
  127. else if (rate >= LocYWarnVal)
  128. {
  129. res = "Yellow";
  130. }
  131. return res;
  132. }
  133. }
  134. }
  135. public class ZtLocationUsageReportViewDto : LocationUsageReportViewDto
  136. {
  137. /// <summary>
  138. /// 空余小货位
  139. /// </summary>
  140. [Description("空余小货位")]
  141. public int LittleSizeLocation
  142. {
  143. get; set;
  144. }
  145. /// <summary>
  146. /// 空余大货位
  147. /// </summary>
  148. [Description("空余大货位")]
  149. public int BigSizeLocation
  150. {
  151. get
  152. {
  153. return SpareLocation - LittleSizeLocation;
  154. }
  155. }
  156. }
  157. public class TunnelDto
  158. {
  159. public string WareHouseName { get; set; }
  160. public string Tunnel { get; set; }
  161. public string Floor { get; set; }
  162. public string Statu { get; set; }
  163. public string StatuName { get; set; }
  164. public string Code { get; set; }
  165. public string Name { get; set; }
  166. public string SContent { get; set; }
  167. public string SType { get; set; }
  168. public string Default1 { get; set; }
  169. public string Default2 { get; set; }
  170. public string Default3 { get; set; }
  171. public string Id { get; set; }
  172. public string Memo { get; set; }
  173. public string AddWho { get; set; }
  174. public string EditWho { get; set; }
  175. public DateTime AddTime { get; set; }
  176. public DateTime EditTime { get; set; }
  177. }
  178. }