Commit e8f01ac9 张东亮

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

20221128

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