GoodsDTO.cs 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. using FluentValidation;
  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.Dtos.PersonnelModule
  9. {
  10. /// <summary>
  11. /// 物品DTO
  12. /// </summary>
  13. public class GoodsDto
  14. {
  15. }
  16. #region 物品 DTO
  17. /// <summary>
  18. /// 物品List DTO
  19. /// </summary>
  20. public class GoodsListDto : DtoBase
  21. {
  22. /// <summary>
  23. /// 类型Id
  24. /// 全部类型:""
  25. /// 其他类型:"1,2,3,4,5"
  26. /// </summary>
  27. public string TypeIds { get; set; }
  28. public string GoodsName { get; set; }
  29. }
  30. /// <summary>
  31. /// 物品 OP DTO
  32. /// </summary>
  33. public class GoodsOpDto
  34. {
  35. /// <summary>
  36. /// ID编号
  37. /// ID > 0 Edit
  38. /// ID < 1 Add
  39. /// </summary>
  40. public int Id { get; set; }
  41. /// <summary>
  42. /// 物品名称
  43. /// </summary>
  44. public string Name { get; set; }
  45. /// <summary>
  46. /// 类型
  47. /// </summary>
  48. public int Type { get; set; }
  49. /// <summary>
  50. /// 物品单位
  51. /// </summary>
  52. public string Unit { get; set; }
  53. /// <summary>
  54. /// 备注
  55. /// </summary>
  56. public string Remark { get; set; }
  57. }
  58. /// <summary>
  59. /// 物品 OP DTO
  60. /// Validator
  61. /// </summary>
  62. public class GoodsOPDTOValidator : AbstractValidator<GoodsOpDto>
  63. {
  64. /// <summary>
  65. /// 初始化
  66. /// </summary>
  67. public GoodsOPDTOValidator()
  68. {
  69. //RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!");
  70. RuleFor(x => x.Name).NotEmpty().WithMessage("物品名称为空!");
  71. RuleFor(x => x.Type).Must(x => x > 0).WithMessage("物品所属类型未选择!");
  72. }
  73. }
  74. #endregion
  75. #region 物品入库 DTO
  76. /// <summary>
  77. /// 物品入库List DTO
  78. /// </summary>
  79. public class GoodsStorageListDto : DtoBase
  80. {
  81. /// <summary>
  82. /// 物品Id
  83. /// </summary>
  84. public int GoodsId { get; set; }
  85. /// <summary>
  86. /// 入库批次号
  87. /// </summary>
  88. public string? BatchNo { get; set; }
  89. }
  90. /// <summary>
  91. /// 物品入库 操作(Create Or Edit)
  92. /// </summary>
  93. public class GoodsStorageOpDto
  94. {
  95. /// <summary>
  96. /// ID编号
  97. /// ID > 0 Edit
  98. /// ID < 1 Add
  99. /// </summary>
  100. public int Id { get; set; }
  101. /// <summary>
  102. /// 商品Id
  103. /// </summary>
  104. public int GoodsId { get; set; }
  105. /// <summary>
  106. /// 此次入库数量
  107. /// </summary>
  108. public decimal Quantity { get; set; }
  109. /// <summary>
  110. /// 此次物品单价
  111. /// </summary>
  112. public decimal UnitPrice { get; set; }
  113. /// <summary>
  114. /// 此次物品总价
  115. /// </summary>
  116. public decimal TotalPrice { get; set; }
  117. /// <summary>
  118. /// 此次供应商名称
  119. /// </summary>
  120. public string? SupplierName { get; set; }
  121. /// <summary>
  122. /// 此次供应商电话
  123. /// </summary>
  124. public string? SupplierTel { get; set; }
  125. /// <summary>
  126. /// 此次供应商地址
  127. /// </summary>
  128. public string? SupplierAddress { get; set; }
  129. /// <summary>
  130. /// 此次供应商来源
  131. /// </summary>
  132. public string? SupplierSource { get; set; }
  133. /// <summary>
  134. /// 入库人
  135. /// </summary>
  136. public int StorageUserId { get; set; }
  137. /// <summary>
  138. /// 入库时间
  139. /// eg:2024-10-01 15:00:00
  140. /// </summary>
  141. public string? StorageTime { get; set; }
  142. /// <summary>
  143. /// 备注
  144. /// </summary>
  145. public string? Remark { get; set; }
  146. }
  147. /// <summary>
  148. /// 物品入库 操作(Create Or Edit)
  149. /// Validator
  150. /// </summary>
  151. public class GoodsStorageOpDtoValidator : AbstractValidator<GoodsStorageOpDto>
  152. {
  153. /// <summary>
  154. /// 初始化
  155. /// </summary>
  156. public GoodsStorageOpDtoValidator()
  157. {
  158. //RuleFor(x => x.CurrUserId).Must(x => x > 0).WithMessage("请传入当前登陆用户ID!");
  159. RuleFor(x => x.GoodsId).Must(x => x > 0).WithMessage("请传入有效的物品Id!");
  160. RuleFor(x => x.Quantity).Must(x => x > 0).WithMessage("请传入有效的物品数量!");
  161. RuleFor(x => x.UnitPrice).Must(x => x > 0).WithMessage("请传入有效的物品单价!");
  162. RuleFor(x => x.TotalPrice).Must(x => x > 0).WithMessage("请传入有效的物品价格合计!");
  163. RuleFor(x => x.StorageUserId).Must(x => x > 0).WithMessage("请传入有效用户Id!");
  164. RuleFor(x => x.StorageTime).NotEmpty().WithMessage("请传入有效的入库时间!");
  165. }
  166. }
  167. #endregion
  168. #region 物品领用
  169. /// <summary>
  170. /// 物品领用List DTO
  171. /// </summary>
  172. public class GoodsReceiveListDTO : DtoBase
  173. {
  174. /// <summary>
  175. /// 物品Id
  176. /// </summary>
  177. public int GoodsId { get; set; }
  178. /// <summary>
  179. /// 物品Name
  180. /// </summary>
  181. public string GoodsName { get; set; }
  182. /// <summary>
  183. /// 开始时间
  184. /// </summary>
  185. public string BeginDt { get; set; }
  186. /// <summary>
  187. /// 结束时间
  188. /// </summary>
  189. public string EndDt { get; set; }
  190. /// <summary>
  191. /// 团组Ids
  192. /// </summary>
  193. public string? GroupLabel { get; set; }
  194. /// <summary>
  195. /// 类型Ids
  196. /// </summary>
  197. public string? TypeLabel { get; set; }
  198. /// <summary>
  199. /// UserIds
  200. /// </summary>
  201. public string? UserLabel { get; set; }
  202. /// <summary>
  203. /// AuditIds
  204. /// </summary>
  205. public string AuditLabel { get; set; }
  206. }
  207. /// <summary>
  208. /// 物品领用 OP DTO
  209. /// </summary>
  210. public class GoodsReceiveOpDto
  211. {
  212. /// <summary>
  213. /// ID
  214. /// Id > 0 修改
  215. /// Id < 1 添加
  216. /// </summary>
  217. public int Id { get; set; }
  218. /// <summary>
  219. /// 团组Id
  220. /// Grp_DelegationInfo Id
  221. /// </summary>
  222. public int GroupId { get; set; }
  223. /// <summary>
  224. /// 商品Id
  225. /// Pm_GoodsInfo Id
  226. /// </summary>
  227. public int GoodsId { get; set; }
  228. /// <summary>
  229. /// 领用数量
  230. /// </summary>
  231. public decimal Quantity { get; set; }
  232. /// <summary>
  233. /// 领用原因
  234. /// </summary>
  235. public string? Reason { get; set; }
  236. /// <summary>
  237. /// 备注
  238. /// </summary>
  239. public string? Remark { get; set; }
  240. }
  241. /// <summary>
  242. /// 物品领用 OP
  243. /// Validator
  244. /// </summary>
  245. public class GoodsReceiveOpDtoValidator : AbstractValidator<GoodsReceiveOpDto>
  246. {
  247. /// <summary>
  248. /// 初始化
  249. /// </summary>
  250. public GoodsReceiveOpDtoValidator()
  251. {
  252. RuleFor(x => x.GoodsId).Must(x => x > 0).WithMessage("请传入有效的物品Id!");
  253. RuleFor(x => x.Quantity).Must(x => x > 0).WithMessage("请传入有效的物品数量!");
  254. RuleFor(x => x.Reason).NotEmpty().WithMessage("请填写领用原由!");
  255. }
  256. }
  257. /// <summary>
  258. /// 物品领用 Audit DTO
  259. /// </summary>
  260. public class GoodsReceiveAuditDTO
  261. {
  262. /// <summary>
  263. /// 数据ID string
  264. /// 1,2,3,4
  265. /// </summary>
  266. public string Label { get; set; }
  267. /// <summary>
  268. /// 审核状态
  269. /// </summary>
  270. public GoodsAuditEnum AuditEnum { get; set; }
  271. }
  272. /// <summary>
  273. /// 物品领用 Audit
  274. /// Validator
  275. /// </summary>
  276. public class GoodsReceiveAuditDTOValidator : AbstractValidator<GoodsReceiveAuditDTO>
  277. {
  278. /// <summary>
  279. /// 初始化
  280. /// </summary>
  281. public GoodsReceiveAuditDTOValidator()
  282. {
  283. RuleFor(x => x.Label).NotEmpty().WithMessage("数据ID字符串为空!");
  284. }
  285. }
  286. #endregion
  287. }