二楼流程优化 电梯bug修复
This commit is contained in:
@@ -953,26 +953,10 @@ namespace Tnb.WarehouseMgr
|
||||
}).Where(r => r.id == target.id).ExecuteCommandAsync();
|
||||
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV已到货 {disTask.endpoint_code} 更新缓存表{target.id}");
|
||||
|
||||
// 下升降机写满托数量和送到信号
|
||||
if (rackAreaPointsDown.Contains(disTask.endlocation_code))
|
||||
{
|
||||
int LXCount = _db.Queryable<WmsCarryD>().Where(a => a.carry_id == disTask.carry_id).Count();
|
||||
|
||||
bool result = await Floor2UpDownMachinecode_SetTag($"下升降机满托{target.stackingposition}数量", LXCount.ToString());
|
||||
Logger.LogInformation($@"【送满托到下升降区】设定下升降机满托{target.stackingposition}满托数量为 {LXCount} 结果为 {result}");
|
||||
if (!result)
|
||||
{
|
||||
throw new Exception($"下升降机满托{target.stackingposition}数量 写入失败");
|
||||
}
|
||||
|
||||
// 尝试写入满托送到信号
|
||||
bool result下升降机空托送到 = await Floor2UpDownMachinecode_SetTag($"下升降机满托{target.stackingposition}送到", "true");
|
||||
Logger.LogInformation($@"【送满托到下升降区】回写 下升降机满托{target.stackingposition}送到 结果为{result下升降机空托送到}");
|
||||
if (!result下升降机空托送到)
|
||||
{
|
||||
throw new Exception($"下升降机满托{target.stackingposition}送到 写入失败");
|
||||
}
|
||||
|
||||
// 绑定料架
|
||||
await _db.Updateable<WmsMechanicalArmH>().SetColumns(r => new WmsMechanicalArmH
|
||||
{
|
||||
@@ -1014,7 +998,7 @@ namespace Tnb.WarehouseMgr
|
||||
if (rackAreaPointsUp.Contains(disTask.endlocation_code) || rackAreaPointsDown.Contains(disTask.endlocation_code))
|
||||
{
|
||||
|
||||
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV在暂存仓取货完成");
|
||||
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV在暂存仓取货确认完成");
|
||||
}
|
||||
else // 去料架区取货
|
||||
{
|
||||
@@ -1042,7 +1026,9 @@ namespace Tnb.WarehouseMgr
|
||||
.Select((a, b) => b).FirstAsync();
|
||||
if (wmsMaterialTransferD == null)
|
||||
{
|
||||
throw new Exception($@"【上升降机】 发生异常!,转库单{target.outbill}没有载具明细");
|
||||
Logger.LogWarning($@"【上升降机】 发生异常!,转库单{target.outbill}没有载具明细");
|
||||
// 转库单删除 不执行后续,不返回失败是为了不卡流程
|
||||
return;
|
||||
}
|
||||
|
||||
string targetWorkstation = wmsMaterialTransferD.station_code;
|
||||
@@ -1094,6 +1080,95 @@ namespace Tnb.WarehouseMgr
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 二楼机械臂
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task Floor2MechanicalComplete(WmsDistaskH disTask, string action)
|
||||
{
|
||||
List<string> rackAreaPointsUp = new List<string>();
|
||||
List<string> rackAreaPointsDown = new List<string>();
|
||||
// 二楼上升降区料架区点位
|
||||
rackAreaPointsUp.Add("AS01");
|
||||
rackAreaPointsUp.Add("AS02");
|
||||
// 二楼下升降区料架区点位
|
||||
rackAreaPointsDown.Add("AX01");
|
||||
rackAreaPointsDown.Add("AX02");
|
||||
|
||||
try
|
||||
{
|
||||
List<BasLocation> basLocations = _db.Queryable<BasLocation>().Where(r => (r.location_code == disTask.endlocation_code || r.location_code == disTask.startlocation_code)
|
||||
&& r.wh_id != "33780009364245").ToList();
|
||||
|
||||
// 暂存仓内任务
|
||||
if (disTask.area_code == "E" && basLocations.Count() == 0)
|
||||
{
|
||||
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】收到到货完成信号 传入参数: {disTask.bill_code} {action}");
|
||||
|
||||
if (action == "UNLOAD")
|
||||
{
|
||||
// 去料架区放货
|
||||
if (rackAreaPointsUp.Contains(disTask.endlocation_code) || rackAreaPointsDown.Contains(disTask.endlocation_code))
|
||||
{
|
||||
ISugarQueryable<WmsMechanicalArmH> WmsMechanicalArmHs = _db.Queryable<WmsMechanicalArmH>().Where(r => r.location_code == disTask.endlocation_code);
|
||||
if (WmsMechanicalArmHs.Count() == 0)
|
||||
{
|
||||
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】 任务执行终点{disTask.endpoint_code} 与料架区的点位不匹配");
|
||||
throw new Exception($"【二楼机械臂Floor2MechanicalComplete】 任务执行终点{disTask.endpoint_code} 与料架区的点位不匹配");
|
||||
}
|
||||
WmsMechanicalArmH target = WmsMechanicalArmHs.First();
|
||||
|
||||
// 下升降机写满托数量和送到信号
|
||||
if (rackAreaPointsDown.Contains(disTask.endlocation_code))
|
||||
{
|
||||
int LXCount = _db.Queryable<WmsCarryD>().Where(a => a.carry_id == disTask.carry_id).Count();
|
||||
|
||||
bool result = await Floor2UpDownMachinecode_SetTag($"下升降机满托{target.stackingposition}数量", LXCount.ToString());
|
||||
Logger.LogInformation($@"【送满托到下升降区】设定下升降机满托{target.stackingposition}满托数量为 {LXCount} 结果为 {result}");
|
||||
if (!result)
|
||||
{
|
||||
throw new Exception($"下升降机满托{target.stackingposition}数量 写入失败");
|
||||
}
|
||||
|
||||
// 尝试写入满托送到信号
|
||||
bool result下升降机空托送到 = await Floor2UpDownMachinecode_SetTag($"下升降机满托{target.stackingposition}送到", "true");
|
||||
Logger.LogInformation($@"【送满托到下升降区】回写 下升降机满托{target.stackingposition}送到 结果为{result下升降机空托送到}");
|
||||
if (!result下升降机空托送到)
|
||||
{
|
||||
throw new Exception($"下升降机满托{target.stackingposition}送到 写入失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
else // 去暂存仓放货
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 去暂存仓取货
|
||||
if (rackAreaPointsUp.Contains(disTask.endlocation_code) || rackAreaPointsDown.Contains(disTask.endlocation_code))
|
||||
{
|
||||
Logger.Information($"【二楼机械臂Floor2MechanicalComplete】{disTask.bill_code} AGV在暂存仓取货完成");
|
||||
}
|
||||
else // 去料架区取货
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError("【Floor2MechanicalComplete】" + ex.ToString());
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private async Task<bool> Floor2UpDownMachinecode_SetTag(string tag, string value)
|
||||
{
|
||||
string DevName = "东面提升机输送线";
|
||||
@@ -1420,7 +1495,7 @@ namespace Tnb.WarehouseMgr
|
||||
/// </param>
|
||||
/// <returns></returns>
|
||||
|
||||
protected async Task<WmsElevatorH> FindElevatorFromPars(ElevagorInfoQuery input)
|
||||
public async Task<WmsElevatorH> FindElevatorFromPars(ElevagorInfoQuery input)
|
||||
{
|
||||
var whereExpable = Expressionable.Create<WmsElevatorH, WmsElevatorD, WmsDistaskH>()
|
||||
.And((a, b, c) => a.enabled == 1);
|
||||
@@ -1459,6 +1534,8 @@ namespace Tnb.WarehouseMgr
|
||||
return ele;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region CTU
|
||||
/// <summary>
|
||||
/// 生成CTU任务执行
|
||||
@@ -1884,7 +1961,7 @@ namespace Tnb.WarehouseMgr
|
||||
/// </summary>
|
||||
/// <param name="disTask"></param>
|
||||
/// <returns></returns>
|
||||
private async Task ExecuteTargetFloorTask(WmsDistaskH disTask)
|
||||
public async Task ExecuteTargetFloorTask(WmsDistaskH disTask)
|
||||
{
|
||||
//收到放货确认通知,向电梯发送到3楼的指令
|
||||
Logger.Information($"开始执行电梯任务,任务ID:{disTask.id}");
|
||||
|
||||
Reference in New Issue
Block a user