Browse Source

接口修改

集成Redis
lvzb 2 years ago
parent
commit
f0772501b1
  1. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs
  2. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs
  3. 27
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs
  4. 4
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs
  5. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs
  6. 28
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs
  7. 1
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs
  8. 3
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs
  9. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs
  10. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs
  11. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs
  12. 9
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs
  13. 6
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs
  14. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs
  15. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs
  16. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs
  17. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs
  18. 5
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs
  19. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs
  20. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs
  21. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs
  22. 118
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs
  23. 7
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs
  24. 8
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs
  25. 2
      be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs
  26. 4
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs
  27. 3
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs
  28. 1
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs
  29. 8
      be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs
  30. 1
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Repositories/ISfsBulkRepositoryBase.cs
  31. 18
      be/Modules/Shared/src/Win_in.Sfs.Shared.EntityFrameworkCore/SfsEfCoreRepositoryBase.cs

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/IPlanRepository.cs

@ -1,7 +1,13 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using EFCore.BulkExtensions;
using Volo.Abp.Domain.Repositories;
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
public interface IPlanRepository : IRepository<Plan, decimal>
{
Task BulkUpdateAsync(IList<Plan> entities, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default);
}

5
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Eos/Plans/PlanManager.cs

@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Services;
namespace Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
@ -16,6 +18,7 @@ public class PlanManager : DomainService, IPlanManager
public virtual async Task<List<Plan>> GetToBeProcessedListAsync()
{
var plans = await _repository.GetListAsync(p => p.WmsState == 0).ConfigureAwait(false);
return plans;
}
@ -29,6 +32,6 @@ public class PlanManager : DomainService, IPlanManager
p.WmsState = 1;
p.WmsDate = Clock.Now;
});
await _repository.UpdateManyAsync(plans).ConfigureAwait(false);
await _repository.BulkUpdateAsync(plans).ConfigureAwait(false);
}
}

27
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos/Plans/PlanEfCoreRepository.cs

@ -1,5 +1,12 @@
using EFCore.BulkExtensions;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Threading;
using System;
using Volo.Abp.Domain.Repositories.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.EOS;
namespace Win_in.Sfs.Wms.DataExchange.EntityFrameworkCore.Fawtyg.Eos.EOS;
@ -9,5 +16,25 @@ public class PlanEfCoreRepository : EfCoreRepository<EosDbContext, Plan, decimal
public PlanEfCoreRepository(IDbContextProvider<EosDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
/// <summary>
/// 批量更新数据
/// </summary>
/// <param name="entities"></param>
/// <param name="bulkConfig"></param>
/// <param name="progress"></param>
/// <param name="type"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task BulkUpdateAsync(IList<Plan> entities, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken))
{
var context = (await GetDbContextAsync().ConfigureAwait(false)) as DbContext;
if (entities != null && entities.Count > 0)
{
await context.BulkUpdateAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false);
}
}
}

4
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/EosAgentModule.cs

@ -165,8 +165,8 @@ public class EosAgentModule : AbpModule
ApplicationInitializationContext context)
{
//context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>();
context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>();
context.AddBackgroundWorkerAsync<EosIncomingBackgroundWorker>();
// context.AddBackgroundWorkerAsync<EosOutgoingBackgroundWorker>();
}
}

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/FawtygAutoMapperProfile.cs

@ -1,6 +1,7 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Label.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain;
@ -102,5 +103,12 @@ public class FawtygAutoMapperProfile : Profile
.ForMember(x => x.Version, y => y.MapFrom(d => d.Remark))
.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => d.PackQty))
.ForMember(x => x.SupplierPackUom, y => y.MapFrom(d => d.PackUom));
CreateMap<SupplierItemEditInput, SupplierItem>()
.IgnoreAuditedObjectProperties()
//.ForMember(x => x.SupplierPackQty, y => y.MapFrom(d => new UomQty(d.SupplierPackUom, d.SupplierPackQty)))
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Id);
}
}

28
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/EosIncomingBackgroundWorker.cs

