change - 提升机地址解析修改,适配13#_L1_HOIST中的第三位字符串类型

dev
WenJY 18 hours ago
parent 7da743e2bd
commit 8a28d7d421

@ -184,26 +184,21 @@ public class HoistDispatchHub
}
/// <summary>
/// 解析起始点内容
/// 14#_L2_02 => 14栋、2层、02货位
/// 解析接驳位编码
/// 13#_L1_HOIST => 13栋、1层、提升机接驳位
/// 14#_L2_03 => 14栋、2层、03货位
/// </summary>
/// <param name="taskCode"></param>
/// <param name="building"></param>
/// <param name="floor"></param>
/// <param name="location"></param>
/// <returns></returns>
private bool TryParsePointCode(string taskCode, out string building, out string floor, out string location)
private static bool TryParsePointCode(string pointCode, out string building, out string floor, out string location)
{
building = null;
floor = null;
location = null;
if (string.IsNullOrWhiteSpace(taskCode))
if (string.IsNullOrWhiteSpace(pointCode))
return false;
// 使用正则表达式匹配格式:数字+#+_+L+数字+_+数字(至少一位)
// 示例14#_L2_03
var match = System.Text.RegularExpressions.Regex.Match(taskCode, @"^(\d+)#_L(\d+)_(\d+)$");
// 格式: {楼栋}#_L{楼层}_{位置},位置可为数字或字母(如 HOIST)
var match = System.Text.RegularExpressions.Regex.Match(pointCode, @"^(\d+)#_L(\d+)_(.+)$");
if (!match.Success)
return false;

@ -62,6 +62,15 @@ namespace Sln.Wcs
handler.ServerCertificateCustomValidationCallback = (_, _, _, _) => true;
});
var service = serviceProvider.GetService<HoistDispatchHub>();
service.TaskDispatch(new BaseDeviceInfo()
{
deviceSerialNo = 1
}, new LiveTaskDetail()
{
startPoint = "13#_L1_HOIST",
endPoint = "13#_L4_HOIST",
});
// var service = serviceProvider.GetService<HikRoBotService>();
// var res = service.GbTaskSubmit(new GbTaskSubmitDto()
// {

Loading…
Cancel
Save