|
|
|
@ -6,6 +6,7 @@ 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;
|
|
|
|
@ -114,6 +115,7 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
return rows > 0 ? DataResult.Success : DataResult.FailedWithDesc(nameof(MultiLanguageConst.Operation_Failed));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const int PAGE_SIZE = 200;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 导入客户银行
|
|
|
|
|
/// </summary>
|
|
|
|
@ -152,6 +154,7 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
{
|
|
|
|
|
ClientId = item.Id,
|
|
|
|
|
OrgId = item.OrgId,
|
|
|
|
|
CodeName = PinYinUtil.GetFristLetter(model.BankName),
|
|
|
|
|
BankName = model.BankName,
|
|
|
|
|
Account = model.BankAccount,
|
|
|
|
|
BankAddress = model.BankAddress,
|
|
|
|
@ -163,6 +166,9 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
InvoiceHeaders = []
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (bank.CodeName.Length > 50)
|
|
|
|
|
bank.CodeName = bank.CodeName.Substring(0, 50);
|
|
|
|
|
|
|
|
|
|
if (model.Currency == "人民币")
|
|
|
|
|
bank.Currency = FeeCurrency.RMB_CODE;
|
|
|
|
|
else if (model.Currency == "美元")
|
|
|
|
@ -178,16 +184,23 @@ public class ClientBankService : ServiceBase, IClientBankService
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sb.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
sb.Remove(0, 1);
|
|
|
|
|
return DataResult.Failed("下列【公司名称】匹配不到客户/供应商:" + sb.ToString());
|
|
|
|
|
}
|
|
|
|
|
//if (sb.Length > 0)
|
|
|
|
|
//{
|
|
|
|
|
// sb.Remove(0, 1);
|
|
|
|
|
// return DataResult.Failed("下列【公司名称】匹配不到客户/供应商:" + sb.ToString());
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
await TenantDb.Ado.BeginTranAsync();
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
await TenantDb.Fastest<InfoClientBank>().BulkMergeAsync(banks);
|
|
|
|
|
//await TenantDb.Fastest<InfoClientBank>().BulkMergeAsync(banks);
|
|
|
|
|
|
|
|
|
|
int page = Convert.ToInt32(Math.Ceiling(banks.Count / Convert.ToDouble(PAGE_SIZE)));
|
|
|
|
|
for (int i = 0; i < page; i++)
|
|
|
|
|
{
|
|
|
|
|
var batchList = banks.Skip(i * PAGE_SIZE).Take(PAGE_SIZE).ToList();
|
|
|
|
|
await TenantDb.Insertable(batchList).ExecuteCommandAsync();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var bank in banks)
|
|
|
|
|
{
|
|
|
|
|