diff --git a/WCS.BLL/Config/LocalStatic.cs b/WCS.BLL/Config/LocalStatic.cs new file mode 100644 index 0000000..fc33ce1 --- /dev/null +++ b/WCS.BLL/Config/LocalStatic.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WCS.BLL.Config +{ + public static class LocalStatic + { + /// + /// 0x02绿色 0x04蓝色 + /// + public static byte CurrentOutStoreColor = 0x02; + } +} diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs index 1f392d6..68957a2 100644 --- a/WCS.BLL/HardWare/SmartShelf.cs +++ b/WCS.BLL/HardWare/SmartShelf.cs @@ -1496,6 +1496,9 @@ namespace WCS.BLL.HardWare if (outOrderMatDetails != null && outOrderMatDetails.Count > 0) { + //相邻物料亮不同颜色 这里绿色和蓝色互相切换 + LocalStatic.CurrentOutStoreColor = LocalStatic.CurrentOutStoreColor == (byte)0x02 ? (byte)0x04 : (byte)0x02; + //存在待出库 然后之前又没亮灯的情况 => 继续分批次亮灯 Logs.Write($"发料单{OrderNumber},还有物料未出!", LogsType.Outstore); var outOrderDetailCount = outOrderMatDetails.GroupBy(t => t.MatCode) diff --git a/WCS.BLL/HardWare/SmartShelfModule.cs b/WCS.BLL/HardWare/SmartShelfModule.cs index 3c3dd81..fcbd6f5 100644 --- a/WCS.BLL/HardWare/SmartShelfModule.cs +++ b/WCS.BLL/HardWare/SmartShelfModule.cs @@ -5,6 +5,7 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading.Tasks; using TouchSocket.Core; +using WCS.BLL.Config; using WCS.DAL.Db; using WCS.DAL.DbModels; @@ -235,6 +236,15 @@ namespace WCS.BLL.HardWare var data4 = outDataStr.Substring(0, 8); GoInOutstoreModeData[3] = Convert.ToByte(data3, 2); GoInOutstoreModeData[4] = Convert.ToByte(data4, 2); + + if (LocalFile.Config.IsSameMatCodeOut) + { + GoInOutstoreModeData[5] = LocalStatic.CurrentOutStoreColor; + } + else + { + GoInOutstoreModeData[5] = 0x02; + } } tcpClient.Send(tcpClient.GenerateMessage(BoardId, GoInOutstoreModeData)); } diff --git a/WCS.BLL/Services/Service/OutstoreService.cs b/WCS.BLL/Services/Service/OutstoreService.cs index eb4a440..ef0ac61 100644 --- a/WCS.BLL/Services/Service/OutstoreService.cs +++ b/WCS.BLL/Services/Service/OutstoreService.cs @@ -679,6 +679,9 @@ namespace WCS.BLL.Services.Service //看是否是分批次出库的情况 分批次亮灯 if (LocalFile.Config.IsSameMatCodeOut) { + //最先亮的颜色为绿色 + LocalStatic.CurrentOutStoreColor = 0x02; + var outOrderDetailCount = outOrderMatDetails.GroupBy(t => t.MatCode) .Select(o => new { count = o.Count(), bb = o }) .Where(o => o.count >= 2) diff --git a/WCS.BLL/Services/Service/StoreInfoService.cs b/WCS.BLL/Services/Service/StoreInfoService.cs index 5dde99b..a4e0c4c 100644 --- a/WCS.BLL/Services/Service/StoreInfoService.cs +++ b/WCS.BLL/Services/Service/StoreInfoService.cs @@ -54,7 +54,6 @@ namespace WCS.BLL.Services.Service Lists = records.ToList() } }; - } catch (Exception ex) { diff --git a/WCS.WebApi/LocalStatic.cs b/WCS.WebApi/LocalStatic.cs deleted file mode 100644 index 5bfa45d..0000000 --- a/WCS.WebApi/LocalStatic.cs +++ /dev/null @@ -1,9 +0,0 @@ -using WCS.BLL; - -namespace WCS.WebApi -{ - public static class LocalStatic - { - - } -}