GoodsInfoView.cs 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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. return $"物品待审核数量:{WaitAuditQuantity.ToString("#0.00")}";
  51. }
  52. }
  53. public int LastUpdateUserId { get; set; }
  54. [Navigate(NavigateType.OneToOne, nameof(Type))]
  55. public GoodsListSetDataView TypeData { get; set; }
  56. [Navigate(NavigateType.OneToOne, nameof(LastUpdateUserId))]
  57. public GoodsListUsersView UserData { get; set; }
  58. public DateTime LastUpdateTime { get; set; }
  59. public string Remark { get; set; }
  60. public int IsDel { get; set; }
  61. }
  62. [SugarTable(tableName: "Pm_GoodsReceive", tableDescription: "物品领用表")]
  63. public class GoodsListReceiveView
  64. {
  65. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  66. public int Id { get; set; }
  67. /// <summary>
  68. /// 商品Id
  69. /// Pm_GoodsInfo Id
  70. /// </summary>
  71. public int GoodsId { get; set; }
  72. /// <summary>
  73. /// 领用数量
  74. /// </summary>
  75. public decimal Quantity { get; set; }
  76. /// <summary>
  77. /// 审核状态
  78. /// </summary>
  79. public GoodsAuditEnum AuditStatus { get; set; } = GoodsAuditEnum.Pending;
  80. public int IsDel { get; set; }
  81. }
  82. [SugarTable(tableName: "Sys_SetData", tableDescription: "")]
  83. public class GoodsListSetDataView
  84. {
  85. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  86. public int Id { get; set; }
  87. /// <summary>
  88. ///
  89. /// </summary>
  90. public string Name { get; set; }
  91. }
  92. [SugarTable(tableName: "Sys_Users", tableDescription: "")]
  93. public class GoodsListUsersView
  94. {
  95. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  96. public int Id { get; set; }
  97. /// <summary>
  98. ///
  99. /// </summary>
  100. public string CnName { get; set; }
  101. }
  102. #endregion
  103. /// <summary>
  104. /// 物品类型View
  105. /// </summary>
  106. [SugarTable("Sys_SetDataType")]
  107. public class GoodsTypeView
  108. {
  109. /// <summary>
  110. /// 物品类型Id
  111. /// </summary>
  112. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  113. public int Id { get; set; }
  114. public string Name { get; set; }
  115. [Navigate(NavigateType.OneToMany, nameof(GoodsSubTypeView.STid))]
  116. public List<GoodsSubTypeView> SubTypeItems { get; set; }
  117. public string Remark { get; set; }
  118. public int IsDel { get; set; }
  119. }
  120. /// <summary>
  121. /// 物品Sub类型
  122. /// View
  123. /// </summary>
  124. [SugarTable("Sys_SetData")]
  125. public class GoodsSubTypeView
  126. {
  127. /// <summary>
  128. /// 物品类型Id
  129. /// </summary>
  130. [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
  131. public int Id { get; set; }
  132. public int STid { get; set; }
  133. public string Name { get; set; }
  134. public int IsDel { get; set; }
  135. }
  136. public class GoodsReceiveView
  137. {
  138. public int Id { get; set; }
  139. public int GroupId { get; set; }
  140. public int GoodsId { get; set; }
  141. public string GoodsName { get; set; }
  142. public decimal Quantity { get; set; }
  143. public string Unit { get; set; }
  144. public string Reason { get; set; }
  145. public string Remark { get; set; }
  146. public GoodsAuditEnum AuditStatus { get; set; }
  147. public string AuditStatusText { get { return AuditStatus.GetEnumDescription(); } }
  148. public string StatusDesc { get; set; }
  149. public int AuditUserId { get; set; }
  150. public string AuditUserName { get; set; }
  151. public DateTime AuditTime { get; set; }
  152. public string CreateUserName { get; set; }
  153. public DateTime CreateTime { get; set; }
  154. }
  155. /// <summary>
  156. ///
  157. /// </summary>
  158. public class GoodsReceiveListView: GoodsReceiveView
  159. {
  160. public string GoodsType { get; set; }
  161. public GoodsStorageAuditPerView[] AuditPers { get; set; }
  162. }
  163. public class GoodsReceiveListMobileView : GoodsReceiveListView
  164. {
  165. public string GroupName { get; set; }
  166. public int GoodsTypeId { 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. public class GoodsStorageExcelDownloadView
  191. {
  192. public int Id { get; set; }
  193. public string Name { get; set; }
  194. /// <summary>
  195. /// 开始库存
  196. /// </summary>
  197. public decimal SQ_Total { get; set; }
  198. /// <summary>
  199. /// 入库库存
  200. /// </summary>
  201. public decimal SQ_Total1 { get; set; }
  202. public string StorageLabel { get; set; }
  203. public decimal OQ_Total { get; set; }
  204. public string ReceiveLabel { get; set; }
  205. public decimal StockQuantity { get; set; }
  206. public string Unit { get; set; }
  207. }
  208. public class GoodsStorageListView
  209. {
  210. public int Id { get; set; }
  211. public int GoodsId { get; set; }
  212. public int GoodsType { get; set; }
  213. public string GoodsName { get; set; }
  214. public string BatchNo { get; set; }
  215. public decimal Quantity { get; set; }
  216. public decimal UnitPrice { get; set; }
  217. public decimal TotalPrice { get; set; }
  218. public string SupplierName { get; set; }
  219. public string SupplierTel { get; set; }
  220. public string SupplierAddress { get; set; }
  221. public string SupplierSource { get; set; }
  222. public string StorageUserName { get; set; }
  223. public string StorageTime { get; set; }
  224. public string CreateUserName { get; set; }
  225. public GoodsConfirmEnum ConfirmStatus { get; set; }
  226. public string ConfirmStatusText
  227. {
  228. get
  229. {
  230. return ConfirmStatus.GetEnumDescription();
  231. }
  232. }
  233. public string StatusDesc { get; set; }
  234. public DateTime CreateTime { get; set; }
  235. public string Remark { get; set; }
  236. public GoodsStorageAuditPerView[] AuditPers { get; set; }
  237. }
  238. public class GoodsStorageAuditPerView
  239. {
  240. public bool AuditPer { get; set; }
  241. public GoodsAuditDepEnum AuditDep { get; set; }
  242. public string ButtonText { get; set; }
  243. }
  244. #region 审核部门View
  245. public class GoodsAuditDepView
  246. {
  247. public GoodsAuditDepEnum AuditDep { get; set; }
  248. public int[] AuditorIds { get; set; }
  249. }
  250. #endregion
  251. }