From 531c6e89dc07bb6997e6249a6cd9f53a9bd474a5 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期一, 23 三月 2026 10:31:54 +0800
Subject: [PATCH] 出库逻辑变更
---
项目代码/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs | 168 ++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 120 insertions(+), 48 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
index e1f0907..05a3d45 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WCS/WCSServices/WIDESEAWCS_Server/Controllers/AGV/AGVController.cs"
@@ -262,7 +262,7 @@
{
throw new Exception($"{task.NextAddress}AGV绔欏彴鏈畾涔�");
}
- if (task.TaskType == TaskTypeEnum.PrintYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.PrintYLBackInbound.ObjToInt())
+ if (task.TaskType == TaskTypeEnum.PrintYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.PrintYLBackInbound.ObjToInt() || task.TaskType == TaskTypeEnum.EmptyStackPlate.ObjToInt())
{
List<Dt_Router> routers = _routerRepository.QueryData(x => x.InOutType == task.TaskType && task.NextAddress == x.StartPosi);
Dt_Router router = routers.FirstOrDefault();
@@ -277,6 +277,10 @@
task.DeviceCode = router.ChildPosiDeviceCode;
_taskService.UpdateTask(task, TaskStatusEnum.AGV_Finish);
PutFinish(oldAddress, task.TaskNum);
+ }
+ else if (task.TaskType == TaskTypeEnum.WFBLMYLBackInbound.ObjToInt() || task.TaskType == TaskTypeEnum.WFBYLInbound.ObjToInt() || task.TaskType == TaskTypeEnum.WFBLMYLInbound.ObjToInt())
+ {
+ _taskService.TaskCompleted(task.TaskNum);
}
else
{
@@ -342,7 +346,7 @@
MESResponse response = _taskService.MESAvgArriveNotice(requestAGVArriveDTO).DeserializeObject<MESResponse>() ?? throw new Exception("鏈幏鍙栧埌杩斿洖淇℃伅");
if (!response.Result)
{
- throw new Exception($"璋冪敤MES灏忚溅鍏佽鏀捐揣鎶ラ敊,MES杩斿洖淇℃伅"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match => {
+ throw new Exception($"璋冪敤MES灏忚溅鍏佽鏀捐揣鎶ラ敊,MES杩斿洖淇℃伅"+ Regex.Replace(response.Msg, @"\\u([0-9a-fA-F]{4})", match =>{
return ((char)Convert.ToInt32(match.Groups[1].Value, 16)).ToString();
}));
}
@@ -431,23 +435,24 @@
return content.Error("绂佹鏀炬枡");
}
}
- else if (device.DeviceCode.Contains("TrussCarton"))//妗佹灦
+ else if (device.DeviceCode.Contains("TrussDixieCup"))//妗佹灦
{
- bool RequestPut = otherDevice.GetValue<W_TrussCartonDB, bool>(GetCartonRequest(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
- if (!RequestPut)
- {
- otherDevice.SetValue(GetCartonRequest(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
- Thread.Sleep(1000);
- }
- bool AllowFinish = otherDevice.GetValue<R_TrussCartonDB, bool>(GetCarton(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
- if (AllowFinish)
- {
- content.OK("鍏佽鏀炬枡");
- }
- else
- {
- return content.Error("绂佹鏀炬枡");
- }
+
+ bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
+ if (!RequestPut)
+ {
+ otherDevice.SetValue(GetTrussDixieCupOutReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
+ Thread.Sleep(1000);
+ }
+ bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupPutOut(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
+ if (AllowFinish)
+ {
+ content.OK("鍏佽鏀炬枡");
+ }
+ else
+ {
+ return content.Error("绂佹鏀炬枡");
+ }
}
}
return content;
@@ -496,9 +501,9 @@
{
otherDevice.SetValue(RetractDB.Ret_PutFinish, true, stationManger.StationDeviceCode);
}
- else if (device.DeviceCode.Contains("TrussCarton"))//绾哥妗佹灦
+ else if (device.DeviceCode.Contains("TrussDixieCup"))//绾告澂妗佹灦
{
- otherDevice.SetValue(GetCartonPut(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
+ otherDevice.SetValue(GetTrussDixieCupPuted(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
}
}
return WebResponseContent.Instance.OK();
@@ -511,45 +516,75 @@
/// <summary>
/// 鑾峰彇妗佹灦鏀炬枡淇″彿
/// </summary>
- private W_TrussCartonDB GetCartonPut(string StationCode)
+ private W_TrussDixieCupDB GetTrussDixieCupPuted(string StationCode)
{
switch (StationCode)
{
case "1":
- return W_TrussCartonDB.W_CartonPut1;
+ return W_TrussDixieCupDB.W_DixieCupPuted1;
case "2":
- return W_TrussCartonDB.W_CartonPut2;
+ return W_TrussDixieCupDB.W_DixieCupPuted2;
case "3":
- return W_TrussCartonDB.W_CartonPut3;
+ return W_TrussDixieCupDB.W_DixieCupPuted3;
case "4":
- return W_TrussCartonDB.W_CartonPut4;
- case "5":
- return W_TrussCartonDB.W_CartonPut5;
- case "6":
- return W_TrussCartonDB.W_CartonPut6;
+ return W_TrussDixieCupDB.W_DixieCupPuted4;
default:
throw new Exception("鏈畾涔夊伐浣�");
}
}
/// <summary>
- /// 鑾峰彇妗佹灦璇锋眰淇″彿
+ /// 鑾峰彇妗佹灦鍙栨枡鏂欎俊鍙�
/// </summary>
- private W_TrussCartonDB GetCartonRequest(string StationCode)
+ private W_TrussDixieCupDB GetTrussDixieCupTaked(string StationCode)
{
switch (StationCode)
{
case "1":
- return W_TrussCartonDB.W_CartonRequest1;
+ return W_TrussDixieCupDB.W_DixieCupTaked1;
case "2":
- return W_TrussCartonDB.W_CartonRequest2;
+ return W_TrussDixieCupDB.W_DixieCupTaked2;
case "3":
- return W_TrussCartonDB.W_CartonRequest3;
+ return W_TrussDixieCupDB.W_DixieCupTaked3;
case "4":
- return W_TrussCartonDB.W_CartonRequest4;
- case "5":
- return W_TrussCartonDB.W_CartonRequest5;
- case "6":
- return W_TrussCartonDB.W_CartonRequest6;
+ return W_TrussDixieCupDB.W_DixieCupTaked4;
+ default:
+ throw new Exception("鏈畾涔夊伐浣�");
+ }
+ }
+ /// <summary>
+ /// 鑾峰彇妗佹灦璇锋眰杩涗俊鍙�
+ /// </summary>
+ private W_TrussDixieCupDB GetTrussDixieCupOutReq(string StationCode)
+ {
+ switch (StationCode)
+ {
+ case "1":
+ return W_TrussDixieCupDB.W_DixieCupReqPut1;
+ case "2":
+ return W_TrussDixieCupDB.W_DixieCupReqPut2;
+ case "3":
+ return W_TrussDixieCupDB.W_DixieCupReqPut3;
+ case "4":
+ return W_TrussDixieCupDB.W_DixieCupReqPut4;
+ default:
+ throw new Exception("鏈畾涔夊伐浣�");
+ }
+ }
+ /// <summary>
+ /// 鑾峰彇妗佹灦璇锋眰杩涗俊鍙�
+ /// </summary>
+ private W_TrussDixieCupDB GetTrussDixieCupInReq(string StationCode)
+ {
+ switch (StationCode)
+ {
+ case "1":
+ return W_TrussDixieCupDB.W_DixieCupReqTake1;
+ case "2":
+ return W_TrussDixieCupDB.W_DixieCupReqTake2;
+ case "3":
+ return W_TrussDixieCupDB.W_DixieCupReqTake3;
+ case "4":
+ return W_TrussDixieCupDB.W_DixieCupReqTake4;
default:
throw new Exception("鏈畾涔夊伐浣�");
}
@@ -558,22 +593,37 @@
/// <summary>
/// 鑾峰彇妗佹灦杩涘叆淇″彿
/// </summary>
- private R_TrussCartonDB GetCarton(string StationCode)
+ private R_TrussDixieCupDB GetDixieCupPutOut(string StationCode)
{
switch (StationCode)
{
case "1":
- return R_TrussCartonDB.R_CartonAllow1;
+ return R_TrussDixieCupDB.R_DixieCupPutOut1;
case "2":
- return R_TrussCartonDB.R_CartonAllow2;
+ return R_TrussDixieCupDB.R_DixieCupPutOut2;
case "3":
- return R_TrussCartonDB.R_CartonAllow3;
+ return R_TrussDixieCupDB.R_DixieCupPutOut3;
case "4":
- return R_TrussCartonDB.R_CartonAllow4;
- case "5":
- return R_TrussCartonDB.R_CartonAllow5;
- case "6":
- return R_TrussCartonDB.R_CartonAllow6;
+ return R_TrussDixieCupDB.R_DixieCupPutOut4;
+ default:
+ throw new Exception("鏈畾涔夊伐浣�");
+ }
+ }
+ /// <summary>
+ /// 鑾峰彇妗佹灦杩涘叆淇″彿
+ /// </summary>
+ private R_TrussDixieCupDB GetDixieCupTakeIn(string StationCode)
+ {
+ switch (StationCode)
+ {
+ case "1":
+ return R_TrussDixieCupDB.R_DixieCupTakeIn1;
+ case "2":
+ return R_TrussDixieCupDB.R_DixieCupTakeIn2;
+ case "3":
+ return R_TrussDixieCupDB.R_DixieCupTakeIn3;
+ case "4":
+ return R_TrussDixieCupDB.R_DixieCupTakeIn4;
default:
throw new Exception("鏈畾涔夊伐浣�");
}
@@ -655,6 +705,24 @@
return content.Error("绂佹鍙栨枡");
}
}
+ else if (device.DeviceCode.Contains("TrussDixieCup"))
+ {
+ bool RequestPut = otherDevice.GetValue<W_TrussDixieCupDB, bool>(GetTrussDixieCupInReq(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
+ if (!RequestPut)
+ {
+ otherDevice.SetValue(GetTrussDixieCupInReq(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
+ Thread.Sleep(1000);
+ }
+ bool AllowFinish = otherDevice.GetValue<R_TrussDixieCupDB, bool>(GetDixieCupTakeIn(stationManger.StackerCraneStationCode), stationManger.StationDeviceCode);
+ if (AllowFinish)
+ {
+ content.OK("鍏佽鍙栨枡");
+ }
+ else
+ {
+ return content.Error("绂佹鍙栨枡");
+ }
+ }
}
return content;
}
@@ -705,6 +773,10 @@
{
otherDevice.SetValue(RetractDB.Ret_TakeFinish, true, stationManger.StationDeviceCode);
}
+ else if (device.DeviceCode.Contains("TrussDixieCup"))//绾告澂妗佹灦
+ {
+ otherDevice.SetValue(GetTrussDixieCupTaked(stationManger.StackerCraneStationCode), true, stationManger.StationDeviceCode);
+ }
}
return WebResponseContent.Instance.OK();
--
Gitblit v1.9.3