From 3ddaef6f21b25269ad0e9fb5b8ba5588090c9389 Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期二, 15 十月 2024 10:10:53 +0800 Subject: [PATCH] 白盒获取装配料号更新 --- Tiger.Business.MES/Transaction/CollectNode.cs | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-) diff --git a/Tiger.Business.MES/Transaction/CollectNode.cs b/Tiger.Business.MES/Transaction/CollectNode.cs index 4d4a5de..d06f672 100644 --- a/Tiger.Business.MES/Transaction/CollectNode.cs +++ b/Tiger.Business.MES/Transaction/CollectNode.cs @@ -57,7 +57,7 @@ info.InputQty = CurOperInfo(input.Locale).InputQty; action.Data.OperInfo = info; } - else if (!IsFinishAllSteps) + else if (Steps.Any() && !IsFinishAllSteps) { action.Data.OperInfo = SetOperNodeInfo(CurOperInfo(input.Locale)); } @@ -115,29 +115,30 @@ //鏌ユ壘涓嶅埌鏉$爜宸茬粦瀹氱殑宸ュ崟 else { - //娌℃湁褰撳墠宸ュ崟锛屽垯鍏堥�夋嫨宸ュ崟鍚庡啀鎵弿鏉$爜 - if (CurBatch.IsNullOrEmpty()) + var lastSn = wosns.OrderByDescending(q => q.SN.UPDATE_TIME).FirstOrDefault(); + if (!lastSn.IsNullOrEmpty()) { - action.Data.ShortMsg = new("鏈�夋嫨宸ュ崟", ShortMessage.Types.Error); + action.Data.ShortMsg = new($"浜у搧{lastSn.SN.STATUS.GetEnumDesc<BIZ_MES_WO_SN.STATUSs>()}", ShortMessage.Types.Error); action.Data.OperInfo = new(); action.IsSuccessed = false; - //action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); - action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException"); + //action.LocaleMsg = new($"杩涚珯鎵弿閿欒锛屾潯鐮乕{0}]{1}", input.SN); + action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.SnStatusError", input.SN, lastSn.SN.STATUS.GetEnumDesc<BIZ_MES_WO_SN.STATUSs>()); } - //鏈夊綋鍓嶅伐鍗曚笖涓嶆槸鎶曞叆锛屽垯鎻愮ず鏉$爜鏈姇鍏ョ敓浜э紝璇峰厛鍘婚绔欐壂鎻� else { - var lastSn = wosns.OrderByDescending(q => q.SN.UPDATE_TIME).FirstOrDefault(); - if (!lastSn.IsNullOrEmpty()) + //娌℃湁褰撳墠宸ュ崟锛屽垯鍏堥�夋嫨宸ュ崟鍚庡啀鎵弿鏉$爜 + if (CurBatch.IsNullOrEmpty()) { - action.Data.ShortMsg = new($"浜у搧{lastSn.SN.STATUS.GetEnumDesc<BIZ_MES_WO_SN.STATUSs>()}", ShortMessage.Types.Error); + action.Data.ShortMsg = new("鏈�夋嫨宸ュ崟", ShortMessage.Types.Error); action.Data.OperInfo = new(); action.IsSuccessed = false; - //action.LocaleMsg = new($"杩涚珯鎵弿閿欒锛屾潯鐮乕{0}]{1}", input.SN); - action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotInputException", input.SN); + //action.LocaleMsg = new($"鏈�夋嫨宸ュ崟锛岃鍏堥�夋嫨瑕佺敓浜х殑宸ュ崟"); + action.LocaleMsg = new("MES.Transaction.CollectNode.Submit.NotSelectOrderException"); } + //鏈夊綋鍓嶅伐鍗曚笖涓嶆槸鎶曞叆锛屽垯鎻愮ず鏉$爜鏈姇鍏ョ敓浜э紝璇峰厛鍘婚绔欐壂鎻� else { + action.Data.ShortMsg = new("鏈姇鍏ョ敓浜�", ShortMessage.Types.Error); action.Data.OperInfo = new(); action.IsSuccessed = false; @@ -573,7 +574,7 @@ Action endAction = null; //濡傛灉褰撳墠鏉$爜宸茬粡璧板埌娴佺▼缁堢偣鍒欒褰曟潯鐮佸畬宸� - if (action.Data.OperInfo.IsReachedEndNode) + if (operInfo.IsReachedEndNode) { //鏇存柊宸ュ崟鏉$爜鏄庣粏淇℃伅 var woSNs = CurBatch.WoSNs.Where(q => CurWipSNs.Any(w => q.WIP_ID == w.ID)).ToList(); -- Gitblit v1.9.3