GoodsInfoView.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. using OASystem.Domain.Entities.PersonnelModule;
  2. using OASystem.Domain.Enums;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace OASystem.Domain.ViewModels.PersonnelModule
  9. {
  10. /// <summary>
  11. /// 物品详细信息 View
  12. /// </summary>
  13. public class GoodsInfoView:Pm_GoodsInfo
  14. {
  15. }
  16. #region 物品领用List
  17. [SugarTable(tableName: "Pm_GoodsInfo", tableDescription: "物品信息表")]
  18. public class GoodsListView
  19. {
  20. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  21. public int Id { get; set; }
  22. public string Name { get; set; }
  23. public int Type { get; set; }
  24. [SugarColumn(IsIgnore = true)]
  25. public string TypeName { get; set; }
  26. public decimal StockQuantity { get; set; }
  27. //SugarColumn(IsIgnore = true),
  28. [Navigate(NavigateType.OneToMany, nameof(GoodsListReceiveView.GoodsId))]
  29. //[Navigate(NavigateType.OneToMany, nameof(GoodsListReceiveView.GoodsId), nameof(Id))]
  30. public List<GoodsListReceiveView> Receives { get; set; }//注意禁止给books手动赋值
  31. [SugarColumn(IsIgnore = true)]
  32. public decimal WaitAuditQuantity
  33. {
  34. get
  35. {
  36. var quantity = 0.00M;
  37. if (Receives.Count > 0)
  38. {
  39. quantity = Receives.Sum(x => x.Quantity);
  40. }
  41. return quantity;
  42. }
  43. }
  44. [SugarColumn(IsIgnore = true)]
  45. public string StockQuantityLabel
  46. {
  47. get
  48. {
  49. var str = "";
  50. if (WaitAuditQuantity > 0)
  51. {
  52. str = $"物品待审核数量合计:{WaitAuditQuantity.ToString("#0.00")}";
  53. }
  54. return str;
  55. }
  56. }
  57. public int LastUpdateUserId { get; set; }
  58. [Navigate(NavigateType.OneToOne, nameof(Type))]
  59. public GoodsListSetDataView TypeData { get; set; }
  60. [Navigate(NavigateType.OneToOne, nameof(LastUpdateUserId))]
  61. public GoodsListUsersView UserData { get; set; }
  62. public DateTime LastUpdateTime { get; set; }
  63. public string Remark { get; set; }
  64. public int IsDel { get; set; }
  65. }
  66. [SugarTable(tableName: "Pm_GoodsReceive", tableDescription: "物品领用表")]
  67. public class GoodsListReceiveView
  68. {
  69. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  70. public int Id { get; set; }
  71. /// <summary>
  72. /// 商品Id
  73. /// Pm_GoodsInfo Id
  74. /// </summary>
  75. public int GoodsId { get; set; }
  76. /// <summary>
  77. /// 领用数量
  78. /// </summary>
  79. public decimal Quantity { get; set; }
  80. /// <summary>
  81. /// 审核状态
  82. /// </summary>
  83. public GoodsAuditEnum AuditStatus { get; set; } = GoodsAuditEnum.Pending;
  84. public int IsDel { get; set; }
  85. }
  86. [SugarTable(tableName: "Sys_SetData", tableDescription: "")]
  87. public class GoodsListSetDataView
  88. {
  89. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  90. public int Id { get; set; }
  91. /// <summary>
  92. ///
  93. /// </summary>
  94. public string Name { get; set; }
  95. }
  96. [SugarTable(tableName: "Sys_Users", tableDescription: "")]
  97. public class GoodsListUsersView
  98. {
  99. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  100. public int Id { get; set; }
  101. /// <summary>
  102. ///
  103. /// </summary>
  104. public string CnName { get; set; }
  105. }
  106. #endregion
  107. /// <summary>
  108. /// 物品类型View
  109. /// </summary>
  110. [SugarTable("Sys_SetDataType")]
  111. public class GoodsTypeView
  112. {
  113. /// <summary>
  114. /// 物品类型Id
  115. /// </summary>
  116. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  117. public int Id { get; set; }
  118. public string Name { get; set; }
  119. [Navigate(NavigateType.OneToMany, nameof(GoodsSubTypeView.STid))]
  120. public List<GoodsSubTypeView> SubTypeItems { get; set; }
  121. public string Remark { get; set; }
  122. public int IsDel { get; set; }
  123. }
  124. /// <summary>
  125. /// 物品Sub类型
  126. /// View
  127. /// </summary>
  128. [SugarTable("Sys_SetData")]
  129. public class GoodsSubTypeView
  130. {
  131. /// <summary>
  132. /// 物品类型Id
  133. /// </summary>
  134. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  135. public int Id { get; set; }
  136. public int STid { get; set; }
  137. public string Name { get; set; }
  138. public int IsDel { get; set; }
  139. }
  140. public class GoodsReceiveView
  141. {
  142. public int Id { get; set; }
  143. public int GroupId { get; set; }
  144. public int GoodsId { get; set; }
  145. public string GoodsName { get; set; }
  146. public decimal Quantity { get; set; }
  147. public string Reason { get; set; }
  148. public string Remark { get; set; }
  149. public GoodsAuditEnum AuditStatus { get; set; }
  150. public string AuditStatusText { get { return AuditStatus.GetEnumDescription(); } }
  151. public int AuditUserId { get; set; }
  152. public string AuditUserName { get; set; }
  153. public DateTime AuditTime { get; set; }
  154. public string CreateUserName { get; set; }
  155. public DateTime CreateTime { get; set; }
  156. }
  157. /// <summary>
  158. ///
  159. /// </summary>
  160. public class GoodsReceiveListView: GoodsReceiveView
  161. {
  162. public string GoodsType { get; set; }
  163. }
  164. public class GoodsReceiveListMobileView : GoodsReceiveListView
  165. {
  166. public string GroupName { get; set; }
  167. }
  168. /// <summary>
  169. ///
  170. /// </summary>
  171. public class GoodsReceiveInfoView : GoodsReceiveView
  172. {
  173. public string GoodsStorageInfo { get; set; }
  174. public object? QuantityInfos { get; set; }
  175. public object? GoodsStorageInfoStr { get; set; }
  176. public string GoodsType { get; set; }
  177. }
  178. public class GoodsReceiveInfoMobileView : GoodsReceiveInfoView
  179. {
  180. public string GroupName { get; set; }
  181. }
  182. /// <summary>
  183. ///
  184. /// </summary>
  185. public class GoodsReceiveLinkStorageView
  186. {
  187. public int StorageId { get; set; }
  188. public decimal Quantity { get; set; }
  189. }
  190. }