From 8d81b36f73525683c4b74a5e2661a1d54894450e Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Wed, 8 Jan 2025 17:42:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WCS.BLL/DbModels/ShelfInfo.cs | 26 +++---------------- WCS.BLL/HardWare/SmartShelf.cs | 13 +--------- WCS.BLL/Manager/ShelfManager.cs | 27 +------------------- WCS.BLL/Manager/TCPClientManager.cs | 6 +---- WCS.BLL/Services/Service/StoreInfoService.cs | 5 ---- 5 files changed, 7 insertions(+), 70 deletions(-) diff --git a/WCS.BLL/DbModels/ShelfInfo.cs b/WCS.BLL/DbModels/ShelfInfo.cs index 9753562..f26872e 100644 --- a/WCS.BLL/DbModels/ShelfInfo.cs +++ b/WCS.BLL/DbModels/ShelfInfo.cs @@ -11,7 +11,6 @@ namespace WCS.DAL.DbModels [SugarTable("wcs_shelf_info")] public class ShelfInfo { - /// /// 主键 自增Id /// @@ -19,34 +18,17 @@ namespace WCS.DAL.DbModels public int Id { get; set; } /// - /// 货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架 + /// 货架编码 /// - [SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码;货架一般按照报警灯来区分 一个报警灯指示的是一个货架")] + [SugarColumn(ColumnName = "shelf_code", Length = 50, IsNullable = false, ColumnDescription = "货架编码")] public string ShelfCode { get; set; } - /// - /// 货架类型Id - /// - [SugarColumn(ColumnName = "shelf_type_id", IsNullable = false, ColumnDescription = "货架类型Id")] - public int ShelfTypeId { get; set; } - /// /// 货架类型名称 /// - [SugarColumn(ColumnName = "shelf_type_name", Length = 50, IsNullable = false, ColumnDescription = "货架类型名称")] - public string ShelfTypeName { get; set; } + [SugarColumn(ColumnName = "shelf_type", Length = 50, IsNullable = false, ColumnDescription = "货架类型")] + public string ShelfType { get; set; } - /// - /// 货架当前状态 - /// - [SugarColumn(ColumnName = "current_mode", IsNullable = false, ColumnDescription = "货架当前状态")] - public Mode CurrentMode { get; set; } - - /// - /// 货架设置当前模式的时间 - /// - [SugarColumn(ColumnName = "set_current_mode_time", IsNullable = true, ColumnDescription = "设置货架当前模式的时间")] - public DateTime SetCurrentModeTime { get; set; } /// /// 货架行数 diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs index bc5f9b8..ecfaf03 100644 --- a/WCS.BLL/HardWare/SmartShelf.cs +++ b/WCS.BLL/HardWare/SmartShelf.cs @@ -911,18 +911,7 @@ namespace WCS.BLL.HardWare public void SetCurrentMode(Mode mode) { - this.CurrentMode = mode; - this.SetCurrentModeTime = DateTime.Now; - Task.Run(() => - { - var shelf = DbHelp.db.Queryable().Where(t => t.Id == ShelfId).First(); - if (shelf != null) - { - shelf.CurrentMode = mode; - shelf.SetCurrentModeTime = SetCurrentModeTime; - DbHelp.db.Updateable(shelf).ExecuteCommand(); - } - }); + } void IShelfBase.Warning() diff --git a/WCS.BLL/Manager/ShelfManager.cs b/WCS.BLL/Manager/ShelfManager.cs index 7d42a2b..cabe4d1 100644 --- a/WCS.BLL/Manager/ShelfManager.cs +++ b/WCS.BLL/Manager/ShelfManager.cs @@ -37,32 +37,7 @@ namespace WCS.BLL.Manager public static IShelfBase InitShelf(ShelfInfo shelfInDb) { - switch (shelfInDb.ShelfTypeId) - { - case 1: - return new SmartShelf(shelfInDb) - { - ShelfId = shelfInDb.Id, - ShelfCode = shelfInDb.ShelfCode, - GroupName = shelfInDb.GroupName, - }; - case 2: - return new SingleLightShelf(shelfInDb) - { - ShelfId = shelfInDb.Id, - ShelfCode = shelfInDb.ShelfCode, - GroupName = shelfInDb.GroupName, - }; - case 3: - return new SmartShelf(shelfInDb) - { - ShelfId = shelfInDb.Id, - ShelfCode = shelfInDb.ShelfCode, - GroupName = shelfInDb.GroupName, - }; - default: - return null; - } + return null; } } } diff --git a/WCS.BLL/Manager/TCPClientManager.cs b/WCS.BLL/Manager/TCPClientManager.cs index 8a6a228..8497fd7 100644 --- a/WCS.BLL/Manager/TCPClientManager.cs +++ b/WCS.BLL/Manager/TCPClientManager.cs @@ -32,7 +32,7 @@ namespace WCS.BLL.Manager .Select(t => new { IP = t.ClientIp, - ShelfTypeName = t.ShelfTypeName, + ShelfTypeName = t.ShelfType, Port = t.Port, }) .Distinct() @@ -220,10 +220,6 @@ namespace WCS.BLL.Manager var shelfInfo = DbHelp.db.Queryable().Where(t => t.ClientIp == tcpClient.RemoteIPHost).ToList(); if (shelfInfo.Count != 0) { - if (shelfInfo[0].ShelfTypeName == "信息化货架") - { - return; - } } Task.Run(() => diff --git a/WCS.BLL/Services/Service/StoreInfoService.cs b/WCS.BLL/Services/Service/StoreInfoService.cs index 30aa8dc..433cedb 100644 --- a/WCS.BLL/Services/Service/StoreInfoService.cs +++ b/WCS.BLL/Services/Service/StoreInfoService.cs @@ -30,7 +30,6 @@ namespace WCS.BLL.Services.Service try { var recordsQueryable = DbHelp.db.Queryable() - .WhereIF(request.ShelfTypeId != 0, t => t.ShelfTypeId == request.ShelfTypeId) .WhereIF(!string.IsNullOrEmpty(request.ShelfCode), t => t.ShelfCode.Contains(request.ShelfCode)); var totalCount = await recordsQueryable.CountAsync(); @@ -101,8 +100,6 @@ namespace WCS.BLL.Services.Service else { shelfnfo.ShelfCode = request.ShelfInfo.ShelfCode; - shelfnfo.ShelfTypeId = request.ShelfInfo.ShelfTypeId; - shelfnfo.ShelfTypeName = request.ShelfInfo.ShelfTypeName; shelfnfo.Rowcounts = request.ShelfInfo.Rowcounts; shelfnfo.Columncounts = request.ShelfInfo.Columncounts; shelfnfo.LightId = request.ShelfInfo.LightId; @@ -148,8 +145,6 @@ namespace WCS.BLL.Services.Service var newShelfInfo = new ShelfInfo() { ShelfCode = request.ShelfInfo.ShelfCode, - ShelfTypeId = request.ShelfInfo.ShelfTypeId, - ShelfTypeName = request.ShelfInfo.ShelfTypeName, Rowcounts = request.ShelfInfo.Rowcounts, Columncounts = request.ShelfInfo.Columncounts, LightId = request.ShelfInfo.LightId,