客户银行重复校验

dev
嵇文龙 4 weeks ago
parent 0549ddd720
commit 26fbaeb720

@ -27,17 +27,17 @@ public class ClientBankReq
/// <summary>
/// Desc:币别
/// </summary>
public string Currency { get; set; }
public string Currency { get; set; } = string.Empty;
/// <summary>
/// Desc:银行名称
/// </summary>
public string BankName { get; set; }
public string BankName { get; set; } = string.Empty;
/// <summary>
/// Desc:银行账户
/// </summary>
public string Account { get; set; }
public string Account { get; set; } = string.Empty;
/// <summary>
/// Desc:银行地址
@ -67,7 +67,7 @@ public class ClientBankReq
/// <summary>
/// Desc:银行账号
/// </summary>
public string BankAccountNo { get; set; }
public string BankAccountNo { get; set; } = string.Empty;
/// <summary>
/// Desc: 银行SWIFT

@ -6,7 +6,6 @@ using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Dtos;
using DS.WMS.Core.Info.Entity;
using DS.WMS.Core.Info.Interface;
using DS.WMS.Core.TaskPlat.Dtos;
using Mapster;
namespace DS.WMS.Core.Info.Method;
@ -59,8 +58,8 @@ public class ClientBankService : ServiceBase, IClientBankService
{
if (req.Id == 0)
{
if (await TenantDb.Queryable<InfoClientBank>().Where(x => x.BankName == req.BankName && x.BankAccountNo == req.BankAccountNo).AnyAsync())
return DataResult.Failed("客户银行信息已存在!", MultiLanguageConst.ClientBankExist);
if (await TenantDb.Queryable<InfoClientBank>().Where(x => x.ClientId == req.ClientId && x.BankName == req.BankName && x.Account == req.Account && x.Currency == req.Currency).AnyAsync())
return DataResult.Failed("银行信息已存在!", MultiLanguageConst.ClientBankExist);
var data = req.Adapt<InfoClientBank>();
var entity = await TenantDb.InsertNav(data).Include(x => x.InvoiceHeaders).ExecuteReturnEntityAsync();

Loading…
Cancel
Save