@ -43,21 +43,21 @@ public class EosIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
//转换Plan
await planConverter.ConvertAsync(plansFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Ship");
var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
//读取并保持Ship
var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
//转换Ship
await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Ship");
// var shipHandleService = workerContext.ServiceProvider.GetRequiredService<ShipReader>();
// var shipConverter = workerContext.ServiceProvider.GetRequiredService<ShipConverter>();
// //读取并保持Ship
// var shipsFromExternalList = await shipHandleService.ReadAsync().ConfigureAwait(false);
// //转换Ship
// await shipConverter.ConvertAsync(shipsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Product");
var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
//读取并保持Product
var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
//转换Product
await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
// Logger.LogInformation($"Read Product");
// var productHandleService = workerContext.ServiceProvider.GetRequiredService<ProductReader>();
// var productConverter = workerContext.ServiceProvider.GetRequiredService<ProductConverter>();
// //读取并保持Product
// var productsFromExternalList = await productHandleService.ReadAsync().ConfigureAwait(false);
//// 转换Product
// await productConverter.ConvertAsync(productsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Completed: Handling {Incoming}");
}

1
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ProductConverter.cs

@ -7,6 +7,7 @@ using Microsoft.Extensions.Logging;
using Volo.Abp.Guids;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.WMS.ItemPack;

3
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.EosAgent/Incoming/ShipReader.cs

@ -32,8 +32,7 @@ public class ShipReader : IReader
public virtual async Task<List<IncomingFromExternal>> ReadAsync()
{
//从EOS读取待处理Ship
var aa = await _shipManager.GetToBeProcessedListAsync().ConfigureAwait(false);
var toBeProcessedShips = aa.Take(5).ToList();
var toBeProcessedShips = await _shipManager.GetToBeProcessedListAsync().ConfigureAwait(false);
if (!toBeProcessedShips.Any())
{
_logger.LogInformation("no ships");

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/IssueConverter.cs

@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class IssueConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -25,10 +26,12 @@ public class IssueConverter : IIncomingConverter
IItemBasicAppService itemBasicAppService,
IObjectMapper objectMapper,
ILogger<IssueConverter> logger,
IConfiguration configuration
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_itemBasicAppService = itemBasicAppService;
_objectMapper = objectMapper;
@ -44,7 +47,8 @@ public class IssueConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/MesOutConverter.cs

@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent;
public class MesOutConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService;
@ -29,7 +30,8 @@ public class MesOutConverter : IIncomingConverter
, IItemBasicAppService itemBasicAppService
, ILogger<MesOutConverter> logger,
IConfiguration configuration,
ILocationAppService locationAppService)
ILocationAppService locationAppService,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
@ -37,6 +39,7 @@ public class MesOutConverter : IIncomingConverter
_logger = logger;
_configuration = configuration;
_locationAppService = locationAppService;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -49,6 +52,8 @@ public class MesOutConverter : IIncomingConverter
var productReceiptNoteList = await BuildIncomingToWmsOfProductReceiptNoteAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(productReceiptNoteList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfProductReceiptNoteAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/PullTaskConverter.cs

@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class PullTaskConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly IItemBasicAppService _itemBasicAppService;
@ -27,13 +28,15 @@ public class PullTaskConverter : IIncomingConverter
, IObjectMapper objectMapper
, IItemBasicAppService itemBasicAppService
, ILogger<PullTaskConverter> logger
, IConfiguration configuration)
, IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_itemBasicAppService = itemBasicAppService;
_logger = logger;
_configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -47,6 +50,8 @@ public class PullTaskConverter : IIncomingConverter
//按Number合并MaterialRequest单据
var materialRequestList = await BuildIncomingToWmsOfMaterialRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfMaterialRequestAsync(List<IncomingFromExternal> incomingDataList)

9
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent/Incoming/ScrapConverter.cs

@ -16,6 +16,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.MesAgent.Incoming;
public class ScrapConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -27,6 +28,10 @@ public class ScrapConverter : IIncomingConverter
IObjectMapper objectMapper,
ILogger<ScrapConverter> logger,
IConfiguration configuration
,
IIncomingFromExternalManager incomingFromExternalManager
)
{
@ -35,6 +40,7 @@ public class ScrapConverter : IIncomingConverter
_objectMapper = objectMapper;
_logger = logger;
_configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -46,7 +52,8 @@ public class ScrapConverter : IIncomingConverter
//按PlanBillNo合并PurchaseOrder
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveManyAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)

6
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BackFluConverter.cs

