客户银行重复校验

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

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

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

Loading…
Cancel
Save