<add>[important]添加出库分流逻辑
This commit is contained in:
parent
aed0a69c8c
commit
e12ca2f02b
|
|
@ -31,7 +31,7 @@ public class StackerInErr(ConveyOperation conveyOperation, DataBaseData dataBase
|
|||
public void ReadFail(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = _dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId;
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.NoRead);
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Go);
|
||||
string errText = _conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,144 @@
|
|||
using WcsMain.Business.Convey.HistoryDataHandler.HisGetData.I;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.Dao;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.DataService;
|
||||
using WcsMain.Enum.Convey;
|
||||
using WcsMain.EquipOperation.Convey;
|
||||
using WcsMain.EquipOperation.Entity;
|
||||
using WcsMain.ExtendMethod;
|
||||
|
||||
namespace WcsMain.Business.Convey.HistoryDataHandler.HisGetData;
|
||||
|
||||
/// <summary>
|
||||
/// 出库分流扫码器 C1
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 有异常的或者只有 6789站台拣选的去往二层
|
||||
/// </remarks>
|
||||
public class StackerOutC1(ConveyOperation conveyOperation, DataBaseData dataBaseData, AppConveyTaskDao conveyTaskDao) : IBaseGetData
|
||||
{
|
||||
private readonly ConveyOperation _conveyOperation = conveyOperation;
|
||||
private readonly DataBaseData _dataBaseData = dataBaseData;
|
||||
private readonly AppConveyTaskDao _conveyTaskDao = conveyTaskDao;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 读码失败
|
||||
/// </summary>
|
||||
/// <param name="disPlayName"></param>
|
||||
/// <param name="msg"></param>
|
||||
/// <param name="area"></param>
|
||||
/// <param name="routerMethodData"></param>
|
||||
public void ReadFail(string? disPlayName, string msg, string? area, AppRouterMethod routerMethodData)
|
||||
{
|
||||
int plcId = _dataBaseData.GetNewPlcTaskId() ?? StaticData.StaticInt.ErrPlcId;
|
||||
ConveyPLCTask plcTask = new(plcId, (short)ConveyRouterEnum.Move);
|
||||
string errText = _conveyOperation.WriteTask(area, plcTask);
|
||||
if (string.IsNullOrEmpty(errText))
|
||||
{
|
||||
ConsoleLog.Success($"出库分流:{area} 读码失败,写入PLC成功,{plcTask}");
|
||||
return;
|
||||
}
|
||||
ConsoleLog.Warning($"【警告】出库分流:{area} 读码失败,写入PLC失败,{plcTask},信息:{errText}");
|
||||
return;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 读码成功
|
||||
/// </summary>
|
||||
/// <param name="disPlayName"></param>
|
||||
/// <param name="msg"></param>
|
||||
/// <param name="area"></param>
|
||||
/// <param name="routerMethodData"></param>
|
||||
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 });
|
||||
if(conveyTasks == default)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】出库分流:{area} 箱码:{msg} 查询任务失败,和服务器连接中断");
|
||||
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;
|
||||
}
|
||||
if(conveyTasks.Count < 1)
|
||||
{
|
||||
ConsoleLog.Warning($"【警告】出库分流:{area} 箱码:{msg} 无拣选任务");
|
||||
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;
|
||||
}
|
||||
/* 检查是不是有 1~5 站台(pick1 区域)的拣选任务,若有则不移栽,走下层 */
|
||||
List<AppConveyStand> pick1Stand = CommonData.AppConveyStands.FindAll(f => f.StandType == (int)ConveyStandTypeEnum.pick && f.Area == "pick1");
|
||||
List<string?> pick1Stands = pick1Stand.Select(f => f.StandId).ToList();
|
||||
bool exists = false; // 默认不存在 1~5 站台(pick1 区域) 任务
|
||||
foreach (var conveyTask in conveyTasks)
|
||||
{
|
||||
if (pick1Stands.Contains(conveyTask.Location))
|
||||
{
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(exists) // 存在该区域任务 1~5 站台(pick1 区域)
|
||||
{
|
||||
ConsoleLog.Info($"出库分流:{area} 箱码:{msg} 存在 1~5 站台任务");
|
||||
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;
|
||||
}
|
||||
else // 6~9 站台(pick2 区域)
|
||||
{
|
||||
ConsoleLog.Info($"出库分流:{area} 箱码:{msg} 不存在 1~5 站台任务");
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -41,6 +41,12 @@ public static class CommonData
|
|||
[NotNull]
|
||||
public static List<AppElTagBase>? AppElTags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 输送线的站台
|
||||
/// </summary>
|
||||
[NotNull]
|
||||
public static List<AppConveyStand>? AppConveyStands { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 指示是否连接PLC
|
||||
|
|
|
|||
46
WcsMain/DataBase/Dao/AppConveyStandDao.cs
Normal file
46
WcsMain/DataBase/Dao/AppConveyStandDao.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||
|
||||
namespace WcsMain.DataBase.Dao;
|
||||
|
||||
|
||||
[Component]
|
||||
public class AppConveyStandDao
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="conveyStand"></param>
|
||||
/// <returns></returns>
|
||||
public List<AppConveyStand>? Query(AppConveyStand conveyStand)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sqlFuc = CommonTool.DbServe.Queryable<AppConveyStand>()
|
||||
.WhereIF(conveyStand.StandId != default, w => w.StandId == conveyStand.StandId)
|
||||
.WhereIF(conveyStand.StandType != default, w => w.StandType == conveyStand.StandType)
|
||||
.WhereIF(conveyStand.StandStatus != default, w => w.StandStatus == conveyStand.StandStatus)
|
||||
.WhereIF(conveyStand.Area != default, w => w.Area == conveyStand.Area)
|
||||
.WhereIF(conveyStand.VehicleNo != default, w => w.VehicleNo == conveyStand.VehicleNo)
|
||||
.WhereIF(conveyStand.Tag != default, w => w.Tag == conveyStand.Tag)
|
||||
.WhereIF(conveyStand.Remark != default, w => w.Remark == conveyStand.Remark);
|
||||
return sqlFuc.ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_ = ex;
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AppConveyStand>? Query() => Query(new AppConveyStand());
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using WcsMain.Common;
|
||||
using System.Threading.Tasks;
|
||||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||
|
||||
|
|
@ -34,6 +35,41 @@ public class AppConveyTaskDao
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 条件查询
|
||||
/// </summary>
|
||||
/// <param name="conveyTask"></param>
|
||||
/// <returns></returns>
|
||||
public List<AppConveyTask>? Query(AppConveyTask conveyTask)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sqlFuc = CommonTool.DbServe.Queryable<AppConveyTask>()
|
||||
.WhereIF(conveyTask.TaskId != default, w => w.TaskId == conveyTask.TaskId)
|
||||
.WhereIF(conveyTask.TaskGroup != default, w => w.TaskGroup == conveyTask.TaskGroup)
|
||||
.WhereIF(conveyTask.VehicleNo != default, w => w.VehicleNo == conveyTask.VehicleNo)
|
||||
.WhereIF(conveyTask.TaskType != default, w => w.TaskType == conveyTask.TaskType)
|
||||
.WhereIF(conveyTask.TaskStatus != default, w => w.TaskStatus == conveyTask.TaskStatus)
|
||||
.WhereIF(conveyTask.Location != default, w => w.Location == conveyTask.Location)
|
||||
.WhereIF(conveyTask.ArriveLocation != default, w => w.ArriveLocation == conveyTask.ArriveLocation)
|
||||
.WhereIF(conveyTask.CreatePerson != default, w => w.CreatePerson == conveyTask.CreatePerson)
|
||||
.WhereIF(conveyTask.Remark != default, w => w.Remark == conveyTask.Remark);
|
||||
return sqlFuc.ToList();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
_ = ex;
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<AppConveyTask>? Query() => Query(new AppConveyTask());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -69,6 +105,54 @@ public class AppConveyTaskDao
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 联表查询任务,带出站台号,区域
|
||||
/// </summary>
|
||||
/// <param name="conveyTask"></param>
|
||||
/// <returns></returns>
|
||||
public List<JoinAppConveyTaskAndAppConveyStand>? QueryWithStandInfo(AppConveyTask conveyTask)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sqlFuc = CommonTool.DbServe.Queryable<AppConveyTask>()
|
||||
.WhereIF(conveyTask.TaskId != default, w => w.TaskId == conveyTask.TaskId)
|
||||
.WhereIF(conveyTask.TaskGroup != default, w => w.TaskGroup == conveyTask.TaskGroup)
|
||||
.WhereIF(conveyTask.VehicleNo != default, w => w.VehicleNo == conveyTask.VehicleNo)
|
||||
.WhereIF(conveyTask.TaskType != default, w => w.TaskType == conveyTask.TaskType)
|
||||
.WhereIF(conveyTask.TaskStatus != default, w => w.TaskStatus == conveyTask.TaskStatus)
|
||||
.WhereIF(conveyTask.Location != default, w => w.Location == conveyTask.Location)
|
||||
.WhereIF(conveyTask.ArriveLocation != default, w => w.ArriveLocation == conveyTask.ArriveLocation)
|
||||
.WhereIF(conveyTask.CreatePerson != default, w => w.CreatePerson == conveyTask.CreatePerson)
|
||||
.WhereIF(conveyTask.Remark != default, w => w.Remark == conveyTask.Remark)
|
||||
.LeftJoin<AppConveyStand>((ct, cs) => ct.Location == cs.StandId)
|
||||
.OrderBy(ct => ct.CreateTime)
|
||||
.Select((ct, cs) => new JoinAppConveyTaskAndAppConveyStand
|
||||
{
|
||||
TaskId = ct.TaskId,
|
||||
TaskGroup = ct.TaskGroup,
|
||||
VehicleNo = ct.VehicleNo,
|
||||
TaskType = ct.TaskType,
|
||||
TaskStatus = ct.TaskStatus,
|
||||
Location = ct.Location,
|
||||
ArriveLocation = ct.ArriveLocation,
|
||||
CreatePerson = ct.CreatePerson,
|
||||
CreateTime = ct.CreateTime,
|
||||
MoveTime = ct.MoveTime,
|
||||
CompleteTime = ct.CompleteTime,
|
||||
Remark = ct.Remark,
|
||||
StandId = cs.StandId,
|
||||
StandType = cs.StandType,
|
||||
});
|
||||
return sqlFuc.ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_ = ex;
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
using WcsMain.Common;
|
||||
using WcsMain.DataBase.TableEntity;
|
||||
using WcsMain.WcsAttribute.AutoFacAttribute;
|
||||
|
||||
namespace WcsMain.DataBase.Dao;
|
||||
|
||||
/// <summary>
|
||||
/// tbl_bs_pick_stand 的操作类
|
||||
/// </summary>
|
||||
[Component]
|
||||
public class BsPickStandDao
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 查询所有数据
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<BsPickStand>? Query() => Query(new BsPickStand());
|
||||
|
||||
/// <summary>
|
||||
/// 根据条件查询数据
|
||||
/// </summary>
|
||||
/// <param name="queryEntity"></param>
|
||||
/// <returns></returns>
|
||||
public List<BsPickStand>? Query(BsPickStand queryEntity)
|
||||
{
|
||||
try
|
||||
{
|
||||
var sqlFUc = CommonTool.DbServe.Queryable<BsPickStand>()
|
||||
.WhereIF(!string.IsNullOrEmpty(queryEntity.PickStand), w => w.PickStand == queryEntity.PickStand)
|
||||
.WhereIF(queryEntity.StandType != default, w => w.StandType == queryEntity.StandType)
|
||||
.WhereIF(queryEntity.StandStatus != default, w => w.StandStatus == queryEntity.StandStatus)
|
||||
.OrderBy(o => o.PickStand);
|
||||
return sqlFUc.ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_ = ex;
|
||||
return default;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
56
WcsMain/DataBase/TableEntity/AppConveyStand.cs
Normal file
56
WcsMain/DataBase/TableEntity/AppConveyStand.cs
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
using SqlSugar;
|
||||
|
||||
namespace WcsMain.DataBase.TableEntity;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 输送线 站台 表
|
||||
/// </summary>
|
||||
[SugarTable("tbl_app_convey_stand")]
|
||||
public class AppConveyStand
|
||||
{
|
||||
/// <summary>
|
||||
/// 站台号
|
||||
/// </summary>
|
||||
[SugarColumn(IsPrimaryKey = true, ColumnName = "stand_id")]
|
||||
public string? StandId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 站台类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stand_type")]
|
||||
public int? StandType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 站台状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stand_status")]
|
||||
public int? StandStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 区域
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "area")]
|
||||
public string? Area { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 载具号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "vehicle_no")]
|
||||
public string? VehicleNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 标记
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "tag")]
|
||||
public string? Tag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
public string? Remark { get;set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
using SqlSugar;
|
||||
|
||||
namespace WcsMain.DataBase.TableEntity;
|
||||
|
||||
/// <summary>
|
||||
/// 拣选站台信息
|
||||
/// </summary>
|
||||
[SugarTable("tbl_bs_pick_stand")]
|
||||
public class BsPickStand
|
||||
{
|
||||
/// <summary>
|
||||
/// 拣选站台名称
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "pick_stand")]
|
||||
public string? PickStand { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 拣选站台类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stand_type")]
|
||||
public int? StandType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 站台状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stand_status")]
|
||||
public int? StandStatus { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
using SqlSugar;
|
||||
|
||||
namespace WcsMain.DataBase.TableEntity;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 联表查询
|
||||
/// </summary>
|
||||
public class JoinAppConveyTaskAndAppConveyStand
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 任务号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "task_id")]
|
||||
public string? TaskId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务组
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "task_group")]
|
||||
public string? TaskGroup { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 载具号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "vehicle_no")]
|
||||
public string? VehicleNo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "task_type")]
|
||||
public int? TaskType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 任务状态
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "task_status")]
|
||||
public int? TaskStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 点位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "location")]
|
||||
public string? Location { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 实际到达的点位
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "arrive_location")]
|
||||
public string? ArriveLocation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建人
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "create_person")]
|
||||
public string? CreatePerson { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "create_time")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 移栽时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "move_time")]
|
||||
public DateTime? MoveTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 完成时间
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "complete_time")]
|
||||
public DateTime? CompleteTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注信息
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 站台号
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stand_id")]
|
||||
public string? StandId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 站台类型
|
||||
/// </summary>
|
||||
[SugarColumn(ColumnName = "stand_type")]
|
||||
public int? StandType { get; set; }
|
||||
}
|
||||
16
WcsMain/Enum/Convey/ConveyStandTypeEnum.cs
Normal file
16
WcsMain/Enum/Convey/ConveyStandTypeEnum.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using WcsMain.Business.Convey.DataHandler.GetRouter;
|
||||
|
||||
namespace WcsMain.Enum.Convey;
|
||||
|
||||
/// <summary>
|
||||
/// 箱式线站台类型
|
||||
/// </summary>
|
||||
public enum ConveyStandTypeEnum
|
||||
{
|
||||
pick = 1, // 拣选
|
||||
send = 2, // 发货
|
||||
receive = 3, // 收货
|
||||
check = 4, // 复核
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@ namespace WcsMain.StartAction;
|
|||
[Component]
|
||||
public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs, SocketOperation socketOperation,
|
||||
AppStackerDao appStackerDao, AppLocationDao appLocationDao, AppConfigDao appConfigDao, ConnectPlcServe connectPlcServe,
|
||||
ConnectOprServe connectOprServe, AppElTagBaseDao appElTagBaseDao)
|
||||
ConnectOprServe connectOprServe, AppElTagBaseDao appElTagBaseDao, AppConveyStandDao conveyStandDao)
|
||||
{
|
||||
private readonly AppConfigDao _appconfigDao = appConfigDao;
|
||||
private readonly AppLocationDao _applocationDao = appLocationDao;
|
||||
|
|
@ -30,6 +30,7 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
private readonly ConnectPlcServe _connectPlcServe = connectPlcServe;
|
||||
private readonly ConnectOprServe _connectOprServe = connectOprServe;
|
||||
private readonly AppElTagBaseDao _appElTagBaseDao = appElTagBaseDao;
|
||||
private readonly AppConveyStandDao _conveyStandDao = conveyStandDao;
|
||||
|
||||
private static string _errMsg = string.Empty;
|
||||
|
||||
|
|
@ -42,6 +43,7 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
LoadingStackerData(); // 加载数据库中的堆垛机信息
|
||||
LoadingLocationData(); // 加载数据库中的库位信息
|
||||
LoadElTagBase(); // 加载电子标签基础资料
|
||||
LoadConveyStand(); // 加载输送线站台基础资料
|
||||
|
||||
if (!string.IsNullOrEmpty(_errMsg))
|
||||
{
|
||||
|
|
@ -133,7 +135,7 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
public void LoadingConfig()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_errMsg)) return;
|
||||
ConsoleLog.Info("正在加载数据库配置信息...");
|
||||
//ConsoleLog.Info("正在加载数据库配置信息...");
|
||||
List<AppConfig>? Configs = _appconfigDao.Query();
|
||||
if (Configs == default)
|
||||
{
|
||||
|
|
@ -168,7 +170,7 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
public void LoadingStackerData()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_errMsg)) return;
|
||||
ConsoleLog.Info("正在加载堆垛机参数信息...");
|
||||
//ConsoleLog.Info("正在加载堆垛机参数信息...");
|
||||
List<AppStacker>? appStackers = _appStackerDao.Select();
|
||||
if (appStackers == default)
|
||||
{
|
||||
|
|
@ -186,7 +188,7 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
public void LoadingLocationData()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_errMsg)) return;
|
||||
ConsoleLog.Info("正在加载库位信息...");
|
||||
//ConsoleLog.Info("正在加载库位信息...");
|
||||
List<AppLocation>? appLocations = _applocationDao.Select();
|
||||
if (appLocations == default)
|
||||
{
|
||||
|
|
@ -203,7 +205,7 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
public void LoadElTagBase()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_errMsg)) return;
|
||||
ConsoleLog.Info("正在加载库位信息...");
|
||||
//ConsoleLog.Info("正在电子标签基础资料信息...");
|
||||
List<AppElTagBase>? eltags = _appElTagBaseDao.Query();
|
||||
if (eltags == default)
|
||||
{
|
||||
|
|
@ -213,4 +215,22 @@ public class ServiceStart(WcsCirculation wcsCirculation, ConnectPLCs connectPLCs
|
|||
}
|
||||
CommonData.AppElTags = eltags;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载输送线站台基础资料信息
|
||||
/// </summary>
|
||||
public void LoadConveyStand()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(_errMsg)) return;
|
||||
//ConsoleLog.Info("正在加载输送线基础资料信息...");
|
||||
List<AppConveyStand>? appConveyStands = _conveyStandDao.Query();
|
||||
if (appConveyStands == default)
|
||||
{
|
||||
_errMsg = "加载输送线站台基础资料信息失败,请检查数据库服务器连接是否正常";
|
||||
CommonData.AppConveyStands = [];
|
||||
return;
|
||||
}
|
||||
CommonData.AppConveyStands = appConveyStands;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user