From 8953f14db850deaf66782197a5d2bff35fe41e1a Mon Sep 17 00:00:00 2001 From: pulg <plg@Haninfo> Date: 星期三, 02 七月 2025 18:02:09 +0800 Subject: [PATCH] Merge branch 'master' of http://121.37.118.194:8000/r/WMSPrjInstance/HH-0014_NongFu_QingXi --- HH.WCS.QingXiNongfu/process/DeviceProcess.cs | 94 ++++++++++++++++++++++++----------------------- 1 files changed, 48 insertions(+), 46 deletions(-) diff --git a/HH.WCS.QingXiNongfu/process/DeviceProcess.cs b/HH.WCS.QingXiNongfu/process/DeviceProcess.cs index 4dfec0b..640d998 100644 --- a/HH.WCS.QingXiNongfu/process/DeviceProcess.cs +++ b/HH.WCS.QingXiNongfu/process/DeviceProcess.cs @@ -1,28 +1,14 @@ -锘縰sing 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 Microsoft.SqlServer.Server; using Newtonsoft.Json; -using NLog.Time; using SqlSugar; using System; -using System.Collections; using System.Collections.Generic; using System.Data; -using System.Diagnostics.Eventing.Reader; using System.Linq; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security.Cryptography; using System.Threading; -using System.Threading.Tasks; -using System.Timers; -using System.Web.Http.Results; -using System.Web.Security; -using System.Web.UI.WebControls; -using static HH.WCS.QingXigongchang.dispatch.NDC; using static HH.WCS.QingXigongchang.util.Settings; namespace HH.WCS.QingXigongchang.process @@ -158,7 +144,6 @@ } } - private static void Analysis13(string data, deviceInfo plc) { //鐢ㄤ簬 鍑哄簱鏃�鏄惁鍙互鐩磋揪 鎻愬崌鏈恒� 00 鍚庨潰杩橀渶澧炲姞閫�枡宸ュ崟澶勭悊銆� @@ -286,6 +271,7 @@ if (!string.IsNullOrEmpty(od.S_ROW)) list.Add(od.S_ROW); ma = string.Join(",", list); + List<LocCntrRel> lcrl = new List<LocCntrRel> { new LocCntrRel @@ -302,7 +288,7 @@ db.Insertable(lcrl).ExecuteCommand(); db.Insertable(new Container { - S_CNTR_CODE=lirl.FirstOrDefault().S_CNTR_CODE, + S_CNTR_CODE = lirl.FirstOrDefault().S_CNTR_CODE, }).ExecuteCommand(); db.Updateable(_cl).UpdateColumns(x => new { x.N_CURRENT_NUM }).ExecuteCommand(); }); @@ -326,7 +312,7 @@ si = "0"; } - else if (data.Contains("11") && (ods.Find(x => x.SQL_PLineNo.Contains("绾哥")) != null || plc.deviceName.Contains("T1"))) + if (data.Contains("11"))// && (ods.Find(x => x.SQL_PLineNo.Contains("绾哥")) != null || plc.deviceName.Contains("T1")) { //if (!ods.Any()) // return; @@ -334,17 +320,31 @@ if (_cl.N_CURRENT_NUM > 0 || _clrel.Any()) { LogHelper.Info($" time锛歿_clrel0?.T_CREATE} = s_type锛歿_clrel0.S_TYPE}"); + //if (DateTime.Now.Subtract(_clrel0.T_CREATE).TotalSeconds < 10 || !string.IsNullOrEmpty(_clrel0.S_TYPE)) + // goto ballll; + //plg 2025骞�鏈�3鏃� 鍘婚櫎10绉掓椂闂撮檺鍒� if (_clrel.Any()) - if (DateTime.Now.Subtract(_clrel0.T_CREATE).TotalSeconds < 10 || !string.IsNullOrEmpty(_clrel0.S_TYPE)) - goto ballll; - - LocationHelper.DoAction(db => { - db.Deleteable(_clrel).ExecuteCommand(); - _cl.N_CURRENT_NUM = 0; - return db.Updateable(_cl).UpdateColumns(x => new { x.N_CURRENT_NUM }).ExecuteCommand() > 0; - }); + if (od?.SQL_PLineNo == "T1鎻愬崌鏈�) + { + if (!string.IsNullOrEmpty(_clrel0.S_TYPE)) + goto ballll; + } + else + { + if (DateTime.Now.Subtract(_clrel0.T_CREATE).TotalSeconds < 3 || !string.IsNullOrEmpty(_clrel0.S_TYPE)) + goto ballll; + } + } + LocationHelper.DoAction(db => + { + db.Deleteable(_clrel).ExecuteCommand(); + _cl.N_CURRENT_NUM = 0; + return db.Updateable(_cl).UpdateColumns(x => new { x.N_CURRENT_NUM }).ExecuteCommand() > 0; + }); } + if (!plc.deviceName.Contains("T1")) + goto ballll; else if (!plc.deviceName.Contains("姘寸嚎鏍囩")) { LogHelper.Info(_cl.S_LOC_CODE + $"璐т綅 鎵捐捣鐐�); @@ -376,8 +376,10 @@ if (sBit != null) { var sign = Settings.GetTimeStamp(); - var res = TaskProcess.CreateTransport(sign, sBit.S_LOC_CODE, _cl.S_LOC_CODE, "鍘熺墿鏂欐惉杩�绾哥", new List<string> { _clrel.FirstOrDefault().S_CNTR_CODE }, sBit.N_CURRENT_NUM, 1, 1, 50);///, EdnRarea == "YWLYLTKQ" ? _clrel0.S_TYPE : ""); + var res = TaskProcess.CreateTransport(sign, sBit.S_LOC_CODE, _cl.S_LOC_CODE, "鍘熺墿鏂欐惉杩�绾哥", new List<string> { _clrel.FirstOrDefault().S_CNTR_CODE }, sBit.N_CURRENT_NUM, 1, 1, 60);///, EdnRarea == "YWLYLTKQ" ? _clrel0.S_TYPE : ""); LogHelper.Info($"鍘熺墿鏂欐惉杩�涓婃彁鍗囨満銆�{sign} 浠诲姟 锛屽垱寤簕res} "); + //var res = TaskProcess.CreateTransport(sign, sBit.S_LOC_CODE, _cl.S_LOC_CODE, "鍘熺墿鏂欐惉杩�绾哥", new List<string> { _clrel.FirstOrDefault().S_CNTR_CODE }, sBit.N_CURRENT_NUM, 1, 1, 50);///, EdnRarea == "YWLYLTKQ" ? _clrel0.S_TYPE : ""); + //LogHelper.Info($"鍘熺墿鏂欐惉杩�涓婃彁鍗囨満銆�{sign} 浠诲姟 锛屽垱寤簕res} "); } } } @@ -2718,7 +2720,6 @@ //灏辨煡鐪嬫湁娌℃湁绌虹殑鎺掍簡銆� //if (endBit != null) /// 瀵绘壘鏈弧鎺掞紝 鐩存帴杩斿洖缁撴灉銆� return endBit; - //LogHelper.Info(" _tempList over锛�); //杩欓噷寮� 瀵绘壘绌烘帓 Empty: @@ -3489,26 +3490,27 @@ } if (endBit == null && _tempList.Any()) { - LogHelper.Info(" ar_RplaceRow over锛�); - var ar_RplaceRows = LocationHelper.GetLocList(x => x.S_AREA_CODE != area1 && x.S_AREA_CODE.Contains(are) && x.S_LOCK_STATE != "鎶ュ簾");//.Select(x => x.N_ROW).Distinct(); - //var ar_RplaceRow1 = ar_RplaceRows.FindAll(x => x.S_LOCK_STATE != "鏃�).Select(x => x.N_ROW).Distinct(); - IEnumerable<int> ar_RplaceRow1 = ar_RplaceRows.FindAll(x => "鍏ュ簱閿�鍑哄簱閿�.Contains(x.S_LOCK_STATE?.Trim())).Select(x => x.N_ROW).Distinct(); - LogHelper.Info(" 鏈夐攣鎺�- " + JsonConvert.SerializeObject(ar_RplaceRow1)); //LogHelper.Info(" 鏈夐攣鎺�- " + JsonConvert.SerializeObject(ar_RplaceRow1)); - var ar_RplaceRow2 = ar_RplaceRows.FindAll(x => x.N_CURRENT_NUM > 0).Select(x => x.N_ROW).Distinct(); - LogHelper.Info(" 鏈夎揣鎺掞細 - " + JsonConvert.SerializeObject(ar_RplaceRow2)); - var ar_RplaceRow_rowlock = LocationHelper.GetRowLock(x => x.S_AREA_CODE.Contains(are))?.Select(x => x.N_ROW); + LogHelper.Info(" ar_RplaceRow over锛� + JsonConvert.SerializeObject(_tempList.Select(x => x.N_ROW).Distinct())); + //var ar_RplaceRows = LocationHelper.GetLocList(x => x.S_AREA_CODE != area1 && x.S_AREA_CODE.Contains(are) && x.S_LOCK_STATE != "鎶ュ簾");//.Select(x => x.N_ROW).Distinct(); + // //var ar_RplaceRow1 = ar_RplaceRows.FindAll(x => x.S_LOCK_STATE != "鏃�).Select(x => x.N_ROW).Distinct(); + //IEnumerable<int> ar_RplaceRow1 = ar_RplaceRows.FindAll(x => "鍏ュ簱閿�鍑哄簱閿�.Contains(x.S_LOCK_STATE?.Trim())).Select(x => x.N_ROW).Distinct(); + //LogHelper.Info(" 鏈夐攣鎺�- " + JsonConvert.SerializeObject(ar_RplaceRow1)); //LogHelper.Info(" 鏈夐攣鎺�- " + JsonConvert.SerializeObject(ar_RplaceRow1)); + //var ar_RplaceRow2 = ar_RplaceRows.FindAll(x => x.N_CURRENT_NUM > 0).Select(x => x.N_ROW).Distinct(); + //LogHelper.Info(" 鏈夎揣鎺掞細 - " + JsonConvert.SerializeObject(ar_RplaceRow2)); + //var ar_RplaceRow_rowlock = LocationHelper.GetRowLock(x => x.S_AREA_CODE.Contains(are))?.Select(x => x.N_ROW); - var ar_RplaceRow = ar_RplaceRow1.Concat(ar_RplaceRow2).Concat(ar_RplaceRow_rowlock).Distinct(); + //var ar_RplaceRow = ar_RplaceRow1.Concat(ar_RplaceRow2).Concat(ar_RplaceRow_rowlock).Distinct(); - if (ar_RplaceRow.Any()) - { - LogHelper.Info("鎺掗櫎闈炵┖鎺�- " + JsonConvert.SerializeObject(ar_RplaceRow)); - _tempList.RemoveAll(x => ar_RplaceRow.Contains(x.N_ROW)); - } - if (_tempList.Any())//涓変釜搴撳尯鐨勪氦闆嗙┖鎺�- { - endBit = _tempList.OrderBy(x => x.N_ROW).ThenBy(x => x.N_COL).FirstOrDefault(); - } + //if (ar_RplaceRow.Any()) + //{ + // LogHelper.Info("鎺掗櫎闈炵┖鎺�- " + JsonConvert.SerializeObject(ar_RplaceRow)); + // _tempList.RemoveAll(x => ar_RplaceRow.Contains(x.N_ROW)); + //} + //if (_tempList.Any())//涓変釜搴撳尯鐨勪氦闆嗙┖鎺�+ //{ + // endBit = _tempList.OrderBy(x => x.N_ROW).ThenBy(x => x.N_COL).FirstOrDefault(); + //} + endBit = _tempList.OrderBy(x => x.N_ROW).ThenBy(x => x.N_COL).FirstOrDefault(); } #endregion -- Gitblit v1.9.1