fix 实体继承处理

This commit is contained in:
2024-03-14 18:30:27 +08:00
parent d3a94a4d28
commit 944d9c2291
2 changed files with 24 additions and 16 deletions

View File

@@ -1,7 +1,9 @@
using Dlhis.External.MealSupplement.Channel;
using Dlhis.Entity.Basic.Entity;
using Dlhis.External.MealSupplement.Channel;
using Dlhis.External.MealSupplement.Request;
using Kurisu.AspNetCore.EventBus.Abstractions;
using Kurisu.SqlSugar.Services;
using Mapster;
namespace Dlhis.External.MealSupplement.Services.Implements;
@@ -10,7 +12,7 @@ public class MealSupplementService : IMealSupplementService
private readonly IEventBus _eventBus;
private readonly IDbContext _dbContext;
public MealSupplementService(IEventBus eventBus , IDbContext dbContext)
public MealSupplementService(IEventBus eventBus, IDbContext dbContext)
{
_eventBus = eventBus;
_dbContext = dbContext;
@@ -18,6 +20,7 @@ public class MealSupplementService : IMealSupplementService
public async Task DoSupplementsAsync(List<MealSupplementReceiveReuqest> reuqests)
{
await _dbContext.InsertAsync(reuqests.Adapt<List<MealSupplementRequestRecordEntity>>());
await _eventBus.PublishAsync(new MealSupplementMessage { Items = reuqests });
}
}