GoodsInfoView.cs 8.6 KB

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