From d4fd2574b94a355de638c0a3ce5436aec8d9edea Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期二, 01 七月 2025 15:45:53 +0800 Subject: [PATCH] 1 --- HH.WCS.QingXiNongfu/process/TaskProcess.cs | 51 +++++++++++++++++++++++++++++++++++---------------- 1 files changed, 35 insertions(+), 16 deletions(-) diff --git a/HH.WCS.QingXiNongfu/process/TaskProcess.cs b/HH.WCS.QingXiNongfu/process/TaskProcess.cs index 8d25bc1..098d22a 100644 --- a/HH.WCS.QingXiNongfu/process/TaskProcess.cs +++ b/HH.WCS.QingXiNongfu/process/TaskProcess.cs @@ -1,26 +1,14 @@ -锘縰sing HH.WCS.QingXigongchang.api; -using HH.WCS.QingXigongchang.core; -using HH.WCS.QingXigongchang.device; +锘縰sing HH.WCS.QingXigongchang.device; using HH.WCS.QingXigongchang.dispatch; using HH.WCS.QingXigongchang.util; using HH.WCS.QingXigongchang.wms; using Newtonsoft.Json; -using NLog.Fluent; using SqlSugar; using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Reflection; -using System.Reflection.Emit; -using System.Runtime.InteropServices; -using System.Security.Cryptography; -using System.Security.Policy; using System.Threading; -using System.Threading.Tasks; -using System.Web.Http.Results; using static HH.WCS.QingXigongchang.api.ApiModel; -using static HH.WCS.QingXigongchang.device.OITcpHelper; using Monitor = HH.WCS.QingXigongchang.core.Monitor; namespace HH.WCS.QingXigongchang.process @@ -321,6 +309,7 @@ return result; } + /// <summary> /// 浠诲姟鐘舵�鏇存柊澶勭悊 /// </summary> @@ -397,17 +386,35 @@ //} } + //缁堢偣璐т綅涓�YWLT1TSJCD 鎴栬� YWLT2TSJCD 鐨�瑕佸彇璐у畬鎴愯В閿佽捣鐐癸紝瑙g粦璧风偣锛岀粦瀹氱粓鐐癸紝鍗歌揣瀹屾垚锛岃В閿佺粓鐐� 2025骞�鏈�0鏃� Plg + //if (mst.S_END_LAREA?.Trim() == "YWLT1TSJCD" || mst.S_END_LAREA?.Trim() == "YWLT2TSJCD") + //{ + // //瑙g粦璧风偣 + // CacheBitUpdate(mst, load: true); + // //缁戝畾缁堢偣 + // CacheBitUpdate(mst, load: false); + //} LocationHelper.UnLockLoc(mst.S_START_LOC.Trim()); } //new List<string> { "鎴愬搧婊℃-鍏ュ簱", "" } if (state == 6 || state == 5) { + LogHelper.Info($"浠诲姟绫诲瀷锛歿mst.S_TYPE}- 鍔ㄤ綔锛歿state}. 鏄惁5绠�锛焮mst.S_TYPE.Contains("鎴愬搧婊℃") || mst.S_TYPE.Contains("澶囪揣")} "); if (mst.S_TYPE.Contains("澶囪揣")) { if (state == 6) goto vvv; } - else if (state == 5) goto vvv; + else if (state == 5) + { + ///鍙渶瑕侀噴鏀捐揣浣嶅氨琛屼簡 + //if (mst.S_END_LAREA?.Trim() == "YWLT1TSJCD" || mst.S_END_LAREA?.Trim() == "YWLT2TSJCD") + //{ + // LocationHelper.UnLockLoc(mst.S_END_LOC.Trim()); + // return r; + //} + goto vvv; + } if (mst.S_TYPE.Trim() == "J绌虹摱鍧�鍑哄簱") { @@ -426,7 +433,10 @@ && mst.S_TYPE.Trim() != "鐡剁洊绌虹瓙杞繍-J2" && mst.S_TYPE.Trim() != "闈掓邯绾哥鎼繍鐗╂枡" && !mst.S_TYPE.Trim().Contains("鑷敱鐐瑰鐐�)) + { CacheBitUpdate(mst, load: false, mst.S_NOTE); + } + if (mst.S_TYPE.Trim().Contains("鎴愬搧-绌烘墭涓婄嚎")) { @@ -1406,6 +1416,7 @@ //} else { + if (start == 0) { //bool flag3 = ; @@ -1516,6 +1527,11 @@ } } + //if (Settings.GetDeviceInfoList().Find(x => x.location.Contains(mst.S_END_LOC))?.deviceType == 13 && mst.S_TYPE.Contains("鏀剁缉鑶滃弶杩�)) + //{ + // end = 7027; + //} + LogHelper.Info("SendTask " + mst.S_TASK_NO); Console.WriteLine("start=" + start.ToString()); Console.WriteLine("end= " + end.ToString()); @@ -1593,8 +1609,11 @@ /// <param name="trayCarryCount"></param> /// <param name="priority"></param> /// <returns></returns> - public static bool CreateTransport(string wWorkNo, string start, string end, string taskType, List<string> cntrs, int startLayer, int endLayer, int trayCarryCount = 1, int priority = 1, string note = "") + public static bool CreateTransport(string wWorkNo, string start, string end, string taskType, List<string> cntrs, int startLayer, int endLayer, int trayCarryCount = 1, int priority = 1, string note = "", string TwoEndLoc = "") { + if (string.IsNullOrEmpty(start) || string.IsNullOrEmpty(end)) + return false; + var result = false; //鎵规鍙峰瓨鎵樼洏鍙凤紝1~3涓墭鐩� var trayCodes = string.Join(",", cntrs); @@ -1602,7 +1621,7 @@ LogHelper.Info($"CreateTransport- " + $"{taskNo}-{start}-{end}-{taskType}"); - var res = TaskHelper.CreateTask(wWorkNo, start.Trim(), end.Trim(), taskType, priority, trayCodes, trayCarryCount, startLayer, endLayer, note, lockLoc: true); + var res = TaskHelper.CreateTask(wWorkNo, start.Trim(), end.Trim(), taskType, priority, trayCodes, trayCarryCount, startLayer, endLayer, note, lockLoc: true, TwoEndLoc); if (res) { result = true; -- Gitblit v1.9.1