diff --git a/WCS.BLL/Config/JsConfig.cs b/WCS.BLL/Config/JsConfig.cs index 83b67ab..b5905a9 100644 --- a/WCS.BLL/Config/JsConfig.cs +++ b/WCS.BLL/Config/JsConfig.cs @@ -39,6 +39,8 @@ namespace WCS.BLL.Config public string? WMSUrl { get; set; } public bool IsResetDBOrTable { get; set; } + + public int InstoreTimeOut { get; set; } = 5000; #region 盟讯公司后台配置 public bool IsMx { get; set; } /// diff --git a/WCS.BLL/DbModels/AppVersion.cs b/WCS.BLL/DbModels/AppVersion.cs new file mode 100644 index 0000000..e062c6b --- /dev/null +++ b/WCS.BLL/DbModels/AppVersion.cs @@ -0,0 +1,46 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WCS.Model.ApiModel.OutStore; + +namespace WCS.BLL.DbModels +{ + [SugarTable("wcs_app_version")] + public class AppVersion + { + /// + /// 主键 自增Id + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsNullable = false, IsIdentity = true)] + public int Id { get; set; } + + /// + /// APP文件名称 + /// + [SugarColumn(ColumnName = "app_name", Length = 100, IsNullable = false, ColumnDescription = "APP文件名称")] + public string AppName { get; set; } + + /// + /// 版本号 + /// + [SugarColumn(ColumnName = "version", Length = 100, IsNullable = false, ColumnDescription = "版本号")] + public string Version { get; set; } + + + /// + /// 更新内容 + /// + [SugarColumn(ColumnName = "content", Length = 250, IsNullable = true, ColumnDescription = "更新内容")] + public string Content { get; set; } + + + /// + /// 操作时间 + /// + [SugarColumn(ColumnName = "operate_time", IsNullable = false, ColumnDescription = "操作时间")] + public DateTime OperateTime { get; set; } = DateTime.Now; + } +} diff --git a/WCS.BLL/DbModels/ShelfInfo.cs b/WCS.BLL/DbModels/ShelfInfo.cs index 8448f0b..9753562 100644 --- a/WCS.BLL/DbModels/ShelfInfo.cs +++ b/WCS.BLL/DbModels/ShelfInfo.cs @@ -72,6 +72,18 @@ namespace WCS.DAL.DbModels [SugarColumn(ColumnName = "client_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应Can模块的Ip")] public string ClientIp { get; set; } + /// + /// 连接Can模块的端口号 + /// + [SugarColumn(ColumnName = "port", Length = 50, IsNullable = true, ColumnDescription = "连接Can模块的端口号")] + public string Port { get; set; } + + /// + /// 货架对应后端的Ip + /// + [SugarColumn(ColumnName = "server_ip", Length = 50, IsNullable = false, ColumnDescription = "货架对应后端服务的Ip")] + public string ServerIp { get; set; } + /// /// 货架的组别、区域(区分单个软件管哪些货架的,前端的配置文件配置一个组别,查询时只显示当前组别的货架) /// diff --git a/WCS.BLL/HardWare/IShelfBase.cs b/WCS.BLL/HardWare/IShelfBase.cs index 5be1182..af7a266 100644 --- a/WCS.BLL/HardWare/IShelfBase.cs +++ b/WCS.BLL/HardWare/IShelfBase.cs @@ -66,6 +66,8 @@ namespace WCS.BLL.HardWare public string GroupName { get; set; } public string WebSocketIpAddress { get; set; } + + public string? CurrentCom { get; set; } /// /// 模组 /// diff --git a/WCS.BLL/HardWare/SingleLightShelf.cs b/WCS.BLL/HardWare/SingleLightShelf.cs index 3e72e0c..ae8ea0e 100644 --- a/WCS.BLL/HardWare/SingleLightShelf.cs +++ b/WCS.BLL/HardWare/SingleLightShelf.cs @@ -4,6 +4,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using WCS.BLL.DbModels; +using WCS.BLL.Manager; +using WCS.DAL.Db; +using WCS.DAL.DbModels; using WCS.Model; using static WCS.BLL.HardWare.WarningLight; @@ -11,26 +14,40 @@ namespace WCS.BLL.HardWare { public class SingleLightShelf : IShelfBase { - public int ShelfId { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string ShelfCode { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public int RowCounts { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public int ColumnCounts { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public Mode CurrentMode { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string ModulesStr { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string GroupName { get; set; } - public MatInfoResponse InStoreData { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public SingleLightShelf(ShelfInfo shelfInfo) + { + ShelfId = shelfInfo.Id; + ShelfCode = shelfInfo.ShelfCode; + RowCounts = shelfInfo.Rowcounts; + ColumnCounts = shelfInfo.Columncounts; + SetCurrentMode(Mode.待机模式); + ClientIp = shelfInfo.ClientIp; + LightId = shelfInfo.LightId; + } + public int ShelfId { get; set; } + public string ShelfCode { get; set; } + public int RowCounts { get; set; } + public int ColumnCounts { get; set; } + public Mode CurrentMode { get; set; } + public string ModulesStr { get; set; } + public string GroupName { get; set; } + public MatInfoResponse InStoreData { get; set; } + public string? CurrentCom { get; set; } = string.Empty; public string OrderNumber { get; set; } public int LightId { get; set; } public LightColorEnum LightColor { get; set; } - public List ModuleIds { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string ClientIp { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public List ExceptionMessages { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public bool IsWarning { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public string WebSocketIpAddress { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } - public List Modules { get => throw new NotImplementedException(); set => throw new NotImplementedException(); } + public List ModuleIds { get; set; } + public string ClientIp { get; set; } + public List ExceptionMessages { get; set; } + public bool IsWarning { get; set; } + public string WebSocketIpAddress { get; set; } + + public List Modules { get; set; } = new List(); public DateTime SetCurrentModeTime { get; set; } + public TCPClient TcpCleint { get { return TCPClientManager.GetTCPClientByIPHost(ClientIp); } } + public bool ConfirmStocktakingSingle(int BoardId, int LightNumber) { throw new NotImplementedException(); diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs index 664e485..4c02971 100644 --- a/WCS.BLL/HardWare/SmartShelf.cs +++ b/WCS.BLL/HardWare/SmartShelf.cs @@ -56,6 +56,7 @@ namespace WCS.BLL.HardWare public int RowCounts { get; set; } public int ColumnCounts { get; set; } public Mode CurrentMode { get; set; } + public DateTime SetCurrentModeTime { get; set; } public string ModulesStr { get; set; }//当前货架所有模组的Str public string GroupName { get; set; } @@ -95,7 +96,6 @@ namespace WCS.BLL.HardWare /// public List ProcessingExceptions { get; set; } = new List(); public string? CurrentCom { get; set; } = string.Empty; - //TODO 退出入库清除 public MatInfoResponse InStoreData { get; set; } @@ -119,6 +119,7 @@ namespace WCS.BLL.HardWare { try { + Logs.Write($"[GoInInstore IPAddress]{IPAddress}", LogsType.Instore); if (this.CurrentMode == Mode.入库模式) { CurrentCom = IPAddress; @@ -217,6 +218,7 @@ namespace WCS.BLL.HardWare WarningLight.BlueLight(TcpCleint); //绑定当前进入入库PDA/WCS前端的IP CurrentCom = IPAddress; + Logs.Write($"[GoInInstore CurrentCom]{CurrentCom}", LogsType.Instore); //返回成功 return; } @@ -866,6 +868,15 @@ namespace WCS.BLL.HardWare } } + public void CalibrationSetOffset(int moduleId, int offSet) + { + var moudle = Modules.Where(t => t.ModuleId == moduleId).First(); + if (moudle != null) + { + moudle.CalibrationSetOffset(offSet, TcpCleint); + } + } + public void SetCurrentMode(Mode mode) { this.CurrentMode = mode; @@ -891,11 +902,62 @@ namespace WCS.BLL.HardWare { try { - OrderNumber = "自检中..."; + if (CurrentMode == Mode.待机模式) + OrderNumber = "自检中..."; foreach (var module in Modules.Where(t => t.IsEnable).ToList()) { + module.IsSelfCheck = true; module.ShelfCheck(TcpCleint); } + + //状态校验 自检模式未响应 + Task.Run(() => + { + var timeOut = 3000; + var timeSpan = TimeSpan.FromMilliseconds(0); + var beginTime = DateTime.Now; + while (timeSpan <= TimeSpan.FromMilliseconds(timeOut)) + { + timeSpan = DateTime.Now - beginTime; + //所有板子成功进入入库模式 表示进入入库模式成功,跳出循环 + var isSelfChecking = Modules.Where(t => t.IsSelfCheck) + .Where(t => t.IsEnable) + .Any(); + if (!isSelfChecking) + { + break; + } + //循环延时处理 + Thread.Sleep(50); + } + + var notReturnList = Modules.Where(t => t.IsSelfCheck) + .Where(t => t.IsEnable).ToList(); + + if (notReturnList.Count > 0) + { + Logs.Write($"货架{ShelfCode}存在模组自检未响应:", LogsType.Instore); + foreach (var item in notReturnList) + { + ExceptionMessages.Add($"模组{item.ModuleCode}未响应自检!"); + } + //通信校验 + var messages = notReturnList.Select(t => $"模组{t.ModuleCode}未响应自检!").ToList(); + var exceptionMessage = string.Join("\r\n", messages); + var warningModel = new WebSocketMessageModel() + { + IsWarning = false, + WarningType = WarningTypeEnum.自检未响应, + StoreId = 0, + StoreCode = "", + ShelfCode = ShelfCode, + ShelfId = ShelfId, + WarningMessage = exceptionMessage, + ClientIp = WebSocketIpAddress, + }; + WarningManager.SendWarning(warningModel); + } + }); } catch (Exception ex) { @@ -903,7 +965,8 @@ namespace WCS.BLL.HardWare } finally { - OrderNumber = string.Empty; + if (CurrentMode == Mode.待机模式) + OrderNumber = string.Empty; } } #endregion @@ -1211,7 +1274,6 @@ namespace WCS.BLL.HardWare if (storeInfo == null) { - //TODO 报错 return; } @@ -1219,7 +1281,6 @@ namespace WCS.BLL.HardWare .FirstOrDefault(); if (module == null) { - //TODO 报错 return; } @@ -1261,7 +1322,7 @@ namespace WCS.BLL.HardWare { module.ComfirmErrInstore(TcpCleint); WarningLight.WaringLightBlueEnd(TcpCleint); - //TO DO Logs.Write($"[{guid}]该位置已放置物料!"); + Logs.Write($"{storeInfo.StoreCode}该位置已放置物料!", LogsType.Instore); return; } #endregion @@ -1293,7 +1354,7 @@ namespace WCS.BLL.HardWare MatSupplier = this.InStoreData.supplier, InstoreTime = DateTime.Now, - InstoreUser = "" + InstoreUser = this.InStoreData.InstoreUser, }; //出入库记录表 @@ -1367,9 +1428,10 @@ namespace WCS.BLL.HardWare .Where(t => t.ShelfId == ShelfId) .Where(t => t.BoardId == boardId && t.LightNumber == lightNumber) .First(); + //库位未找到 if (storeInfo == null) { - //TO DO 库位未找到 + Logs.Write($"【InStoreExceptionReturnProcess】boardId:{boardId},lightNumber{lightNumber},库位未找到 ", LogsType.Instore); return; } //已放物料丢失了 物料多放了 储位恢复正常 @@ -1421,6 +1483,8 @@ namespace WCS.BLL.HardWare }; WarningManager.SendWarning(warningModel); + WarningLight.WaringLightAlwaysRed(TcpCleint); + ProcessingExceptions.Add(new ProcessingExceptionType() { BoardId = boardId, @@ -1446,6 +1510,8 @@ namespace WCS.BLL.HardWare }; WarningManager.SendWarning(warningModel); + WarningLight.WaringLightAlwaysRed(TcpCleint); + ProcessingExceptions.Add(new ProcessingExceptionType() { BoardId = boardId, @@ -1651,6 +1717,7 @@ namespace WCS.BLL.HardWare var orderMatDetails = DbHelp.db.Queryable() .Where(t => t.OrderId == CurrentOutOrder.Id) .Where(t => t.MatSN == inventoryDetail.MatSN) + .Where(t => t.IsSended == false) .First(); if (orderMatDetails == null) @@ -2030,7 +2097,9 @@ namespace WCS.BLL.HardWare WarningMessage = exceptionMessage, ClientIp = WebSocketIpAddress, }; + WarningManager.SendWarning(warningModel); + WarningLight.WaringLightAlwaysRed(TcpCleint); ProcessingExceptions.Add(new ProcessingExceptionType() { @@ -2055,7 +2124,9 @@ namespace WCS.BLL.HardWare WarningMessage = exceptionMessage, ClientIp = WebSocketIpAddress }; + WarningManager.SendWarning(warningModel); + WarningLight.WaringLightAlwaysRed(TcpCleint); ProcessingExceptions.Add(new ProcessingExceptionType() { @@ -2182,6 +2253,16 @@ namespace WCS.BLL.HardWare public void SelfCheckProcess(byte[] data, int boardId, int lightNumber) { + var module = this.Modules.Where(t => t.BoardId == boardId).FirstOrDefault(); + if (module == null) + { + return; + } + else + { + module.IsSelfCheck = false; + } + if (data[TcpCleint.PreFixLength + 3] == 0x01) { //比对结果相同 diff --git a/WCS.BLL/HardWare/SmartShelfModule.cs b/WCS.BLL/HardWare/SmartShelfModule.cs index 8f2e73d..5720228 100644 --- a/WCS.BLL/HardWare/SmartShelfModule.cs +++ b/WCS.BLL/HardWare/SmartShelfModule.cs @@ -75,20 +75,33 @@ namespace WCS.BLL.HardWare /// public byte[] VoltageSingleData = { 0x17, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /// - /// 电压偏移值 + /// 查询电压偏移值 /// public byte[] OffsetSingleData = { 0x18, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; /// - /// 电压标准值 + /// 查询电压标准值 /// public byte[] StandardSingleData = { 0x19, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + + /// + /// 标定 + /// + public byte[] CalibrationData = { 0x0D, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + /// + /// 设置偏移量 01 F4 = 500 + /// + public byte[] SetOffsetData = { 0x0E, 0x0A, 0x01, 0xF4, 0x00, 0x00, 0x00, 0x00 }; + #endregion public int ModuleId { get; set; } public string ModuleCode { get; set; } public int BoardId { get; set; } public bool IsEnable { get; set; } public Mode CurrentMode { get; set; } - + /// + /// 是否已发送自检命令 + /// + public bool IsSelfCheck { get; set; } = false; public List CurrentOutSns { get; set; } public List CurrentStockTakingSns { get; set; } @@ -197,7 +210,7 @@ namespace WCS.BLL.HardWare /// public void GoInOutStoreMode(TCPClient tcpClient, List outSns) { - Logs.Write($"模组{ModuleCode},本次亮灯物料{string.Join(",",outSns)}", LogsType.Outstore); + Logs.Write($"模组{ModuleCode},本次亮灯物料{string.Join(",", outSns)}", LogsType.Outstore); CurrentOutSns = outSns; var storeInfos = DbHelp.db.Queryable().Where(t => t.ModuleId == ModuleId) .Where(t => t.BoardId == BoardId) @@ -408,5 +421,25 @@ namespace WCS.BLL.HardWare tcpClient.Send(tcpClient.GenerateMessage(BoardId, OffsetSingleData)); }); } + + public void CalibrationSetOffset(int offSet, TCPClient tcpClient) + { + var offSetData = BitConverter.GetBytes(unchecked((short)offSet)); + // 检查是否需要交换字节 + if (BitConverter.IsLittleEndian) + { + // 如果是小端序系统,则交换字节 + byte temp = offSetData[0]; + offSetData[0] = offSetData[1]; + offSetData[1] = temp; + } + + SetOffsetData[2] = offSetData[0]; + SetOffsetData[3] = offSetData[1]; + + tcpClient.Send(tcpClient.GenerateMessage(BoardId, CalibrationData)); + Thread.Sleep(100); + tcpClient.Send(tcpClient.GenerateMessage(BoardId, SetOffsetData)); + } } } diff --git a/WCS.BLL/Manager/DbInit.cs b/WCS.BLL/Manager/DbInit.cs index ccba627..065e18b 100644 --- a/WCS.BLL/Manager/DbInit.cs +++ b/WCS.BLL/Manager/DbInit.cs @@ -61,10 +61,12 @@ namespace WCS.BLL.Manager Logs.Write("【初始化数据库】MX", LogsType.StartBoot); } //手动修改后台配置后再进行CodeFirst 数据库的生成、表的生成 + //如果不配置此参数 每次启动都会持续几十秒才能成功启动后端 if (LocalFile.Config.IsResetDBOrTable) { #region 建库建表 只在表有变动时运行 DbHelp.db.DbMaintenance.CreateDatabase(); + //新部署时 日志需要建表 不然没得接口记录 DbHelp.dbLog.DbMaintenance.CreateDatabase(); Logs.Write("【初始化数据库】创建数据库", LogsType.StartBoot); @@ -72,12 +74,13 @@ namespace WCS.BLL.Manager , typeof(InventoryDetail), typeof(OutOrder), typeof(OutOrderDetail), typeof(OutOrderMatDetail) , typeof(ShelfTypeInfo), typeof(MatBaseInfo), typeof(MatInfo) , typeof(StockTakingOrder), typeof(StockTakingOrderMatDetail), typeof(InOutRecord) - , typeof(DocumentSerialNumber),typeof(OrderLight),typeof(MatInfoLog) + , typeof(DocumentSerialNumber), typeof(OrderLight), typeof(MatInfoLog) + , typeof(AppVersion) ); - Logs.Write("【初始化数据库】db建表", LogsType.StartBoot); + Logs.Write("【初始化数据库】db(业务数据库)建表", LogsType.StartBoot); DbHelp.dbLog.CodeFirst.InitTables(typeof(SystemApiLogRecord)); - Logs.Write("【初始化数据库】logdb建表", LogsType.StartBoot); + Logs.Write("【初始化数据库】dblog(日志数据库)建表", LogsType.StartBoot); //初始化单据序列号数据 if (!DbHelp.db.Queryable().Any()) @@ -88,14 +91,12 @@ namespace WCS.BLL.Manager UpdateDate = DateTime.Now, CurrentSerialNumber = 0 }; - var stockTakingDocumentSerialNumber = new DocumentSerialNumber() { DocumentType = DocumentTypeEnum.盘点单据, UpdateDate = DateTime.Now, CurrentSerialNumber = 0 }; - DbHelp.db.Insertable(outDocumentSerialNumber).ExecuteCommand(); DbHelp.db.Insertable(stockTakingDocumentSerialNumber).ExecuteCommand(); } diff --git a/WCS.BLL/Manager/ShelfManager.cs b/WCS.BLL/Manager/ShelfManager.cs index 347222e..7d42a2b 100644 --- a/WCS.BLL/Manager/ShelfManager.cs +++ b/WCS.BLL/Manager/ShelfManager.cs @@ -47,7 +47,7 @@ namespace WCS.BLL.Manager GroupName = shelfInDb.GroupName, }; case 2: - return new SmartShelf(shelfInDb) + return new SingleLightShelf(shelfInDb) { ShelfId = shelfInDb.Id, ShelfCode = shelfInDb.ShelfCode, diff --git a/WCS.BLL/Manager/TCPClientManager.cs b/WCS.BLL/Manager/TCPClientManager.cs index cfbd4fa..f20200f 100644 --- a/WCS.BLL/Manager/TCPClientManager.cs +++ b/WCS.BLL/Manager/TCPClientManager.cs @@ -29,7 +29,12 @@ namespace WCS.BLL.Manager var clientsInDB = DbHelp.db.Queryable() .WhereIF(!string.IsNullOrEmpty(LocalFile.Config.GroupName), t => t.GroupName == LocalFile.Config.GroupName) - .Select(t => new { IP = t.ClientIp, ShelfTypeName = t.ShelfTypeName }) + .Select(t => new + { + IP = t.ClientIp, + ShelfTypeName = t.ShelfTypeName, + Port = t.Port, + }) .Distinct() .ToList(); Logs.Write($"【InitTcpClient】需要连接的服务端地址如下:\r\n{string.Join(";", clientsInDB)}", LogsType.StartBoot); @@ -37,7 +42,7 @@ namespace WCS.BLL.Manager { Task.Run(() => { - var tcpCleint = new TCPClient(cleientInDB.IP, "",cleientInDB.ShelfTypeName); + var tcpCleint = new TCPClient(cleientInDB.IP, cleientInDB.Port, cleientInDB.ShelfTypeName); tcpCleint.tcpClient.Received += (client, e) => { var clientIpHost = client.IP + ":" + client.Port; @@ -123,7 +128,7 @@ namespace WCS.BLL.Manager if (TcpCleint.IsFirstConnected == false) { Logs.Write($"【InitTcpClient】{clientIpHost}完成首次连接", LogsType.StartBoot); - + Console.WriteLine($"【InitTcpClient】{clientIpHost}完成首次连接"); @@ -138,8 +143,8 @@ namespace WCS.BLL.Manager return EasyTask.CompletedTask; }; - lock(TCPClients)//避免添加失败的情况 - { + lock (TCPClients)//避免添加失败的情况 + { TCPClients.Add(tcpCleint); } diff --git a/WCS.BLL/Manager/WarningManager.cs b/WCS.BLL/Manager/WarningManager.cs index baa6d26..e364b98 100644 --- a/WCS.BLL/Manager/WarningManager.cs +++ b/WCS.BLL/Manager/WarningManager.cs @@ -50,10 +50,12 @@ namespace WCS.BLL.Manager lock (flag) { Warnings.Add(warning); + //发送WebSocket记录 + Logs.Write(JsonConvert.SerializeObject(warning),LogsType.WebSocket); + WebSoceketManager.TrySendMessage(warning.ClientIp, JsonConvert.SerializeObject(warning)); warning.LastSendTime = DateTime.Now; } - } public static void ClearWarning(WebSocketMessageModel warning, SolveTypeEnum solveType) @@ -66,7 +68,6 @@ namespace WCS.BLL.Manager { if (solveType == SolveTypeEnum.处理) { - //TODO 对应报警处理对应的数据 switch (warningInManager.WarningType) { case WarningTypeEnum.入库自检丢失: diff --git a/WCS.BLL/Manager/WebSocketServicePlugin.cs b/WCS.BLL/Manager/WebSocketServicePlugin.cs index 4560201..4ec5ff3 100644 --- a/WCS.BLL/Manager/WebSocketServicePlugin.cs +++ b/WCS.BLL/Manager/WebSocketServicePlugin.cs @@ -48,7 +48,6 @@ namespace WCS.BLL.Manager var warningInManager = WarningManager.Warnings.Where(t => t.Guid == warning.Guid).FirstOrDefault(); if (warningInManager != null) { - warningInManager.ClientIsReceived = true; } } diff --git a/WCS.BLL/Services/IService/IHomerService.cs b/WCS.BLL/Services/IService/IHomerService.cs index 3e254b8..3c04517 100644 --- a/WCS.BLL/Services/IService/IHomerService.cs +++ b/WCS.BLL/Services/IService/IHomerService.cs @@ -1,8 +1,10 @@  +using WCS.Model; + namespace WCS.BLL.Services.IService { public interface IHomerService { - + public Task GetShelfServer(RequestBase request); } } diff --git a/WCS.BLL/Services/IService/ISelfCheckService.cs b/WCS.BLL/Services/IService/ISelfCheckService.cs index 12793a6..378f5c1 100644 --- a/WCS.BLL/Services/IService/ISelfCheckService.cs +++ b/WCS.BLL/Services/IService/ISelfCheckService.cs @@ -14,5 +14,7 @@ namespace WCS.BLL.Services.IService public Task StartSelfCheckByShelfCode(StartSelfCheckByShelfCodeRequest request); public Task StartSelfCheckByGroupName(List GroupNames); + + } } diff --git a/WCS.BLL/Services/IService/IStoreInfoService.cs b/WCS.BLL/Services/IService/IStoreInfoService.cs index 73e869b..c61631f 100644 --- a/WCS.BLL/Services/IService/IStoreInfoService.cs +++ b/WCS.BLL/Services/IService/IStoreInfoService.cs @@ -52,7 +52,13 @@ namespace WCS.BLL.Services.IService /// public Task queryModuleVoltage(QueryModuleVoltageRequest request); - + /// + /// 标定+设置偏移量 + /// + /// + /// + public Task calibrationSetOffset(CalibrationSetOffsetRequest request); + /// /// 查询库位列表 /// diff --git a/WCS.BLL/Services/Service/HomerService.cs b/WCS.BLL/Services/Service/HomerService.cs index 2f12a50..100bc83 100644 --- a/WCS.BLL/Services/Service/HomerService.cs +++ b/WCS.BLL/Services/Service/HomerService.cs @@ -4,11 +4,35 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using WCS.BLL.Services.IService; +using WCS.DAL.Db; +using WCS.DAL.DbModels; +using WCS.Model; +using WCS.Model.ApiModel.Home; namespace WCS.BLL.Services.Service { - public class HomerService: IHomerService + public class HomerService : IHomerService { public HomerService() { } + + public async Task GetShelfServer(RequestBase request) + { + //直接获取数据库数据 分组进行返回 + var data = await DbHelp.db.Queryable() + .Where(t => !string.IsNullOrEmpty(t.BigShelfCode)) + .Select(t => new GetShelfServerResponseItem() + { + BigShelfCode = t.BigShelfCode, + ServerIp = t.ServerIp, + }) + .Distinct() + .ToListAsync(); + return new GetShelfServerResponse() + { + Code = 200, + Message = "success", + Data = data + }; + } } } diff --git a/WCS.BLL/Services/Service/InstoreService.cs b/WCS.BLL/Services/Service/InstoreService.cs index 8d832b6..1c0c630 100644 --- a/WCS.BLL/Services/Service/InstoreService.cs +++ b/WCS.BLL/Services/Service/InstoreService.cs @@ -220,7 +220,7 @@ namespace WCS.BLL.Services.Service Message = "success" }; } - else if (Result != null && Result.Code == 200 && Result.Data == null) + else if (Result != null && Result.Code == 200 && (Result.Data == null || Result.Data.Count == 0)) { //Mes系统中未获取到物料信息 @@ -295,7 +295,6 @@ namespace WCS.BLL.Services.Service var matInfo = await DbHelp.db.Queryable().Where(t => t.MatSn == request.MatSn).FirstAsync(); if (matInfo != null) { - //TODO 改成wcs的实体 if (!request.SingleLightIn && shelf != null) shelf.InStoreData = new MatInfoResponse() { @@ -391,8 +390,8 @@ namespace WCS.BLL.Services.Service }; } - //TODO 配置这个时间相当于需要入库扫码后需要等待的时间 - var timeOut = 5000; + //配置这个时间相当于需要入库扫码后需要等待的时间 + var timeOut = LocalFile.Config.InstoreTimeOut; var timeSpan = TimeSpan.FromMilliseconds(0); var beginTime = DateTime.Now; while (timeSpan <= TimeSpan.FromMilliseconds(timeOut)) diff --git a/WCS.BLL/Services/Service/MXL4Service.cs b/WCS.BLL/Services/Service/MXL4Service.cs index 7bc3678..2834501 100644 --- a/WCS.BLL/Services/Service/MXL4Service.cs +++ b/WCS.BLL/Services/Service/MXL4Service.cs @@ -52,7 +52,8 @@ namespace WCS.BLL.Services.Service Message = $"操作失败:库位【{string.Join(",", storeCodeList)}】不存在!", }; } - //第二步 获取当前所有库位任务 + + //第二步 获取库位正在进行的任务 //模式相同视为可以继续发送任务 var currenTasks = DbHelp.db.Queryable() .Where(t => storeCodeList.Contains(t.StoreCode)) diff --git a/WCS.BLL/Services/Service/SelfCheckService.cs b/WCS.BLL/Services/Service/SelfCheckService.cs index 01b476d..d802053 100644 --- a/WCS.BLL/Services/Service/SelfCheckService.cs +++ b/WCS.BLL/Services/Service/SelfCheckService.cs @@ -5,7 +5,10 @@ using System.Text; using System.Threading.Tasks; using WCS.BLL.Manager; using WCS.BLL.Services.IService; +using WCS.DAL.Db; +using WCS.DAL.DbModels; using WCS.Model; +using WCS.Model.ApiModel.Home; using WCS.Model.ApiModel.SelfCheck; using WCS.Model.WebSocketModel; @@ -63,10 +66,11 @@ namespace WCS.BLL.Services.Service foreach (var ip in cleintIps) { var currentIdShelfs = shelfs.Where(t => t.ClientIp == ip) + .Where(t => t.CurrentMode == HardWare.Mode.待机模式) .ToList(); Task.Run(() => { - foreach(var shelf in currentIdShelfs) + foreach (var shelf in currentIdShelfs) { Task.Run(() => @@ -116,5 +120,7 @@ namespace WCS.BLL.Services.Service Message = $"已成功开始自检!", }; } + + } } diff --git a/WCS.BLL/Services/Service/StoreInfoService.cs b/WCS.BLL/Services/Service/StoreInfoService.cs index 2c4ce36..ec21070 100644 --- a/WCS.BLL/Services/Service/StoreInfoService.cs +++ b/WCS.BLL/Services/Service/StoreInfoService.cs @@ -240,7 +240,7 @@ namespace WCS.BLL.Services.Service } /// - /// TODO HardCode 根据模组信息生成库位 + /// /// /// public async Task> GenerateStoreInfo() @@ -248,32 +248,32 @@ namespace WCS.BLL.Services.Service //var shelfInfos = DbHelp.db.Queryable().ToList(); //foreach (var shelfInfo in shelfInfos) //{ - var ModuleInfos = await DbHelp.db.Queryable().ToListAsync(); - ModuleInfos.ForEach(moduleInfo => + var ModuleInfos = await DbHelp.db.Queryable().ToListAsync(); + ModuleInfos.ForEach(moduleInfo => + { + for (int i = 1; i <= moduleInfo.LightCount; i++) { - for (int i = 1; i <= moduleInfo.LightCount; i++) + var storeInfo = new StoreInfo() { - var storeInfo = new StoreInfo() - { - StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(), - ShelfTypeId = 1, - ModuleId = moduleInfo.Id, - ModuleCode = moduleInfo.ModuleCode, - ShelfId = moduleInfo.ShelfId, - ShelfCode = moduleInfo.ShelfCode, - BoardId = moduleInfo.BoardId, - LightNumber = i, - Priority = 1, - CurrentMatSn = string.Empty, - BigShelfCode = moduleInfo.Bigshelfcode, - R = moduleInfo.R, - C = moduleInfo.C, - Wei = i.ToString(), - GroupName = moduleInfo.GroupName, - }; - DbHelp.db.Insertable(storeInfo).ExecuteCommand(); - } - }); + StoreCode = moduleInfo.ModuleCode + "-" + i.ToString(), + ShelfTypeId = 1, + ModuleId = moduleInfo.Id, + ModuleCode = moduleInfo.ModuleCode, + ShelfId = moduleInfo.ShelfId, + ShelfCode = moduleInfo.ShelfCode, + BoardId = moduleInfo.BoardId, + LightNumber = i, + Priority = 1, + CurrentMatSn = string.Empty, + BigShelfCode = moduleInfo.Bigshelfcode, + R = moduleInfo.R, + C = moduleInfo.C, + Wei = i.ToString(), + GroupName = moduleInfo.GroupName, + }; + DbHelp.db.Insertable(storeInfo).ExecuteCommand(); + } + }); //} return new ResponseCommon() { Message = "111" }; } @@ -443,6 +443,44 @@ namespace WCS.BLL.Services.Service } } + public async Task calibrationSetOffset(CalibrationSetOffsetRequest request) + { + try + { + var modules = await DbHelp.db.Queryable().Where(t => request.MouduleIds.Contains(t.Id)).ToListAsync(); + var isSend = false; + foreach (var module in modules) + { + var shelf = ShelfManager.Shelves.Where(t => t.ShelfId == module.ShelfId).FirstOrDefault(); + if (shelf != null && shelf is SmartShelf) + { + var smartShelf = (SmartShelf)shelf; + smartShelf.CalibrationSetOffset(module.Id, request.OffSet); + isSend = true; + } + } + if (isSend) + return new ResponseCommon() + { + Code = 200, + Message = "Success" + }; + else + return new ResponseCommon() + { + Code = 201, + Message = "操作失败:未找到对应模组" + }; + } + catch (Exception ex) + { + return new ResponseCommon() + { + Code = 300, + Message = "操作失败:" + ex.Message + }; + } + } #endregion #region 库位管理 @@ -580,7 +618,6 @@ namespace WCS.BLL.Services.Service } } - #endregion } } diff --git a/WCS.BLL/Services/Service/UserService.cs b/WCS.BLL/Services/Service/UserService.cs index 53a144a..9dd55bf 100644 --- a/WCS.BLL/Services/Service/UserService.cs +++ b/WCS.BLL/Services/Service/UserService.cs @@ -455,6 +455,7 @@ namespace WCS.BLL.Services.Service .FirstAsync(); if (user == null) { + return new ResponseCommon() { Code = 201, @@ -497,6 +498,8 @@ namespace WCS.BLL.Services.Service //返回字串不返回密码 user.Password = "***"; + request.PassWord = "***"; + var response = new ResponseCommon() { Code = 200, diff --git a/WCS.BLL/Tool/Logs.cs b/WCS.BLL/Tool/Logs.cs index f4d9411..0973352 100644 --- a/WCS.BLL/Tool/Logs.cs +++ b/WCS.BLL/Tool/Logs.cs @@ -45,6 +45,7 @@ namespace WCS.BLL /// 入库流程日志 /// Instore, + WebSocket, } /// diff --git a/WCS.BLL/Tool/TCPClient.cs b/WCS.BLL/Tool/TCPClient.cs index b0fc136..8d9c66b 100644 --- a/WCS.BLL/Tool/TCPClient.cs +++ b/WCS.BLL/Tool/TCPClient.cs @@ -66,21 +66,42 @@ namespace WCS.BLL tcpClient = new TcpClient(); - //载入配置 - tcpClient.Setup(new TouchSocketConfig() - .SetRemoteIPHost(RemoteIPHost) - //.SetBindIPHost(BindIPHost) - .ConfigurePlugins(a => - { - //配置断线重连 - a.UseReconnection(-1, true, 1000); - a.Add(); - }) - .ConfigureContainer(a => - { - //添加控制台日志注入 - a.AddConsoleLogger(); - })); + if (string.IsNullOrEmpty(BindIPHost)) + { + //载入配置 + tcpClient.Setup(new TouchSocketConfig() + .SetRemoteIPHost(new IPHost(RemoteIPHost)) + //.SetBindIPHost(BindIPHost) + .ConfigurePlugins(a => + { + //配置断线重连 + a.UseReconnection(-1, true, 1000); + a.Add(); + }) + .ConfigureContainer(a => + { + //添加控制台日志注入 + a.AddConsoleLogger(); + })); + } + else + { + //载入配置 + tcpClient.Setup(new TouchSocketConfig() + .SetRemoteIPHost(new IPHost(RemoteIPHost)) + .SetBindIPHost(new IPHost(BindIPHost)) + .ConfigurePlugins(a => + { + //配置断线重连 + a.UseReconnection(-1, true, 1000); + a.Add(); + }) + .ConfigureContainer(a => + { + //添加控制台日志注入 + a.AddConsoleLogger(); + })); + } //添加接收事件 匹配已发送的指令 tcpClient.Received += (client, e) => @@ -96,7 +117,7 @@ namespace WCS.BLL //灯控制统一返回的是 FF-00-00-0A-00-02-D7-B5 if (len == 8) { - if (data[4] == 0x00 && data[0] == 0xFF && data[1] == 0x00 && (data[4] == 0x01 && data[4] == 0x02)) + if (data[4] == 0x00 && data[0] == 0xFF && data[1] == 0x00 && (data[5] == 0x01 || data[5] == 0x02)) { //查询当前板子是否有待验证的指令 var message = new MessageDto(); @@ -233,8 +254,8 @@ namespace WCS.BLL { Logs.Write($"【发送】{BitConverter.ToString(message)}", LogsType.Instructions); }); - //发送自带8ms间隔 - Thread.Sleep(8); + //发送自带15ms间隔 + Thread.Sleep(15); } } catch (Exception ex) diff --git a/WCS.BLL/WCS.BLL.csproj b/WCS.BLL/WCS.BLL.csproj index 013ebfa..33674c1 100644 --- a/WCS.BLL/WCS.BLL.csproj +++ b/WCS.BLL/WCS.BLL.csproj @@ -7,7 +7,7 @@ - + diff --git a/WCS.Model/ApiModel/Home/GetShelfServerResponse.cs b/WCS.Model/ApiModel/Home/GetShelfServerResponse.cs new file mode 100644 index 0000000..177cf12 --- /dev/null +++ b/WCS.Model/ApiModel/Home/GetShelfServerResponse.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WCS.Model.ApiModel.Home +{ + public class GetShelfServerResponse : ResponseBase> + { + public List Data { get; set; } + } + + public class GetShelfServerResponseItem + { + public string BigShelfCode { get; set; } + + public string ServerIp { get; set; } + } +} diff --git a/WCS.Model/ApiModel/Home/GetShelfStatusResponse.cs b/WCS.Model/ApiModel/Home/GetShelfStatusResponse.cs index 7d56251..cd5f82a 100644 --- a/WCS.Model/ApiModel/Home/GetShelfStatusResponse.cs +++ b/WCS.Model/ApiModel/Home/GetShelfStatusResponse.cs @@ -29,6 +29,9 @@ namespace WCS.Model public string ModulesStr { get; set; } + public string? CurrentCom { get; set; } = string.Empty; + + public DateTime SetCurrentModeTime { get; set; } /// /// 货架组别 /// diff --git a/WCS.Model/ApiModel/StoreInfo/CalibrationSetOffsetRequest.cs b/WCS.Model/ApiModel/StoreInfo/CalibrationSetOffsetRequest.cs new file mode 100644 index 0000000..d5e6ba9 --- /dev/null +++ b/WCS.Model/ApiModel/StoreInfo/CalibrationSetOffsetRequest.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace WCS.Model.ApiModel.StoreInfo +{ + public class CalibrationSetOffsetRequest : RequestBase + { + public List MouduleIds { get; set; } + + public int OffSet { get; set; } + } +} diff --git a/WCS.Model/ApiModel/StoreInfo/ShelfInfoModel.cs b/WCS.Model/ApiModel/StoreInfo/ShelfInfoModel.cs index feb3e4f..ad1160d 100644 --- a/WCS.Model/ApiModel/StoreInfo/ShelfInfoModel.cs +++ b/WCS.Model/ApiModel/StoreInfo/ShelfInfoModel.cs @@ -21,7 +21,6 @@ namespace WCS.Model.ApiModel.StoreInfo /// 货架当前状态 /// public int CurrentMode { get; set; } - /// /// 货架行数 /// diff --git a/WCS.Model/ApiModel/User/AuthModels.cs b/WCS.Model/ApiModel/User/AuthModels.cs index 688a9e7..060a4ba 100644 --- a/WCS.Model/ApiModel/User/AuthModels.cs +++ b/WCS.Model/ApiModel/User/AuthModels.cs @@ -21,10 +21,17 @@ namespace WCS.Model.ApiModel public List RoleIds { get; set; } = new List(); public List RoleNames { get; set; } + /// - /// 是否最大权限 + /// 是否最大权限管理员 /// public bool IsAdmin { get; set; } + + /// + /// 是否是工程研发人员 + /// + public bool IsGCYF { get; set; } + /// /// 创建时间 /// diff --git a/WCS.Model/WebSocketModel/WebSocketMessageModel.cs b/WCS.Model/WebSocketModel/WebSocketMessageModel.cs index d5cee2f..8ee5fdb 100644 --- a/WCS.Model/WebSocketModel/WebSocketMessageModel.cs +++ b/WCS.Model/WebSocketModel/WebSocketMessageModel.cs @@ -59,6 +59,7 @@ namespace WCS.Model.WebSocketModel 自检丢失 = 15, 自检未扫描上架 = 16, + 自检未响应 = 17, //通知类 恢复正常 = 50, diff --git a/WCS.WebApi/Controllers/FileDownLoadController.cs b/WCS.WebApi/Controllers/FileDownLoadController.cs index 83bfd85..d17915e 100644 --- a/WCS.WebApi/Controllers/FileDownLoadController.cs +++ b/WCS.WebApi/Controllers/FileDownLoadController.cs @@ -1,8 +1,13 @@ using Microsoft.AspNetCore.Mvc; +using MiniExcelLibs; using NPOI.HPSF; +using WCS.BLL.DbModels; using WCS.BLL.Services.IService; +using WCS.BLL.Services.Service; +using WCS.DAL.Db; using WCS.Model; using WCS.Model.ApiModel; +using WCS.Model.ApiModel.MatBaseInfo; using WCS.Model.ApiModel.User; using WCS.Model.WebSocketModel; @@ -21,6 +26,85 @@ namespace WCS.WebApi.Controllers } + [HttpPost("uploadApp")] + public async Task uploadApp([FromForm] IFormFile excelFile, [FromForm] string version, [FromForm] string content) + { + //文件校验 + if (excelFile == null || excelFile.Length == 0 || !excelFile.FileName.ToUpper().Contains("APK")) + { + return new ResponseCommon() + { + Code = 201, + Message = "上传失败:文件格式错误或文件为空!" + }; + } + //版本号输入参数的校验 + if (string.IsNullOrEmpty(version)) + { + return new ResponseCommon() + { + Code = 201, + Message = "上传失败:请输入上传文件的版本号version!" + }; + } + + //版本号输入参数的校验 + if (string.IsNullOrEmpty(content) || content.Length > 250) + { + return new ResponseCommon() + { + Code = 201, + Message = $"上传失败:请输入【更新内容】或者【更新内容】长度{content.Length}过长需要小于250!" + }; + } + + // 定义保存路径 + var savePath = Path.Combine(Directory.GetCurrentDirectory(), $"Files"); + // 确保文件夹存在 + if (!Directory.Exists(savePath)) + { + Directory.CreateDirectory(savePath); + } + + // 构造文件完整路径 + var filePath = Path.Combine(savePath, excelFile.FileName); + try + { + // 保存文件 + using (var stream = new FileStream(filePath, FileMode.Create)) + { + await excelFile.CopyToAsync(stream); + } + + #region 保存数据 + var appVersion = new AppVersion() + { + AppName = excelFile.FileName, + Version = version, + Content = content, + }; + DbHelp.db.Insertable(appVersion).ExecuteCommand(); + #endregion + + // 文件上传成功,返回成功信息 + return new ResponseCommon() + { + Code = 200, + Message = "上传成功!" + }; + } + catch (Exception ex) + { + // 异常处理,返回错误信息 + return new ResponseCommon() + { + Code = 300, + Message = "上传失败: " + ex.Message + }; + } + } + + [HttpGet("downloadApp")] public IActionResult downloadApp(string fileName) { @@ -79,5 +163,49 @@ namespace WCS.WebApi.Controllers } } + + /// + /// 获取最新的版本 + /// + /// + [HttpGet("getLatestAppVersion")] + public ResponseBase getLatestAppVersion() + { + try + { + var appVersion = DbHelp.db.Queryable().OrderByDescending(t => t.Id).First(); ; + if (appVersion != null) + { + return new ResponseBase() + { + Code = 200, + Message = "success", + Data = new + { + AppName = appVersion.AppName, + Version = appVersion.Version, + Content = appVersion.Content, + } + }; + } + else + { + return new ResponseBase() + { + Code = 201, + Message = "未获取到APK的最新版本", + }; + } + } + catch (Exception ex) + { + return new ResponseBase() + { + Code = 300, + Message = $"请求失败:{ex.Message}" + }; + } + } + } } diff --git a/WCS.WebApi/Controllers/HomeController.cs b/WCS.WebApi/Controllers/HomeController.cs index 5c6aac3..7d74fb0 100644 --- a/WCS.WebApi/Controllers/HomeController.cs +++ b/WCS.WebApi/Controllers/HomeController.cs @@ -82,6 +82,8 @@ namespace WCS.WebApi.Controllers { ShelfId = t.ShelfId, ShelfCode = t.ShelfCode, + CurrentCom = t.CurrentCom, + SetCurrentModeTime = t.SetCurrentModeTime, CurentMode = (int)t.CurrentMode, ModulesStr = t.ModulesStr, GroupName = t.GroupName, @@ -236,5 +238,56 @@ namespace WCS.WebApi.Controllers }; } } + + + + /// + /// 获取货架对应的服务端的Ip和端口号 + /// + /// + /// + [Route("getShelfServer")] + [HttpPost(Name = "getShelfServer")] + public async Task getShelfServer(RequestBase request) + { + try + { + return await _homerService.GetShelfServer(request); + } + catch (Exception ex) + { + return new ResponseBase() + { + Code = 300, + Message = "查询失败" + ex.Message, + Data = null + }; + } + } + + + [Route("getWebSocketWarnings")] + [HttpPost(Name = "getWebSocketWarnings")] + public async Task getWebSocketWarnings(RequestBase request) + { + try + { + return new ResponseBase() + { + Code = 200, + Message = "success", + Data = WarningManager.Warnings + }; + } + catch (Exception ex) + { + return new ResponseBase() + { + Code = 300, + Message = "查询失败" + ex.Message, + Data = null + }; + } + } } } diff --git a/WCS.WebApi/Controllers/InstoreController.cs b/WCS.WebApi/Controllers/InstoreController.cs index 40aa9bb..8087f49 100644 --- a/WCS.WebApi/Controllers/InstoreController.cs +++ b/WCS.WebApi/Controllers/InstoreController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using WCS.BLL; using WCS.BLL.HardWare; using WCS.BLL.Manager; using WCS.BLL.Services.IService; @@ -34,18 +35,22 @@ namespace WebApi.Controllers string content = string.Empty; try { + Logs.Write($"[request.IpAdress]{request.IpAdress}", LogsType.Instore); //ȡ豸IPַ - var IPAdress = HttpContext?.Connection?.RemoteIpAddress?.ToString(); - if (string.IsNullOrEmpty(IPAdress)) + if (string.IsNullOrEmpty(request.IpAdress)) { - //δȡ豸IPַ - //TO DO ¼־δȡIP - } - else - { - //ȡ豸Ipַ request - request.IpAdress = IPAdress; + var IPAdress = HttpContext?.Connection?.RemoteIpAddress?.ToString(); + if (string.IsNullOrEmpty(IPAdress)) + { + + } + else + { + //ȡ豸Ipַ request + request.IpAdress = IPAdress; + } } + Logs.Write($"[request.IpAdress]{request.IpAdress}", LogsType.Instore); return _instoreService.shelfGoInInStore(request); } @@ -140,7 +145,6 @@ namespace WebApi.Controllers [HttpPost(Name = "singleLightCommitInstore")] public async Task singleLightCommitInstore(QueryByMatSnRequestSingle request) { - //TODO: ƻύ try { //var aa = Helper.Query(); diff --git a/WCS.WebApi/Controllers/MXL4Controller.cs b/WCS.WebApi/Controllers/MXL4Controller.cs index bf44b1f..baa4203 100644 --- a/WCS.WebApi/Controllers/MXL4Controller.cs +++ b/WCS.WebApi/Controllers/MXL4Controller.cs @@ -13,7 +13,7 @@ using WCS.Model.WebSocketModel; namespace WCS.WebApi.Controllers { /// - /// 单灯单独控制亮灯接口 煤科院钻探分院项目 + /// 液晶面板 煤科院钻探分院项目 /// [ApiController] [Route("[controller]")] diff --git a/WCS.WebApi/Controllers/OutstoreController.cs b/WCS.WebApi/Controllers/OutstoreController.cs index d828528..db22254 100644 --- a/WCS.WebApi/Controllers/OutstoreController.cs +++ b/WCS.WebApi/Controllers/OutstoreController.cs @@ -294,7 +294,6 @@ namespace WebApi.Controllers [HttpPost(Name = "singleLightGoInOutstore")] public async Task singleLightGoInOutstore(GetOutOrderDetailRequest request) { - //TODO: try { return await _outstoreService.GoInOutstoreSingle(request); @@ -342,7 +341,6 @@ namespace WebApi.Controllers [HttpPost(Name = "singleLightConfirmOutstore")] public async Task singleLightConfirmOutstore(OutOrderMatDetailModelSingle request) { - //TODO try { return await _outstoreService.SingleLightConfirmOutstore(request); diff --git a/WCS.WebApi/Controllers/StoreInfoController.cs b/WCS.WebApi/Controllers/StoreInfoController.cs index 92dc1a4..ed41590 100644 --- a/WCS.WebApi/Controllers/StoreInfoController.cs +++ b/WCS.WebApi/Controllers/StoreInfoController.cs @@ -66,6 +66,13 @@ namespace WCS.WebApi.Controllers { return await _storeInfoService.queryModuleVoltage(request); } + + [Route("calibrationSetOffset")] + [HttpPost(Name = "calibrationSetOffset")] + public async Task calibrationSetOffset(CalibrationSetOffsetRequest request) + { + return await _storeInfoService.calibrationSetOffset(request); + } #endregion #region 库位管理 diff --git a/WCS.WebApi/Files/智能货架.apk b/WCS.WebApi/Files/智能货架.apk new file mode 100644 index 0000000..fbba45a Binary files /dev/null and b/WCS.WebApi/Files/智能货架.apk differ diff --git a/WCS.WebApi/Program.cs b/WCS.WebApi/Program.cs index 580efb7..0937cce 100644 --- a/WCS.WebApi/Program.cs +++ b/WCS.WebApi/Program.cs @@ -28,7 +28,6 @@ namespace WebApi //ʼݿ DbInit.InitDb(); - //ʼļ LocalFile.SaveConfig(); @@ -46,9 +45,27 @@ namespace WebApi { MXBackgroundThread.InitBackgroundThread(); var str = string.Empty; - MXBackgroundThread.SendDingDingMsg("̨ɹ", new List { "104379" }, ref str); + MXBackgroundThread.SendDingDingMsg($"{LocalFile.Config.GroupName}̨ɹ", new List { "104379" }, ref str); } + //̨ı־ + Task.Run(async () => + { + while (true) + { + try + { + //ǰ־ + WCS.BLL.Logs.Clear(TimeSpan.FromDays(92)); + //ÿһִһ + await Task.Delay(1000 * 60 * 60 * 24); + } + catch (Exception ex) + { + } + } + }); + var builder = WebApplication.CreateBuilder(args); diff --git a/货架标准上位机/App.xaml b/货架标准上位机/App.xaml index 7a6cdcc..e87a63d 100644 --- a/货架标准上位机/App.xaml +++ b/货架标准上位机/App.xaml @@ -21,7 +21,8 @@ pack://application,,,/货架标准上位机;component/Fonts/#iconfont - 金川数智 + 卓越盟讯 + 智造未来 diff --git a/货架标准上位机/Resources/Logo.ico b/货架标准上位机/Resources/Logo.ico index ad6d59b..95cadfa 100644 Binary files a/货架标准上位机/Resources/Logo.ico and b/货架标准上位机/Resources/Logo.ico differ diff --git a/货架标准上位机/Resources/Logo.png b/货架标准上位机/Resources/Logo.png index 0ec14fe..9e62c7c 100644 Binary files a/货架标准上位机/Resources/Logo.png and b/货架标准上位机/Resources/Logo.png differ diff --git a/货架标准上位机/Resources/LogoJC.ico b/货架标准上位机/Resources/LogoJC.ico new file mode 100644 index 0000000..ad6d59b Binary files /dev/null and b/货架标准上位机/Resources/LogoJC.ico differ diff --git a/货架标准上位机/Resources/LogoJC.png b/货架标准上位机/Resources/LogoJC.png new file mode 100644 index 0000000..0ec14fe Binary files /dev/null and b/货架标准上位机/Resources/LogoJC.png differ diff --git a/货架标准上位机/Resources/LogoMX.ico b/货架标准上位机/Resources/LogoMX.ico deleted file mode 100644 index 95cadfa..0000000 Binary files a/货架标准上位机/Resources/LogoMX.ico and /dev/null differ diff --git a/货架标准上位机/Resources/LogoMX.png b/货架标准上位机/Resources/LogoMX.png deleted file mode 100644 index 9e62c7c..0000000 Binary files a/货架标准上位机/Resources/LogoMX.png and /dev/null differ diff --git a/货架标准上位机/ScannerManager.cs b/货架标准上位机/ScannerManager.cs index 3742621..7e42c39 100644 --- a/货架标准上位机/ScannerManager.cs +++ b/货架标准上位机/ScannerManager.cs @@ -87,5 +87,7 @@ namespace 货架标准上位机 public string ModulesStr { get; set; } = string.Empty; public string MatSn { get; set; } = string.Empty; + + public string InstoreUser { get; set; } = string.Empty; } } diff --git a/货架标准上位机/ViewModels/HomeViewModel.cs b/货架标准上位机/ViewModels/HomeViewModel.cs index 22e8972..4a8eef8 100644 --- a/货架标准上位机/ViewModels/HomeViewModel.cs +++ b/货架标准上位机/ViewModels/HomeViewModel.cs @@ -89,7 +89,11 @@ namespace 货架标准上位机.ViewModel Result.Data .ForEach(t => { - var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, ""); + if (t.CurentMode == 0 || t.CurentMode == 1) + { + t.OrderNumber = string.Empty; + } + var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.OrderNumber); wrapPanel.Children.Add(shelf); }); }); diff --git a/货架标准上位机/ViewModels/InInventoryViewModel.cs b/货架标准上位机/ViewModels/InInventoryViewModel.cs index cb6f18f..c704d7d 100644 --- a/货架标准上位机/ViewModels/InInventoryViewModel.cs +++ b/货架标准上位机/ViewModels/InInventoryViewModel.cs @@ -57,11 +57,12 @@ namespace 货架标准上位机.ViewModel scanner.TempCode += currentScanedCode; //校验末尾码 CheckDataCompleteness(scanner); - scanner.ScannerDisplayControl.RefreshValues(scanner.ShelfCode, scanner.MatSn); + scanner.ScannerDisplayControl.RefreshValues(scanner.ShelfCode, scanner.MatSn, scanner.InstoreUser); } return EasyTask.CompletedTask; }; } + RevertScannerStatus(); } #region Property @@ -77,6 +78,58 @@ namespace 货架标准上位机.ViewModel #endregion #region Command + /// + /// 第一次加载时 获取服务器对应货架是否在入库模式 是否是扫码枪启动的 还原扫码枪的状态 + /// + public void RevertScannerStatus() + { + Task.Run(() => + { + Thread.Sleep(1000); + try + { + var body = new GetShelfStatusRequest() + { + UserName = LocalStatic.CurrentUser, + DeviceType = "WCS前端", + GroupNames = LocalFile.Config.GroupName, + }; + var Result = ApiHelp.Post([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body).Result; + if (Result != null && Result.Data != null && Result.Data?.Count > 0) + { + var shelfs = Result.Data.Where(t => t.CurentMode == 1 && !string.IsNullOrEmpty(t.CurrentCom)).ToList(); + if (shelfs == null || shelfs.Count == 0) + return; + + Logs.Write($"【启动时发现需要恢复扫码枪状态】{string.Join(",", shelfs.Select(t => t.CurrentCom).ToList())}", LogsType.Scanner); + foreach (var shelf in shelfs) + { + var scanner = ScannerManager.Scanners.Where(t => t.COM == shelf.CurrentCom).FirstOrDefault(); + if (scanner != null) + { + + scanner.IsInstoreMode = true; + scanner.IsInstoreModeTime = shelf.SetCurrentModeTime; + scanner.ShelfCode = shelf.ShelfCode; + scanner.ModulesStr = shelf.ModulesStr; + + scanner.ScannerDisplayControl.RefreshValues(scanner.ShelfCode, scanner.MatSn, scanner.InstoreUser); + Logs.Write($"【恢复扫码枪】{scanner.COM}", LogsType.Scanner); + } + } + } + } + catch (Exception ex) + { + + } + finally + { + + } + }); + } + public void CheckDataCompleteness(Scanner scanner) { if (scanner.TempCode.EndsWith("\r"))//结束符 TODO结束符是否需要自定义 现场配置 @@ -118,7 +171,24 @@ namespace 货架标准上位机.ViewModel Logs.Write($"[{scanner.COM}]校验到扫码数据为结束入库码【{scanner.TempCode}】", LogsType.Scanner); ShelfGoOutInstoreProcess(scanner); } - //TODO 增加正则表达式进行判断是否扫到的是物料码 + else if (scanner.TempCode.ToUpper().Contains("MXID") && scanner.TempCode.ToUpper().Contains("NAME")) + { + string pattern = @"\b\d{6}\b"; // 匹配一个完整的6位数字 + Match match = Regex.Match(scanner.TempCode, pattern); + if (match.Success) + { + scanner.InstoreUser = match.Value; + } + else + { + // + Logs.Write($"扫码枪扫到{scanner.TempCode},无法解析出工号!", LogsType.Scanner); + } + } + else if (Regex.IsMatch(scanner.TempCode, @"^\d{6}$")) + { + scanner.InstoreUser = scanner.TempCode; + } else { Logs.Write($"[{scanner.COM}]校验到扫码数据为物料码【{scanner.TempCode}】", LogsType.Scanner); @@ -164,7 +234,7 @@ namespace 货架标准上位机.ViewModel ShelfCode = scanner.ShelfCode, IPAdress = scanner.COM, DeviceType = LocalFile.Config.DeviceType, - UserName = LocalStatic.CurrentUser, + UserName = string.IsNullOrEmpty(scanner.InstoreUser) ? LocalStatic.CurrentUser : scanner.InstoreUser, }; var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "instore/shelfGoOutInStore", body, "POST", true); if (Result != null && Result.Code == 200) @@ -197,7 +267,7 @@ namespace 货架标准上位机.ViewModel { ModuleCode = scanner.TempCode, DeviceType = LocalFile.Config.DeviceType, - UserName = LocalStatic.CurrentUser, + UserName = string.IsNullOrEmpty(scanner.InstoreUser) ? LocalStatic.CurrentUser : scanner.InstoreUser, IpAdress = scanner.COM, }; var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "instore/shelfGoInInStore", body, "POST"); @@ -247,7 +317,7 @@ namespace 货架标准上位机.ViewModel ShelfCode = scanner.ShelfCode, IPAdress = scanner.COM, DeviceType = LocalFile.Config.DeviceType, - UserName = LocalStatic.CurrentUser, + UserName = string.IsNullOrEmpty(scanner.InstoreUser) ? LocalStatic.CurrentUser : scanner.InstoreUser, }; var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "instore/shelfGoOutInStore", body, "POST"); if (Result != null && Result.Code == 200) @@ -277,7 +347,7 @@ namespace 货架标准上位机.ViewModel ShelfCode = scanner.ShelfCode, IpAddress = scanner.COM, DeviceType = LocalFile.Config.DeviceType, - UserName = LocalStatic.CurrentUser, + UserName = string.IsNullOrEmpty(scanner.InstoreUser) ? LocalStatic.CurrentUser : scanner.InstoreUser, }; var Result = ApiHelp.GetDataFromHttp>(LocalFile.Config.ApiIpHost + "instore/queryByMatSn", body, "POST"); if (Result != null && Result.Code == 200) @@ -294,14 +364,14 @@ namespace 货架标准上位机.ViewModel ShelfCode = scanner.ShelfCode, IpAddress = scanner.COM, DeviceType = LocalFile.Config.DeviceType, - UserName = LocalStatic.CurrentUser, + UserName = string.IsNullOrEmpty(scanner.InstoreUser) ? LocalStatic.CurrentUser : scanner.InstoreUser, }; var Result = ApiHelp.GetDataFromHttp>(LocalFile.Config.ApiIpHost + "instore/queryInstoreStatus", body, "POST"); if (Result != null && !string.IsNullOrEmpty(Result.Message)) { TextBoxLog.AddLog($"物料[{scanner.MatSn}]" + Result.Message, "InstoreLog", DateTime.Now); scanner.MatSn = string.Empty; - scanner.ScannerDisplayControl.RefreshValues(scanner.ShelfCode, scanner.MatSn); + scanner.ScannerDisplayControl.RefreshValues(scanner.ShelfCode, scanner.MatSn, scanner.InstoreUser); } } catch (Exception ex) @@ -337,7 +407,7 @@ namespace 货架标准上位机.ViewModel { ShelfCode = t.ShelfCode, DeviceType = LocalFile.Config.DeviceType, - UserName = LocalStatic.CurrentUser, + UserName = string.IsNullOrEmpty(t.InstoreUser) ? LocalStatic.CurrentUser : t.InstoreUser, }; var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "instore/shelfGoOutInStore", body, "POST"); if (Result != null && Result.Code == 200) @@ -346,7 +416,7 @@ namespace 货架标准上位机.ViewModel t.ShelfCode = string.Empty; t.MatSn = string.Empty; - t.ScannerDisplayControl.RefreshValues(t.ShelfCode, t.MatSn); + t.ScannerDisplayControl.RefreshValues(t.ShelfCode, t.MatSn, t.InstoreUser); Growl.Success(Result.Message); } } diff --git a/货架标准上位机/ViewModels/MXViewModel/MXOutInventoryViewModel.cs b/货架标准上位机/ViewModels/MXViewModel/MXOutInventoryViewModel.cs index 568cf3b..9694c22 100644 --- a/货架标准上位机/ViewModels/MXViewModel/MXOutInventoryViewModel.cs +++ b/货架标准上位机/ViewModels/MXViewModel/MXOutInventoryViewModel.cs @@ -34,6 +34,7 @@ namespace 货架标准上位机.ViewModel RefreshOutOrderList(); } + public static object flag { get; set; } = new object(); #region Property private OutOrderModel selectedOutOrder; public OutOrderModel SelectedOutOrder @@ -42,14 +43,19 @@ namespace 货架标准上位机.ViewModel set { SetProperty(ref selectedOutOrder, value); - if (selectedOutOrder != null) + + if (selectedOutOrder != null && selectedOutOrder.OrderNumber != SelectedOutOrderNumber) { SelectedOutOrderNumber = selectedOutOrder.OrderNumber; RefreshDataGridItemSource(); } + else if (selectedOutOrder != null && selectedOutOrder.OrderNumber == SelectedOutOrderNumber) + { + RefreshDataGridItemSource(); + } else { - DataGridItemSource?.Clear(); + } } } @@ -119,8 +125,18 @@ namespace 货架标准上位机.ViewModel { Task.Run(() => { - SendedPan = dataGridItemSource.Where(t => t.IsSended).Count(); - TotalPan = dataGridItemSource.Count(); + try + { + SendedPan = dataGridItemSource.Where(t => t.IsSended).Count(); + TotalPan = dataGridItemSource.Count(); + } + catch (Exception ex) + { + Thread.Sleep(500); + SendedPan = dataGridItemSource.Where(t => t.IsSended).Count(); + TotalPan = dataGridItemSource.Count(); + } + }); } #endregion @@ -131,6 +147,7 @@ namespace 货架标准上位机.ViewModel { var window = new MXOutOrderView(); window.Owner = Application.Current.MainWindow; + window.Topmost = true; window.ShowDialog(); } @@ -143,22 +160,22 @@ namespace 货架标准上位机.ViewModel //判断是否选择单据 if (SelectedOutOrder == null) { - Growl.Warning("未选择单据!"); + Growl.Warning("未选择单据!请选择左侧单据!"); return; } #region 调用接口开始出库 var body = new GetOutOrderDetailRequest() { - OrderId = selectedOutOrder.Id, - OrderNumber = selectedOutOrder.OrderNumber, + OrderId = SelectedOutOrder.Id, + OrderNumber = SelectedOutOrder.OrderNumber, UserName = LocalStatic.CurrentUser, DeviceType = LocalFile.Config.DeviceType, }; var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "outStore/goInOutstore", body, "POST"); if (Result != null && Result.Code == 200) { - Growl.Warning("已成功开始出库!"); + Growl.Warning("已成功开始发料!"); RefreshOutOrderList(SelectedOutOrderNumber); } else if (Result != null) @@ -188,23 +205,22 @@ namespace 货架标准上位机.ViewModel //判断是否选择单据 if (SelectedOutOrder == null) { - Growl.Warning("未选择单据!"); + Growl.Warning("未选择单据!请选择左侧单据!"); return; } #region 调用接口结束出库 var body = new GetOutOrderDetailRequest() { - OrderId = selectedOutOrder.Id, - OrderNumber = selectedOutOrder.OrderNumber, + OrderId = SelectedOutOrder.Id, + OrderNumber = SelectedOutOrder.OrderNumber, UserName = LocalStatic.CurrentUser, DeviceType = LocalFile.Config.DeviceType, }; var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "outStore/goOutOutstore", body, "POST"); if (Result != null && Result.Code == 200) { - Growl.Warning("已成功结束出库!"); + Growl.Warning("已成功取消发料!"); RefreshOutOrderList(SelectedOutOrderNumber); - //RefreshDataGridItemSource(); } else if (Result != null) { @@ -227,59 +243,89 @@ namespace 货架标准上位机.ViewModel public void RefreshOutOrderList(string OrderNumber = "") { - #region 调用接口获取发料单 - try + lock (flag) { - var body = new GetOutOrderListByStatusRequest() + Logs.Write($"【RefreshOutOrderList1】OrderNumber{OrderNumber}", LogsType.Info); + if (string.IsNullOrEmpty(OrderNumber) && !string.IsNullOrEmpty(SelectedOutOrderNumber)) { - IsMXPD = false, - OrderExeStatus = new List() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 } - }; - var Result = ApiHelp.GetDataFromHttp>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST"); - if (Result != null && Result.Code == 200) + OrderNumber = SelectedOutOrderNumber; + Logs.Write($"【RefreshOutOrderList2】OrderNumber{OrderNumber}", LogsType.Info); + } + #region 调用接口获取发料单 + try { - OutOrderList = new ObservableCollection(Result.Data.Lists); - if (!string.IsNullOrEmpty(OrderNumber)) + var body = new GetOutOrderListByStatusRequest() { - SelectedOutOrder = OutOrderList.Where(t => t.OrderNumber == OrderNumber).FirstOrDefault(); + IsMXPD = false, + OrderExeStatus = new List() { OutOrderExeStatus.开始发料, OutOrderExeStatus.发料完成 } + }; + var Result = ApiHelp.GetDataFromHttp>(LocalFile.Config.ApiIpHost + "outstore/getOutOrderListByStatus", body, "POST"); + if (Result != null && Result.Code == 200) + { + OutOrderList = new ObservableCollection(Result.Data.Lists); + if (!string.IsNullOrEmpty(OrderNumber)) + { + if (selectedOutOrder == null) + { + SelectedOutOrder = OutOrderList?.Where(t => t.OrderNumber == OrderNumber).FirstOrDefault(); + } + Logs.Write($"【RefreshOutOrderList3】SelectedOutOrder{SelectedOutOrder?.OrderNumber}", LogsType.Info); + } + else + { + if (selectedOutOrder == null) + SelectedOutOrder = OutOrderList?.FirstOrDefault(); + Logs.Write($"【RefreshOutOrderList3】SelectedOutOrder{SelectedOutOrder?.OrderNumber}", LogsType.Info); + } + } + else if (Result != null && !string.IsNullOrEmpty(Result.Message)) + { + Growl.Warning(Result.Message); } } - else if (Result != null && !string.IsNullOrEmpty(Result.Message)) + catch (Exception ex) { - Growl.Warning(Result.Message); + Growl.Warning(ex.Message); } } - catch (Exception ex) - { - Growl.Warning(ex.Message); - } #endregion } public void RefreshDataGridItemSource() { - if (SelectedOutOrder == null) + lock (flag) { - //选择的单据为空无法进行查询 - return; + if (SelectedOutOrder == null) + { + Logs.Write("【RefreshDataGridItemSource】选择的单据为空无法进行查询", LogsType.Info); + SelectedOutOrder = OutOrderList?.FirstOrDefault(); + return; + } } #region 调用接口获取出库单物料明细 Task.Run(() => { + Logs.Write($"【RefreshDataGridItemSource】{SelectedOutOrder?.OrderNumber}", LogsType.Info); + var body = new GetOutOrderDetailRequest() { - OrderId = selectedOutOrder.Id, - OrderNumber = selectedOutOrder.OrderNumber, + OrderId = SelectedOutOrder.Id, + OrderNumber = SelectedOutOrder.OrderNumber, UserName = LocalStatic.CurrentUser, DeviceType = LocalFile.Config.DeviceType, }; - var Result = ApiHelp.GetDataFromHttp>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderMatDetail", body, "POST"); + var Result = ApiHelp.GetDataFromHttp>>(LocalFile.Config.ApiIpHost + "outStore/getOutOrderMatDetail", body, "POST", true); if (Result != null && Result.Code == 200) { if (Result.Data.Count > 0) { - DataGridItemSource = new ObservableCollection(Result.Data); + var list = Result.Data.OrderBy(t => t.IsSended).ToList(); + Logs.Write($"【RefreshDataGridItemSource】Result.Data.Count > 0{SelectedOutOrder?.OrderNumber}", LogsType.Info); + //App.Current.Dispatcher.Invoke(() => + //{ + DataGridItemSource = new ObservableCollection(list); + //}); OrderStatus = Result.Message; if (OrderStatus == OutOrderStatus.全部发料.ToString()) { @@ -288,6 +334,7 @@ namespace 货架标准上位机.ViewModel } else { + Logs.Write("【RefreshDataGridItemSource】Result.Data.Count <= 0,清空明细", LogsType.Info); App.Current.Dispatcher.Invoke(() => { DataGridItemSource?.Clear(); diff --git a/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml b/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml index 0a8ac9d..4c6d772 100644 --- a/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml +++ b/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml @@ -15,6 +15,8 @@ 当前入库物料 + 当前入库人 + diff --git a/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml.cs b/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml.cs index 1981d2c..01b2208 100644 --- a/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml.cs +++ b/货架标准上位机/Views/Controls/ScannerDisplayControl.xaml.cs @@ -28,12 +28,13 @@ namespace 货架标准上位机.Views.Controls txtCom.Text = COM; } - public void RefreshValues(string shelfCode, string matSn) + public void RefreshValues(string shelfCode, string matSn,string instoreUser = "") { Dispatcher.BeginInvoke(new Action(() => { txtCurrentShelf.Text = shelfCode; txtCurrentMat.Text = matSn; + txtInstoreUser.Text = instoreUser; })); } } diff --git a/货架标准上位机/Views/HomeView.xaml.cs b/货架标准上位机/Views/HomeView.xaml.cs index 76528c0..a0cb4ed 100644 --- a/货架标准上位机/Views/HomeView.xaml.cs +++ b/货架标准上位机/Views/HomeView.xaml.cs @@ -40,6 +40,8 @@ namespace 货架标准上位机 viewModel.LoadTask(); } + + private void vis(object sender, DependencyPropertyChangedEventArgs e) { if (IsInDesignMode) diff --git a/货架标准上位机/Views/InInventoryView.xaml b/货架标准上位机/Views/InInventoryView.xaml index 2e62513..933e9c8 100644 --- a/货架标准上位机/Views/InInventoryView.xaml +++ b/货架标准上位机/Views/InInventoryView.xaml @@ -24,16 +24,14 @@ - -