This commit is contained in:
alex
2023-08-15 14:27:10 +08:00
parent e09251ef76
commit 2f3cf868d7
10 changed files with 88 additions and 24 deletions

View File

@@ -6,6 +6,7 @@ using System.Reflection;
using System.Security.Claims;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Channels;
using System.Threading.Tasks;
using Aspose.Cells.Drawing;
using JNPF;
@@ -32,6 +33,7 @@ using Tnb.WarehouseMgr.Entities;
using Tnb.WarehouseMgr.Entities.Attributes;
using Tnb.WarehouseMgr.Entities.Consts;
using Tnb.WarehouseMgr.Entities.Dto;
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
using Tnb.WarehouseMgr.Entities.Entity;
using Tnb.WarehouseMgr.Interfaces;
@@ -44,6 +46,12 @@ namespace Tnb.WarehouseMgr
{
private static Dictionary<string, IWHStorageService> _stroageMap = new(StringComparer.OrdinalIgnoreCase);
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
private readonly ChannelWriter<NotifyMessage> _channelWriter;
public BaseWareHouseService(ChannelWriter<NotifyMessage>? channelWriter = default)
{
_channelWriter = channelWriter;
}
static BaseWareHouseService()
{
@@ -93,7 +101,18 @@ namespace Tnb.WarehouseMgr
}
return Task.FromResult(isMatch);
}
/// <summary>
/// 发布消息
/// </summary>
/// <param name="taskName"></param>
/// <returns></returns>
[NonAction]
protected async Task Publish(string taskName)
{
NotifyMessage message = new() { TaskName = taskName };
if (_channelWriter != null)
await _channelWriter.WriteAsync(message);
}
[NonAction]
protected async Task DoUpdate(WareHouseUpInput input)