From d44b94795e966f13cd52243801b7c95389a37405 Mon Sep 17 00:00:00 2001 From: gcw_MV9p2JJN Date: Tue, 27 Jan 2026 15:29:27 +0800 Subject: [PATCH] 1 --- .../Stations/PlcIntoStationService_OP07_01.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/RIZO.Service/PLCBackground/Stations/PlcIntoStationService_OP07_01.cs b/RIZO.Service/PLCBackground/Stations/PlcIntoStationService_OP07_01.cs index 576690f..36d8af7 100644 --- a/RIZO.Service/PLCBackground/Stations/PlcIntoStationService_OP07_01.cs +++ b/RIZO.Service/PLCBackground/Stations/PlcIntoStationService_OP07_01.cs @@ -196,6 +196,23 @@ namespace RIZO.Service.PLCBackground.Stations } } + + //12 最大重复入站次数 + int MaxRepeatEntries = processOperations.Where(operation => operation.OperationCode == workstationCode).Select(operation => operation.MaxStationCount??1).First(); + if(MaxRepeatEntries>1) + { + int currentStationEntryCount = await Context.Queryable() + .Where(it => it.ProductSN == productSN) + .Where(it => it.OperationCode == workstationCode) + .Where(it => it.PasstationType == 1) + .CountAsync(); + if(currentStationEntryCount >= MaxRepeatEntries) + { + result = EntryPermissionResult.MaximumRepeatedEntries; + goto InsertPassrecord; + } + } + //OK 准许进站 result = EntryPermissionResult.AllowIntoStation; goto InsertPassrecord; @@ -252,7 +269,9 @@ namespace RIZO.Service.PLCBackground.Stations //0之前工位数据异常 PreviousStationDataAbnormal = 0, //11 未知异常 - UnkownException = 11 + UnkownException = 11, + //12 最大重复入站次数 + MaximumRepeatedEntries = 12 } }