GoodsInfoView.cs 9.1 KB

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