Commit 9e9d9777 张东亮

出库完成通知失败重新通知

1 个父辈 4832bd2b
......@@ -165,7 +165,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("RFID [ " + Config.CameraName_1_RFID + " ] 读到数据 " + data.NumStr());
//获取托盘信息
TrayInfo tray = TrayManager.GetTrayInfo(trayNum);
if (tray.InoutPar.ManualJudgeNG||tray.InoutPar.Corrected)
if (tray.InoutPar.ManualJudgeNG || tray.InoutPar.Corrected)
{
//扫码
(bool result, string barcode) = CodeManager.ReelCheckCameraScan(new List<string> { Config.CameraName_1 }, Name);
......@@ -179,12 +179,12 @@ namespace OnlineStore.DeviceLibrary
{
(int resCode, taskInfo task) = SServerManager.getTaskInfo(barcode);
if(resCode==-1)
if (resCode == -1)
{
TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】",DeviceID);
TrayDisableManager.AddDisableTray(trayNum, Name, "【屏蔽料盘二次判断】【-1】", DeviceID);
LogUtil.info($"【屏蔽料盘二次判断】【-1】【需要禁用该托盘】【{tray.ToStr()}】");
}
else if (resCode==100)
else if (resCode == 100)
{
tray.InoutPar.InStoreNg = true;
tray.InoutPar.PlateH = task.plateH;
......@@ -242,7 +242,7 @@ namespace OnlineStore.DeviceLibrary
(int resCode, taskInfo task) = SServerManager.getTaskInfo(barcode);
if (resCode == -1)
{
TrayDisableManager.AddDisableTray(trayNum,Name, "【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】",DeviceID);
TrayDisableManager.AddDisableTray(trayNum, Name, "【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】", DeviceID);
LogUtil.info($"【屏蔽料盘二次判断】【-1】【初次无料,第二次有料】 【禁用该托盘】【{tray.ToStr()}】");
}
else if (resCode == 100)
......@@ -567,7 +567,7 @@ namespace OnlineStore.DeviceLibrary
bool corr = tray.InoutPar?.Corrected ?? false;
if (jNg && (!corr))
{
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘【" + currTrayNum + "】被为标记判定NG,放盘通过,["+jNg+"]["+corr+"]");
LogInfo(SecondMoveInfo.MoveNum + "*************** 托盘【" + currTrayNum + "】被为标记判定NG,放盘通过,[" + jNg + "][" + corr + "]");
MO_14_TopDown();
}
else if (param != null)
......@@ -689,7 +689,8 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_15_WaitCanGo))
{
if (DeviceID.Equals(203)){
if (DeviceID.Equals(203))
{
MoveEquip moveEquip = LineManager.Line.GetMoveByDId(17);
if (moveEquip.IOValue(IO_Type.StopCylinder_Check1).Equals(IO_VALUE.LOW))
......@@ -744,7 +745,8 @@ namespace OnlineStore.DeviceLibrary
private void MO_16_Stop2Down()
{
if (DeviceID.Equals(203)) {
if (DeviceID.Equals(203))
{
MoveEquip move17 = LineManager.Line.GetMoveByDId(17);
if (move17.IOValue(IO_Type.StopCylinder_Check1).Equals(IO_VALUE.HIGH))
......@@ -926,10 +928,6 @@ namespace OnlineStore.DeviceLibrary
{
if (LineIsReady())
{
MoveInfo.NextMoveStep(LineMoveStep.PO_09_CylinderRelax);
OutLog("出料:" + MoveInfo.SLog + ",夹料气缸放松)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
if (MoveInfo.MoveParam.urgentReel && this.Config.SidesWayNum.Equals(4))
{
afterPutCutOK = false;
......@@ -937,16 +935,24 @@ namespace OnlineStore.DeviceLibrary
TaskData taskData;
string shefId = "BN";
int ShelfLoc = 1;
string msg = SServerManager.afterPutCut(Name, shefId, MoveInfo.MoveParam.WareCode, "", ShelfLoc, out taskData);
afterPutCutOK = SServerManager.afterPutCut(Name, shefId, MoveInfo.MoveParam.WareCode, "", ShelfLoc, out taskData, out string msg);
if (String.IsNullOrEmpty(msg).Equals(false))
{
LogUtil.error(Name + "【" + MoveInfo.MoveParam.WareCode + "】【" + shefId + "】【" + ShelfLoc.ToString() + "】afterPutCut 结果:" + msg);
taskData = null;
}
if (!afterPutCutOK)
return;
MoveInfo.NextMoveStep(LineMoveStep.PO_09_CylinderRelax);
OutLog("出料:" + MoveInfo.SLog + ",夹料气缸放松)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
afterPutCutOK = true;
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.PO_09_CylinderRelax);
OutLog("出料:" + MoveInfo.SLog + ",夹料气缸放松)");
CylinderMove(MoveInfo, IO_Type.ClampCylinder_Slack, IO_Type.ClampCylinder_Tighten);
afterPutCutOK = true;
}
}
......
......@@ -382,7 +382,63 @@ namespace OnlineStore.DeviceLibrary
return msg;
}
public static bool afterPutCut(string deviceName, string rfid, string barcode, string cid, int rfidLoc, out TaskData afterData, out string msg)
{
afterData = null;
msg = "";
try
{
//参数:
//cid: 料仓cid,流水线可传入空
//barcode : 条码
//rfid : RFID
//rfidLoc: 料架位置,流水线可传-1
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode); // 参数: barcode=料盘的条码
paramMap.Add("rfid", rfid); // rfid = 料架的RFID信息
paramMap.Add("rfidLoc", rfidLoc.ToString()); // rfidLoc=料架的架位信息
paramMap.Add("cid", cid); // 料仓cid,流水线可传入空
string server = GetAddr(Addr_afterPutCut, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
if (barcode != "")
{
LogUtil.info(deviceName + "afterPutCut " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
}
else
{
LogUtil.debug(deviceName + "afterPutCut " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
}
//> 返回:
//>>` {"code": 0, "msg":"ok", "data":{"cutPackageTask":"0","urgentPackageTask":"20","cutTask":"21","urgentTask":"22"}} `
//>>
//>> - code: 0为正常,其他为异常,
//>> - msg:消息,
//>> - data:为包装料仓的空闲仓位数(key为与客户端一致的料仓标识, value为空闲仓位)
//>> - cutPackageTask: 表示当前包装仓的分盘任务数
//>> - urgentPackageTask: 表示当前包装仓的紧急料任务数
//>> - cutTask: 表示流水线分盘任务数
//>> - urgentTask: 表示流水线紧急料任务数
AfterPutData serverResult = JsonHelper.DeserializeJsonToObject<AfterPutData>(resultStr);
if (serverResult == null)
{
return false;
}
else if (serverResult.code.Equals(0).Equals(false))
{
return false;
}
afterData = serverResult.data;
return true;
}
catch (Exception ex)
{
LogUtil.error(deviceName + " " + ex.ToString());
}
return false;
}
// 分盘料/紧急料启动时获取料架的虚拟RFID调用 地址: /rest/api/qisda/device/findTempRfid
private static string Addr_findTempRfid = "/rest/api/qisda/device/findTempRfid";
public static string findTempRfid(string deviceName, string rfid, out string tempRfid)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!