|
|
@ -123,13 +123,15 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
{
|
|
|
|
{
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
long userId = long.Parse(User.UserId);
|
|
|
|
DateTime dtNow = DateTime.Now;
|
|
|
|
DateTime dtNow = DateTime.Now;
|
|
|
|
|
|
|
|
TenantDb.QueryFilter.Clear<IOrgId>();
|
|
|
|
|
|
|
|
TenantDb.QueryFilter.Clear<ISharedOrgId>();
|
|
|
|
var clientNames = list.Select(x => x.CompanyName).Distinct();
|
|
|
|
var clientNames = list.Select(x => x.CompanyName).Distinct();
|
|
|
|
var clients = await TenantDb.Queryable<InfoClient>().Where(x => clientNames.Contains(x.ShortName))
|
|
|
|
var clients = await TenantDb.Queryable<InfoClient>().Where(x => clientNames.Contains(x.ShortName) || clientNames.Contains(x.Description))
|
|
|
|
.Select(x => new
|
|
|
|
.Select(x => new
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x.Id,
|
|
|
|
x.Id,
|
|
|
|
x.ShortName,
|
|
|
|
x.ShortName,
|
|
|
|
|
|
|
|
x.Description,
|
|
|
|
x.OrgId
|
|
|
|
x.OrgId
|
|
|
|
}).ToListAsync();
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
|
@ -137,17 +139,19 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
List<InfoClientBank> banks = new List<InfoClientBank>(list.Count);
|
|
|
|
List<InfoClientBank> banks = new List<InfoClientBank>(list.Count);
|
|
|
|
foreach (var model in list)
|
|
|
|
foreach (var model in list)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var client = clients.Find(x => x.ShortName == model.CompanyName);
|
|
|
|
var clientList = clients.FindAll(x => x.ShortName == model.CompanyName || x.Description == model.CompanyName);
|
|
|
|
if (client == null)
|
|
|
|
if (clientList.Count == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sb.Append("," + model.CompanyName);
|
|
|
|
sb.Append("," + model.CompanyName);
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in clientList)
|
|
|
|
|
|
|
|
{
|
|
|
|
InfoClientBank bank = new()
|
|
|
|
InfoClientBank bank = new()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ClientId = client.Id,
|
|
|
|
ClientId = item.Id,
|
|
|
|
OrgId = client.OrgId,
|
|
|
|
OrgId = item.OrgId,
|
|
|
|
BankName = model.BankName,
|
|
|
|
BankName = model.BankName,
|
|
|
|
Account = model.BankAccount,
|
|
|
|
Account = model.BankAccount,
|
|
|
|
BankAddress = model.BankAddress,
|
|
|
|
BankAddress = model.BankAddress,
|
|
|
@ -172,6 +176,7 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
|
|
|
|
|
|
|
banks.Add(bank);
|
|
|
|
banks.Add(bank);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (sb.Length > 0)
|
|
|
|
if (sb.Length > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|