1、删除无用类
2、调整定时逻辑,将定时改为框架的事件总线 3、电梯业务逻辑代码调整
This commit is contained in:
@@ -15,5 +15,6 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
/// 任务执行Ids
|
||||
/// </summary>
|
||||
public List<string> disTaskIds { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace Tnb.WarehouseMgr.Entities.Dto.Inputs
|
||||
/// <summary>
|
||||
/// 任务执行Ids
|
||||
/// </summary>
|
||||
public List<string> disTaskIds { get; set; }
|
||||
public List<string> disTaskIds { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,4 +13,53 @@ public partial class WmsElevatorH
|
||||
{
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public int end_floor { get; set; }
|
||||
/// <summary>
|
||||
/// 上级表单ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string bill_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 库位ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
|
||||
public string location_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 库位编号
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
|
||||
public string location_code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 点位ID
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
|
||||
public string point_id { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 点位编号
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
|
||||
public string point_code { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 楼层
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
|
||||
public int floor { get; set; }
|
||||
/// <summary>
|
||||
/// 执行任务Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string distask_id { get; set; }
|
||||
/// <summary>
|
||||
/// 设备Id
|
||||
/// </summary>
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public string device_id { get; set; }
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ using JNPF.Common.Extension;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.Extras.CollectiveOAuth.Enums;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -34,6 +35,8 @@ using NPOI.SS.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
using SqlSugar;
|
||||
using Tnb.BasicData.Entities;
|
||||
using Tnb.Common.Core.EventBus.Constants;
|
||||
using Tnb.Common.Core.EventBus.Sources;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
using Tnb.WarehouseMgr.Entities.Attributes;
|
||||
using Tnb.WarehouseMgr.Entities.Consts;
|
||||
@@ -53,14 +56,21 @@ namespace Tnb.WarehouseMgr
|
||||
private static Lazy<Dictionary<string, IWHStorageService>> _stroageMapLazy;
|
||||
private static Dictionary<string, IWHStorageService> _storeMap = new(StringComparer.OrdinalIgnoreCase);
|
||||
public OverideVisualDevFunc OverideFuncs { get; } = new OverideVisualDevFunc();
|
||||
private readonly ChannelWriter<NotifyMessage> _channelWriter;
|
||||
|
||||
private IEventPublisher _eventPublisher;
|
||||
|
||||
protected IEventPublisher EventPublisher
|
||||
{
|
||||
set { _eventPublisher = value; }
|
||||
get { return _eventPublisher; }
|
||||
}
|
||||
|
||||
|
||||
public BaseWareHouseService(ChannelWriter<NotifyMessage>? channelWriter = default)
|
||||
|
||||
/*public BaseWareHouseService(ChannelWriter<NotifyMessage>? channelWriter = default)
|
||||
{
|
||||
_channelWriter = channelWriter;
|
||||
}
|
||||
}*/
|
||||
|
||||
static BaseWareHouseService()
|
||||
{
|
||||
@@ -160,9 +170,7 @@ namespace Tnb.WarehouseMgr
|
||||
[NonAction]
|
||||
protected async Task Publish(string taskName)
|
||||
{
|
||||
NotifyMessage message = new() { TaskName = taskName };
|
||||
if (_channelWriter != null)
|
||||
await _channelWriter.WriteAsync(message);
|
||||
await _eventPublisher.PublishAsync(new TaskStatusChangeSource(EventSubscribeEventConsts.TaskStatusChangeEventId, taskName));
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
|
||||
@@ -6,11 +6,26 @@ using System.Threading.Tasks;
|
||||
using JNPF.Common.Contracts;
|
||||
using JNPF.Logging;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SqlSugar;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
public class BaseWareHouseService<T> : BaseWareHouseService
|
||||
public class BaseWareHouseService<T> : BaseWareHouseService
|
||||
{
|
||||
protected static Dictionary<string, object> _elevatorMap = new Dictionary<string, object>();
|
||||
|
||||
public BaseWareHouseService(ISqlSugarClient db)
|
||||
{
|
||||
if (_elevatorMap.Count < 1)
|
||||
{
|
||||
Task.Run(async () =>
|
||||
{
|
||||
_elevatorMap = await db.Queryable<WmsElevatorH>().ToDictionaryAsync(x =>x.elevator_id,x=>x.elevator_code);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected ILogger Logger => LoggerFactory.Create(builder => builder.AddFile($"{AppContext.BaseDirectory}/logs/custom{DateTime.Now:yyyyMMdd}.log", cfgOpts =>
|
||||
{
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
public class ConditionalBackgroundService : IHostedService
|
||||
{
|
||||
private readonly IHostedService _backgroundService;
|
||||
//private readonly Func<bool> _condition;
|
||||
|
||||
public ConditionalBackgroundService(IHostedService backgroundService)
|
||||
{
|
||||
_backgroundService = backgroundService;
|
||||
}
|
||||
|
||||
public async Task StartAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
await _backgroundService.StartAsync(cancellationToken);
|
||||
}
|
||||
public async Task StopAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
await _backgroundService.StopAsync(cancellationToken);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Tnb.WarehouseMgr
|
||||
IEventPublisher eventPublisher,
|
||||
IUserManager userManger,
|
||||
IElevatorControlService elevatorControlService
|
||||
)
|
||||
) : base(repository.AsSugarClient())
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_wareHouseService = wareHouseService;
|
||||
@@ -92,32 +92,43 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
Log.Information("取货确认..................");
|
||||
|
||||
try
|
||||
{
|
||||
var elevator = await _db.Queryable<WmsElevatorH>().LeftJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
|
||||
var elevator = await _db.Queryable<WmsElevatorH>().LeftJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
|
||||
.LeftJoin<WmsDistaskH>((a, b, c) => b.location_id == c.startlocation_id)
|
||||
.LeftJoin<WmsPointH>((a, b, c, d) => c.startlocation_id == d.location_id)
|
||||
.Where((a, b, c, d) => d.point_code == input.sourceName && input.taskCode.Contains(c.bill_code))
|
||||
.Select((a, b, c, d) => new WmsElevatorH
|
||||
{
|
||||
distask_id = c.id,
|
||||
device_id = c.device_id,
|
||||
}, true)
|
||||
.FirstAsync();
|
||||
|
||||
//Log.Information($"elevator!=null?{elevator!=null}");
|
||||
|
||||
(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(_eleCtlCfg.DevName, CancellationToken.None);
|
||||
Logger.Information($"电梯当前状态->系统状态:{sysStatus.ToEnum<EnumSysStatus>().ToString()},运行状态:{runStatus.ToEnum<EnumRunStatus>().ToString()},Agv状态:{agvStatus.ToEnum<EnumAgvStatus>().ToString()},当前楼层:{floorNo}");
|
||||
if (elevator.IsNull())
|
||||
{
|
||||
Logger.Error("未找到匹配的电梯任务", new Exception($"根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务"));
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, $"根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务");
|
||||
}
|
||||
try
|
||||
{
|
||||
Logger.Information($"当前任务Id:{elevator.distask_id}");
|
||||
if (_elevatorMap.TryGetValue(elevator.device_id, out var elevatorCode))
|
||||
{
|
||||
//var endFloor = elevator.end_floor;
|
||||
var floor = 5;
|
||||
if (doorStatus.ToEnum<EnumDoorStatus>() != EnumDoorStatus.开门到位保持)
|
||||
var devName = elevatorCode?.ToString() ?? _eleCtlCfg.DevName;
|
||||
(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(devName, CancellationToken.None);
|
||||
Logger.Information($"电梯当前状态->系统状态:{sysStatus.ToEnum<EnumSysStatus>().ToString()},运行状态:{runStatus.ToEnum<EnumRunStatus>().ToString()},Agv状态:{agvStatus.ToEnum<EnumAgvStatus>().ToString()},当前楼层:{floorNo}");
|
||||
{
|
||||
await _elevatorControlService.SendOpenCloseCmd(_eleCtlCfg.DevName, 3); //发送电梯前门开门指令
|
||||
if (doorStatus.ToEnum<EnumDoorStatus>() != EnumDoorStatus.开门到位保持)
|
||||
{
|
||||
await _elevatorControlService.SendOpenCloseCmd(devName, 3); //发送电梯前门开门指令
|
||||
}
|
||||
if (sysStatus.ToEnum<EnumSysStatus>() == EnumSysStatus.正常状态 && runStatus.ToEnum<EnumRunStatus>() == EnumRunStatus.停梯)
|
||||
{
|
||||
//elevator.current_floor = floor;
|
||||
//await _db.Updateable(elevator).UpdateColumns(it => it.current_floor).ExecuteCommandAsync();
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
|
||||
}
|
||||
if (sysStatus.ToEnum<EnumSysStatus>() == EnumSysStatus.正常状态 && runStatus.ToEnum<EnumRunStatus>() == EnumRunStatus.停梯)
|
||||
{
|
||||
//elevator.current_floor = floor;
|
||||
//await _db.Updateable(elevator).UpdateColumns(it => it.current_floor).ExecuteCommandAsync();
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -145,48 +156,59 @@ namespace Tnb.WarehouseMgr
|
||||
.LeftJoin<WmsDistaskH>((a, b, c) => b.location_id == c.endlocation_id)
|
||||
.LeftJoin<WmsPointH>((a, b, c, d) => c.endlocation_id == d.location_id)
|
||||
.Where((a, b, c, d) => d.point_code == input.targetName && c.bill_code == input.taskCode)
|
||||
.Select((a, b, c, d) => new WmsElevatorH { end_floor = SqlFunc.ToInt32(c.end_floor) }, true)
|
||||
.Select((a, b, c, d) => new WmsElevatorH
|
||||
{
|
||||
end_floor = SqlFunc.ToInt32(c.end_floor),
|
||||
distask_id = c.id,
|
||||
}, true)
|
||||
.FirstAsync();
|
||||
|
||||
(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(_eleCtlCfg.DevName, CancellationToken.None);//elevator.elevator_code
|
||||
Logger.Information($"电梯当前状态->系统状态:{sysStatus.ToEnum<EnumSysStatus>().ToString()},运行状态:{runStatus},门状态:{doorStatus},Agv状态:{agvStatus},当前楼层:{floorNo}");
|
||||
//判断Agv电梯是否进入状态
|
||||
if (agvStatus != (int)EnumAgvStatus.AGV运行状态)
|
||||
if (elevator.IsNull())
|
||||
throw new Exception($"根据参数,sourceName:{input.sourceName},taskCode:{input.taskCode},未找到匹配的电梯任务");
|
||||
if (_elevatorMap.TryGetValue(elevator.elevator_id, out var elevatorCode))
|
||||
{
|
||||
await _elevatorControlService.WriteTagAsync(_eleCtlCfg.DevName, ElevatorConsts.AGVControl, 1);
|
||||
}
|
||||
|
||||
Logger.Information("目前正常");
|
||||
|
||||
//电梯到达目标楼层后,判断当前电梯门状态是否为开门到位保持状态
|
||||
if (doorStatus != (int)EnumDoorStatus.开门到位保持)
|
||||
{
|
||||
await _elevatorControlService.SendOpenCloseCmd(_eleCtlCfg.DevName, 3); //发送电梯前门开门指令
|
||||
}
|
||||
if (sysStatus == (int)EnumSysStatus.正常状态 && runStatus == (int)EnumRunStatus.停梯
|
||||
&& doorStatus == (int)EnumDoorStatus.开门到位保持)
|
||||
{
|
||||
Log.Information("进入开门状态,马上要成功了");
|
||||
try
|
||||
(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(_eleCtlCfg.DevName, CancellationToken.None);//elevator.elevator_code
|
||||
Logger.Information($"电梯当前状态->系统状态:{sysStatus.ToEnum<EnumSysStatus>().ToString()},运行状态:{runStatus},门状态:{doorStatus},Agv状态:{agvStatus},当前楼层:{floorNo}");
|
||||
//判断Agv电梯是否进入状态
|
||||
if (agvStatus != (int)EnumAgvStatus.AGV运行状态)
|
||||
{
|
||||
/* elevator.current_floor = elevator.end_floor;
|
||||
await _db.Updateable(elevator).UpdateColumns(it => it.current_floor).ExecuteCommandAsync();*/
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError("更新延迟队列异常", ex);
|
||||
throw;
|
||||
await _elevatorControlService.WriteTagAsync(_eleCtlCfg.DevName, ElevatorConsts.AGVControl, 1);
|
||||
}
|
||||
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
Logger.Information("目前正常");
|
||||
|
||||
//电梯到达目标楼层后,判断当前电梯门状态是否为开门到位保持状态
|
||||
if (doorStatus != (int)EnumDoorStatus.开门到位保持)
|
||||
{
|
||||
await _elevatorControlService.SendOpenCloseCmd(_eleCtlCfg.DevName, 3); //发送电梯前门开门指令
|
||||
}
|
||||
if (sysStatus == (int)EnumSysStatus.正常状态 && runStatus == (int)EnumRunStatus.停梯
|
||||
&& doorStatus == (int)EnumDoorStatus.开门到位保持)
|
||||
{
|
||||
Log.Information("进入开门状态,马上要成功了");
|
||||
try
|
||||
{
|
||||
/* elevator.current_floor = elevator.end_floor;
|
||||
await _db.Updateable(elevator).UpdateColumns(it => it.current_floor).ExecuteCommandAsync();*/
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError("更新延迟队列异常", ex);
|
||||
throw;
|
||||
}
|
||||
|
||||
return await ToApiResult(HttpStatusCode.OK, "成功");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error("放货确认失败", ex);
|
||||
return await ToApiResult(HttpStatusCode.InternalServerError, "电梯还未开门,请重试!");
|
||||
throw;
|
||||
}
|
||||
@@ -271,7 +293,7 @@ namespace Tnb.WarehouseMgr
|
||||
disTaskIds = disTasks.Select(x => x.id).ToList()
|
||||
};
|
||||
await _wareHouseService.TaskExecuteAfter(taskExecuteAfterUpInput);
|
||||
Logger.Information("Agv取货完成");
|
||||
Logger.Information($"Agv取货完成,任务Id:{string.Join(",", disTasks.Select(x => x.id))}");
|
||||
var elevatorQueueItem = await _db.Queryable<WmsElevatorUnexecute>().FirstAsync(it => disTasks.Select(x => x.id).Contains(it.distask_id) && it.task_status == "执行中");
|
||||
if (elevatorQueueItem != null)
|
||||
{
|
||||
@@ -285,11 +307,6 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
await _elevatorControlService.SendOpenCloseCmd(elevatorQueueItem.elevator_code, 4); //向电梯发送前门关门指令
|
||||
await _db.Deleteable(elevatorQueueItem).ExecuteCommandAsync();
|
||||
elevatorQueueItem = await _db.Queryable<WmsElevatorUnexecute>().FirstAsync(it => disTasks.Select(x => x.id).Contains(it.distask_id) && it.task_status == "待执行");
|
||||
if (!elevatorQueueItem?.elevator_code.IsNullOrEmpty() ?? false)
|
||||
{
|
||||
await (_wareHouseService.AddUnExecuteTask?.Invoke(elevatorQueueItem?.elevator_code!, disTask.start_floor.ParseToInt()) ?? Task.CompletedTask);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Contracts;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 迪杰斯特拉(最短路径算法)
|
||||
/// </summary>
|
||||
//public class Dijkstra<T> where T : BaseEntity<string>, IWmsRoadEntity, new()
|
||||
//{
|
||||
// public static int MAX = int.MaxValue;
|
||||
|
||||
// public int mEdgNum; // 边的数量
|
||||
// public VNode[] mVexs; // 顶点数组
|
||||
// //private EData[] edges; //边的数组
|
||||
// /*
|
||||
// * 创建图
|
||||
// *
|
||||
// * 参数说明:
|
||||
// * vexs -- 顶点数组
|
||||
// * edges -- 边
|
||||
// */
|
||||
// public Dijkstra(string[] vexs, EData[] edges)
|
||||
// {
|
||||
|
||||
// // 初始化"顶点数"和"边数"
|
||||
// int vlen = vexs.Length;
|
||||
// int elen = edges.Length;
|
||||
|
||||
// // 初始化"顶点"
|
||||
// mVexs = new VNode[vlen];
|
||||
// for (int i = 0; i < mVexs.Length; i++)
|
||||
// {
|
||||
// mVexs[i] = new VNode();
|
||||
// mVexs[i].data = vexs[i];
|
||||
// mVexs[i].firstEdge = null;
|
||||
// }
|
||||
|
||||
// // 初始化"边"
|
||||
// mEdgNum = elen;
|
||||
// for (int i = 0; i < elen; i++)
|
||||
// {
|
||||
// // 读取边的起始顶点和结束顶点
|
||||
// string c1 = edges[i].start;
|
||||
// string c2 = edges[i].end;
|
||||
// int weight = edges[i].weight;
|
||||
|
||||
// // 读取边的起始顶点和结束顶点
|
||||
// int p1 = GetPosition(c1);
|
||||
// int p2 = GetPosition(c2);
|
||||
// // 初始化node1
|
||||
// ENode node1 = new ENode();
|
||||
// node1.ivex = p2;
|
||||
// node1.weight = weight;
|
||||
// // 将node1链接到"p1所在链表的末尾"
|
||||
// if (mVexs[p1].firstEdge == null)
|
||||
// mVexs[p1].firstEdge = node1;
|
||||
// else
|
||||
// LinkLast(mVexs[p1].firstEdge, node1);
|
||||
// // 初始化node2
|
||||
// ENode node2 = new ENode();
|
||||
// node2.ivex = p1;
|
||||
// node2.weight = weight;
|
||||
// // 将node2链接到"p2所在链表的末尾"
|
||||
// if (mVexs[p2].firstEdge == null)
|
||||
// mVexs[p2].firstEdge = node2;
|
||||
// else
|
||||
// LinkLast(mVexs[p2].firstEdge, node2);
|
||||
// }
|
||||
// }
|
||||
|
||||
// /*
|
||||
// * 将node节点链接到list的最后
|
||||
// */
|
||||
// private void LinkLast(ENode list, ENode node)
|
||||
// {
|
||||
// ENode p = list;
|
||||
|
||||
// while (p.nextEdge != null)
|
||||
// p = p.nextEdge;
|
||||
// p.nextEdge = node;
|
||||
// }
|
||||
|
||||
// /*
|
||||
// * 返回ch位置
|
||||
// */
|
||||
// private int GetPosition(string ch)
|
||||
// {
|
||||
// for (int i = 0; i < mVexs.Length; i++)
|
||||
// if (mVexs[i].data == ch)
|
||||
// return i;
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
// /*
|
||||
// * 获取边<start, end>的权值;若start和end不是连通的,则返回无穷大。
|
||||
// */
|
||||
// private int GetWeight(int start, int end)
|
||||
// {
|
||||
// if (start == end)
|
||||
// return 0;
|
||||
|
||||
// ENode node = mVexs[start].firstEdge;
|
||||
// while (node != null)
|
||||
// {
|
||||
// if (end == node.ivex)
|
||||
// return node.weight;
|
||||
// node = node.nextEdge;
|
||||
// }
|
||||
|
||||
// return MAX;
|
||||
// }
|
||||
|
||||
// /*
|
||||
// * Dijkstra最短路径。
|
||||
// * 即,统计图中"起点D"到其它各个顶点的最短路径。
|
||||
// *
|
||||
// * 参数说明:
|
||||
// * vs -- 起始顶点(start vertex)。
|
||||
// * prev -- 前驱顶点数组。即,prev[i]的值是"起点D"到"顶点i"的最短路径所经历的全部顶点中,位于"顶点i"之前的那个顶点。
|
||||
// * dist -- 长度数组。即,dist[i]是"起点D"到"顶点i"的最短路径的长度。
|
||||
// */
|
||||
// public void CalcDijkstra(int vs, int[] prev, int[] dist, List<T> roads)
|
||||
// {
|
||||
// //List<T> vertexs = new(); //最短路径串联的点位列表
|
||||
// // flag[i]=true表示"起点D"到"顶点i"的最短路径已成功获取。
|
||||
// bool[] flag = new bool[mVexs.Length];
|
||||
|
||||
// // 初始化
|
||||
// for (int i = 0; i < mVexs.Length; i++)
|
||||
// {
|
||||
// flag[i] = false; // 顶点i的最短路径还没获取到。
|
||||
// prev[i] = 0; // 顶点i的前驱顶点为0。
|
||||
// dist[i] = GetWeight(vs, i); // 顶点i的最短路径为"起点D"到"顶点i"的权。
|
||||
// }
|
||||
|
||||
// // 对"起点D"自身进行初始化
|
||||
// flag[vs] = true;
|
||||
// dist[vs] = 0;
|
||||
|
||||
// // 遍历mVexs.Length-1次;每次找出一个顶点的最短路径。
|
||||
// int k = 0;
|
||||
// for (int i = 1; i < mVexs.Length; i++)
|
||||
// {
|
||||
// // 寻找当前最小的路径
|
||||
// // 即,在未获取最短路径的顶点中,找到离起点D最近的顶点(k)。
|
||||
// int min = MAX;
|
||||
// for (int j = 0; j < mVexs.Length; j++)
|
||||
// {
|
||||
// if (flag[j] == false && dist[j] < min)
|
||||
// {
|
||||
// min = dist[j];
|
||||
// k = j;
|
||||
// }
|
||||
// }
|
||||
// // 标记"顶点k"为已经获取到最短路径
|
||||
// flag[k] = true;
|
||||
// // 更新当前最短路径和前驱顶点
|
||||
// // 即,更新"未获取最短路径的顶点的最短路径和前驱顶点"。
|
||||
// for (int j = 0; j < mVexs.Length; j++)
|
||||
// {
|
||||
// int tmp = GetWeight(k, j);
|
||||
// tmp = (tmp == MAX ? MAX : (min + tmp)); // 防止溢出
|
||||
// if (flag[j] == false && (tmp < dist[j]))
|
||||
// {
|
||||
// dist[j] = tmp;
|
||||
// prev[j] = k;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 邻接表中表对应的链表的顶点
|
||||
///// </summary>
|
||||
//public class ENode
|
||||
//{
|
||||
// public int ivex; // 该边所指向的顶点的位置
|
||||
// public int weight; // 该边的权
|
||||
// public ENode nextEdge; // 指向下一条弧的指针
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 邻接表中表的顶点
|
||||
///// </summary>
|
||||
//public class VNode
|
||||
//{
|
||||
// public string data; // 顶点信息
|
||||
// public ENode firstEdge; // 指向第一条依附该顶点的弧
|
||||
//}
|
||||
|
||||
///// <summary>
|
||||
///// 边的结构体
|
||||
///// </summary>
|
||||
//public class EData
|
||||
//{
|
||||
// public string start; // 边的起点
|
||||
// public string end; // 边的终点
|
||||
// public int weight; // 边的权重
|
||||
|
||||
// public EData(string start, string end, int weight)
|
||||
// {
|
||||
// this.start = start;
|
||||
// this.end = end;
|
||||
// this.weight = weight;
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Templates;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using Spire.Doc;
|
||||
using Tnb.WarehouseMgr.Entities;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
/// <summary>
|
||||
/// 动态规划类
|
||||
/// </summary>
|
||||
public class Dp
|
||||
{
|
||||
private HashSet<string> set = new HashSet<string>();
|
||||
|
||||
/// <summary>
|
||||
/// 动态规划函数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void DpFunc(List<WmsRoad> roads, List<string> pointIds, Dictionary<string, bool> isVisited, string sPointId, string ePointId, dynamic ArrivedEpoint)
|
||||
{
|
||||
var sRoads = roads.FindAll(x => x.startpoint_id == sPointId).ToList();
|
||||
var sRoads_EPointIds = sRoads.Select(x => x.endpoint_id).ToList();
|
||||
|
||||
if (!isVisited[sPointId])
|
||||
{
|
||||
pointIds.Add(sPointId);
|
||||
set.Add(roads?.Find(x => x.startpoint_id == sPointId)?.startpoint_code!);
|
||||
isVisited[sPointId] = true;
|
||||
}
|
||||
|
||||
if (sRoads_EPointIds.Contains(ePointId)) //判断是否到达终点
|
||||
{
|
||||
ArrivedEpoint.isArrivedEpoint = true;
|
||||
pointIds.Add(ePointId);
|
||||
foreach (var kvp in isVisited)
|
||||
{
|
||||
isVisited[kvp.Key] = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (sRoads_EPointIds?.Count > 0)
|
||||
{
|
||||
var subRoads = roads?.FindAll(x => sRoads_EPointIds.Contains(x.startpoint_id) && !isVisited[x.endpoint_id]);
|
||||
if (subRoads?.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < subRoads.Count; i++)
|
||||
{
|
||||
var sIdx = subRoads[i].startpoint_id;
|
||||
if (!isVisited[sIdx])
|
||||
{
|
||||
DpFunc(roads, pointIds, isVisited, sIdx, ePointId, ArrivedEpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!ArrivedEpoint.isArrivedEpoint)
|
||||
{
|
||||
pointIds.Remove(sPointId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using JNPF.Common.Configuration;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.TaskScheduler.Entitys;
|
||||
using SqlSugar;
|
||||
using Tnb.Common.Core.EventBus.Constants;
|
||||
using Tnb.Common.Core.EventBus.Sources;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
|
||||
namespace Tnb.WarehouseMgr.EventSubscribers;
|
||||
|
||||
/// <summary>
|
||||
/// 任务事件订阅.
|
||||
/// </summary>
|
||||
public class TaskStatusChangeSubscriber : IEventSubscriber, ISingleton
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化客户端.
|
||||
/// </summary>
|
||||
//private static SqlSugarScope? _sqlSugarClient;
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
/// <summary>
|
||||
/// 构造函数.
|
||||
/// </summary>
|
||||
public TaskStatusChangeSubscriber(IWareHouseService wareHouseService)
|
||||
{
|
||||
_wareHouseService = wareHouseService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建任务日记.
|
||||
/// </summary>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
[EventSubscribe(EventSubscribeEventConsts.TaskStatusChangeEventId)]
|
||||
public async Task Excute(EventHandlerExecutingContext context)
|
||||
{
|
||||
var tscSource = (TaskStatusChangeSource)context.Source;
|
||||
switch (tscSource.Payload)
|
||||
{
|
||||
case nameof(_wareHouseService.GenTaskExecute):
|
||||
await _wareHouseService.GenTaskExecute();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ using Tnb.WarehouseMgr.Entities.Dto.Inputs;
|
||||
using Tnb.WarehouseMgr.Entities.Entity;
|
||||
using Tnb.WarehouseMgr.Entities.Enums;
|
||||
using Tnb.WarehouseMgr.Interfaces;
|
||||
using JNPF.Common.Extension;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -47,12 +48,13 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ICacheManager _cacheManager;
|
||||
private readonly IElevatorControlService _elevatorControlService;
|
||||
private static Dictionary<string, object> _elevatorMap = new Dictionary<string, object>();
|
||||
private static Dictionary<string, int> _elevatorAgvCtlStatusMap = new(StringComparer.OrdinalIgnoreCase);
|
||||
private readonly ElevatorControlConfiguration _eleCtlCfg = App.Configuration.Build<ElevatorControlConfiguration>();
|
||||
public Func<string, int, Task> AddUnExecuteTask { get; set; }
|
||||
|
||||
public WareHouseService(ISqlSugarRepository<WmsInstockH> repository, IDictionaryDataService dictionaryDataService,
|
||||
IBillRullService billRullService, IUserManager userManager, ICacheManager cacheManager, IElevatorControlService elevatorControlService)
|
||||
: base(repository.AsSugarClient())
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
@@ -60,10 +62,6 @@ namespace Tnb.WarehouseMgr
|
||||
_userManager = userManager;
|
||||
_cacheManager = cacheManager;
|
||||
_elevatorControlService = elevatorControlService;
|
||||
AddUnExecuteTask = async (code, floor) =>
|
||||
{
|
||||
await _elevatorControlService.CallLift(code, floor, CancellationToken.None);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -226,10 +224,23 @@ namespace Tnb.WarehouseMgr
|
||||
var db = _db.CopyNew();
|
||||
try
|
||||
{
|
||||
//if (_elevatorMap.Count < 1)
|
||||
//{
|
||||
// _elevatorMap = await _db.Queryable<WmsElevatorH>().ToDictionaryAsync(x => x.elevator_id, x => x.elevator_code);
|
||||
//}
|
||||
/*if (_elevatorMap.Count < 1)
|
||||
{
|
||||
_elevatorMap = await _db.Queryable<WmsElevatorH>().ToDictionaryAsync(x => x.elevator_id, x => x.elevator_code);
|
||||
}*/
|
||||
//获取电梯数据
|
||||
var elevatorList = await db.Queryable<WmsElevatorH>().InnerJoin<WmsElevatorD>((a, b) => a.id == b.bill_id)
|
||||
.Select((a, b) => new WmsElevatorH
|
||||
{
|
||||
bill_id = b.bill_id,
|
||||
location_id = b.location_id,
|
||||
location_code = b.location_code,
|
||||
point_id = b.point_id,
|
||||
point_code = b.point_code,
|
||||
floor = b.floor
|
||||
}, true).ToListAsync();
|
||||
|
||||
|
||||
//获取所有未下发的预任务申请
|
||||
var preTasks = await db.Queryable<WmsPretaskH>().InnerJoin<WmsCarryH>((a, b) => a.startlocation_id == b.location_id && a.carry_id == b.id)
|
||||
.InnerJoin<WmsAreaH>((a, b, c) => a.area_id == c.id)
|
||||
@@ -240,6 +251,14 @@ namespace Tnb.WarehouseMgr
|
||||
move_num = c.move_num
|
||||
}, true)
|
||||
.ToListAsync();
|
||||
var agvElevatorTasks = preTasks
|
||||
.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) &&
|
||||
!it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
var firstEleGrp = agvElevatorTasks.GroupBy(g => g.endlocation_code).Select(t => t.OrderBy(o => o.bill_code).FirstOrDefault());
|
||||
agvElevatorTasks = agvElevatorTasks.FindAll(x => firstEleGrp.Select(y => y.endlocation_code).Contains(x.endlocation_code));
|
||||
preTasks = preTasks.Where(it => !it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase)).Concat(agvElevatorTasks).ToList();
|
||||
|
||||
var ids = preTasks.Select(x => x.id).Distinct().ToList();
|
||||
var preTaskCodes = await db.Queryable<WmsPretaskCode>().Where(it => ids.Contains(it.bill_id)).ToListAsync();
|
||||
if (preTasks.Count > 0)
|
||||
@@ -323,7 +342,25 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
await db.Ado.BeginTranAsync();
|
||||
|
||||
var endPointIds = disTasks.Where(t => t.area_code.StartsWith("ELE", StringComparison.OrdinalIgnoreCase)).Select(t => t.endpoint_id).ToList();
|
||||
if (endPointIds?.Count > 0)
|
||||
{
|
||||
elevatorList = elevatorList.FindAll(x => endPointIds.Contains(x.point_id));
|
||||
if (elevatorList?.Count > 0)
|
||||
{
|
||||
foreach (var e in elevatorList)
|
||||
{
|
||||
var disTask = disTasks.Find(x => x.endpoint_id == e.point_id);
|
||||
if (disTask != null)
|
||||
{
|
||||
disTask.device_id = e.elevator_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//disTasks.ForEach(x => x.id = SnowflakeIdHelper.NextId());
|
||||
|
||||
|
||||
var row = await db.Insertable(disTasks).ExecuteCommandAsync();
|
||||
if (preTaskCodes?.Count > 0)
|
||||
{
|
||||
@@ -335,24 +372,22 @@ namespace Tnb.WarehouseMgr
|
||||
row = await db.Updateable<WmsPretaskH>().SetColumns(it => new WmsPretaskH { status = WmsWareHouseConst.PRETASK_BILL_STATUS_YXF_ID }).Where(it => preTaskIds.Contains(it.id)).ExecuteCommandAsync();
|
||||
}
|
||||
|
||||
sw.Stop();
|
||||
Log.Information($"程序运行耗时{sw.ElapsedMilliseconds}ms");
|
||||
await db.Ado.CommitTranAsync();
|
||||
|
||||
//呼梯操作
|
||||
//获取目标库位为电梯库位的任务
|
||||
|
||||
var endLocCodes = disTasks
|
||||
.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) &&
|
||||
!it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)
|
||||
).Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList();
|
||||
.Where(it => it.endlocation_code.StartsWith("DT", StringComparison.OrdinalIgnoreCase) &&
|
||||
!it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase))
|
||||
.Select(it => (it.endlocation_code, it.device_id, it.id, it.start_floor)).ToList();
|
||||
if (endLocCodes?.Count > 0)
|
||||
{
|
||||
|
||||
await CallingLanding(endLocCodes);
|
||||
}
|
||||
//执行电梯任务
|
||||
var elevatorTasks = disTasks.Where(it => it.area_code.Contains("ELE", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
|
||||
|
||||
if (elevatorTasks?.Count > 0)
|
||||
{
|
||||
Logger.Information($"当前电梯任务数:{elevatorTasks?.Count ?? 0}");
|
||||
@@ -371,7 +406,6 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
await AgvDispatch(agvTasks, agvCts.Token);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex) when (ex is HttpRequestException hReqEx)
|
||||
@@ -396,59 +430,67 @@ namespace Tnb.WarehouseMgr
|
||||
/// <returns></returns>
|
||||
private async Task CallingLanding(List<(string endlocation_code, string device_id, string id, string floorNO)> endLocCodes)
|
||||
{
|
||||
Logger.Information($"开始呼梯操作.............");
|
||||
Logger.Information($" 开始呼梯操作.............");
|
||||
try
|
||||
{
|
||||
var item = endLocCodes.FirstOrDefault();
|
||||
//if (_elevatorMap.ContainsKey(item.device_id))
|
||||
var devName = _eleCtlCfg.DevName;
|
||||
foreach (var (_, devId, disTaskId, floorNO) in endLocCodes)
|
||||
{
|
||||
var agvStatus = await _elevatorControlService.GetTagAsync(devName, ElevatorConsts.AGVControl);
|
||||
Logger.Information($"当前Agv状态:{agvStatus.ToEnum<EnumAgvStatus>().ToString()}");
|
||||
|
||||
//判断当前设备是否为运行状态,不是则进入Agv电梯控制状态
|
||||
if (agvStatus.ToEnum<EnumAgvStatus>() != EnumAgvStatus.AGV运行状态)
|
||||
if (!_elevatorMap.TryGetValue(devId, out var elevatorCode)) continue;
|
||||
|
||||
var devName = elevatorCode.ToString();
|
||||
|
||||
Logger.Information($"当前:{devName.Match(@"\d+")}#梯");
|
||||
|
||||
await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.AGVControl, 1);
|
||||
(int sysStatus, int runStatus, int curFloorNo, int doorStatus, int agvStatus) eleStatusMulti = (-1, -1, -1, -1, -1);
|
||||
if (!_elevatorAgvCtlStatusMap.TryGetValue(devId, out var agvCtlStatus) || agvCtlStatus != (int)EnumAgvStatus.AGV运行状态)
|
||||
{
|
||||
await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.AGVControl, 1);
|
||||
do
|
||||
{
|
||||
eleStatusMulti = await _elevatorControlService.GetElevatorStatus(devName, CancellationToken.None);
|
||||
await Task.Delay(500);
|
||||
} while (eleStatusMulti.agvStatus != (int)EnumAgvStatus.AGV运行状态);
|
||||
Logger.Information($"{devName.Match(@"\d+")}#, 当前Agv状态:{eleStatusMulti.agvStatus.ToEnum<EnumAgvStatus>().ToString()}");
|
||||
_elevatorAgvCtlStatusMap[devId] = eleStatusMulti.agvStatus;
|
||||
}
|
||||
}
|
||||
{
|
||||
(int sysStatus, int runStatus, int curFloorNo, int doorStatus, int agvStatus) = await _elevatorControlService.GetElevatorStatus(devName, CancellationToken.None);
|
||||
|
||||
foreach (var (_, devId, disTaskId, floorNO) in endLocCodes)
|
||||
Logger.Information($"任务开始目标楼层为:{floorNO}");
|
||||
|
||||
var floorN = await GetRealFloor(floorNO.ParseToInt());
|
||||
//如果电梯在当前楼层则不呼梯
|
||||
if (floorN == eleStatusMulti.curFloorNo)
|
||||
{
|
||||
Logger.Information($"任务开始目标楼层为:{floorNO}");
|
||||
|
||||
var floorN = await GetRealFloor(floorNO.ParseToInt());
|
||||
|
||||
Logger.Information($"实际目标楼层为:{floorN}");
|
||||
|
||||
WmsElevatorUnexecute elevatorQueueItem = new()
|
||||
{
|
||||
distask_id = disTaskId,
|
||||
elevator_id = devId,
|
||||
elevator_code = devName,
|
||||
floor = floorN, //5代表4楼
|
||||
task_status = "待执行",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
var elevatorQueue = await _db.Queryable<WmsElevatorUnexecute>().Where(it => it.distask_id == disTaskId && it.task_status == "执行中").ToListAsync();
|
||||
if ((elevatorQueue.IsNull() || elevatorQueue.Count < 1) && floorNO.ParseToInt() != curFloorNo)
|
||||
{
|
||||
|
||||
elevatorQueueItem.task_status = "执行中";
|
||||
var callLiftRes = await _elevatorControlService.CallLift(devName, floorN, CancellationToken.None);
|
||||
string successful = "成功", fail = "失败";
|
||||
var callLiftResult = callLiftRes ? successful : fail;
|
||||
Logger.Information($"呼梯结果:{callLiftResult}");
|
||||
}
|
||||
|
||||
//如果当前电梯有任务在做,将当前呼梯任务放入待执行队列
|
||||
await _db.Insertable(elevatorQueueItem).ExecuteCommandAsync();
|
||||
Logger.Information($"{devName.Match(@"\d+")}#,在当前楼层,无需呼梯");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
Logger.Information($"实际目标楼层为:{floorN}");
|
||||
|
||||
WmsElevatorUnexecute elevatorQueueItem = new()
|
||||
{
|
||||
distask_id = disTaskId,
|
||||
elevator_id = devId,
|
||||
elevator_code = devName,
|
||||
floor = floorN, //5代表4楼
|
||||
task_status = "待执行",
|
||||
create_id = _userManager.UserId,
|
||||
create_time = DateTime.Now
|
||||
};
|
||||
var elevatorQueue = await _db.Queryable<WmsElevatorUnexecute>().Where(it => it.distask_id == disTaskId && it.task_status == "执行中").ToListAsync();
|
||||
if ((elevatorQueue.IsNull() || elevatorQueue.Count < 1) && floorN != eleStatusMulti.curFloorNo)
|
||||
{
|
||||
|
||||
elevatorQueueItem.task_status = "执行中";
|
||||
var callLiftRes = await _elevatorControlService.CallLift(devName, floorN, CancellationToken.None);
|
||||
string successful = "成功", fail = "失败";
|
||||
var callLiftResult = callLiftRes ? successful : fail;
|
||||
Logger.Information($"{devName.Match(@"\d+")}#, 呼梯结果:{callLiftResult}");
|
||||
}
|
||||
|
||||
//如果当前电梯有任务在做,将当前呼梯任务放入待执行队列
|
||||
await _db.Insertable(elevatorQueueItem).ExecuteCommandAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -468,54 +510,58 @@ namespace Tnb.WarehouseMgr
|
||||
Logger.Information($"开始执行电梯任务,任务ID:{disTask.id}");
|
||||
try
|
||||
{
|
||||
/* var elevatorQueueItem = await _db.Queryable<WmsElevatorUnexecute>().FirstAsync(it => it.task_status == "执行中");
|
||||
Log.Information($"是否存在电梯任务项:{elevatorQueueItem != null}");
|
||||
*/ //if (elevatorQueueItem != null)
|
||||
if (!_elevatorMap.TryGetValue(disTask.device_id, out var elevatorCode))
|
||||
{
|
||||
//var disTask = disTasks.Find(x => x.id == elevatorQueueItem.distask_id);
|
||||
//if (disTask?.status == WmsWareHouseConst.TASK_BILL_STATUS_COMPLE_ID)
|
||||
{
|
||||
var doorStatus = -1;
|
||||
var closeDoorRes = await _elevatorControlService.SendOpenCloseCmd(_eleCtlCfg.DevName, 4); //向电梯发送前门关门指令
|
||||
Logger.Information($"关门结果:{closeDoorRes}");
|
||||
do
|
||||
{
|
||||
doorStatus = await _elevatorControlService.GetTagAsync(_eleCtlCfg.DevName, ElevatorConsts.DoorStatus);
|
||||
await Task.Delay(2000);
|
||||
} while (doorStatus != 4);
|
||||
Logger.Information($"当前门状态:{doorStatus}");
|
||||
|
||||
var floor = await GetRealFloor(disTask.end_floor.ParseToInt());
|
||||
|
||||
Logger.Information($"目标楼层:{floor}");
|
||||
|
||||
//发送到目标楼的指令
|
||||
var reuslt = await _elevatorControlService.WriteTagAsync(_eleCtlCfg.DevName, ElevatorConsts.FloorExecute, floor);
|
||||
//电梯任务手动执行任务状态上报
|
||||
(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) tuple = (-1, -1, -1, -1, -1);
|
||||
|
||||
do
|
||||
{
|
||||
tuple = await _elevatorControlService.GetElevatorStatus(_eleCtlCfg.DevName, CancellationToken.None);
|
||||
await Task.Delay(2000);
|
||||
} while (tuple.sysStatus != 3 && tuple.runStatus != 0);
|
||||
|
||||
Logger.Information($"sysStatus:{tuple.sysStatus},runStatus:{tuple.runStatus},floorNo:{tuple.floorNo},disTask.end_floor={disTask.end_floor}");
|
||||
|
||||
if (tuple.sysStatus.ToEnum<EnumSysStatus>() == EnumSysStatus.正常状态 && tuple.runStatus.ToEnum<EnumRunStatus>() == EnumRunStatus.停梯)
|
||||
{
|
||||
Log.Information($"disTask.require_id={disTask.require_id}");
|
||||
|
||||
List<string> disTaskIds = new() { disTask.id };
|
||||
Log.Information($"disTaskIds={string.Join(",", disTaskIds)}");
|
||||
TaskExecuteAfterUpInput teaUpInput = new() { disTaskIds = disTaskIds };
|
||||
await TaskExecuteAfter(teaUpInput);
|
||||
|
||||
TaskCompleUpInput tcUpInput = new() { disTaskIds = disTaskIds };
|
||||
await TaskComplate(tcUpInput);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
var devName = _elevatorMap[disTask.device_id]?.ToString() ?? _eleCtlCfg.DevName;
|
||||
|
||||
Logger.Information($"当前:{devName.Match(@"\d+")}#梯");
|
||||
|
||||
var doorStatus = -1;
|
||||
var closeDoorRes = await _elevatorControlService.SendOpenCloseCmd(devName, 4); //向电梯发送前门关门指令
|
||||
Logger.Information($"关门结果:{closeDoorRes}");
|
||||
do
|
||||
{
|
||||
doorStatus = await _elevatorControlService.GetTagAsync(devName, ElevatorConsts.DoorStatus);
|
||||
await Task.Delay(2000);
|
||||
} while (doorStatus != 4);
|
||||
Logger.Information($"当前门状态:{doorStatus}");
|
||||
|
||||
var floor = await GetRealFloor(disTask.end_floor.ParseToInt());
|
||||
|
||||
Logger.Information($"目标楼层:{floor}");
|
||||
|
||||
//发送到目标楼的指令
|
||||
var reuslt = await _elevatorControlService.WriteTagAsync(devName, ElevatorConsts.FloorExecute, floor);
|
||||
//电梯任务手动执行任务状态上报
|
||||
(int sysStatus, int runStatus, int floorNo, int doorStatus, int agvStatus) tuple = (-1, -1, -1, -1, -1);
|
||||
|
||||
do
|
||||
{
|
||||
tuple = await _elevatorControlService.GetElevatorStatus(devName, CancellationToken.None);
|
||||
await Task.Delay(2000);
|
||||
} while (tuple.sysStatus != 3 && tuple.runStatus != 0);
|
||||
|
||||
Logger.Information($"sysStatus:{tuple.sysStatus},runStatus:{tuple.runStatus},floorNo:{tuple.floorNo},disTask.end_floor={disTask.end_floor}");
|
||||
|
||||
if (tuple.sysStatus.ToEnum<EnumSysStatus>() == EnumSysStatus.正常状态 && tuple.runStatus.ToEnum<EnumRunStatus>() == EnumRunStatus.停梯)
|
||||
{
|
||||
Log.Information($"disTask.require_id={disTask.require_id}");
|
||||
var disTaskIds = new List<string> { disTask.id };
|
||||
var upInput = new { disTaskIds = disTask.id };
|
||||
TaskExecuteAfterUpInput teaUpInput = new()
|
||||
{
|
||||
disTaskIds = disTaskIds,
|
||||
};
|
||||
await TaskExecuteAfter(teaUpInput);
|
||||
TaskCompleUpInput tcUpInput = new()
|
||||
{
|
||||
disTaskIds = disTaskIds,
|
||||
};
|
||||
await TaskComplate(tcUpInput);
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -746,7 +792,7 @@ namespace Tnb.WarehouseMgr
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error($"任务结束失败", ex);
|
||||
Log .Error($"任务结束失败堆栈异常", ex.StackTrace);
|
||||
Log.Error($"任务结束失败堆栈异常", ex.StackTrace);
|
||||
await _db.Ado.RollbackTranAsync();
|
||||
throw;
|
||||
}
|
||||
@@ -916,8 +962,9 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Error("路径算法异常", ex);
|
||||
throw;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -44,7 +45,6 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
private readonly ChannelWriter<NotifyMessage> _channelWriter;
|
||||
|
||||
|
||||
public WmsCarryMoveInStockService(
|
||||
@@ -54,8 +54,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -63,7 +63,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = CarryMoveIn;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -46,7 +47,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -54,6 +56,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = CarryMoveOut;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -44,8 +45,8 @@ namespace Tnb.WarehouseMgr
|
||||
IRunService runService,
|
||||
IBillRullService billRullService,
|
||||
IUserManager userManager,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_warehouseService = wareHouseService;
|
||||
@@ -53,6 +54,7 @@ namespace Tnb.WarehouseMgr
|
||||
_runService = runService;
|
||||
_billRullService = billRullService;
|
||||
_userManager = userManager;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -56,8 +57,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -66,6 +67,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -128,7 +130,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
var points = await _wareHouseService.PathAlgorithms(sPoint.id, ePoint.id);
|
||||
|
||||
Log.Information($"经过的所有点位编码:{Environment.NewLine}{string.Join("\r\n", points.Select(x=>x.point_code))}");
|
||||
Log.Information($"经过的所有点位编码:{Environment.NewLine}{string.Join("\r\n", points.Select(x => x.point_code))}");
|
||||
|
||||
//根据获取的路径点生成预任务,生成顺序必须预路径算法返回的起终点的顺序一致(预任务顺序)
|
||||
if (points?.Count > 0)
|
||||
@@ -139,7 +141,7 @@ namespace Tnb.WarehouseMgr
|
||||
var sPoint = it.FirstOrDefault();
|
||||
var ePoint = it.LastOrDefault();
|
||||
|
||||
Log.Information("ePoint?.point_code="+ ePoint?.point_code);
|
||||
Log.Information("ePoint?.point_code=" + ePoint?.point_code);
|
||||
|
||||
WmsPretaskH preTask = new();
|
||||
preTask.org_id = _userManager.User.OrganizeId;
|
||||
|
||||
@@ -10,6 +10,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -54,8 +55,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMesageNotify
|
||||
) : base(taskMesageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -63,7 +64,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_channelWriter = taskMesageNotify.Writer;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = WmsEmptyIn;
|
||||
}
|
||||
private async Task<dynamic> WmsEmptyIn(VisualDevModelDataCrInput input)
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -52,8 +53,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -61,6 +62,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = WmsEmptyOut;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Filter;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -55,8 +56,8 @@ namespace Tnb.WarehouseMgr
|
||||
IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService,
|
||||
IPrdInstockService prdInstockService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
@@ -64,6 +65,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_prdInstockService = prdInstockService;
|
||||
EventPublisher = eventPublisher;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据入库申请单ID获取申请单明细信息
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -49,8 +50,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -58,6 +59,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = KittingInStk;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -48,8 +49,8 @@ namespace Tnb.WarehouseMgr
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
IWmsCarryService wmsCarryService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -58,6 +59,7 @@ namespace Tnb.WarehouseMgr
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
_wmsCarryService = wmsCarryService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = CarryOutBale;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ using Tnb.WarehouseMgr.Interfaces;
|
||||
using System.Reflection;
|
||||
using Tnb.WarehouseMgr.Print;
|
||||
using System.Runtime.InteropServices;
|
||||
using JNPF.EventBus;
|
||||
|
||||
namespace Tnb.WarehouseMgr
|
||||
{
|
||||
@@ -67,7 +68,7 @@ namespace Tnb.WarehouseMgr
|
||||
IBillRullService billRullService,
|
||||
IWmsCarryMoveInStockService wmsCarryMoveInStockService,
|
||||
IWmsCarryService wareCarryService,
|
||||
ITaskMessageNotify taskMessageNotify) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
@@ -78,6 +79,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
_wmsCarryMoveInStockService = wmsCarryMoveInStockService;
|
||||
_wareCarryService = wareCarryService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = OutStockApplyFor;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Entitys.Permission;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -51,7 +52,7 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -59,6 +60,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = PDACarryMoveIn;
|
||||
}
|
||||
|
||||
@@ -251,7 +253,7 @@ namespace Tnb.WarehouseMgr
|
||||
handleH.carry_code = input.data[nameof(WmsHandleH.carry_code)]?.ToString()!;
|
||||
handleH.require_id = input.data["ReturnIdentity"].ToString();
|
||||
handleH.require_code = input.data[nameof(WmsHandleH.bill_code)]?.ToString()!;
|
||||
handleH.create_id = _userManager.UserId ;
|
||||
handleH.create_id = _userManager.UserId;
|
||||
handleH.create_time = DateTime.Now;
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
//根据载具移入Id,回更单据状态
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -39,6 +40,7 @@ namespace Tnb.WarehouseMgr
|
||||
private readonly IWareHouseService _wareHouseService;
|
||||
private readonly IBillRullService _billRullService;
|
||||
private readonly IUserManager _userManager;
|
||||
|
||||
public WmsPDACarryMoveOutStockService(
|
||||
ISqlSugarRepository<WmsCarryH> repository,
|
||||
IRunService runService,
|
||||
@@ -46,8 +48,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -55,6 +57,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = PDACarryMoveOut;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.DependencyInjection;
|
||||
using JNPF.DynamicApiController;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -51,8 +52,8 @@ namespace Tnb.WarehouseMgr
|
||||
IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -61,6 +62,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -48,7 +49,7 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -56,6 +57,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = PDAWmsEmptyIn;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Logging;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
@@ -49,8 +50,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -58,6 +59,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = PDAWmsEmptyOut;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -55,8 +56,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -64,6 +65,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = ScanCodeInStock;
|
||||
}
|
||||
|
||||
@@ -83,7 +85,7 @@ namespace Tnb.WarehouseMgr
|
||||
if (input.data.ContainsKey("tablefield115"))
|
||||
{
|
||||
jArr = JArray.Parse(input.data["tablefield115"].ToString()!);
|
||||
|
||||
|
||||
}
|
||||
//入库取终点 //出库起点
|
||||
var inStockStrategyInput = new InStockStrategyQuery { warehouse_id = input.data[nameof(InStockStrategyQuery.warehouse_id)].ToString()!, Size = 1 };
|
||||
@@ -142,7 +144,7 @@ namespace Tnb.WarehouseMgr
|
||||
create_time = DateTime.Now,
|
||||
source_id = input.data[nameof(WmsKittingInstock.source_id)].ToString(),
|
||||
source_code = input.data[nameof(WmsKittingInstock.source_code)].ToString()
|
||||
};
|
||||
};
|
||||
|
||||
return preTask;
|
||||
}).ToList();
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -50,8 +51,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -59,6 +60,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = Inbale;
|
||||
}
|
||||
|
||||
@@ -152,7 +154,7 @@ namespace Tnb.WarehouseMgr
|
||||
handleH.create_time = DateTime.Now;
|
||||
preTaskUpInput.PreTaskRecord = handleH;
|
||||
//根据载具移入Id,回更单据状态
|
||||
await _db.Updateable<WmsInbale>().SetColumns(it => new WmsInbale { status = WmsWareHouseConst.BILLSTATUS_ON_ID}).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsInbale>().SetColumns(it => new WmsInbale { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == preTaskUpInput.RquireId).ExecuteCommandAsync();
|
||||
|
||||
var baleNum = input.data[nameof(WmsCarryH.bale_num)]?.ToString();
|
||||
await _wareHouseService.GenInStockTaskHandleAfter(preTaskUpInput,
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -39,8 +40,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(repository, runService, visualDevService, wareHouseService, userManager, billRullService, taskMessageNotify)
|
||||
IEventPublisher publisher
|
||||
) : base(repository, runService, visualDevService, wareHouseService, userManager, billRullService, publisher)
|
||||
|
||||
{
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -48,8 +49,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -57,6 +58,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher= eventPublisher;
|
||||
OverideFuncs.CreateAsync = PDAOutBale;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -46,8 +47,8 @@ namespace Tnb.WarehouseMgr
|
||||
IBillRullService billRullService,
|
||||
IWareHouseService wareHouseService,
|
||||
IPrdInstockService prdInstockService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_dictionaryDataService = dictionaryDataService;
|
||||
@@ -55,6 +56,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
_wareHouseService = wareHouseService;
|
||||
_prdInstockService = prdInstockService;
|
||||
EventPublisher = eventPublisher;
|
||||
OverideFuncs.CreateAsync = ScanInStock;
|
||||
}
|
||||
public async Task<dynamic> ScanInStock(VisualDevModelDataCrInput input)
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -51,8 +52,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher publisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -60,6 +61,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
EventPublisher = publisher;
|
||||
OverideFuncs.CreateAsync = CarryTransfer;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ using JNPF.Common.Core.Manager;
|
||||
using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using Mapster;
|
||||
@@ -45,8 +46,8 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService warehouseService,
|
||||
IBillRullService billRullService,
|
||||
IWmsKittingInStkService wmsKittingInStkService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher publisher
|
||||
)
|
||||
{
|
||||
_wmsCarryBindService = wmsCarryBindService;
|
||||
_db = repository.AsSugarClient();
|
||||
@@ -54,6 +55,7 @@ namespace Tnb.WarehouseMgr
|
||||
_warehouseService = warehouseService;
|
||||
_billRullService = billRullService;
|
||||
_wmsKittingInStkService = wmsKittingInStkService;
|
||||
EventPublisher = publisher;
|
||||
}
|
||||
/// <summary>
|
||||
/// 机器人完成任务后回调接口
|
||||
|
||||
@@ -13,6 +13,7 @@ using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Manager;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -59,8 +60,8 @@ namespace Tnb.WarehouseMgr
|
||||
ICacheManager cacheManager,
|
||||
IRunService runService,
|
||||
IVisualDevService visualDevService,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher publisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_wareHouseService = wareHouseService;
|
||||
@@ -69,6 +70,7 @@ namespace Tnb.WarehouseMgr
|
||||
_cacheManager = cacheManager;
|
||||
_runService = runService;
|
||||
_visualDevService = visualDevService;
|
||||
EventPublisher = publisher;
|
||||
//OverideFuncs.CreateAsync = Create;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ using JNPF.Common.Dtos.VisualDev;
|
||||
using JNPF.Common.Enums;
|
||||
using JNPF.Common.Extension;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.Systems.Interfaces.System;
|
||||
using JNPF.VisualDev;
|
||||
@@ -52,7 +53,7 @@ namespace Tnb.WarehouseMgr
|
||||
IWareHouseService wareHouseService,
|
||||
IUserManager userManager,
|
||||
IBillRullService billRullService,
|
||||
ITaskMessageNotify taskMessageNotify):base(taskMessageNotify.Writer)
|
||||
IEventPublisher publisher)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_runService = runService;
|
||||
@@ -60,7 +61,7 @@ namespace Tnb.WarehouseMgr
|
||||
_wareHouseService = wareHouseService;
|
||||
_userManager = userManager;
|
||||
_billRullService = billRullService;
|
||||
|
||||
EventPublisher = publisher;
|
||||
OverideFuncs.CreateAsync = CarryTransfer;
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ namespace Tnb.WarehouseMgr
|
||||
// 计算路径,插入预任务申请
|
||||
WmsPointH? sPoint = null;
|
||||
WmsPointH? ePoint = null;
|
||||
|
||||
|
||||
if (input.data.ContainsKey(nameof(WmsTransfer.endlocation_id)))
|
||||
{
|
||||
ePoint = await _db.Queryable<WmsPointH>().FirstAsync(it => it.location_id == input.data[nameof(WmsTransfer.endlocation_id)].ToString());
|
||||
@@ -97,7 +98,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
var sPoint = it.FirstOrDefault();
|
||||
var ePoint = it.LastOrDefault();
|
||||
|
||||
|
||||
WmsPretaskH preTask = new();
|
||||
preTask.org_id = _userManager.User.OrganizeId;
|
||||
preTask.startlocation_id = sPoint?.location_id!;
|
||||
@@ -145,6 +146,7 @@ namespace Tnb.WarehouseMgr
|
||||
await _db.Updateable<BasLocation>().SetColumns(it => new BasLocation { is_lock = 1 }).Where(it => ids.Contains(it.id)).ExecuteCommandAsync();
|
||||
await _db.Updateable<WmsTransfer>().SetColumns(it => new WmsTransfer { status = WmsWareHouseConst.BILLSTATUS_ON_ID }).Where(it => it.id == input.data["ReturnIdentity"].ToString()).ExecuteCommandAsync();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ using JNPF.Common.Extension;
|
||||
using JNPF.Common.Manager;
|
||||
using JNPF.Common.Security;
|
||||
using JNPF.DataEncryption;
|
||||
using JNPF.EventBus;
|
||||
using JNPF.FriendlyException;
|
||||
using JNPF.LinqBuilder;
|
||||
using JNPF.Logging;
|
||||
@@ -62,8 +63,8 @@ namespace Tnb.WarehouseMgr
|
||||
IBillRullService billRullService,
|
||||
IWmsCarryService carryService,
|
||||
ICacheManager cacheManager,
|
||||
ITaskMessageNotify taskMessageNotify
|
||||
) : base(taskMessageNotify.Writer)
|
||||
IEventPublisher eventPublisher
|
||||
)
|
||||
{
|
||||
_db = repository.AsSugarClient();
|
||||
_warehouseService = warehouseService;
|
||||
@@ -71,7 +72,7 @@ namespace Tnb.WarehouseMgr
|
||||
_billRullService = billRullService;
|
||||
_carryService = carryService;
|
||||
_cacheManager = cacheManager;
|
||||
|
||||
EventPublisher = eventPublisher;
|
||||
}
|
||||
/// <summary>
|
||||
/// 齐套出库(新增状态)
|
||||
@@ -169,7 +170,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
Log.Error("齐套出库,新增时出现错误", ex);
|
||||
await curDb.Ado.RollbackTranAsync();
|
||||
if(_userManager?.ToKen.IsNullOrEmpty() ?? false)
|
||||
if (_userManager?.ToKen.IsNullOrEmpty() ?? false)
|
||||
{
|
||||
TimedTaskErrorInfo ei = new()
|
||||
{
|
||||
@@ -279,7 +280,7 @@ namespace Tnb.WarehouseMgr
|
||||
{
|
||||
Log.Error("齐套出库,待配送时出现错误", ex);
|
||||
await curDb.Ado.RollbackTranAsync();
|
||||
if(_userManager?.ToKen.IsNullOrEmpty() ?? false)
|
||||
if (_userManager?.ToKen.IsNullOrEmpty() ?? false)
|
||||
{
|
||||
TimedTaskErrorInfo ei = new()
|
||||
{
|
||||
|
||||
@@ -63,11 +63,11 @@ public class Startup : AppStartup
|
||||
|
||||
services.AddOverideVisualDev();
|
||||
//注册任务消息通知 added by ly on 20230814
|
||||
services.AddTaskMessageNotify();
|
||||
//services.AddTaskMessageNotify();
|
||||
|
||||
SnowflakeIdHelper.InitYitIdWorker();
|
||||
//定时任务
|
||||
services.AddHostedService<TimedTaskBackgroundService>();
|
||||
//services.AddHostedService<TimedTaskBackgroundService>();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Tnb.Common.Core.EventBus.Constants
|
||||
{
|
||||
public class EventSubscribeEventConsts
|
||||
{
|
||||
/// <summary>
|
||||
/// 预任务执行EventId
|
||||
/// </summary>
|
||||
public const string TaskStatusChangeEventId = "DisTask:TaskStatusChange";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using JNPF.EventBus;
|
||||
using SqlSugar;
|
||||
|
||||
namespace Tnb.Common.Core.EventBus.Sources
|
||||
{
|
||||
public class TaskStatusChangeSource : IEventSource
|
||||
{
|
||||
/// <summary>
|
||||
/// 构造函数.
|
||||
/// </summary>
|
||||
/// <param name="eventId">事件ID.</param>
|
||||
/// <param name="connectionConfig">数据库连接配置.</param>
|
||||
/// <param name="entity">实体.</param>
|
||||
public TaskStatusChangeSource(string eventId, object payload)
|
||||
{
|
||||
EventId = eventId;
|
||||
Payload = payload;
|
||||
}
|
||||
|
||||
///// <summary>
|
||||
///// 数据库连接配置.
|
||||
///// </summary>
|
||||
//public ConnectionConfigOptions ConnectionConfig { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 事件 Id.
|
||||
/// </summary>
|
||||
public string EventId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 事件承载(携带)数据.
|
||||
/// </summary>
|
||||
public object Payload { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 取消任务 Token.
|
||||
/// </summary>
|
||||
/// <remarks>用于取消本次消息处理.</remarks>
|
||||
public CancellationToken CancellationToken { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 事件创建时间.
|
||||
/// </summary>
|
||||
public DateTime CreatedTime { get; } = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections;
|
||||
using System.Globalization;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace JNPF.Common.Extension;
|
||||
|
||||
@@ -701,6 +702,13 @@ public static partial class Extensions
|
||||
{
|
||||
return thisValue == null;
|
||||
}
|
||||
//added by ly on 20231030
|
||||
public static T ConvertToType<T>(this object value) where T : class
|
||||
{
|
||||
var jsonData = JsonConvert.SerializeObject(value);
|
||||
return JsonConvert.DeserializeObject<T>(jsonData);
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user