Commit 4e882e84 张东亮

连续出工单问题优化

1 个父辈 29cf234f
......@@ -807,6 +807,61 @@ namespace OnlineStore.DeviceLibrary
dtUpperB = DateTime.Now;
}
}
/// <summary>
/// 获取指定面的出库任务
/// </summary>
/// <param name="sideA"></param>
/// <param name="param"></param>
/// <returns></returns>
bool GetOutInOutParam(bool sideA,out InOutParam param)
{
param = null;
try
{
if (sideA)//A面
{
var pos = waitAOutStoreList.First();
if(!string.IsNullOrEmpty(CurHSerial))
{
if(CurHSerial.Equals(pos.PosInfo.hSerial))
{
return waitAOutStoreList.TryDequeue(out param);
}
else
{
if(CheckBOutDoor())
{
return waitAOutStoreList.TryDequeue(out param);
}
}
}
}
else
{
var pos = waitBOutStoreList.First();
if (!string.IsNullOrEmpty(CurHSerial))
{
if (CurHSerial.Equals(pos.PosInfo.hSerial))
{
return waitBOutStoreList.TryDequeue(out param);
}
else
{
if (CheckAOutDoor())
{
return waitBOutStoreList.TryDequeue(out param);
}
}
}
}
}catch(Exception ex)
{
LogUtil.error($"GetOutInOutParam error [{sideA}]",ex);
}
return false;
}
private void ExecuteOutListProcess()
{
try
......@@ -831,7 +886,7 @@ namespace OnlineStore.DeviceLibrary
else if (CheckAOutDoor())
{
InOutParam param = null;
bool result = waitAOutStoreList.TryDequeue(out param);
bool result = GetOutInOutParam(true,out param);
if (result && param != null)
{
LogInfo("执行A面排队的出库【" + param.PosInfo.ToStr() + "】");
......@@ -856,7 +911,7 @@ namespace OnlineStore.DeviceLibrary
else if (CheckBOutDoor())
{
InOutParam param = null;
bool result = waitBOutStoreList.TryDequeue(out param);
bool result = GetOutInOutParam(false,out param);
if (result && param != null)
{
LogInfo("执行B面排队的出库【" + param.PosInfo.ToStr() + "】");
......@@ -963,7 +1018,7 @@ namespace OnlineStore.DeviceLibrary
msg += "runStatus: " + runStatus + "\n";
msg += "runStep: " + MoveInfo.MoveStep + "\n";
msg += "alarm: " + alarmType + "\n";
msg += "hSerial: " + CurHSerial + "\n";
return msg;
......
......@@ -15,6 +15,11 @@ namespace OnlineStore.DeviceLibrary
{
partial class BoxEquip
{
/// <summary>
/// 当前需求单号
/// </summary>
public string CurHSerial = "";
/// <summary>
/// 料盘放到出料口成功,并将料盘信息写入该口
/// </summary>
......@@ -184,7 +189,7 @@ namespace OnlineStore.DeviceLibrary
{
if (waitBOutStoreList.Count > 0 && CheckBOutDoor())
{
if (waitBOutStoreList.TryDequeue(out InOutParam inOutParam))//B面料叉空且B面出料口无料,有出库任务
if (GetOutInOutParam(false,out InOutParam inOutParam))//B面料叉空且B面出料口无料,有出库任务
{
MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready);
LogInfo($"存储机构-出库 {MoveInfo.SLog}:A面切换到B面,B面取料[{inOutParam.PosInfo.barcode}]");
......@@ -201,7 +206,7 @@ namespace OnlineStore.DeviceLibrary
{
if (waitAOutStoreList.Count > 0 && CheckAOutDoor())
{
if (waitAOutStoreList.TryDequeue(out InOutParam inOutParam))
if (GetOutInOutParam(true,out InOutParam inOutParam))
{
MoveInfo.NextMoveStep(StepEnum.SO_01_PullAxis_Ready);
LogInfo($"存储机构-出库 {MoveInfo.SLog}:B面切换到A面,A面取料[{inOutParam.PosInfo.barcode}]");
......
......@@ -1172,6 +1172,7 @@ namespace OnlineStore.DeviceLibrary
param.MoveP = new LineMoveP(Config, param.PosInfo.PosId);
SetBoxStatus(DeviceStatus.OutStoreExecute, RunStatus.Busy, param.PosInfo.PosId, param.PosInfo.barcode);
MoveInfo.NewMove(MoveType.OutStore, param);
CurHSerial = param.PosInfo.hSerial;
LogInfo("启动出库【" + param.PosInfo.ToStr() + "】 ");
///开始记录
StartRecord();
......
......@@ -524,7 +524,7 @@ namespace OnlineStore.DeviceLibrary
}
}
internal bool ShelfReadyOut(InOutPosInfo posInfo = null, bool SendShelfOut = false)
internal bool ReelReadyOut(InOutPosInfo posInfo = null, bool SendShelfOut = false)
{
if (MoveInfo.MoveType.Equals(MoveType.OutStore) && MoveInfo.IsStep(StepEnum.IS11_ShelfReady))
{
......
......@@ -9,6 +9,7 @@ using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
namespace OnlineStore.DeviceLibrary
{
......@@ -403,14 +404,17 @@ namespace OnlineStore.DeviceLibrary
}
else
{
//如果有物料且不能放料,需要送一个料串离开
if (BufferDataManager.AOutStoreInfo != null)
{
CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, IO_Type.UnderArea_Check_A, BatchMoveList, true);
}
else if (BufferDataManager.BOutStoreInfo != null)
//如果两侧都有物料且不能放料,需要送一个料串离开
if (BufferDataManager.AOutStoreInfo != null && BufferDataManager.BOutStoreInfo != null)
{
CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, IO_Type.UnderArea_Check_B, BatchMoveList, true);
if(!CheckStartOutPos("A下暂存区", BufferDataManager.AOutStoreInfo, IO_Type.UnderArea_Check_A, BatchMoveList, true))
{
if(!CheckStartOutPos("B下暂存区", BufferDataManager.BOutStoreInfo, IO_Type.UnderArea_Check_B, BatchMoveList, true))
{
LogUtil.error(Name + "A下和B下均有料,但没有合适处理");
}
}
}
}
......@@ -452,7 +456,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"当前{moveBean.Name}料串的 hSerial:{curhSerial},与{posType}料盘{posInfo.barcode}的工单hSerial:{posInfo.hSerial}不符 [{shelfAutoLeave}]");
moveBean.ShelfNeedLeave = true;
}
else if (moveBean.ShelfReadyOut(posInfo, shelfAutoLeave))
else if (moveBean.ReelReadyOut(posInfo, shelfAutoLeave))
{
InOutParam param = new InOutParam(posInfo.ToCopy());
param.ShelfType = moveBean.ShelfType;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!