From 0187d7d752ee493b3691432a24cf97ededda2530 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 24 三月 2026 08:48:40 +0800
Subject: [PATCH] 辊分下空筒、涂布上空筒,涂布缓存架存放空筒
---
wcs-server-hbf/WIDESEA_WCS/JobsPart/AGV/UpdateAgvTaskText.cs | 108 +++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 87 insertions(+), 21 deletions(-)
diff --git a/wcs-server-hbf/WIDESEA_WCS/JobsPart/AGV/UpdateAgvTaskText.cs b/wcs-server-hbf/WIDESEA_WCS/JobsPart/AGV/UpdateAgvTaskText.cs
index c44cb50..145a18a 100644
--- a/wcs-server-hbf/WIDESEA_WCS/JobsPart/AGV/UpdateAgvTaskText.cs
+++ b/wcs-server-hbf/WIDESEA_WCS/JobsPart/AGV/UpdateAgvTaskText.cs
@@ -211,6 +211,20 @@
WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿dt_Stationinfo.stationCode},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
}
}
+ else if (agvTask.agv_remark.Contains("鍏ュ3涓婃枡浠诲姟"))
+ {
+ dt_stationinfo dt_Stationinfo = stationinfoRepository.FindFirst(d => d.stationCode == agvTask.agv_fromaddress);
+ if (dt_Stationinfo == null)
+ {
+ return;
+ }
+ dt_Stationinfo.task = false;
+ int a = stationinfoRepository.Update(dt_Stationinfo, x => new { x.task }, true);
+ if (a == 0)
+ {
+ WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿dt_Stationinfo.stationCode},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
+ }
+ }
#endregion
plcClient.WriteValue(TaskDBName.taskFbInteractiveW.ToString(), 1);
for (int i = 0; i < 5; i++)
@@ -276,19 +290,22 @@
if (agvTask.agv_fromaddress.Contains("HCJ"))
{
base_ware_location location = locationRepository.FindFirst(x => x.upper_code == agvTask.agv_fromaddress);
- if (!agvTask.agv_remark.Contains("鍒囧嵎涓婃枡鍥炵┖"))
+ if (location != null)
{
- location.geartype = "鏆傛棤";
- }
- location.update_time = DateTime.Now;
- location.logic_col = 0;
- location.task = 2;
- location.logic_row = "0";
+ if (!agvTask.agv_remark.Contains("鍒囧嵎涓婃枡鍥炵┖") && !agvTask.agv_remark.Contains("娑傚竷涓婄┖绛掍换鍔�"))
+ {
+ location.geartype = "鏆傛棤";
+ }
+ location.update_time = DateTime.Now;
+ location.logic_col = 0;
+ location.task = 2;
+ location.logic_row = "0";
- int a = locationRepository.Update(location, x => new { x.logic_col, x.task, x.logic_row, x.update_time, x.geartype }, true);
- if (a == 0)
- {
- WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿location.upper_code},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
+ int a = locationRepository.Update(location, x => new { x.logic_col, x.task, x.logic_row, x.update_time, x.geartype }, true);
+ if (a == 0)
+ {
+ WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿location.upper_code},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
+ }
}
}
}
@@ -492,7 +509,7 @@
}
else
{
- if (!agvTask.agv_remark.Contains("鍒囧嵎涓婃枡鍛煎彨"))
+ if (!agvTask.agv_remark.Contains("鍒囧嵎涓婃枡鍛煎彨") && !agvTask.agv_remark.Contains("杈婂垎涓嬬┖绛掍换鍔�"))
{
location.geartype = "鏆傛棤";
}
@@ -582,6 +599,20 @@
WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿dt_Stationinfo.stationCode},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
}
+ }
+ else if (agvTask.agv_remark.Contains("鍏ュ3涓嬫枡浠诲姟"))
+ {
+ dt_stationinfo dt_Stationinfo = stationinfoRepository.FindFirst(d => d.stationCode == agvTask.agv_toaddress);
+ if (dt_Stationinfo == null)
+ {
+ return;
+ }
+ dt_Stationinfo.task = false;
+ int a = stationinfoRepository.Update(dt_Stationinfo, x => new { x.task }, true);
+ if (a == 0)
+ {
+ WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿dt_Stationinfo.stationCode},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
+ }
}
#endregion
plcClient.WriteValue(TaskDBName.taskFbInteractiveW.ToString(), 1);
@@ -691,22 +722,57 @@
}
}
+ else if (agvTask.agv_remark.Contains("鍏ュ3涓嬫枡浠诲姟"))
+ {
+ dt_stationinfo dt_Stationinfo = stationinfoRepository.FindFirst(d => d.stationCode == agvTask.agv_toaddress);
+ if (dt_Stationinfo != null)
+ {
+ dt_Stationinfo.task = false;
+ int a = stationinfoRepository.Update(dt_Stationinfo, x => new { x.task }, true);
+ if (a == 0)
+ {
+ WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿dt_Stationinfo.stationCode},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
+ }
+ }
+ }
else
{
base_ware_location location = locationRepository.FindFirst(x => x.upper_code == agvTask.agv_toaddress);
- location.logic_col = 0;
- location.logic_row = "0";
- location.task = 2;
- locationRepository.Update(location, x => new { x.logic_col, x.logic_row, x.task }, true);
+ if (location!=null)
+ {
+ location.logic_col = 0;
+ location.logic_row = "0";
+ location.task = 2;
+ locationRepository.Update(location, x => new { x.logic_col, x.logic_row, x.task }, true);
+ }
}
}
else if (agvTask.agv_toaddress.Contains("SB") && agvTask.agv_fromaddress.Contains("HCJ"))
{
- base_ware_location location = locationRepository.FindFirst(x => x.upper_code == agvTask.agv_fromaddress);
- location.logic_col = 0;
- location.logic_row = "0";
- location.task = 2;
- locationRepository.Update(location, x => new { x.logic_col, x.logic_row, x.task }, true);
+ if (agvTask.agv_remark.Contains("鍏ュ3涓婃枡浠诲姟"))
+ {
+ dt_stationinfo dt_Stationinfo = stationinfoRepository.FindFirst(d => d.stationCode == agvTask.agv_fromaddress);
+ if (dt_Stationinfo != null)
+ {
+ dt_Stationinfo.task = false;
+ int a = stationinfoRepository.Update(dt_Stationinfo, x => new { x.task }, true);
+ if (a == 0)
+ {
+ WriteLog.GetLog().Write($"浠诲姟鍙凤細{agvTask.agv_tasknum},鍐呭锛氱粓鐐瑰湴鍧�锛歿dt_Stationinfo.stationCode},璐т綅淇敼澶辫触", $"璐т綅淇敼澶辫触");
+ }
+ }
+ }
+ else
+ {
+ base_ware_location location = locationRepository.FindFirst(x => x.upper_code == agvTask.agv_fromaddress);
+ if (location != null)
+ {
+ location.logic_col = 0;
+ location.logic_row = "0";
+ location.task = 2;
+ locationRepository.Update(location, x => new { x.logic_col, x.logic_row, x.task }, true);
+ }
+ }
}
else if (agvTask.agv_toaddress.Contains("HCJ") && agvTask.agv_fromaddress.Contains("HCJ"))
{
--
Gitblit v1.9.3