From 08dd2afd7a9614dad029e94918516b068d413cac Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期四, 04 七月 2024 17:46:41 +0800
Subject: [PATCH] 大屏
---
代码管理/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs | 20 +++++++++++---------
1 files changed, 11 insertions(+), 9 deletions(-)
diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
index fa4ebb5..d56fee2 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/PCS/WCS_Server/WIDESEA_WCS/Common/Gantry.cs"
@@ -27,7 +27,7 @@
namespace WIDESEA_WCS
{
- public class Gantry
+ public class Gantry : Gantry2
{
#region 鏌ヨ杞﹁疆鏁版嵁
/// <summary>
@@ -75,7 +75,7 @@
}
}
- var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "杈婇亾涓婃枡鏌ヨ杞﹁疆" ? "17" : "28")).FirstOrDefault();
+ var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "杈婇亾涓婃枡鏌ヨ杞﹁疆" ? "17" : "28")).OrderByDescending(x => x.CreateTime).FirstOrDefault();
if (Mes_Work == null)
{
client.WriteByOrder("W_i_status", (byte)2, name);
@@ -173,7 +173,7 @@
}
var wp_type = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_o_wp_type").First(), client);
- var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "杈婇亾涓婃枡鏌ヨ璁㈠崟" ? "17" : "28")).FirstOrDefault();
+ var Mes_Work = workinfoRepository.Find(x => x.SN == wp_id && x.processCode == (name != "杈婇亾涓婃枡鏌ヨ璁㈠崟" ? "17" : "28")).OrderByDescending(x => x.CreateTime).FirstOrDefault();
if (Mes_Work == null)
{
client.WriteByOrder("W_i_status", (byte)2, name);
@@ -299,7 +299,7 @@
}
//var Wheel_id = DBExtension.Read(details.Where(x => x.plcdetail_name == "R_Wheel_id").First(), client).ToString();
- var Mes_Work = workinfoRepository.Find(x => x.SN == Wheel_SN && x.processCode == "17").FirstOrDefault();
+ var Mes_Work = workinfoRepository.Find(x => x.SN == Wheel_SN && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
if (Mes_Work == null)
{
#region 鏃ュ織璁板綍
@@ -429,7 +429,7 @@
WriteLog.Write_Log(name + "鐢宠鏀炬枡寮傚父", "杞﹁疆SN鍙蜂负绌�", "", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN鍙凤細{Wheel_id}涓虹┖");
continue;
}
- var Work = workinfoRepository.Find(x => x.SN == Wheel_id && x.processCode == "17").FirstOrDefault();
+ var Work = workinfoRepository.Find(x => x.SN == Wheel_id && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
if (Work == null)
{
client.WriteByOrder("W_Enabl_Load", false, name);//淇″彿涓篺alse妗佹灦鍋滄杩涘叆
@@ -463,7 +463,8 @@
#endregion
#region 鎵樼洏绫诲瀷涓嶄竴鑷撮渶鏇存崲鎵樼洏
- foreach (var Stationinfo in Stations)
+ stations = Stations.Where(x => x.enable).ToList();
+ foreach (var Stationinfo in stations)
{
if (Stationinfo.tray_type != "LargeTray" && /*(wheel == null ? wheel1.e :)*/ wheel.e > 1100)
{
@@ -626,7 +627,8 @@
if (!Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state != LocationStateEnum.Stroge.ToString()).Any())
{
var station = Stations.Where(x => x.enable && x.stationCode != NGStation && x.location_state == LocationStateEnum.Stroge.ToString()).OrderBy(x => x.lastUpdateTime).FirstOrDefault();
- agvtask(stationinfoRepository, station, Work, name == "3鍗曞厓涓嬫枡鍖�" ? "TaskType_OutsourceInbound" : "TaskType_Inbound");
+ if (station != null)
+ agvtask(stationinfoRepository, station, Work, name == "3鍗曞厓涓嬫枡鍖�" ? "TaskType_OutsourceInbound" : "TaskType_Inbound");
}
#endregion
}
@@ -717,7 +719,7 @@
//WriteDBLog.Success(name + "鍏佽鏀炬枡", $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿Wheel_id}\n杞瀷ID锛歿Wheel_Type}\n杞﹁疆鐘舵�侊細NG" +$"\n璇诲彇鎵樼洏鍏夌數淇″彿锛歿PalletSignal}" +
// $"\n\n鍐欏叆妗佹灦淇℃伅锛歕n涓嬫枡浣嶅彿锛歿area}\n绗嚑涓溅杞細{(Stationinfo.quantity + 1)}\n鎵樼洏绫诲瀷锛�1\nW_Enabl_Load锛歵rue", "PCS");
WriteLog.Write_Log(name + "鐢宠鏀炬枡", Wheel_id, "鍏佽鏀炬枡",
- $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿Wheel_id}\n杞瀷ID锛歿Wheel_Type}\n杞﹁疆鐘舵�侊細鍚堟牸" +
+ $"璇诲彇妗佹灦淇℃伅锛歕n杞﹁疆SN锛歿Wheel_id}\n杞瀷ID锛歿Wheel_Type}\n杞﹁疆鐘舵�侊細涓嶅悎鏍�" +
$"\n璇诲彇鎵樼洏鍏夌數淇″彿锛歿PalletSignal}" +
$"\n\n鍐欏叆妗佹灦淇℃伅锛歕n涓嬫枡浣嶅彿锛歿area}\n绗嚑涓溅杞細{(Stationinfo.quantity + 1)}\n鎵樼洏绫诲瀷锛�1\n鏄惁鍏佽涓嬫枡锛歵rue");
#endregion
@@ -748,7 +750,7 @@
VOLContext Context = new VOLContext();
Idt_agvtaskRepository agvtaskRepository = new dt_agvtaskRepository(Context);
IVV_Mes_WorkinfoRepository workinfoRepository = new VV_Mes_WorkinfoRepository(Context);
- Work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.processCode == "17").FirstOrDefault();
+ Work = workinfoRepository.Find(x => x.workOrder == stationinfo.Number && x.processCode == "17").OrderByDescending(x => x.CreateTime).FirstOrDefault();
var task = agvtaskRepository.Find(x => x.agv_fromaddress == stationinfo.stationCode).FirstOrDefault();
if (task != null) return;
if (!string.IsNullOrEmpty(Work.area))
--
Gitblit v1.9.3