GoodsInfoView.cs 6.3 KB

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