Commit e8f01ac9 张东亮

合并分支 '周转箱混料问题' 到 'master'

20221128

查看合并请求 !1
2 个父辈 1ad4ce0d 8bdd1c90
正在显示 83 个修改的文件 包含 108 行增加37 行删除
...@@ -23,7 +23,7 @@ namespace AGVDispatch ...@@ -23,7 +23,7 @@ namespace AGVDispatch
private void button1_Click(object sender, EventArgs e) private void button1_Click(object sender, EventArgs e)
{ {
if (string.IsNullOrEmpty(txtRfid.Text)) return; if (string.IsNullOrEmpty(txtRfid.Text)) return;
bool rtn = HttpManager.ClearBoxBind(txtRfid.Text.ToUpper()); bool rtn = HttpManager.ClearBoxBind(txtRfid.Text.ToUpper(), "Manual");
string msg=$"清除料箱【{txtRfid.Text}】"+(rtn?"成功":"失败"); string msg=$"清除料箱【{txtRfid.Text}】"+(rtn?"成功":"失败");
MessageBox.Show(msg, "结果"); MessageBox.Show(msg, "结果");
} }
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup> </startup>
<appSettings> <appSettings>
<add key="ProName" value="AGVDispatch-调试" /> <add key="ProName" value="AGVDispatch-混料问题修复" />
</appSettings> </appSettings>
</configuration> </configuration>
\ No newline at end of file \ No newline at end of file
95b86aba1faa78e788f8141cc6b2400fb8d7bfbf 93489750a85a1848d77dc79ab1253087d3b8af91
7232fd204538b33e06178b9972fea298aec1ab28 3406c2e07fa06d203c9bad455e20c6250c3a1e4d
647f1de51989aa7672b0da37f586c9efb39a5a06 fbbcae88553fb2947324dace9b8bac9e63e8284d
...@@ -247,11 +247,11 @@ namespace DeviceLib.BLL ...@@ -247,11 +247,11 @@ namespace DeviceLib.BLL
OrderManager.SetOrderState(orderId, state); OrderManager.SetOrderState(orderId, state);
Log.Info($"改变订单状态:【{robot?.name??""}】【{orderId}】【{state}】【{OrderManager.GetOrderState(state)}】"); Log.Info($"改变订单状态:【{robot?.name??""}】【{orderId}】【{state}】【{OrderManager.GetOrderState(state)}】");
} }
protected bool NeedToShelfPlace(string shelfID, out string targetLines) protected bool NeedToShelfPlace(Robot robot,string shelfID, out string targetLines)
{ {
targetLines = "";//A05-2FSMT-16S targetLines = "";//A05-2FSMT-16S
bool rtn = HttpManager.GetBoxTarget(shelfID, out BoxTaskInfo boxTaskInfo); bool rtn = HttpManager.GetBoxTarget(shelfID, out BoxTaskInfo boxTaskInfo);
RobotManager.ClearBoxBind(shelfID); RobotManager.ClearBoxBind(robot,shelfID);
if (rtn) if (rtn)
{ {
if (String.IsNullOrEmpty(boxTaskInfo.line)) if (String.IsNullOrEmpty(boxTaskInfo.line))
......
...@@ -124,6 +124,7 @@ namespace DeviceLib.BLL ...@@ -124,6 +124,7 @@ namespace DeviceLib.BLL
case JobGoal.Get: case JobGoal.Get:
//NodeManager.RequestLeave(JobParam.CurDstNode.Id); //NodeManager.RequestLeave(JobParam.CurDstNode.Id);
RobotManager.SetLoadInfo(robot.id, GetNoneSide(robot), ShelfType.Full, JobParam.FullBoxId); RobotManager.SetLoadInfo(robot.id, GetNoneSide(robot), ShelfType.Full, JobParam.FullBoxId);
HttpManager.BoxToAgv(JobParam.FullBoxId, robot.name);
break; break;
} }
} }
......
...@@ -56,7 +56,7 @@ namespace DeviceLib.BLL ...@@ -56,7 +56,7 @@ namespace DeviceLib.BLL
SetOrderState(JobParam.OrderId, 4); SetOrderState(JobParam.OrderId, 4);
break; break;
case RunStep.ToStore_07_CheckIsNeedToShelfPlace: case RunStep.ToStore_07_CheckIsNeedToShelfPlace:
if (NeedToShelfPlace(JobParam.FullBoxId, out string targetLines)) if (NeedToShelfPlace(robot,JobParam.FullBoxId, out string targetLines))
{ {
JobParam.LineNode = NodeManager.GetLineNodeByName(targetLines); JobParam.LineNode = NodeManager.GetLineNodeByName(targetLines);
if (JobParam.LineNode != null) if (JobParam.LineNode != null)
...@@ -71,7 +71,7 @@ namespace DeviceLib.BLL ...@@ -71,7 +71,7 @@ namespace DeviceLib.BLL
{ {
ToNextStep(RunStep.ToStore_10_End, $"获取不到目标点位数据,结束任务:{targetLines}"); ToNextStep(RunStep.ToStore_10_End, $"获取不到目标点位数据,结束任务:{targetLines}");
OrderManager.DeleteOrderById(JobParam.OrderId, out string res, true); OrderManager.DeleteOrderById(JobParam.OrderId, out string res, true);
RobotManager.SetLoadInfo(robot.id, GetFullSide(robot, out string shelfId), ShelfType.Empty, shelfId);
} }
} }
else else
...@@ -80,7 +80,6 @@ namespace DeviceLib.BLL ...@@ -80,7 +80,6 @@ namespace DeviceLib.BLL
{ {
ToNextStep(RunStep.ToStore_10_End, $"目的产线为空,结束任务:{targetLines}"); ToNextStep(RunStep.ToStore_10_End, $"目的产线为空,结束任务:{targetLines}");
OrderManager.DeleteOrderById(JobParam.OrderId, out string res, true); OrderManager.DeleteOrderById(JobParam.OrderId, out string res, true);
RobotManager.SetLoadInfo(robot.id, GetFullSide(robot, out string shelfId), ShelfType.Empty, shelfId);
} }
else else
{ {
...@@ -96,7 +95,6 @@ namespace DeviceLib.BLL ...@@ -96,7 +95,6 @@ namespace DeviceLib.BLL
{ {
ToNextStep(RunStep.ToStore_10_End, $"获取不到目标点位数据,结束任务:{targetLines}"); ToNextStep(RunStep.ToStore_10_End, $"获取不到目标点位数据,结束任务:{targetLines}");
OrderManager.DeleteOrderById(JobParam.OrderId, out string res, true); OrderManager.DeleteOrderById(JobParam.OrderId, out string res, true);
RobotManager.SetLoadInfo(robot.id, GetFullSide(robot, out string shelfId), ShelfType.Empty, shelfId);
} }
} }
...@@ -104,14 +102,17 @@ namespace DeviceLib.BLL ...@@ -104,14 +102,17 @@ namespace DeviceLib.BLL
break; break;
case RunStep.ToStore_08_ToShelfPlace: case RunStep.ToStore_08_ToShelfPlace:
Context.SetNodeOccupied(robot.id, ""); Context.SetNodeOccupied(robot.id, "");
RobotManager.SetLoadInfo(robot.id, GetFullSide(robot, out string shelfId), ShelfType.Empty, shelfId);
job = new ToLinesJob(JobParam); job = new ToLinesJob(JobParam);
break; break;
case RunStep.ToStore_09_ToLine: case RunStep.ToStore_09_ToLine:
Context.SetNodeOccupied(robot.id, ""); Context.SetNodeOccupied(robot.id, "");
RobotManager.SetLoadInfo(robot.id, GetFullSide(robot, out shelfId), ShelfType.Empty, shelfId);
job = new ToLinesJob(JobParam); job = new ToLinesJob(JobParam);
break; break;
case RunStep.ToStore_10_End: case RunStep.ToStore_10_End:
Context.SetNodeOccupied(robot.id, ""); Context.SetNodeOccupied(robot.id, "");
RobotManager.SetLoadInfo(robot.id, GetFullSide(robot, out shelfId), ShelfType.Empty, shelfId);
job = null; job = null;
break; break;
} }
......
...@@ -19,7 +19,30 @@ namespace DeviceLib.BLL ...@@ -19,7 +19,30 @@ namespace DeviceLib.BLL
/// </summary> /// </summary>
/// <param name="rfid"></param> /// <param name="rfid"></param>
/// <returns></returns> /// <returns></returns>
public static bool ClearBoxBind(string rfid="") //public static bool ClearBoxBind(string rfid="")
//{
// try
// {
// //if (string.IsNullOrEmpty(rfid)) return false;
// //HttpClient httpClient = new HttpClient(baseUrl);
// Dictionary<string, string> queryStr = new Dictionary<string, string>();
// queryStr.Add("rfid", rfid);
// string json = httpClient.Get("/service/store/innerBox/boxTakeAway", queryStr);
// RtnData rtnData = JsonHelper.DeserializeJsonToObject<RtnData>(json);
// LogUtil.Info($"清除料箱绑定:【{rfid}】【{json}】");
// if (rtnData != null)
// {
// return rtnData.code == 0;
// }
// }
// catch(Exception ex)
// {
// LogUtil.Error($"清除料箱绑定异常:【{rfid}】",ex);
// }
// return false;
//}
public static bool ClearBoxBind(string rfid,string source)
{ {
try try
{ {
...@@ -27,23 +50,78 @@ namespace DeviceLib.BLL ...@@ -27,23 +50,78 @@ namespace DeviceLib.BLL
//HttpClient httpClient = new HttpClient(baseUrl); //HttpClient httpClient = new HttpClient(baseUrl);
Dictionary<string, string> queryStr = new Dictionary<string, string>(); Dictionary<string, string> queryStr = new Dictionary<string, string>();
queryStr.Add("rfid", rfid); queryStr.Add("rfid", rfid);
string json = httpClient.Get("/service/store/innerBox/boxTakeAway", queryStr); queryStr.Add("source", source);
string json = httpClient.Get("/service/store/innerBox/clearRfidInfo", queryStr);
RtnData rtnData = JsonHelper.DeserializeJsonToObject<RtnData>(json); RtnData rtnData = JsonHelper.DeserializeJsonToObject<RtnData>(json);
LogUtil.Info($"清除料箱绑定:【{rfid}】【{json}】"); LogUtil.Info($"清理料箱信息:【{rfid}】【{json}】");
if (rtnData != null) if (rtnData != null)
{ {
return rtnData.code == 0; return rtnData.code == 0;
} }
} }
catch(Exception ex) catch (Exception ex)
{ {
LogUtil.Error($"清除料箱绑定异常:【{rfid}】",ex); LogUtil.Error($"清理料箱信息:【{rfid}】", ex);
} }
return false; return false;
} }
/// <summary>
/// 料箱送入agv
/// </summary>
/// <param name="rfid"></param>
/// <param name="boxTaskInfo"></param>
/// <returns></returns>
public static bool BoxToAgv(string rfid,string agvName)
{
try
{
if (string.IsNullOrEmpty(rfid)) return false;
//HttpClient httpClient = new HttpClient(baseUrl);
Dictionary<string, string> queryStr = new Dictionary<string, string>();
queryStr.Add("rfid", rfid);
string json = httpClient.Get("/service/store/innerBox/getBoxStatusInfo", queryStr);
RtnData rtnData = JsonHelper.DeserializeJsonToObject<RtnData>(json);
LogUtil.Info($"料箱送入agv:【{rfid}】【{agvName}】【{json}】");
if (rtnData != null)
{
return rtnData.code == 0;
}
}
catch (Exception ex)
{
LogUtil.Error($"料箱送入agv:【{rfid}】【{agvName}】", ex);
public static bool GetBoxTarget(string rfid,out BoxTaskInfo boxTaskInfo) }
return false;
}
//public static bool GetBoxTarget(string rfid,out BoxTaskInfo boxTaskInfo)
//{
// boxTaskInfo = null;
// try
// {
// if (string.IsNullOrEmpty(rfid)) return false;
// //HttpClient httpClient = new HttpClient(baseUrl);
// Dictionary<string, string> queryStr = new Dictionary<string, string>();
// queryStr.Add("rfid", rfid);
// string json = httpClient.Get("/service/store/innerBox/getBoxStatusInfo", queryStr);
// ServerData1 rtnData = JsonHelper.DeserializeJsonToObject<ServerData1>(json);
// LogUtil.Info($"获取料箱信息:【{rfid}】【{json}】");
// if (rtnData != null)
// {
// boxTaskInfo = rtnData.data;
// return rtnData.code == 0;
// }
// }
// catch (Exception ex)
// {
// LogUtil.Error($"获取料箱信息:【{rfid}】", ex);
// }
// return false;
//}
public static bool GetBoxTarget(string rfid, out BoxTaskInfo boxTaskInfo)
{ {
boxTaskInfo = null; boxTaskInfo = null;
try try
...@@ -52,7 +130,7 @@ namespace DeviceLib.BLL ...@@ -52,7 +130,7 @@ namespace DeviceLib.BLL
//HttpClient httpClient = new HttpClient(baseUrl); //HttpClient httpClient = new HttpClient(baseUrl);
Dictionary<string, string> queryStr = new Dictionary<string, string>(); Dictionary<string, string> queryStr = new Dictionary<string, string>();
queryStr.Add("rfid", rfid); queryStr.Add("rfid", rfid);
string json = httpClient.Get("/service/store/innerBox/getBoxStatusInfo", queryStr); string json = httpClient.Get("/service/store/innerBox/getAgvLineInfo", queryStr);
ServerData1 rtnData = JsonHelper.DeserializeJsonToObject<ServerData1>(json); ServerData1 rtnData = JsonHelper.DeserializeJsonToObject<ServerData1>(json);
LogUtil.Info($"获取料箱信息:【{rfid}】【{json}】"); LogUtil.Info($"获取料箱信息:【{rfid}】【{json}】");
if (rtnData != null) if (rtnData != null)
...@@ -120,10 +198,9 @@ namespace DeviceLib.BLL ...@@ -120,10 +198,9 @@ namespace DeviceLib.BLL
/// </summary> /// </summary>
public class BoxTaskInfo public class BoxTaskInfo
{ {
///// <summary> public string outlet { get; set; }
///// 箱子编号 public string cid { get; set; }
///// </summary> public string rfid { get; set; }
//public string boxLoc = "";
/// <summary> /// <summary>
/// 所属需求单剩余当前料仓未完成任务数 /// 所属需求单剩余当前料仓未完成任务数
/// </summary> /// </summary>
...@@ -143,20 +220,12 @@ namespace DeviceLib.BLL ...@@ -143,20 +220,12 @@ namespace DeviceLib.BLL
/// <summary> /// <summary>
/// 当前料箱隔口内侧已放入 /// 当前料箱隔口内侧已放入
/// </summary> /// </summary>
public int inCount { get; set; } = -1; public int boxTCount { get; set; } = -1;
public int outCount { get; set; } = -1; public int boxBCount { get; set; } = -1;
//public bool IsValid()
//{
// if (bigEmpty != -1 && smallEmpty != -1)
// {
// return true;
// }
// return false;
//}
public string ToStr() public string ToStr()
{ {
return $"内侧格口已有数量:{inCount},外侧格口已有数量;{outCount}; 需求单:{hSerial},剩余任务数={remainTaskCount}," + return $"内侧格口已有数量:{boxTCount},外侧格口已有数量;{boxBCount}; 需求单:{hSerial},剩余任务数={remainTaskCount}," +
$"剩余料架数:{rackTaskCount},目的地:{line}"; $"剩余料架数:{rackTaskCount},目的地:{line}";
} }
} }
......
...@@ -158,9 +158,9 @@ namespace DeviceLib.BLL ...@@ -158,9 +158,9 @@ namespace DeviceLib.BLL
} }
return null; return null;
} }
public static void ClearBoxBind(string rfid) public static void ClearBoxBind(Robot robot,string rfid)
{ {
HttpManager.ClearBoxBind(rfid); HttpManager.ClearBoxBind(rfid,robot.name);
} }
} }
} }
cb09706f1f7653320c39c8166014469f4adb1bbf a50a0eea5cb577d2dc281ec57e1298fd790c9e1c
4e6ac5b716b6f78fe4cb28dbf540c7333b32532f 95805b0f55fc1a9e75fa9c9572e5899161a5110a
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!