From 37ee0fafa63dbea6868071d0f79173aa5be990a2 Mon Sep 17 00:00:00 2001 From: zxxxf <1939543722@qq.com> Date: Sun, 16 Jun 2024 22:19:15 +0800 Subject: [PATCH] 123 --- EntrustSettle.Api/Controllers/OrderController.cs | 2 ++ EntrustSettle.Model/Validator/AllValidator.cs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/EntrustSettle.Api/Controllers/OrderController.cs b/EntrustSettle.Api/Controllers/OrderController.cs index 85b0a8f..490cad4 100644 --- a/EntrustSettle.Api/Controllers/OrderController.cs +++ b/EntrustSettle.Api/Controllers/OrderController.cs @@ -872,6 +872,8 @@ namespace EntrustSettle.Api.Controllers [HttpPost] public async Task ApplyInvoice(ApplyInvoiceDto input) { + new ApplyInvoiceValidator().ValidateAndThrow(input); + if (input.OrderIdList?.Any() != true) { throw new Exception("申请列表为空"); diff --git a/EntrustSettle.Model/Validator/AllValidator.cs b/EntrustSettle.Model/Validator/AllValidator.cs index d20e0f0..a9d7afa 100644 --- a/EntrustSettle.Model/Validator/AllValidator.cs +++ b/EntrustSettle.Model/Validator/AllValidator.cs @@ -51,7 +51,11 @@ namespace EntrustSettle.Model.Validator public ApplyInvoiceValidator() { RuleFor(x => x.CompanyName).NotNull().NotEmpty().WithMessage("公司全称不能为空"); - //RuleFor(x=>x.) + RuleFor(x => x.Address).NotNull().NotEmpty().WithMessage("地址不能为空"); + RuleFor(x => x.TaxCode).NotNull().NotEmpty().WithMessage("税号不能为空"); + RuleFor(x => x.Tel).NotNull().NotEmpty().WithMessage("电话不能为空"); + RuleFor(x => x.Bank).NotNull().NotEmpty().WithMessage("开户行不能为空"); + RuleFor(x => x.BankAccount).NotNull().NotEmpty().WithMessage("银行账户不能为空"); } } } \ No newline at end of file