Commit 77997491 刘韬

1

1 个父辈 4a5f2091
......@@ -211,6 +211,10 @@ namespace OnlineStore.Common
/// </summary>
public static string posId = "posId";
/// <summary>
/// 需求单号
/// </summary>
public static string hSerial = "hSerial";
/// <summary>
/// 料盘宽
/// </summary>
public static string plateW = "plateW";
......
......@@ -104,7 +104,34 @@ namespace OnlineStore.DeviceLibrary
return msg;
}
public static int GetOutTaskCount(string hSerial)
{
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("cid", StoreManager.Config.CID);
paramMap.Add("hSerial", hSerial);
string server = GetAddr("/service/store/outTaskCount", paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "", Encoding.UTF8, 10000, out bool IsTimeOut);
LogUtil.info("GetoutTaskCount " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
if (IsTimeOut)
{
return 998;
}
if (int.TryParse(resultStr, out int r))
return r;
}
catch (Exception ex)
{
LogUtil.error("GetoutTaskCount error ", ex);
return 997;
}
return 999;
}
/// <summary>
/// 1 皮带线扫码后调用,用于获取尺寸后升起气缸
/// 地址: /rest/api/qisda/device/getSize
......
......@@ -94,13 +94,13 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
OutStoreBoxEnd = 10,
/// <summary>
/// 12=移栽出库移栽过程中(移栽完成后变成OnLine)
///11=出库完成
/// </summary>
OutMoveExecute = 12,
OutStoreEnd = 11,
/// <summary>
///11=出库失败
/// 12=移栽出库移栽过程中(移栽完成后变成OnLine)
/// </summary>
OutStoreFaild = 11,
OutMoveExecute = 12,
/// <summary>
/// 重置中(原点返回和重置都发此状态)
/// </summary>
......
......@@ -91,6 +91,11 @@ namespace OnlineStore.DeviceLibrary
/// 物品二维码
/// </summary>
public string barcode { get; set; }
/// <summary>
/// 需求单号
/// </summary>
public string hSerial { get; set; }
/// <summary>
/// 库位号编码
/// </summary>
......@@ -129,7 +134,7 @@ namespace OnlineStore.DeviceLibrary
public bool singleOut = false;
public string ToStr()
{
return " [" + barcode + "] [" + PosId + "] [" + PlateW + "x" + PlateH + "],urgentReel [" + urgentReel
return " [" + barcode + "] [" + PosId + "] [" + hSerial + "][" + PlateW + "x" + PlateH + "],urgentReel [" + urgentReel
+ "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],singleOut[" + singleOut + "]";
}
......
......@@ -207,7 +207,7 @@ namespace OnlineStore.DeviceLibrary
try
{
foreach (var item in cloumnsSig.Keys)
foreach (var item in cloumnsSig.Keys.ToArray())
{
bool preState = cloumnsSig[item];
bool curState = IOValue(item).Equals(IO_VALUE.HIGH);
......
......@@ -24,6 +24,21 @@ namespace OnlineStore.DeviceLibrary
serverConnectTimer.Enabled = false;
serverConnectTimer.Elapsed += server_connect_timer_Tick;
}
public void SendStoreState(string posid, DeviceStatus storeStatus)
{
Operation operation = getLineBoxStatus();
if (!string.IsNullOrEmpty(posid))
{
operation.boxStatus[1].data[ParamDefine.posId]= posid;
}
LogUtil.info($"SendStoreState,posid:{posid}, storeStatus:{storeStatus}");
operation.boxStatus[1].status = (int)storeStatus;
LogUtil.info(JsonHelper.SerializeObject(operation));
Operation resultOperation = HttpHelper.PostOperation(SServerManager.GetPostApi(server), operation);
}
internal void SetConnectServerTimer(bool open)
{
serverConnectTimer.Enabled = open;
......@@ -284,6 +299,11 @@ namespace OnlineStore.DeviceLibrary
//string realRfid = data.ContainsKey(ParamDefine.realRfid) ? data[ParamDefine.realRfid] : "";
//int taskCount = FormUtil.GetIntData(data, ParamDefine.taskCount, 0);
string hSerials = "";
if (data.ContainsKey(ParamDefine.hSerial))
hSerials = data[ParamDefine.hSerial];
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
......@@ -301,6 +321,7 @@ namespace OnlineStore.DeviceLibrary
int plateH = Convert.ToInt32(plateHArray[index]);
InOutParam inoutParam = new InOutParam(new InOutPosInfo(barcode, posId, plateW, plateH, urgentReel));
inoutParam.PosInfo.hSerial = hSerials;
//根据发送的posId获取位置列表
BoxPosition position = CSVPositionReader<BoxPosition>.GetPositon(posId);
if (position == null)
......
......@@ -707,7 +707,13 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StepEnum.IS14_ReelOK);
WorkLog($"出库{MoveInfo.SLog} 放料完成");
CheckShelfIsFull();
if (SServerManager.GetOutTaskCount(MoveInfo.MoveParam.PosInfo.hSerial) == 0)
{
SendOutShelfLeave("工单已结束:" + MoveInfo.MoveParam.PosInfo.hSerial);
}
else
CheckShelfIsFull();
}
else
{
......
......@@ -446,11 +446,17 @@ namespace OnlineStore.DeviceLibrary
{
foreach (BatchMoveBean moveBean in BatchMoveList)
{
if (moveBean.ShelfReadyOut(posInfo, shelfAutoLeave))
var curhSerial = moveBean.MoveInfo.MoveParam?.PosInfo?.hSerial;
if (!string.IsNullOrEmpty(curhSerial) && curhSerial != posInfo.hSerial)
{
LogInfo($"{posType}当前料串的 hSerial:{curhSerial},与准备出库到料串 hSerial:{posInfo.hSerial} 不符");
moveBean.ShelfNeedLeave = true;
}
else if (moveBean.ShelfReadyOut(posInfo, shelfAutoLeave))
{
InOutParam param = new InOutParam(posInfo.ToCopy());
param.ShelfType = moveBean.ShelfType;
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType}");
LogInfo($"{posType}物料{param.PosInfo.ToStr()},准备出库到料串{param.ShelfType},当前料串的 hSerial:{curhSerial}");
StartOutstore(param);
return true;
break;
......
......@@ -961,6 +961,7 @@ namespace OnlineStore.DeviceLibrary
BatchMove_B.ReelPutOk();
SServerManager.ShelfFinish(BatchMove_B.CurrShelf.ShelfRfid, MoveInfo.MoveParam.PosInfo.barcode);
}
StoreManager.XLRStore.boxEquip.SendStoreState(MoveInfo.MoveParam.PosInfo.PosId, DeviceStatus.OutStoreEnd);
MoveInfo.NextMoveStep(StepEnum.IO32_UpdownToP1);
MoveLog($"出库->料串 {MoveInfo.SLog}: 升降轴到P1(待机点){Config.Updown_P1}");
UpdownAxis.AbsMove(MoveInfo, Config.Updown_P1, Config.Updown_P1_Speed);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!