@ -13,6 +13,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
public class BackFluConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -22,6 +23,8 @@ public class BackFluConverter : IIncomingConverter
IItemBasicAppService itemBasicAppService,
IObjectMapper objectMapper,
ILogger<BackFluConverter> logger
,
IIncomingFromExternalManager incomingFromExternalManager
)
{
@ -29,6 +32,7 @@ public class BackFluConverter : IIncomingConverter
_itemBasicAppService = itemBasicAppService;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -39,6 +43,8 @@ public class BackFluConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/BomConverter.cs

@ -13,6 +13,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
public class BomConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IObjectMapper _objectMapper;
@ -25,7 +26,8 @@ public class BomConverter : IIncomingConverter
IObjectMapper objectMapper,
ILogger<BomConverter> logger,
IGuidGenerator guidGenerator,
IConfiguration configuration)
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
@ -34,6 +36,7 @@ public class BomConverter : IIncomingConverter
_logger = logger;
_guidGenerator = guidGenerator;
_configuration = configuration;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -44,7 +47,8 @@ public class BomConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)
{

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/CustomerConverter.cs

@ -17,17 +17,23 @@ public class CustomerConverter : IIncomingConverter
private readonly IObjectMapper _objectMapper;
private readonly ILogger<CustomerConverter> _logger;
private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public CustomerConverter(
IIncomingToWmsManager incomingToWmsManager,
IObjectMapper objectMapper,
ILogger<CustomerConverter> logger,
IGuidGenerator guidGenerator
,
IIncomingFromExternalManager incomingFromExternalManager
)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
_guidGenerator = guidGenerator;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
{
@ -38,6 +44,8 @@ public class CustomerConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DepartmentConverter.cs

@ -15,15 +15,18 @@ public class DepartmentConverter : IIncomingConverter
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly ILogger<DepartmentConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public DepartmentConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<DepartmentConverter> logger)
, ILogger<DepartmentConverter> logger,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -37,6 +40,8 @@ public class DepartmentConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfDepartmentRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfDepartmentRequestAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictConverter.cs

@ -17,17 +17,20 @@ public class DictConverter : IIncomingConverter
private readonly IObjectMapper _objectMapper;
private readonly ILogger<DictConverter> _logger;
private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public DictConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<DictConverter> logger,
IGuidGenerator guidGenerator)
IGuidGenerator guidGenerator,
IIncomingFromExternalManager incomingFromExternalManager)
{
_guidGenerator = guidGenerator;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -41,6 +44,8 @@ public class DictConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfDictRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfDictRequestAsync(List<IncomingFromExternal> incomingDataList)

5
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/DictpjReader.cs

@ -5,6 +5,7 @@ using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Volo.Abp.Guids;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.DataExchange.Domain;
using Win_in.Sfs.Wms.DataExchange.Domain.Fawtyg.Tyrp;
@ -20,13 +21,16 @@ public class DictpjReader : IReader
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly ILogger<DictpjReader> _logger;
private readonly IConfiguration _configuration;
private readonly IGuidGenerator _guidGenerator;
public DictpjReader(
IDictpjManager dictpjManager
, IIncomingFromExternalManager incomingFromExternalManager
, ILogger<DictpjReader> logger
, IConfiguration configuration
, IGuidGenerator guidGenerator
)
{
_guidGenerator = guidGenerator;
_configuration = configuration;
_dictpjManager = dictpjManager;
_incomingFromExternalManager = incomingFromExternalManager;
@ -55,6 +59,7 @@ public class DictpjReader : IReader
var incomingData = BuildIncomingFromExternal(dict);
incomingData.SetEffectiveDate(DateTime.Now);
incomingData.SetSuccess();
incomingData.SetId(_guidGenerator.Create());
try
{
var DictRequest = BuildDictRequestCreateInput(dict);

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/InterfaceCalendarConverter.cs

@ -15,15 +15,18 @@ public class InterfaceCalendarConverter : IIncomingConverter
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly ILogger<InterfaceCalendarConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public InterfaceCalendarConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<InterfaceCalendarConverter> logger)
, ILogger<InterfaceCalendarConverter> logger,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
_incomingFromExternalManager = incomingFromExternalManager;
}
public virtual async Task ConvertAsync(List<IncomingFromExternal> incomingFromExternalList)
@ -37,6 +40,8 @@ public class InterfaceCalendarConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfInterfaceCalendarRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfInterfaceCalendarRequestAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/ItemBasicConverter.cs

@ -14,6 +14,7 @@ namespace Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent.Incoming;
public class ItemBasicConverter : IIncomingConverter
{
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly ILogger<ItemBasicConverter> _logger;
@ -25,8 +26,10 @@ public class ItemBasicConverter : IIncomingConverter
, IObjectMapper objectMapper
, ILogger<ItemBasicConverter> logger,
IGuidGenerator guidGenerator,
IConfiguration configuration)
IConfiguration configuration,
IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
@ -45,6 +48,8 @@ public class ItemBasicConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfItemBasicRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfItemBasicRequestAsync(List<IncomingFromExternal> incomingDataList)

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/SupplierConverter.cs

@ -17,11 +17,13 @@ public class SupplierConverter : IIncomingConverter
private readonly IObjectMapper _objectMapper;
private readonly ILogger<SupplierConverter> _logger;
private readonly IGuidGenerator _guidGenerator;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public SupplierConverter(
IIncomingToWmsManager incomingToWmsManager,
IObjectMapper objectMapper,
ILogger<SupplierConverter> logger,
IGuidGenerator guidGenerator
IGuidGenerator guidGenerator,
IIncomingFromExternalManager incomingFromExternalManage
)
{
@ -39,7 +41,8 @@ public class SupplierConverter : IIncomingConverter
}
var incomingToWmsDataList = await BuildIncomingToWmsOfPurchaseOrderAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateBulkAsync(incomingToWmsDataList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfPurchaseOrderAsync(List<IncomingFromExternal> incomingDataList)
{

118
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/TyrpIncomingBackgroundWorker.cs

@ -67,65 +67,65 @@ public class TyrpIncomingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
////转换itemBasic
//await itemBasicConverter.ConvertAsync(itemBasicOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read User");//用户和部门
//var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
//var userConverter = workerContext.ServiceProvider.GetRequiredService<UserConverter>();
//var departmentConverter = workerContext.ServiceProvider.GetRequiredService<DepartmentConverter>();
////读取并保存user
//var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false);
//var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList();
//var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList();
////转换user
//await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false);
////转换department
//await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read InterfaceCalendar");//账期
//var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>();
//var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>();
////读取并保存InterfaceCalendar
//var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false);
////转换InterfaceCalendar
//await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Dict");//系统代码
//var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>();
//var dictConverter = workerContext.ServiceProvider.GetRequiredService<DictConverter>();
////读取并保存Dict
//var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false);
////转换Dict
//await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Bom");
var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>();
var BomConverter = workerContext.ServiceProvider.GetRequiredService<BomConverter>();
//读取并保存Bom
var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false);
//转换Bom
await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Supplier");//供应商
//var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
//var SupplierConverter = workerContext.ServiceProvider.GetRequiredService<SupplierConverter>();
////读取并保存Supplier
//var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false);
////转换Supplier
//await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Dictpj");//专案代码
//var DictpjReader = workerContext.ServiceProvider.GetRequiredService<DictpjReader>();
////读取并保存Dictpj
//var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false);
////转换Dictpj
//await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Customer");//客户资料
//var CustomerReader = workerContext.ServiceProvider.GetRequiredService<CustomerReader>();
//var CustomerConverter = workerContext.ServiceProvider.GetRequiredService<CustomerConverter>();
////读取并保存Customer
//var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false);
////转换Customer
//await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read User");//用户和部门
var userReader = workerContext.ServiceProvider.GetRequiredService<UserReader>();
var userConverter = workerContext.ServiceProvider.GetRequiredService<UserConverter>();
var departmentConverter = workerContext.ServiceProvider.GetRequiredService<DepartmentConverter>();
//读取并保存user
var outsFromExternalList = await userReader.ReadAsync().ConfigureAwait(false);
var userOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.User.ToString()).ToList();
var departmentOutsFromExternalList = outsFromExternalList.Where(r => r.DataType == EnumIncomingDataType.Department.ToString()).ToList();
//转换user
await userConverter.ConvertAsync(userOutsFromExternalList).ConfigureAwait(false);
//转换department
await departmentConverter.ConvertAsync(departmentOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read InterfaceCalendar");//账期
var interfaceCalendarReader = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarReader>();
var interfaceCalendarConverter = workerContext.ServiceProvider.GetRequiredService<InterfaceCalendarConverter>();
//读取并保存InterfaceCalendar
var interfaceCalendarOutsFromExternalList = await interfaceCalendarReader.ReadAsync().ConfigureAwait(false);
//转换InterfaceCalendar
await interfaceCalendarConverter.ConvertAsync(interfaceCalendarOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Dict");//系统代码
var dictReader = workerContext.ServiceProvider.GetRequiredService<DictReader>();
var dictConverter = workerContext.ServiceProvider.GetRequiredService<DictConverter>();
//读取并保存Dict
var dictOutsFromExternalList = await dictReader.ReadAsync().ConfigureAwait(false);
//转换Dict
await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
//Logger.LogInformation($"Read Bom");
//var BomReader = workerContext.ServiceProvider.GetRequiredService<BomReader>();
//var BomConverter = workerContext.ServiceProvider.GetRequiredService<BomConverter>();
////读取并保存Bom
//var bomsFromExternalList = await BomReader.ReadAsync().ConfigureAwait(false);
////转换Bom
//await BomConverter.ConvertAsync(bomsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Supplier");//供应商
var SupplierReader = workerContext.ServiceProvider.GetRequiredService<SupplierReader>();
var SupplierConverter = workerContext.ServiceProvider.GetRequiredService<SupplierConverter>();
//读取并保存Supplier
var suppliersFromExternalList = await SupplierReader.ReadAsync().ConfigureAwait(false);
//转换Supplier
await SupplierConverter.ConvertAsync(suppliersFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Dictpj");//专案代码
var DictpjReader = workerContext.ServiceProvider.GetRequiredService<DictpjReader>();
//读取并保存Dictpj
var dictpjOutsFromExternalList = await DictpjReader.ReadAsync().ConfigureAwait(false);
//转换Dictpj
await dictConverter.ConvertAsync(dictOutsFromExternalList).ConfigureAwait(false);
Logger.LogInformation($"Read Customer");//客户资料
var CustomerReader = workerContext.ServiceProvider.GetRequiredService<CustomerReader>();
var CustomerConverter = workerContext.ServiceProvider.GetRequiredService<CustomerConverter>();
//读取并保存Customer
var customersFromExternalList = await CustomerReader.ReadAsync().ConfigureAwait(false);
//转换Customer
await CustomerConverter.ConvertAsync(customersFromExternalList).ConfigureAwait(false);
}
else
{

7
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Incoming/UserConverter.cs

@ -15,12 +15,13 @@ public class UserConverter : IIncomingConverter
private readonly IIncomingToWmsManager _incomingToWmsManager;
private readonly IObjectMapper _objectMapper;
private readonly ILogger<UserConverter> _logger;
private readonly IIncomingFromExternalManager _incomingFromExternalManager;
public UserConverter(
IIncomingToWmsManager incomingToWmsManager
, IObjectMapper objectMapper
, ILogger<UserConverter> logger)
, ILogger<UserConverter> logger, IIncomingFromExternalManager incomingFromExternalManager)
{
_incomingFromExternalManager = incomingFromExternalManager;
_incomingToWmsManager = incomingToWmsManager;
_objectMapper = objectMapper;
_logger = logger;
@ -37,6 +38,8 @@ public class UserConverter : IIncomingConverter
//按流水号创建单据
var materialRequestList = await BuildIncomingToWmsOfIdentityUserRequestAsync(incomingFromExternalList).ConfigureAwait(false);
await _incomingToWmsManager.CreateManyAsync(materialRequestList).ConfigureAwait(false);
//归档
await _incomingFromExternalManager.ArchiveBulkAsync(incomingFromExternalList).ConfigureAwait(false);
}
private async Task<List<IncomingToWms>> BuildIncomingToWmsOfIdentityUserRequestAsync(List<IncomingFromExternal> incomingDataList)

8
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/Outgoing/TyrpOutgoingBackgroundWorker.cs

@ -94,10 +94,10 @@ public class TyrpOutgoingBackgroundWorker : AsyncPeriodicBackgroundWorkerBase
var unplannedIssueNoteNoteList = await unplannedIssueNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(unplannedIssueNoteNoteList).ConfigureAwait(false);
//Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料
//var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedReceiptNoteConverter>();
//var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync();
//await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList);
Logger.LogInformation($"Write UnplannedReceiptNote");//非生产退料
var unplannedReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<UnplannedReceiptNoteConverter>();
var unplannedReceiptNoteList = await unplannedReceiptNoteConvert.ConvertAsync().ConfigureAwait(false);
await wmsoutmWriter.WriteAsync(unplannedReceiptNoteList).ConfigureAwait(false);
Logger.LogInformation($"Write RecycledMaterialReceiptNote");//回收料入库单
var recycledMaterialReceiptNoteConvert = workerContext.ServiceProvider.GetRequiredService<RecycledMaterialReceiptNoteConverter>();

2
be/DataExchange/Fawtyg/Win_in.Sfs.Wms.DataExchange.Fawtyg.TyrpAgent/TyrpAgentModule.cs

@ -173,7 +173,7 @@ public class TyrpAgentModule : AbpModule
{
context.AddBackgroundWorkerAsync<TyrpIncomingBackgroundWorker>();
//context.AddBackgroundWorkerAsync<TyrpOutgoingBackgroundWorker>();
// context.AddBackgroundWorkerAsync<TyrpOutgoingBackgroundWorker>();
}
}

4
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Agent/AgentModule.cs

@ -149,7 +149,7 @@ public class AgentModule : AbpModule
public override void OnApplicationInitialization(
ApplicationInitializationContext context)
{
context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
// context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>();
// context.AddBackgroundWorkerAsync<IncomingToWmsWorker>();
context.AddBackgroundWorkerAsync<OutgoingFromWmsWorker>();
}
}

3
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/ArchivedIncomingFromExternal/IArchivedIncomingFromExternalRepository.cs

@ -1,7 +1,8 @@
using System;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.DataExchange.Domain;
public interface IArchivedIncomingFromExternalRepository : ISfsRepositoryBase<ArchivedIncomingFromExternal>
public interface IArchivedIncomingFromExternalRepository : ISfsRepositoryBase<ArchivedIncomingFromExternal>, ISfsBulkRepositoryBase<ArchivedIncomingFromExternal>
{
}

1
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IIncomingFromExternalManager.cs

@ -12,4 +12,5 @@ public interface IIncomingFromExternalManager : IDomainService
Task ArchiveManyAsync(List<IncomingFromExternal> entities);
Task<List<IncomingFromExternal>> CreateBulkAsync(List<IncomingFromExternal> entities);
Task<string> GetDataByMaxEffectiveDate(string dataType);
Task ArchiveBulkAsync(List<IncomingFromExternal> entities);
}

