optimize
hao 11 months ago
parent b35f765c90
commit f66f83c6d7

@ -29,27 +29,11 @@ namespace Myshipping.Application.Event
/// </summary>
public class BookingSlotStockSubscriber : IEventSubscriber
{
private readonly SqlSugarRepository<BookingSlotBase> _repBase;
private readonly SqlSugarRepository<BookingSlotCtn> _repCtn;
private readonly SqlSugarRepository<BookingSlotStock> _repStock;
private readonly SqlSugarRepository<BookingSlotAllocation> _repAlloc;
private readonly SqlSugarRepository<BookingSlotAllocationCtn> _repAllocCtn;
private readonly ILogger<BookingSlotStockSubscriber> _logger;
public BookingSlotStockSubscriber(SqlSugarRepository<BookingSlotBase> repBase,
SqlSugarRepository<BookingSlotCtn> repCtn,
SqlSugarRepository<BookingSlotStock> repStock,
SqlSugarRepository<BookingSlotAllocation> repAlloc,
SqlSugarRepository<BookingSlotAllocationCtn> repAllocCtn,
public BookingSlotStockSubscriber(
ILogger<BookingSlotStockSubscriber> logger)
{
_repBase = repBase;
_repCtn = repCtn;
_repStock = repStock;
_repAlloc = repAlloc;
_repAllocCtn = repAllocCtn;
_logger = logger;
}
@ -59,6 +43,12 @@ namespace Myshipping.Application.Event
{
_logger.LogInformation($"收到更新库存订阅请求:{context.Source.Payload}");
var _repBase = App.GetService<SqlSugarRepository<BookingSlotBase>>();
var _repCtn = App.GetService<SqlSugarRepository<BookingSlotCtn>>();
var _repStock = App.GetService<SqlSugarRepository<BookingSlotStock>>();
var _repAlloc = App.GetService<SqlSugarRepository<BookingSlotAllocation>>();
var _repAllocCtn = App.GetService<SqlSugarRepository<BookingSlotAllocationCtn>>();
var paraObj = context.Source.Payload as BookingSlotStockUpdateModel;
var baseList = await _repBase.AsQueryable().Filter(null, true)

Loading…
Cancel
Save