GoodsInfoView.cs 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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 string GroupName { get; set; }
  141. public int GoodsId { get; set; }
  142. public string GoodsName { get; set; }
  143. public decimal Quantity { get; set; }
  144. public string Unit { get; set; }
  145. public string Reason { get; set; }
  146. public string Remark { get; set; }
  147. public GoodsAuditEnum AuditStatus { get; set; }
  148. public string AuditStatusText { get { return AuditStatus.GetEnumDescription(); } }
  149. public string StatusDesc { get; set; }
  150. public int AuditUserId { get; set; }
  151. public string AuditUserName { get; set; }
  152. public DateTime AuditTime { get; set; }
  153. public string CreateUserName { get; set; }
  154. public DateTime CreateTime { get; set; }
  155. }
  156. /// <summary>
  157. ///
  158. /// </summary>
  159. public class GoodsReceiveListView: GoodsReceiveView
  160. {
  161. public string GoodsType { get; set; }
  162. public string GoodsDetails { get; set; }
  163. public GoodsStorageAuditPerView[] AuditPers { get; set; }
  164. }
  165. public class GoodsReceiveListMobileView : GoodsReceiveListView
  166. {
  167. public int GoodsTypeId { get; set; }
  168. /// <summary>
  169. /// 是否贵重物品
  170. /// true:贵重物品
  171. /// false:非贵重物品
  172. /// </summary>
  173. public bool IsValuable { get; set; } = false;
  174. //public GoodsStorageAuditPerView[] AuditPers { get; set; }
  175. }
  176. /// <summary>
  177. ///
  178. /// </summary>
  179. public class GoodsReceiveInfoView : GoodsReceiveView
  180. {
  181. public string GoodsStorageInfo { get; set; }
  182. public object? QuantityInfos { get; set; }
  183. public object? GoodsStorageInfoStr { get; set; }
  184. public string GoodsType { get; set; }
  185. }
  186. public class GoodsReceiveInfoMobileView : GoodsReceiveInfoView
  187. {
  188. public string GroupName { get; set; }
  189. }
  190. /// <summary>
  191. ///
  192. /// </summary>
  193. public class GoodsReceiveLinkStorageView
  194. {
  195. public int StorageId { get; set; }
  196. public decimal Quantity { get; set; }
  197. }
  198. public class GoodsStorageExcelDownloadView
  199. {
  200. public int Id { get; set; }
  201. public string Name { get; set; }
  202. /// <summary>
  203. /// 开始库存
  204. /// </summary>
  205. public decimal SQ_Total { get; set; }
  206. /// <summary>
  207. /// 入库库存
  208. /// </summary>
  209. public decimal SQ_Total1 { get; set; }
  210. public string StorageLabel { get; set; }
  211. public decimal OQ_Total { get; set; }
  212. public string ReceiveLabel { get; set; }
  213. public decimal StockQuantity { get; set; }
  214. public string Unit { get; set; }
  215. }
  216. public class GoodsStorageListView
  217. {
  218. public int Id { get; set; }
  219. public int GoodsId { get; set; }
  220. public int GoodsType { get; set; }
  221. public string GoodsName { get; set; }
  222. public string BatchNo { get; set; }
  223. public decimal Quantity { get; set; }
  224. public decimal UnitPrice { get; set; }
  225. public decimal TotalPrice { get; set; }
  226. public string SupplierName { get; set; }
  227. public string SupplierTel { get; set; }
  228. public string SupplierAddress { get; set; }
  229. public string SupplierSource { get; set; }
  230. public string StorageUserName { get; set; }
  231. public string StorageTime { get; set; }
  232. public string CreateUserName { get; set; }
  233. public GoodsConfirmEnum ConfirmStatus { get; set; }
  234. public string ConfirmStatusText
  235. {
  236. get
  237. {
  238. return ConfirmStatus.GetEnumDescription();
  239. }
  240. }
  241. public string StatusDesc { get; set; }
  242. public DateTime CreateTime { get; set; }
  243. public string Remark { get; set; }
  244. public GoodsStorageAuditPerView[] AuditPers { get; set; }
  245. }
  246. public class GoodsStorageAuditPerView
  247. {
  248. public bool AuditPer { get; set; }
  249. public GoodsAuditDepEnum AuditDep { get; set; }
  250. public string ButtonText { get; set; }
  251. }
  252. #region 审核部门View
  253. public class GoodsAuditDepView
  254. {
  255. public GoodsAuditDepEnum AuditDep { get; set; }
  256. public int[] AuditorIds { get; set; }
  257. }
  258. #endregion
  259. }