VisaCommissionDto.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using EyeSoft.Collections.Generic;
  2. using FluentValidation;
  3. using Org.BouncyCastle.Utilities;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace OASystem.Domain.Dtos.Groups
  10. {
  11. public class VisaCommissionDto
  12. {
  13. }
  14. public class VisaCommissionItemDto : PortDtoBase
  15. {
  16. public int CurrUserId { get; set; }
  17. public int DiId { get; set; }
  18. }
  19. public class VisaCommissionItemDtoValidator : AbstractValidator<VisaCommissionItemDto>
  20. {
  21. public VisaCommissionItemDtoValidator() {
  22. RuleFor(x => x.PortType).InclusiveBetween(from: 1, to: 3)
  23. .WithMessage(MsgTips.Port);
  24. RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 1)
  25. .WithMessage("请输入有效的CurrUserId!");
  26. RuleFor(x => x.DiId).GreaterThan(valueToCompare: 1)
  27. .WithMessage("请输入有效的DiId!");
  28. }
  29. }
  30. public class VisaCommissionSaveDto
  31. {
  32. public VisaCommissionCreateView[] Items { get; set; }
  33. }
  34. public class VisaCommissionCreateView
  35. {
  36. /// <summary>
  37. /// ID
  38. /// ID<=0 添加
  39. /// ID>=1 修改
  40. /// </summary>
  41. public int Id { get; set; }
  42. /// <summary>
  43. /// 用户ID
  44. /// </summary>
  45. public int CurrUserId { get; set; }
  46. /// <summary>
  47. /// 团组ID
  48. /// </summary>
  49. public int DiId { get; set; }
  50. /// <summary>
  51. /// 国家
  52. /// </summary>
  53. public string Country { get; set; }
  54. /// <summary>
  55. /// 数量
  56. /// </summary>
  57. public int Quantity { get; set; }
  58. /// <summary>
  59. /// 备注
  60. /// </summary>
  61. public string Remark { get; set; }
  62. }
  63. /// <summary>
  64. /// Create Dto
  65. /// </summary>
  66. public class VisaCommissionCreateDto
  67. {
  68. /// <summary>
  69. /// 用户ID
  70. /// </summary>
  71. public int CurrUserId { get; set; }
  72. /// <summary>
  73. /// 团组ID
  74. /// </summary>
  75. public int DiId { get; set; }
  76. /// <summary>
  77. /// 国家
  78. /// </summary>
  79. public string Country { get; set; }
  80. /// <summary>
  81. /// 数量
  82. /// </summary>
  83. public int Quantity { get; set; }
  84. /// <summary>
  85. /// 备注
  86. /// </summary>
  87. public string Remark { get; set; }
  88. }
  89. public class VisaCommissionCreateDtoValidator : AbstractValidator<VisaCommissionCreateDto>
  90. {
  91. public VisaCommissionCreateDtoValidator()
  92. {
  93. RuleFor(x => x.CurrUserId).GreaterThan(valueToCompare: 0)
  94. .WithMessage("请输入有效的CurrUserId!");
  95. RuleFor(x => x.DiId).GreaterThan(valueToCompare: 0)
  96. .WithMessage("请输入有效的DiId!");
  97. RuleFor(x => x.Country).NotEmpty()
  98. .WithMessage("国家不能为空!");
  99. RuleFor(x => x.Quantity).GreaterThan(valueToCompare: 0)
  100. .WithMessage("请输入有效的Qauntity!");
  101. }
  102. }
  103. }