Commit 07355ddd 张东亮

屏蔽库位功能

1 个父辈 6cebbc55
......@@ -48,10 +48,68 @@ namespace OnlineStore.DeviceLibrary
//http://localhost/myproject/service/store/emptyPosForPutin
private static string Addr_PosForPutin = "/service/store/emptyPosForPutin";
/// <summary>
/// 屏蔽库位接口
/// </summary>
private static string Addr_disabledPos = "/service/store/disabledPos";
/// <summary>
/// 屏蔽库位
/// </summary>
/// <param name="deviceName"></param>
/// <param name="barcode"></param>
/// <param name="poid"></param>
/// <returns></returns>
public static string DisablePos(string deviceName, string barcode,string poid)
{
string msg = "";
try
{
if (String.IsNullOrEmpty(barcode))
{
return msg;
}
if (string.IsNullOrEmpty(serverAddr))
{
LogUtil.error(deviceName + "DisablePos [" + barcode + "] [" + poid + "] :未找到服务器地址");
return msg;
}
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("posId", poid);//posId:库位号
paramMap.Add("barcode", barcode); // barcode = 料盘的条码
string server = GetAddr(Addr_disabledPos, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("DisablePos " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
// 返回: { "code": 0, "msg":"ok", "data":""}
ServerData serverResult = JsonHelper.DeserializeJsonToObject<ServerData>(resultStr);
if (serverResult == null)
{
msg = deviceName + "DisablePos【 " + barcode + "】【" + poid + "】没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
// code: 0为正常,其他为异常, msg: 消息, data: 为空
msg = deviceName + " DisablePos【 " + barcode + "】【" + poid + "】:" + "[" + serverResult.code + "]" + serverResult.msg;
}
if (!msg.Equals(""))
{
LogUtil.error(msg);
}
}
catch (Exception ex)
{
LogUtil.error(deviceName + " ", ex);
}
return msg;
}
/// <summary>
/// 1 皮带线扫码后调用,用于获取尺寸后升起气缸
/// 地址: /rest/api/qisda/device/getSize
/// </summary>
private static string Addr_getSize = "/rest/api/qisda/device/getSize";
// private static string Addr_getSize = "/rest/api/qisda/device/getSize";
/// <summary>
/// 2 料盘流转位置信息更新
......
......@@ -369,54 +369,54 @@
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(114, 6);
//
// 启动AToolStripMenuItem
//
this.启动AToolStripMenuItem.Name = "启动AToolStripMenuItem";
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.启动AToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.启动AToolStripMenuItem.Text = "启动 ";
this.启动AToolStripMenuItem.Click += new System.EventHandler(this.启动所有料仓AToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator4.Size = new System.Drawing.Size(114, 6);
//
// 复位RToolStripMenuItem
//
this.复位RToolStripMenuItem.Name = "复位RToolStripMenuItem";
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.复位RToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.复位RToolStripMenuItem.Text = "复位";
this.复位RToolStripMenuItem.Click += new System.EventHandler(this.复位RToolStripMenuItem_Click);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(114, 6);
//
// 停止TToolStripMenuItem
//
this.停止TToolStripMenuItem.Name = "停止TToolStripMenuItem";
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.停止TToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.停止TToolStripMenuItem.Text = "停止";
this.停止TToolStripMenuItem.Click += new System.EventHandler(this.停止所有料仓TToolStripMenuItem_Click);
//
// toolStripSeparator5
//
this.toolStripSeparator5.Name = "toolStripSeparator5";
this.toolStripSeparator5.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator5.Size = new System.Drawing.Size(114, 6);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(177, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(114, 6);
this.toolStripSeparator2.Visible = false;
//
// 退出ToolStripMenuItem
//
this.退出ToolStripMenuItem.Name = "退出ToolStripMenuItem";
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(180, 26);
this.退出ToolStripMenuItem.Size = new System.Drawing.Size(117, 26);
this.退出ToolStripMenuItem.Text = "退出";
this.退出ToolStripMenuItem.Click += new System.EventHandler(this.退出ToolStripMenuItem_Click_1);
//
......
......@@ -177,10 +177,11 @@ namespace OnlineStore.XLRStore
{
return;
}
DialogResult result = MessageBox.Show("确定清除A下暂存区物料:" + BufferDataManager.AOutStoreInfo.ToStr(), "", MessageBoxButtons.OKCancel);
DialogResult result = MessageBox.Show("确定清除A下暂存区物料(同时会屏蔽该物料所在库位):" + BufferDataManager.AOutStoreInfo.ToStr(), "", MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{
LogUtil.info(Name + "手动清除A下暂存区物料:" + BufferDataManager.AOutStoreInfo.ToStr());
DisablePos(BufferDataManager.AOutStoreInfo.PosId, BufferDataManager.AOutStoreInfo.barcode);
LogUtil.info(Name + "手动清除A下暂存区物料,并屏蔽该物料所在库位:" + BufferDataManager.AOutStoreInfo.ToStr());
BufferDataManager.AOutStoreInfo = null;
}
}
......@@ -203,14 +204,22 @@ namespace OnlineStore.XLRStore
{
return;
}
DialogResult result = MessageBox.Show("确定清除B下暂存区物料:" + BufferDataManager.BOutStoreInfo.ToStr(), "", MessageBoxButtons.OKCancel);
DialogResult result = MessageBox.Show("确定清除B下暂存区物料(同时会屏蔽该物料所在库位):" + BufferDataManager.BOutStoreInfo.ToStr(), "", MessageBoxButtons.OKCancel);
if (result.Equals(DialogResult.OK))
{
LogUtil.info(Name + "手动清除B下暂存区物料:" + BufferDataManager.BOutStoreInfo.ToStr());
LogUtil.info(Name + "手动清除B下暂存区物料,并屏蔽该物料所在库位:" + BufferDataManager.BOutStoreInfo.ToStr());
BufferDataManager.BOutStoreInfo = null;
}
}
/// <summary>
/// 屏蔽下暂存区里物料的库位
/// </summary>
/// <param name="posId"></param>
/// <param name="barcode"></param>
private void DisablePos(string posId,string barcode)
{
SServerManager.DisablePos(StoreManager.XLRStore.Name, barcode, posId);
}
private void AddForm(string text, Form form)
{
//text = text.PadRight(10, ' ');
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!