<update>[important]删除箱式线对方向码的支持
This commit is contained in:
parent
93d720f595
commit
8a61f237eb
|
|
@ -34,20 +34,8 @@ public class LoginGetData(WmsWebApiPost wmsWebApiPost) : IBaseGetData
|
|||
/// <param name="routerMethodData"></param>
|
||||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if(!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if(!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】注册口:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 发送 WMS 请求入库 */
|
||||
ApplyInRequest applyInRequest = new(area, code, msg);
|
||||
ApplyInRequest applyInRequest = new(area, msg, msg);
|
||||
var postResult = wmsWebApiPost.HttpPost<ApplyInRequest, WmsResponse>(applyInRequest, CommonData.AppApiBaseInfos.GetAddress("ApplyEnterApiAddress") ?? "");
|
||||
if(!postResult.IsSend || postResult.ResponseEntity == default)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,28 +49,8 @@ public class Pick1StandOutC3(ConveyOperation conveyOperation, DataBaseData dataB
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】一区出口:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.RightMove);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"一区出口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】一区出口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = code, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】一区出口:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
|
|
|
|||
|
|
@ -50,28 +50,8 @@ public class Pick2StandOutC4(ConveyOperation conveyOperation, DataBaseData dataB
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】二区出口:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.RightMove);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"二区出口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】二区出口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = code, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】二区出口:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
|
|
|
|||
|
|
@ -51,28 +51,8 @@ public class PickStandGetData(ConveyOperation conveyOperation, DataBaseData data
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】拣选站台:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Go);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"拣选站台:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】拣选站台:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 判断条码有没有这个拣选站台的拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = code, TaskStatus = (int)ConveyTaskStatusEnum.create, Location = area });
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create, Location = area });
|
||||
if (conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】拣选站台:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
|
|
|
|||
|
|
@ -49,28 +49,8 @@ public class PickStandP5(ConveyOperation conveyOperation, DataBaseData dataBaseD
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】拣选站台:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.RightMove);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"拣选站台:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】拣选站台:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = code, TaskStatus = (int)ConveyTaskStatusEnum.create});
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create});
|
||||
if (conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】拣选站台:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
|
|
|
|||
|
|
@ -47,28 +47,8 @@ public class StackerInErr(ConveyOperation conveyOperation, DataBaseData dataBase
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】入库异常口:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.WcsErr);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"入库异常口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】入库异常口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 查询任务 */
|
||||
List<AppWcsTask>? wcsTasks = wcsTaskDao.Select(new AppWcsTask { VehicleNo = code, TaskStatus = (int)WcsTaskStatusEnum.create });
|
||||
List<AppWcsTask>? wcsTasks = wcsTaskDao.Select(new AppWcsTask { VehicleNo = msg, TaskStatus = (int)WcsTaskStatusEnum.create });
|
||||
if (wcsTasks == default)
|
||||
{
|
||||
// 数据库服务器连接失败
|
||||
|
|
|
|||
|
|
@ -51,28 +51,8 @@ public class StackerInSpliter(ConveyOperation conveyOperation, DataBaseData data
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】入库分流:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.WcsErr);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"入库分流:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】入库分流:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 查询任务 */
|
||||
List<AppWcsTask>? wcsTasks = wcsTaskDao.Select(new AppWcsTask { VehicleNo = code, TaskStatus = (int)WcsTaskStatusEnum.create });
|
||||
List<AppWcsTask>? wcsTasks = wcsTaskDao.Select(new AppWcsTask { VehicleNo = msg, TaskStatus = (int)WcsTaskStatusEnum.create });
|
||||
if(wcsTasks == default)
|
||||
{
|
||||
// 数据库服务器连接失败
|
||||
|
|
|
|||
|
|
@ -49,28 +49,8 @@ public class StackerOutC1(ConveyOperation conveyOperation, DataBaseData dataBase
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】出库分流:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Move);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"出库分流:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】出库分流:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = code, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if(conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】出库分流:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
|
|
|
|||
|
|
@ -35,28 +35,8 @@ public class StackerOutErrC2(ConveyOperation conveyOperation, DataBaseData dataB
|
|||
public void ReadSuccess(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId; // 获取一个 plcId
|
||||
(string code, string direction) = msg.FormatDir();
|
||||
/* 判断方向是否正确 */
|
||||
string? routerDirection = routerMethodData.AllowDirection;
|
||||
if (!string.IsNullOrEmpty(routerDirection))
|
||||
{
|
||||
string[] dirs = routerDirection.Split(',');
|
||||
if (!dirs.Contains(direction))
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】出库异常口:{area} 箱码:{msg} 方向:{direction} 方向不正确,允许的方向为:{routerDirection}");
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Move);
|
||||
string errText = conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"出库异常口:{area} 箱码:{msg},写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】出库异常口:{area} 箱码:{msg},写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* 判断条码有没有拣选任务 */
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = code, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
List<AppConveyTask>? conveyTasks = conveyTaskDao.Query(new AppConveyTask { VehicleNo = msg, TaskStatus = (int)ConveyTaskStatusEnum.create });
|
||||
if (conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】出库异常口:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ public static partial class StringExtendMethod
|
|||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns></returns>
|
||||
[Obsolete("客户变更需求,不使用方向码", true)]
|
||||
public static (string code, string direction) FormatDir(this string? value)
|
||||
{
|
||||
if (string.IsNullOrEmpty(value)) return (string.Empty, string.Empty);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
"AllowedHosts": "*",
|
||||
"Settings": {
|
||||
"DBMysql": "server=192.168.103.200;port=3306;user=developer;password=developer;database=wcs_main;",
|
||||
"DBMysqlLocal": "server=192.168.234.128;port=3306;user=developer;password=developer;database=wcs_kate_suzhou;",
|
||||
"DBMysqlLocal": "server=192.168.234.134;port=3306;user=developer;password=developer;database=wcs_kate_suzhou;",
|
||||
|
||||
"DBMssql": "Data Source=192.168.142.131;Initial Catalog=wcs;User Id=sa;Password=Sa123;",
|
||||
"DBMssqlLocal": "Data Source=192.168.142.131;Initial Catalog=wcs_stacker;User Id=sa;Password=Sa123;",
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user