8
be/DataExchange/src/Win_in.Sfs.Wms.DataExchange.Domain/IncomingFromExternal/IncomingFromExternalManager.cs

@ -62,7 +62,15 @@ public class IncomingFromExternalManager : DomainService, IIncomingFromExternalM
await _historyRepository.InsertAsync(archivedEntity).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task ArchiveBulkAsync(List<IncomingFromExternal> entities)
{
await _repository.BulkDeleteAsync(entities).ConfigureAwait(false);
var archivedEntities = _objectMapper.Map<List<IncomingFromExternal>, List<ArchivedIncomingFromExternal>>(entities);
await _historyRepository.BulkInsertAsync(archivedEntities).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task ArchiveManyAsync(List<IncomingFromExternal> entities)
{

1
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain/Repositories/ISfsBulkRepositoryBase.cs

@ -43,4 +43,5 @@ public interface ISfsBulkRepositoryBase<TEntity>
/// <returns></returns>
Task BulkInsertAsync<TDetail>(IList<TDetail> details, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken))
where TDetail : class, new();
Task BulkUpdateAsync(IList<TEntity> entities, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default);
}

18
be/Modules/Shared/src/Win_in.Sfs.Shared.EntityFrameworkCore/SfsEfCoreRepositoryBase.cs

@ -76,4 +76,22 @@ public abstract class SfsEfCoreRepositoryBase<TDbContext, TEntity>
await context.BulkDeleteAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false);
}
}
/// <summary>
/// 批量更新数据
/// </summary>
/// <param name="entities"></param>
/// <param name="bulkConfig"></param>
/// <param name="progress"></param>
/// <param name="type"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public virtual async Task BulkUpdateAsync(IList<TEntity> entities, BulkConfig bulkConfig = null, Action<decimal> progress = null, Type type = null, CancellationToken cancellationToken = default(CancellationToken))
{
var context = (await GetDbContextAsync().ConfigureAwait(false)) as DbContext;
if (entities != null && entities.Count > 0)
{
await context.BulkUpdateAsync(entities, bulkConfig, progress, type, cancellationToken).ConfigureAwait(false);
}
}
}

Loading…
Cancel
Save