From 9b85a8b67aa6354ee9ea1a13c5799bf1c934922f Mon Sep 17 00:00:00 2001 From: IPC-610 <IPC-610@DESKTOP-6LEOOS3> Date: 星期四, 31 十月 2024 18:12:14 +0800 Subject: [PATCH] 修改问题 --- Admin.NET/WCS.Application/Service/WcsCheckTask/WcsCheckTaskService.cs | 39 ++++++++++++++++++++------------------- 1 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Admin.NET/WCS.Application/Service/WcsCheckTask/WcsCheckTaskService.cs b/Admin.NET/WCS.Application/Service/WcsCheckTask/WcsCheckTaskService.cs index 82a8859..b99dd08 100644 --- a/Admin.NET/WCS.Application/Service/WcsCheckTask/WcsCheckTaskService.cs +++ b/Admin.NET/WCS.Application/Service/WcsCheckTask/WcsCheckTaskService.cs @@ -233,26 +233,27 @@ [DisplayName("浠诲姟寮哄埗缁撴壒")] public async Task CloseTaskForPLC(CloseTaskPLCInput input) { - if (PLCTaskAction.boDemo) - { - //婕旂ず妯″紡 - var checkTaskList2 = await _wcsCheckTaskRep.Context.Queryable<WcsCheckTask>().FirstAsync(w => w.Port == "208"); + // 娉ㄩ噴锛氭紨绀烘ā寮忎笉缁戝畾鍒嗛亾銆俵iudl 2024-10-30 + //if (PLCTaskAction.boDemo) + //{ + // //婕旂ず妯″紡 + // var checkTaskList2 = await _wcsCheckTaskRep.Context.Queryable<WcsCheckTask>().FirstAsync(w => w.Port == "208"); - var deviceInfo = await _wcsDeviceRep.Context.Queryable<WcsDevice>().FirstAsync(w => w.StationNum == "208"); - if (deviceInfo == null) - { - throw Oops.Bah($"鎵句笉鍒板伐浣嶅彿锛�208鐨勭爜鍨涘伐浣嶄俊鎭�"); - } - var modPlc = await _wcsDeviceRep.Context.Queryable<WcsPlc>().FirstAsync(s => s.Id == deviceInfo.PlcId); - if (modPlc == null) - { - throw Oops.Bah($"鎵句笉鍒板伐浣嶅彿锛�208鐨勮澶囦俊鎭�"); - } - PLCUtil modUtil = new PLCUtil(modPlc); + // var deviceInfo = await _wcsDeviceRep.Context.Queryable<WcsDevice>().FirstAsync(w => w.StationNum == "208"); + // if (deviceInfo == null) + // { + // throw Oops.Bah($"鎵句笉鍒板伐浣嶅彿锛�208鐨勭爜鍨涘伐浣嶄俊鎭�"); + // } + // var modPlc = await _wcsDeviceRep.Context.Queryable<WcsPlc>().FirstAsync(s => s.Id == deviceInfo.PlcId); + // if (modPlc == null) + // { + // throw Oops.Bah($"鎵句笉鍒板伐浣嶅彿锛�208鐨勮澶囦俊鎭�"); + // } + // PLCUtil modUtil = new PLCUtil(modPlc); - var ret = modUtil.SetPlcDBValue(checkTaskList2.PosTypeLot, checkTaskList2.DbNumber, checkTaskList2.PosLot, "1"); - return; - } + // var ret = modUtil.SetPlcDBValue(checkTaskList2.PosTypeLot, checkTaskList2.DbNumber, checkTaskList2.PosLot, "1"); + // return; + //} // 姝e父妯″紡 if (string.IsNullOrWhiteSpace(input.lotNo)) @@ -280,7 +281,7 @@ PLCUtil modUtil = new PLCUtil(modPlc); if (modUtil.Connected) { - var ret = modUtil.SetPlcDBValue(item.PosTypeLot, item.DbNumber, item.PosLot, "1"); + var ret = modUtil.SetPlcDBValue(item.PosTypeLot, item.DbNumber, item.PosLot, "0"); // 瑙g粦鍒嗛亾 if (ret.IsSucceed) { //鍐欏叆娴佺▼瀛楁垚鍔熷悗鏇存柊鍒嗘嫞浠诲姟 -- Gitblit v1.8.0