From e197c32f52f0766aee5027320e8af2bd2e3cbe8b Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Fri, 1 Nov 2024 10:10:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E6=97=A0=E6=B3=95=E6=B8=85?= =?UTF-8?q?=E7=90=86=E7=8A=B6=E6=80=81!!!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WCS.BLL/HardWare/SmartShelf.cs | 6 ++++-- WCS.BLL/Services/Service/SingleLightService.cs | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs index be74e18..a8d6cca 100644 --- a/WCS.BLL/HardWare/SmartShelf.cs +++ b/WCS.BLL/HardWare/SmartShelf.cs @@ -994,7 +994,7 @@ namespace WCS.BLL.HardWare ExceptionMessages.Add($"模组{item.ModuleCode}未响应自检!"); } //通信校验 - var messages = notReturnList.Select(t => $"模组{t.ModuleCode}未响应自检!").ToList(); + var messages = notReturnList.Select(t => $"模组{t.ModuleCode}({t.CurrentMode})未响应自检!").ToList(); var exceptionMessage = string.Join("\r\n", messages); var warningModel = new WebSocketMessageModel() { @@ -2240,7 +2240,9 @@ namespace WCS.BLL.HardWare public void ResetReturnProcess(byte[] data, int boardId, int lightNumber) { - var module = this.Modules.Where(t => t.BoardId == boardId && t.CurrentMode == Mode.入库模式).FirstOrDefault(); + var module = this.Modules + .Where(t => t.BoardId == boardId) + .FirstOrDefault(); if (module == null) { return; diff --git a/WCS.BLL/Services/Service/SingleLightService.cs b/WCS.BLL/Services/Service/SingleLightService.cs index 49724d4..922f886 100644 --- a/WCS.BLL/Services/Service/SingleLightService.cs +++ b/WCS.BLL/Services/Service/SingleLightService.cs @@ -42,12 +42,13 @@ namespace WCS.BLL.Services.Service Message = "操作失败:没有需要控制的库位", }; } - //对应库位 + //库位编码去重 var storeCodes = request.StoreList.Select(t => t.StoreCode) .Distinct() .ToList(); - var stores = DbHelp.db.Queryable().Where(t => storeCodes.Contains(t.StoreCode)) - .ToList(); + var stores = DbHelp.db.Queryable() + .Where(t => storeCodes.Contains(t.StoreCode)) + .ToList(); if (stores == null || stores.Count == 0) { return new ResponseCommon @@ -61,10 +62,11 @@ namespace WCS.BLL.Services.Service var shelfIds = stores.Select(t => t.ShelfId).Distinct().ToList(); var shelfs = DbHelp.db.Queryable().Where(t => shelfIds.Contains(t.Id)) .ToList(); + //对应模组信息 var moduleIds = stores.Select(t => t.ModuleId).Distinct().ToList(); var modules = DbHelp.db.Queryable().Where(t => moduleIds.Contains(t.Id)) - .ToList(); + .ToList(); //加载请求参数中的库位灯 板子ID和货架ID foreach (var store in request.StoreList)